diff --git a/bin/generate-v3 b/bin/generate-v3 index 8526a6b11..906c287f2 100755 --- a/bin/generate-v3 +++ b/bin/generate-v3 @@ -33,7 +33,7 @@ docker run \ --input-spec ${SWAGGER_FILE} \ --generator-name dart \ --output /local/dart-v3 \ - --template-dir /local/dart-templates + --template-dir /local/dart-v3-templates sleep 3 diff --git a/dart-v3-templates/README.mustache b/dart-v3-templates/README.mustache new file mode 100644 index 000000000..01718999f --- /dev/null +++ b/dart-v3-templates/README.mustache @@ -0,0 +1,145 @@ +# {{{pubName}}} +{{#appDescriptionWithNewLines}} +{{{appDescriptionWithNewLines}}} +{{/appDescriptionWithNewLines}} + +This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: {{{appVersion}}} +{{#artifactVersion}} +- Package version: {{{artifactVersion}}} +{{/artifactVersion}} +{{^hideGenerationTimestamp}} +- Build date: {{{generatedDate}}} +{{/hideGenerationTimestamp}} +- Build package: {{{generatorClass}}} +{{#infoUrl}} +For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) +{{/infoUrl}} + +## Requirements + +Dart 2.0 or later + +## Installation & Usage + +### Github +If this Dart package is published to Github, add the following dependency to your pubspec.yaml +``` +dependencies: + {{{pubName}}}: + git: https://{{{gitHost}}}/{{{gitUserId}}}/{{{gitRepoId}}}.git +``` + +### Local +To use the package in your local drive, add the following dependency to your pubspec.yaml +``` +dependencies: + {{{pubName}}}: + path: /path/to/{{{pubName}}} +``` + +## Tests + +TODO + +## Getting Started + +Please follow the [installation procedure](#installation--usage) and then run the following: + +```dart +import 'package:{{{pubName}}}/api.dart'; +{{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}} +{{#hasAuthMethods}} +{{#authMethods}} +{{#isBasic}} +{{#isBasicBasic}} +// TODO Configure HTTP basic authorization: {{{name}}} +//defaultApiClient.getAuthentication('{{{name}}}').username = 'YOUR_USERNAME' +//defaultApiClient.getAuthentication('{{{name}}}').password = 'YOUR_PASSWORD'; +{{/isBasicBasic}} +{{#isBasicBearer}} +// TODO Configure HTTP Bearer authorization: {{{name}}} +// Case 1. Use String Token +//defaultApiClient.getAuthentication('{{{name}}}').setAccessToken('YOUR_ACCESS_TOKEN'); +// Case 2. Use Function which generate token. +// String yourTokenGeneratorFunction() { ... } +//defaultApiClient.getAuthentication('{{{name}}}').setAccessToken(yourTokenGeneratorFunction); +{{/isBasicBearer}} +{{/isBasic}} +{{#isApiKey}} +// TODO Configure API key authorization: {{{name}}} +//defaultApiClient.getAuthentication('{{{name}}}').apiKey = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//defaultApiClient.getAuthentication('{{{name}}}').apiKeyPrefix = 'Bearer'; +{{/isApiKey}} +{{#isOAuth}} +// TODO Configure OAuth2 access token for authorization: {{{name}}} +//defaultApiClient.getAuthentication('{{{name}}}').accessToken = 'YOUR_ACCESS_TOKEN'; +{{/isOAuth}} +{{/authMethods}} +{{/hasAuthMethods}} + +final api_instance = {{{classname}}}(); +{{#allParams}} +final {{{paramName}}} = {{#isArray}}[{{/isArray}}{{#isBodyParam}}{{{dataType}}}(){{/isBodyParam}}{{^isBodyParam}}{{{example}}}{{/isBodyParam}}{{#isArray}}]{{/isArray}}; // {{{dataType}}} | {{{description}}} +{{/allParams}} + +try { + {{#returnType}}final result = {{/returnType}}api_instance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}); + {{#returnType}} + print(result); + {{/returnType}} +} catch (e) { + print('Exception when calling {{{classname}}}->{{{operationId}}}: $e\n'); +} +{{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}} +``` + +## Documentation for API Endpoints + +All URIs are relative to *{{{basePath}}}* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{{classname}}}* | [**{{{operationId}}}**]({{{apiDocPath}}}/{{{classname}}}.md#{{{operationIdLowerCase}}}) | **{{{httpMethod}}}** {{{path}}} | {{#summary}}{{{summary}}}{{/summary}} +{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} + +## Documentation For Models + +{{#models}}{{#model}} - [{{{classname}}}]({{{modelDocPath}}}/{{{classname}}}.md) +{{/model}}{{/models}} + +## Documentation For Authorization + +{{^authMethods}} All endpoints do not require authorization. +{{/authMethods}}{{#authMethods}}{{#last}} Authentication schemes defined for the API:{{/last}}{{/authMethods}} +{{#authMethods}}## {{{name}}} + +{{#isApiKey}}- **Type**: API key +- **API key parameter name**: {{{keyParamName}}} +- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} +{{/isApiKey}} +{{#isBasic}} +{{#isBasicBasic}} +- **Type**: HTTP Basic authentication +{{/isBasicBasic}} +{{#isBasicBearer}} +- **Type**: HTTP Bearer authentication +{{/isBasicBearer}} +{{/isBasic}} +{{#isOAuth}}- **Type**: OAuth +- **Flow**: {{{flow}}} +- **Authorization URL**: {{{authorizationUrl}}} +- **Scopes**: {{^scopes}}N/A{{/scopes}} +{{#scopes}} - **{{{scope}}}**: {{{description}}} +{{/scopes}} +{{/isOAuth}} + +{{/authMethods}} + +## Author + +{{#apiInfo}}{{#apis}}{{#-last}}{{{infoEmail}}} +{{/-last}}{{/apis}}{{/apiInfo}} + diff --git a/dart-v3-templates/analysis_options.mustache b/dart-v3-templates/analysis_options.mustache new file mode 100644 index 000000000..2e6cdca29 --- /dev/null +++ b/dart-v3-templates/analysis_options.mustache @@ -0,0 +1 @@ +analyzer: diff --git a/dart-v3-templates/api.mustache b/dart-v3-templates/api.mustache new file mode 100644 index 000000000..8f0055be6 --- /dev/null +++ b/dart-v3-templates/api.mustache @@ -0,0 +1,202 @@ +{{>header}} +{{>part_of}} +{{#operations}} + +class {{classname}} { + const {{classname}}(this._apiClient); + + final {{clientName}} _apiClient; + + {{#operation}} + /// {{#summary}}{{.}}{{/summary}}{{^summary}}{{nickname}}{{/summary}} + /// {{notes}} + /// + /// Parameters: + {{#allParams}} + /// * [{{paramName}}] {{#description}}- {{{.}}}{{/description}} + {{/allParams}} + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future]{{#returnType}} containing a [Response] with a [{{{returnType}}}] as data{{/returnType}} + /// Throws [DioException] if API call or serialization fails + {{#externalDocs}} + /// {{description}} + /// Also see [{{summary}} Documentation]({{url}}) + {{/externalDocs}} + {{#isDeprecated}} + @Deprecated('This operation has been deprecated') + {{/isDeprecated}} + Future> {{nickname}}({ {{#allParams}}{{#isPathParam}} + required {{{dataType}}} {{paramName}},{{/isPathParam}}{{#isQueryParam}} + {{#required}}required {{/required}}{{{dataType}}}{{^required}}?{{/required}} {{paramName}},{{/isQueryParam}}{{#isHeaderParam}} + {{#required}}required {{/required}}{{{dataType}}}{{^required}}?{{/required}} {{paramName}},{{/isHeaderParam}}{{#isBodyParam}} + {{#required}}required {{/required}}{{{dataType}}}{{^required}}?{{/required}} {{paramName}},{{/isBodyParam}}{{#isFormParam}} + {{#required}}required {{/required}}{{{dataType}}}{{^required}}?{{/required}} {{paramName}},{{/isFormParam}}{{/allParams}} + {{#hasConsumes}}{{#hasBodyParam}}Iterable? bodyParameters,{{/hasBodyParam}}{{/hasConsumes}} + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final String path = r'{{{path}}}'{{#pathParams}}.replaceAll('{' r'{{{baseName}}}' '}', {{{paramName}}}.toString()){{/pathParams}}; + final options = Options( + method: r'{{#lambda.uppercase}}{{httpMethod}}{{/lambda.uppercase}}', + {{#isResponseFile}} + responseType: ResponseType.bytes, + {{/isResponseFile}} + headers: { + {{#httpUserAgent}} + r'User-Agent': r'{{{.}}}', + {{/httpUserAgent}} + // to string ?? + {{#headerParams}} + {{^required}}{{^nullable}}if ({{{paramName}}} != null) {{/nullable}}{{/required}}r'{{baseName}}': {{paramName}}, + {{/headerParams}} + ...?headers, + }, + extra: { + 'secure': >[{{^hasAuthMethods}}],{{/hasAuthMethods}}{{#hasAuthMethods}} + {{#authMethods}}{ + 'type': '{{type}}', + {{#scheme}}'scheme': '{{scheme}}',{{/scheme}} + 'name': '{{name}}',{{#isApiKey}} + 'keyName': '{{keyParamName}}', + 'where': '{{#isKeyInQuery}}query{{/isKeyInQuery}}{{#isKeyInHeader}}header{{/isKeyInHeader}}',{{/isApiKey}} + },{{/authMethods}} + ],{{/hasAuthMethods}} + ...?extra, + }, + {{#hasConsumes}}contentType: '{{#prioritizedContentTypes}}{{#-first}}{{{mediaType}}}{{/-first}}{{/prioritizedContentTypes}}',{{/hasConsumes}} + validateStatus: validateStatus, + ); + + {{#hasQueryParams}} + final queryParameters = { + {{#queryParams}} + {{^required}}{{^isNullable}}if ({{{paramName}}} != null) {{/isNullable}}{{/required}}r'{{baseName}}': + {{#isContainer}}encodeCollectionQueryParameter{{/isContainer}}{{^isContainer}}encodeQueryParameter{{/isContainer}}( + {{{paramName}}}{{#isContainer}}, + format: ListFormat.{{{collectionFormat}}}{{/isContainer}} + ), + {{/queryParams}} + }; + {{/hasQueryParams}} + + {{#hasBodyOrFormParams}} + dynamic bodyData; + + try { + {{#hasFormParams}} + {{#isMultipart}} + bodyData = FormData.fromMap({ + {{#formParams}} + {{^required}}{{^isNullable}}if ({{{paramName}}} != null) {{/isNullable}}{{/required}}r'{{{baseName}}}': {{#isFile}}{{{paramName}}}{{/isFile}}{{^isFile}}encodeFormParameter({{{paramName}}}){{/isFile}}, + {{/formParams}} + }); + {{/isMultipart}} + {{^isMultipart}} + bodyData = { + {{#formParams}} + {{^required}} + {{^isNullable}}if ({{{paramName}}} != null) {{/isNullable}} + {{/required}} + r'{{{baseName}}}': {{#isContainer}}encodeCollectionQueryParameter{{/isContainer}}{{^isContainer}}encodeQueryParameter{{/isContainer}}( + {{{paramName}}}, + {{#isContainer}} + format: ListFormat.{{{collectionFormat}}} + {{/isContainer}} + ), + {{/formParams}} + }; + {{/isMultipart}} + {{/hasFormParams}} + {{#bodyParam}} + {{#isPrimitiveType}} + bodyData = {{paramName}}{{#isFile}}.finalize(){{/isFile}}; + {{/isPrimitiveType}} + {{^isPrimitiveType}} + bodyData = {{paramName}}{{^required}}?{{/required}}.toJson(bodyParameters); + {{/isPrimitiveType}} + {{/bodyParam}} + } catch(error, stackTrace) { + throw DioException( + error: error, + requestOptions: options.compose( + _apiClient.dio.options, + path, + {{#hasQueryParams}} + queryParameters: queryParameters, + {{/hasQueryParams}} + ), + stackTrace: stackTrace, + type: DioExceptionType.unknown, + ); + } + {{/hasBodyOrFormParams}} + + {{#returnType}}final response = await{{/returnType}}{{^returnType}}return{{/returnType}} _apiClient.dio.request( + path, + {{#hasBodyOrFormParams}} + data: bodyData, + {{/hasBodyOrFormParams}} + options: options, + {{#hasQueryParams}} + queryParameters: queryParameters, + {{/hasQueryParams}} + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + {{#returnType}} + {{{returnType}}} responseData; + + try { + {{#isResponseFile}} + responseData = response.data as {{{returnType}}}; + {{/isResponseFile}} + {{^isResponseFile}} + {{#returnSimpleType}} + {{#returnTypeIsPrimitive}} + responseData = response.data as {{{returnType}}}; + {{/returnTypeIsPrimitive}} + {{^returnTypeIsPrimitive}} + responseData = await _apiClient.deserializeAsync<{{{returnType}}}>(response.data!, '{{{returnType}}}'); + {{/returnTypeIsPrimitive}} + {{/returnSimpleType}} + {{^returnSimpleType}} + responseData = await _apiClient.deserializeAsync<{{{returnType}}}>(response.data!, '{{{returnType}}}'); + {{/returnSimpleType}} + {{/isResponseFile}} + } catch (error, stackTrace) { + throw DioException( + error: error, + requestOptions: response.requestOptions, + response: response, + stackTrace: stackTrace, + type: DioExceptionType.unknown, + ); + } + + return Response<{{{returnType}}}>( + data: responseData, + headers: response.headers, + isRedirect: response.isRedirect, + requestOptions: response.requestOptions, + redirects: response.redirects, + statusCode: response.statusCode, + statusMessage: response.statusMessage, + extra: response.extra, + ); + {{/returnType}} + } + {{/operation}} +} +{{/operations}} diff --git a/dart-v3-templates/api_client.mustache b/dart-v3-templates/api_client.mustache new file mode 100644 index 000000000..a2ff55b99 --- /dev/null +++ b/dart-v3-templates/api_client.mustache @@ -0,0 +1,161 @@ +{{>header}} +{{>part_of}} + +class {{clientName}} { + {{clientName}}({ + Dio? dio, + String? basePathOverride, + List? interceptors, + }) : this.dio = dio ?? + Dio(BaseOptions( + baseUrl: basePathOverride ?? basePath, + )) { + this.dio.interceptors.addAll(interceptors ?? [ + OAuthInterceptor(), + BasicAuthInterceptor(), + BearerAuthInterceptor(), + ApiKeyAuthInterceptor(), + ]); + } + + static const String basePath = r'{{{basePath}}}'; + + final Dio dio; + // final Logger _logger = Logger('{{clientName}}'); + + void setOAuthToken(String name, String token) { + for (final interceptor in dio.interceptors) { + if (interceptor is OAuthInterceptor) { + interceptor.tokens[name] = token; + break; + } + } + } + + void setBearerAuth(String name, String token) { + for (final interceptor in dio.interceptors) { + if (interceptor is BearerAuthInterceptor) { + interceptor.tokens[name] = token; + break; + } + } + } + + void setBasicAuth(String name, String username, String password) { + for (final interceptor in dio.interceptors) { + if (interceptor is BasicAuthInterceptor) { + interceptor.authInfo[name] = BasicAuthInfo(username, password); + break; + } + } + } + + void setApiKey(String name, String apiKey) { + // ApiKeyAuth({{#isKeyInCookie}}'cookie'{{/isKeyInCookie}}{{^isKeyInCookie}}{{#isKeyInHeader}}'header'{{/isKeyInHeader}}{{^isKeyInHeader}}'query'{{/isKeyInHeader}}{{/isKeyInCookie}}, '{{{keyParamName}}}'); + for (final interceptor in dio.interceptors) { + if (interceptor is ApiKeyAuthInterceptor) { + interceptor.apiKeys[name] = apiKey; + break; + } + } + } + + {{#apiInfo}}{{#apis}} + /// Get {{classname}} instance + {{classname}} get{{classname}}() { + return {{classname}}(this); + }{{/apis}}{{/apiInfo}} + + Future> invokeAPI({ + required String path, + Object? body, + Options? options, + Map? queryParameters, + CancelToken? cancelToken, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + return dio.request( + path, + data: body, + options: options, + queryParameters: queryParameters, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + } +{{#native_serialization}} + + Future deserializeAsync(dynamic json, String targetType, {bool growable = false}) async => + // ignore: deprecated_member_use_from_same_package + deserialize(json, targetType, growable: growable) as T; + + @Deprecated('Scheduled for removal in OpenAPI Generator 6.x. Use deserializeAsync() instead.') + dynamic deserialize(dynamic json, String targetType, {bool growable = false}) { + // Remove all spaces. Necessary for regular expressions as well. + targetType = targetType.replaceAll(' ', ''); // ignore: parameter_assignments + + // If the expected target type is String, nothing to do... + return targetType == 'String' + ? jsonEncode(json) + : _deserialize(json, targetType, growable: growable == true); + } + + static dynamic _deserialize(dynamic value, String targetType, {bool growable = false}) { + try { + switch (targetType) { + case 'String': + return '$value'; + case 'int': + return value is int ? value : int.parse('$value'); + case 'bool': + if (value is bool) { + return value; + } + final valueString = '$value'.toLowerCase(); + return valueString == 'true' || valueString == '1'; + case 'double': + return value is double ? value : double.parse('$value'); + {{#models}} + {{#model}} + case '{{{classname}}}': + {{#isEnum}} + {{#native_serialization}}return {{{classname}}}TypeTransformer().decode(value);{{/native_serialization}} + {{#json_serializable}} return _$enumDecode(_${{{classname}}}EnumMap, value);{{/json_serializable}} + {{/isEnum}} + {{^isEnum}} + return {{{classname}}}.fromJson(value); + {{/isEnum}} + {{/model}} + {{/models}} + default: + Match? match; + if (value is List && (match = _regList.firstMatch(targetType)) != null) { + targetType = match![1]!; // ignore: parameter_assignments + return value + .map((v) => _deserialize(v, targetType, growable: growable)) + .toList(growable: growable); + } + if (value is Set && (match = _regSet.firstMatch(targetType)) != null) { + targetType = match![1]!; // ignore: parameter_assignments + return value + .map((v) => _deserialize(v, targetType, growable: growable)) + .toSet(); + } + if (value is Map && (match = _regMap.firstMatch(targetType)) != null) { + targetType = match![1]!; // ignore: parameter_assignments + return Map.fromIterables( + value.keys, + value.values.map((v) => _deserialize(v, targetType, growable: growable)), + ); + } + break; + } + } on Exception catch (error, trace) { + throw ApiException.withInner(HttpStatus.internalServerError, 'Exception during deserialization.', error, trace,); + } + throw ApiException(HttpStatus.internalServerError, 'Could not find a suitable class for deserialization',); + } +{{/native_serialization}} +} diff --git a/dart-v3-templates/api_doc.mustache b/dart-v3-templates/api_doc.mustache new file mode 100644 index 000000000..ae324061e --- /dev/null +++ b/dart-v3-templates/api_doc.mustache @@ -0,0 +1,96 @@ +# {{{pubName}}}.api.{{{classname}}}{{#description}} +{{{description}}}{{/description}} + +## Load the API package +```dart +import 'package:{{{pubName}}}/api.dart'; +``` + +All URIs are relative to *{{{basePath}}}* + +Method | HTTP request | Description +------------- | ------------- | ------------- +{{#operations}}{{#operation}}[**{{{operationId}}}**]({{{classname}}}.md#{{{operationIdLowerCase}}}) | **{{{httpMethod}}}** {{{path}}} | {{#summary}}{{{summary}}}{{/summary}} +{{/operation}}{{/operations}} + +{{#operations}} +{{#operation}} +# **{{{operationId}}}** +> {{#returnType}}{{{returnType}}} {{/returnType}}{{{operationId}}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}) + +{{{summary}}}{{#notes}} + +{{{notes}}}{{/notes}} + +### Example +```dart +import 'package:{{{pubName}}}/api.dart'; +{{#hasAuthMethods}} +{{#authMethods}} +{{#isBasic}} +{{#isBasicBasic}} +// TODO Configure HTTP basic authorization: {{{name}}} +//defaultApiClient.getAuthentication('{{{name}}}').username = 'YOUR_USERNAME' +//defaultApiClient.getAuthentication('{{{name}}}').password = 'YOUR_PASSWORD'; +{{/isBasicBasic}} +{{#isBasicBearer}} +// TODO Configure HTTP Bearer authorization: {{{name}}} +// Case 1. Use String Token +//defaultApiClient.getAuthentication('{{{name}}}').setAccessToken('YOUR_ACCESS_TOKEN'); +// Case 2. Use Function which generate token. +// String yourTokenGeneratorFunction() { ... } +//defaultApiClient.getAuthentication('{{{name}}}').setAccessToken(yourTokenGeneratorFunction); +{{/isBasicBearer}} +{{/isBasic}} +{{#isApiKey}} +// TODO Configure API key authorization: {{{name}}} +//defaultApiClient.getAuthentication('{{{name}}}').apiKey = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//defaultApiClient.getAuthentication('{{{name}}}').apiKeyPrefix = 'Bearer'; +{{/isApiKey}} +{{#isOAuth}} +// TODO Configure OAuth2 access token for authorization: {{{name}}} +//defaultApiClient.getAuthentication('{{{name}}}').accessToken = 'YOUR_ACCESS_TOKEN'; +{{/isOAuth}} +{{/authMethods}} +{{/hasAuthMethods}} + +final api_instance = {{{classname}}}(); +{{#allParams}} +final {{{paramName}}} = {{#isArray}}[{{/isArray}}{{#isBodyParam}}{{{dataType}}}(){{/isBodyParam}}{{^isBodyParam}}{{{example}}}{{/isBodyParam}}{{#isArray}}]{{/isArray}}; // {{{dataType}}} | {{{description}}} +{{/allParams}} + +try { + {{#returnType}}final result = {{/returnType}}api_instance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}); + {{#returnType}} + print(result); + {{/returnType}} +} catch (e) { + print('Exception when calling {{{classname}}}->{{{operationId}}}: $e\n'); +} +``` + +### Parameters +{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} +Name | Type | Description | Notes +------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} +{{#allParams}} **{{{paramName}}}** | {{#isPrimitiveType}}**{{{dataType}}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{{dataType}}}**]({{{baseType}}}.md){{/isPrimitiveType}}| {{{description}}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{{defaultValue}}}]{{/defaultValue}} +{{/allParams}} + +### Return type + +{{#returnType}}{{#returnTypeIsPrimitive}}**{{{returnType}}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}[**{{{returnType}}}**]({{{returnBaseType}}}.md){{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}void (empty response body){{/returnType}} + +### Authorization + +{{^authMethods}}No authorization required{{/authMethods}}{{#authMethods}}[{{{name}}}](../README.md#{{{name}}}){{^-last}}, {{/-last}}{{/authMethods}} + +### HTTP request headers + + - **Content-Type**: {{#consumes}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/consumes}}{{^consumes}}Not defined{{/consumes}} + - **Accept**: {{#produces}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/produces}}{{^produces}}Not defined{{/produces}} + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +{{/operation}} +{{/operations}} diff --git a/dart-v3-templates/api_exception.mustache b/dart-v3-templates/api_exception.mustache new file mode 100644 index 000000000..aeb7aa9ce --- /dev/null +++ b/dart-v3-templates/api_exception.mustache @@ -0,0 +1,23 @@ +{{>header}} +{{>part_of}} +class ApiException implements Exception { + ApiException(this.code, this.message); + + ApiException.withInner(this.code, this.message, this.innerException, this.stackTrace); + + int code = 0; + String? message; + Exception? innerException; + StackTrace? stackTrace; + + @override + String toString() { + if (message == null) { + return 'ApiException'; + } + if (innerException == null) { + return 'ApiException $code: $message'; + } + return 'ApiException $code: $message (Inner exception: $innerException)\n\n$stackTrace'; + } +} diff --git a/dart-v3-templates/api_helper.mustache b/dart-v3-templates/api_helper.mustache new file mode 100644 index 000000000..01f0f4aef --- /dev/null +++ b/dart-v3-templates/api_helper.mustache @@ -0,0 +1,60 @@ +{{>header}} +{{>part_of}} + +// extracted from dart:io package which cannot be used for web clients +class HttpStatus { + static const int internalServerError = 500; +} + +/// Format the given form parameter object into something that Dio can handle. +String encodeFormParameter(dynamic parameter) { + return parameterToString(parameter); +} + +ListParam encodeCollectionQueryParameter(Iterable parameters, {ListFormat format = ListFormat.multi}) { + return ListParam([for (final parameter in parameters) parameterToString(parameter),], format); +} + +// ListParam encodeCollectionQueryParameter(Iterable parameters, {ListFormat format = ListFormat.multi}) { +// return ListParam([for (final parameter in parameters) parameter,], format); +// } + +String encodeQueryParameter(dynamic parameter) { + return parameterToString(parameter); +} + +/// Format the given parameter object into a [String]. +String parameterToString(dynamic value) { + if (value == null) { + return ''; + } + if (value is DateTime) { + return value.toUtc().toIso8601String(); + } + {{#models}} + {{#model}} + {{#isEnum}} + if (value is {{{classname}}}) { +{{#native_serialization}} return {{{classname}}}TypeTransformer().encode(value).toString();{{/native_serialization}}{{#json_serializable}} return value.toString();{{/json_serializable}} + } + {{/isEnum}} + {{/model}} + {{/models}} + return value.toString(); + // return jsonEncode(value); +} + +/// Returns a valid [DateTime], null otherwise. +DateTime? mapToDateTime(String? value) { + if (value == null) { + return null; + } + + DateTime dateTime = DateTime.parse(value); + + if (dateTime.isUtc == false) { + dateTime = DateTime.parse('${value}Z'); + } + + return dateTime; +} diff --git a/dart-v3-templates/api_test.mustache b/dart-v3-templates/api_test.mustache new file mode 100644 index 000000000..55f1e5558 --- /dev/null +++ b/dart-v3-templates/api_test.mustache @@ -0,0 +1,28 @@ +{{>header}} +// import 'package:{{{pubName}}}/api.dart'; +import 'package:test/test.dart'; + +{{#operations}} + +/// tests for {{{classname}}} +void main() { + // final instance = {{{classname}}}(); + + group('tests for {{{classname}}}', () { + {{#operation}} + {{#summary}} + // {{{.}}} + // + {{/summary}} + {{#notes}} + // {{{.}}} + // + {{/notes}} + //{{#returnType}}Future<{{{returnType}}}> {{/returnType}}{{^returnType}}Future {{/returnType}}{{{operationId}}}({{#allParams}}{{#required}}{{{dataType}}} {{{paramName}}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#hasOptionalParams}}{ {{#allParams}}{{^required}}{{{dataType}}} {{{paramName}}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}} }{{/hasOptionalParams}}) async + test('test {{{operationId}}}', () async { + }); + + {{/operation}} + }); +} +{{/operations}} diff --git a/dart-v3-templates/apilib.mustache b/dart-v3-templates/apilib.mustache new file mode 100644 index 000000000..05df001e9 --- /dev/null +++ b/dart-v3-templates/apilib.mustache @@ -0,0 +1,34 @@ +{{>header}} +{{#pubLibrary}}library {{{pubLibrary}}};{{/pubLibrary}}{{^pubLibrary}}library {{{pubName}}}.api;{{/pubLibrary}} + +import 'dart:convert'; + +import 'package:collection/collection.dart'; +import 'package:dio/dio.dart'; +{{#json_serializable}} +import 'package:json_annotation/json_annotation.dart'; +{{/json_serializable}} +// import 'package:logging/logging.dart'; + +part 'api_client.dart'; +part 'api_helper.dart'; +part 'api_exception.dart'; +part 'auth/authentication.dart'; +part 'auth/api_key_auth.dart'; +part 'auth/oauth.dart'; +part 'auth/http_basic_auth.dart'; +part 'auth/http_bearer_auth.dart'; + +{{#apiInfo}}{{#apis}}part 'api/{{{classFilename}}}.dart'; +{{/apis}}{{/apiInfo}} +{{#models}}{{#model}}part 'model/{{{classFilename}}}.dart'; +{{/model}}{{/models}} + +{{#json_serializable}} +part 'api.g.dart'; +{{/json_serializable}} +final _regList = RegExp(r'^List<(.*)>$'); +final _regSet = RegExp(r'^Set<(.*)>$'); +final _regMap = RegExp(r'^Map$'); + +{{clientName}} defaultApiClient = {{clientName}}(); diff --git a/dart-v3-templates/auth/api_key_auth.mustache b/dart-v3-templates/auth/api_key_auth.mustache new file mode 100644 index 000000000..cbfcacde6 --- /dev/null +++ b/dart-v3-templates/auth/api_key_auth.mustache @@ -0,0 +1,31 @@ +{{>header}} +{{>part_of}} + +class ApiKeyAuthInterceptor extends AuthInterceptor { + final Map apiKeys = {}; + + @override + void onRequest(RequestOptions options, RequestInterceptorHandler handler) { + final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'apiKey'); + + for (final info in authInfo) { + final String authName = info['name']!; + final apiKey = apiKeys[authName]; + + if (apiKey == null) { + continue; + } + + final String authKeyName = info['keyName']!; + final String authWhere = info['where']!; + + if (authWhere == 'query') { + options.queryParameters[authKeyName] = apiKey; + } else { + options.headers[authKeyName] = apiKey; + } + } + + super.onRequest(options, handler); + } +} diff --git a/dart-v3-templates/auth/authentication.mustache b/dart-v3-templates/auth/authentication.mustache new file mode 100644 index 000000000..441b0bde1 --- /dev/null +++ b/dart-v3-templates/auth/authentication.mustache @@ -0,0 +1,20 @@ +{{>header}} +{{>part_of}} + +abstract class AuthInterceptor extends Interceptor { + /// Get auth information on given route for the given type. + /// Can return an empty list if type is not present on auth data or + /// if route doesn't need authentication. + List> getAuthInfo(RequestOptions route, bool Function(Map secure) handles) { + final List>? auth = route.extra['secure']; + + if (auth == null) { + return >[]; + } + + return >[ + for (final Map secure in auth) + if (handles(secure)) secure, + ]; + } +} diff --git a/dart-v3-templates/auth/header.mustache b/dart-v3-templates/auth/header.mustache new file mode 100644 index 000000000..32c88287e --- /dev/null +++ b/dart-v3-templates/auth/header.mustache @@ -0,0 +1,3 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// diff --git a/dart-v3-templates/auth/http_basic_auth.mustache b/dart-v3-templates/auth/http_basic_auth.mustache new file mode 100644 index 000000000..253ce6c4c --- /dev/null +++ b/dart-v3-templates/auth/http_basic_auth.mustache @@ -0,0 +1,31 @@ +{{>header}} +{{>part_of}} + +class BasicAuthInfo { + const BasicAuthInfo(this.username, this.password); + + final String username; + final String password; +} + +class BasicAuthInterceptor extends AuthInterceptor { + final Map authInfo = {}; + + @override + void onRequest(RequestOptions options, RequestInterceptorHandler handler) { + final metadataAuthInfo = getAuthInfo(options, (secure) => (secure['type'] == 'http' && secure['scheme'] == 'basic') || secure['type'] == 'basic'); + + for (final info in metadataAuthInfo) { + final String authName = info['name']!; + + final basicAuthInfo = authInfo[authName]; + if (basicAuthInfo != null) { + final basicAuth = 'Basic ${base64Encode(utf8.encode('${basicAuthInfo.username}:${basicAuthInfo.password}'))}'; + options.headers['Authorization'] = basicAuth; + break; + } + } + + super.onRequest(options, handler); + } +} diff --git a/dart-v3-templates/auth/http_bearer_auth.mustache b/dart-v3-templates/auth/http_bearer_auth.mustache new file mode 100644 index 000000000..2eff7f7ff --- /dev/null +++ b/dart-v3-templates/auth/http_bearer_auth.mustache @@ -0,0 +1,21 @@ +{{>header}} +{{>part_of}} + +class BearerAuthInterceptor extends AuthInterceptor { + final Map tokens = {}; + + @override + void onRequest(RequestOptions options, RequestInterceptorHandler handler) { + final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'http' && secure['scheme'] == 'bearer'); + + for (final info in authInfo) { + final token = tokens[info['name']]; + if (token != null) { + options.headers['Authorization'] = 'Bearer ${token}'; + break; + } + } + + super.onRequest(options, handler); + } +} diff --git a/dart-v3-templates/auth/oauth.mustache b/dart-v3-templates/auth/oauth.mustache new file mode 100644 index 000000000..28efee631 --- /dev/null +++ b/dart-v3-templates/auth/oauth.mustache @@ -0,0 +1,20 @@ +{{>header}} +{{>part_of}} +class OAuthInterceptor extends AuthInterceptor { + final Map tokens = {}; + + @override + void onRequest(RequestOptions options, RequestInterceptorHandler handler) { + final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'oauth' && secure['type'] == 'oauth2'); + + for (final info in authInfo) { + final token = tokens[info['name']]; + if (token != null) { + options.headers['Authorization'] = 'Bearer ${token}'; + break; + } + } + + super.onRequest(options, handler); + } +} diff --git a/dart-v3-templates/auth/part_of.mustache b/dart-v3-templates/auth/part_of.mustache new file mode 100644 index 000000000..d9f1d4097 --- /dev/null +++ b/dart-v3-templates/auth/part_of.mustache @@ -0,0 +1 @@ +{{#pubLibrary}}part of {{{pubLibrary}}};{{/pubLibrary}}{{^pubLibrary}}part of {{{pubName}}}.api;{{/pubLibrary}} diff --git a/dart-v3-templates/build.yaml.mustache b/dart-v3-templates/build.yaml.mustache new file mode 100644 index 000000000..89a4dd6e1 --- /dev/null +++ b/dart-v3-templates/build.yaml.mustache @@ -0,0 +1,18 @@ +targets: + $default: + builders: + json_serializable: + options: + # Options configure how source code is generated for every + # `@JsonSerializable`-annotated class in the package. + # + # The default value for each is listed. + any_map: false + checked: true + create_factory: true + create_to_json: true + disallow_unrecognized_keys: true + explicit_to_json: true + field_rename: none + ignore_unannotated: false + include_if_null: false diff --git a/dart-v3-templates/dart_constructor.mustache b/dart-v3-templates/dart_constructor.mustache new file mode 100644 index 000000000..86228d2de --- /dev/null +++ b/dart-v3-templates/dart_constructor.mustache @@ -0,0 +1,26 @@ + /// Returns a new [{{{classname}}}] instance. + {{{classname}}}({ + {{#vars}} + {{! + A field is required in Dart when it is + required && !defaultValue in OAS + }} + {{#required}} + {{^defaultValue}}required {{/defaultValue}} + {{/required}} + {{^required}} + {{^isNullable}} + {{^defaultValue}}required {{/defaultValue}} + {{/isNullable}} + {{/required}} + this.{{{name}}} + {{#required}} + {{#defaultValue}} = {{#isEnum}}{{^isContainer}}const {{{enumName}}}._({{/isContainer}}{{/isEnum}}{{{defaultValue}}}{{#isEnum}}{{^isContainer}}){{/isContainer}}{{/isEnum}}{{/defaultValue}} + {{/required}} + {{^required}} + {{^isNullable}} + {{#defaultValue}} = {{#isEnum}}{{^isContainer}}const {{{enumName}}}._({{/isContainer}}{{/isEnum}}{{{defaultValue}}}{{#isEnum}}{{^isContainer}}){{/isContainer}}{{/isEnum}}{{/defaultValue}} + {{/isNullable}} + {{/required}}, + {{/vars}} + }); \ No newline at end of file diff --git a/dart-v3-templates/git_push.sh.mustache b/dart-v3-templates/git_push.sh.mustache new file mode 100755 index 000000000..8b3f689c9 --- /dev/null +++ b/dart-v3-templates/git_push.sh.mustache @@ -0,0 +1,58 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="{{{gitHost}}}" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="{{{gitUserId}}}" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="{{{gitRepoId}}}" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="{{{releaseNote}}}" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=`git remote` +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' + diff --git a/dart-v3-templates/gitignore.mustache b/dart-v3-templates/gitignore.mustache new file mode 100644 index 000000000..7c2804416 --- /dev/null +++ b/dart-v3-templates/gitignore.mustache @@ -0,0 +1,27 @@ +# See https://www.dartlang.org/tools/private-files.html + +# Files and directories created by pub +.buildlog +.packages +.project +.pub/ +build/ +**/packages/ + +# Files created by dart2js +# (Most Dart developers will use pub build to compile Dart, use/modify these +# rules if you intend to use dart2js directly +# Convention is to use extension '.dart.js' for Dart compiled to Javascript to +# differentiate from explicit Javascript files) +*.dart.js +*.part.js +*.js.deps +*.js.map +*.info.json + +# Directory created by dartdoc +doc/api/ + +# Don't commit pubspec lock file +# (Library packages only! Remove pattern if developing an application package) +pubspec.lock diff --git a/dart-v3-templates/header.mustache b/dart-v3-templates/header.mustache new file mode 100644 index 000000000..32c88287e --- /dev/null +++ b/dart-v3-templates/header.mustache @@ -0,0 +1,3 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// diff --git a/dart-v3-templates/model.mustache b/dart-v3-templates/model.mustache new file mode 100644 index 000000000..d2f1ab216 --- /dev/null +++ b/dart-v3-templates/model.mustache @@ -0,0 +1,22 @@ +{{>header}} +{{>part_of}} +{{#models}} +{{#model}} +{{#isEnum}} +{{#native_serialization}} +{{>serialization/native/enum}} +{{/native_serialization}} +{{#json_serializable}} +{{>serialization/json_serializable/json_serializable_enum}} +{{/json_serializable}} +{{/isEnum}} +{{^isEnum}} +{{#native_serialization}} +{{>serialization/native/class}} +{{/native_serialization}} +{{#json_serializable}} +{{>serialization/json_serializable/json_serializable_class}} +{{/json_serializable}} +{{/isEnum}} +{{/model}} +{{/models}} diff --git a/dart-v3-templates/model_test.mustache b/dart-v3-templates/model_test.mustache new file mode 100644 index 000000000..bad3c7357 --- /dev/null +++ b/dart-v3-templates/model_test.mustache @@ -0,0 +1,28 @@ +{{>header}} +{{#models}} +{{#model}} +// import 'package:{{{pubName}}}/api.dart'; +import 'package:test/test.dart'; + +// tests for {{{classname}}} +void main() { + {{^isEnum}} + // final instance = {{{classname}}}(); + {{/isEnum}} + + group('test {{{classname}}}', () { + {{#vars}} + {{#description}} + // {{{description}}} + {{/description}} + // {{#isFreeFormObject}}Map{{/isFreeFormObject}}{{^isFreeFormObject}}{{{datatype}}}{{/isFreeFormObject}} {{{name}}}{{#defaultValue}} (default value: {{{.}}}){{/defaultValue}} + test('to test the property `{{{name}}}`', () async { + }); + + {{/vars}} + + }); + +} +{{/model}} +{{/models}} diff --git a/dart-v3-templates/object_doc.mustache b/dart-v3-templates/object_doc.mustache new file mode 100644 index 000000000..94402b858 --- /dev/null +++ b/dart-v3-templates/object_doc.mustache @@ -0,0 +1,16 @@ +{{#models}}{{#model}}# {{{pubName}}}.model.{{{classname}}} + +## Load the model package +```dart +import 'package:{{{pubName}}}/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +{{#vars}}**{{{name}}}** | {{#isPrimitiveType}}**{{{dataType}}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{{dataType}}}**]({{{complexType}}}.md){{/isPrimitiveType}} | {{{description}}} | {{^required}}[optional] {{/required}}{{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}}[default to {{{defaultValue}}}]{{/defaultValue}} +{{/vars}} + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + +{{/model}}{{/models}} diff --git a/dart-v3-templates/part_of.mustache b/dart-v3-templates/part_of.mustache new file mode 100644 index 000000000..d9f1d4097 --- /dev/null +++ b/dart-v3-templates/part_of.mustache @@ -0,0 +1 @@ +{{#pubLibrary}}part of {{{pubLibrary}}};{{/pubLibrary}}{{^pubLibrary}}part of {{{pubName}}}.api;{{/pubLibrary}} diff --git a/dart-v3-templates/pubspec.mustache b/dart-v3-templates/pubspec.mustache new file mode 100644 index 000000000..10502829b --- /dev/null +++ b/dart-v3-templates/pubspec.mustache @@ -0,0 +1,16 @@ +# +# AUTO-GENERATED FILE, DO NOT MODIFY! +# + +name: '{{{pubName}}}' +version: '{{{pubVersion}}}' +description: '{{{pubDescription}}}' +homepage: '{{{pubHomepage}}}' +environment: + sdk: '>=3.0.0 <4.0.0' +dependencies: + collection: '^1.15.0' + dio: '^5.0.0' + logging: '^1.0.0' +dev_dependencies: + test: '^1.16.0' diff --git a/dart-v3-templates/serialization/json_serializable/json_serializable_class.mustache b/dart-v3-templates/serialization/json_serializable/json_serializable_class.mustache new file mode 100644 index 000000000..3a9ff0362 --- /dev/null +++ b/dart-v3-templates/serialization/json_serializable/json_serializable_class.mustache @@ -0,0 +1,70 @@ +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: true, + explicitToJson: true, +) +class {{{classname}}} { +{{>dart_constructor}} + +{{#vars}} + {{#description}} + /// {{{description}}} + {{/description}} + {{^isEnum}} + {{#minimum}} + // minimum: {{{minimum}}} + {{/minimum}} + {{#maximum}} + // maximum: {{{maximum}}} + {{/maximum}} + {{/isEnum}} + {{^isBinary}} + @JsonKey( + {{#defaultValue}}defaultValue: {{{defaultValue}}},{{/defaultValue}}{{^defaultValue}}nullable: {{isNullable}},{{/defaultValue}} + name: r'{{{baseName}}}', + required: {{#required}}true{{/required}}{{^required}}false{{/required}}, + ) + {{/isBinary}} + {{#isBinary}} + @JsonKey(ignore: true) + {{/isBinary}} + {{{datatypeWithEnum}}} {{{name}}}; + +{{/vars}} + @override + bool operator ==(Object other) => identical(this, other) || other is {{{classname}}} && + {{#vars}} + other.{{{name}}} == {{{name}}}{{^-last}} &&{{/-last}}{{#-last}};{{/-last}} + {{/vars}} + + @override + int get hashCode => + {{#vars}} + ({{{name}}} == null ? 0 : {{{name}}}.hashCode){{^-last}} +{{/-last}}{{#-last}};{{/-last}} + {{/vars}} + + factory {{{classname}}}.fromJson(Map json) => _${{{classname}}}FromJson(json); + + Map toJson() => _${{{classname}}}ToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} +{{#vars}} + {{#isEnum}} + {{^isContainer}} + +{{>serialization/json_serializable/json_serializable_enum_inline}} + {{/isContainer}} + {{#isContainer}} + {{#mostInnerItems}} + +{{>serialization/json_serializable/json_serializable_enum_inline}} + {{/mostInnerItems}} + {{/isContainer}} + {{/isEnum}} +{{/vars}} \ No newline at end of file diff --git a/dart-v3-templates/serialization/json_serializable/json_serializable_enum.mustache b/dart-v3-templates/serialization/json_serializable/json_serializable_enum.mustache new file mode 100644 index 000000000..3fe458ab9 --- /dev/null +++ b/dart-v3-templates/serialization/json_serializable/json_serializable_enum.mustache @@ -0,0 +1,7 @@ +enum {{{classname}}} { +{{#allowableValues}} +{{#enumVars}} + {{{name}}}, +{{/enumVars}} +{{/allowableValues}} +} \ No newline at end of file diff --git a/dart-v3-templates/serialization/json_serializable/json_serializable_enum_inline.mustache b/dart-v3-templates/serialization/json_serializable/json_serializable_enum_inline.mustache new file mode 100644 index 000000000..5249f86b3 --- /dev/null +++ b/dart-v3-templates/serialization/json_serializable/json_serializable_enum_inline.mustache @@ -0,0 +1,8 @@ +{{#description}}/// {{{description}}}{{/description}} +enum {{{enumName}}} { +{{#allowableValues}} +{{#enumVars}} + {{{name}}}, +{{/enumVars}} +{{/allowableValues}} +} \ No newline at end of file diff --git a/dart-v3-templates/serialization/native/class.mustache b/dart-v3-templates/serialization/native/class.mustache new file mode 100644 index 000000000..7ad67ada0 --- /dev/null +++ b/dart-v3-templates/serialization/native/class.mustache @@ -0,0 +1,307 @@ +class {{{classname}}} {{#interfaces}}{{#-first}}implements {{/-first}}{{.}}{{^-last}}, {{/-last}} {{/interfaces}}{ +{{>dart_constructor}} + + /// Returns a new [{{{classname}}}] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static {{{classname}}}? fromJson(Object? json) { + if (json is! Map) { + return null; + } + + return {{{classname}}}( + {{#vars}} + {{#isDateTime}} + {{{name}}}: mapToDateTime(json[r'{{{baseName}}}']){{^isNullable}}!{{/isNullable}}, + {{/isDateTime}} + {{#isDate}} + {{{name}}}: json[r'{{{baseName}}}'] == null + ? null + : DateTime.parse(json[r'{{{baseName}}}']), + {{/isDate}} + {{^isDateTime}} + {{^isDate}} + {{#complexType}} + {{#isArray}} + {{#items.isArray}} + {{{name}}}: + {{#items.complexType}} + {{items.complexType}}.listFromJson(json[r'{{{baseName}}}']), + {{/items.complexType}} + {{^items.complexType}} + json[r'{{{baseName}}}'] == null ? null : List<{{{items.dataType}}}>.from(json[r'{{{baseName}}}']).map((e) => List<{{items.items.dataType}}>.from(e)).toList(growable: false), + {{/items.complexType}} + {{/items.isArray}} + {{^items.isArray}} + {{{name}}}: + {{#items.isFreeFormObject}} + json[r'{{{baseName}}}'] == null ? null : List>.from(json[r'{{{baseName}}}']), + {{/items.isFreeFormObject}} + {{^items.isFreeFormObject}} + {{{complexType}}}.listFromJson(json[r'{{{baseName}}}']), + {{/items.isFreeFormObject}} + {{/items.isArray}} + {{/isArray}} + {{^isArray}} + {{#isMap}} + {{#items.isArray}} + {{{name}}}: + {{#items.complexType}} + {{items.complexType}}.mapListFromJson(json[r'{{{baseName}}}']), + {{/items.complexType}} + {{^items.complexType}} + Map.from(json[r'{{{baseName}}}'] ?? {}), + {{/items.complexType}} + {{/items.isArray}} + {{^items.isArray}} + {{{name}}}: + {{#items.isMap}} + {{#items.complexType}} + {{items.complexType}}.mapFromJson(json[r'{{{baseName}}}']), + {{/items.complexType}} + {{^items.complexType}} + Map.from(json[r'{{{baseName}}}'] ?? {}), + {{/items.complexType}} + {{/items.isMap}} + {{^items.isMap}} + {{#items.isModel}} + {{items.complexType}}.mapFromJson(json[r'{{{baseName}}}']), + {{/items.isModel}} + {{^items.isModel}} + {{#isNullable}}json[r'{{{baseName}}}'] == null ? null : {{/isNullable}} + Map.from(json[r'{{{baseName}}}']), + {{/items.isModel}} + {{/items.isMap}} + {{/items.isArray}} + {{/isMap}} + {{^isMap}} + {{#isBinary}} + {{{name}}}: null, // No support for decoding binary content from JSON + {{/isBinary}} + {{^isBinary}} + {{{name}}}: {{{complexType}}}.fromJson(json[r'{{{baseName}}}']){{^isNullable}}!{{/isNullable}}, + {{/isBinary}} + {{/isMap}} + {{/isArray}} + {{/complexType}} + {{^complexType}} + {{#isArray}} + {{#isEnum}} + {{{name}}}: {{{items.datatypeWithEnum}}}.listFromJson(json[r'{{{baseName}}}']), + {{/isEnum}} + {{^isEnum}} + {{{name}}}: + {{#isNullable}}json[r'{{{baseName}}}'] == null ? null : {{/isNullable}} + {{#uniqueItems}}Set{{/uniqueItems}}{{^uniqueItems}}List{{/uniqueItems}}<{{{items.datatype}}}>.from(json[r'{{{baseName}}}']), + {{/isEnum}} + {{/isArray}} + {{^isArray}} + {{#isMap}} + {{{name}}}: + {{#isNullable}}json[r'{{{baseName}}}'] == null ? null : {{/isNullable}} + Map.from(json[r'{{{baseName}}}']), + {{/isMap}} + {{^isMap}} + {{#isNumber}} + {{{name}}}: json[r'{{{baseName}}}'] == null ? + null : + json[r'{{{baseName}}}'].toDouble(), + {{/isNumber}} + {{^isNumber}} + {{#isEnum}} + {{{name}}}: {{{enumName}}}.fromJson(json[r'{{{baseName}}}']){{^isNullable}}!{{/isNullable}}, + {{/isEnum}} + {{^isEnum}} + {{#isFreeFormObject}} + {{{name}}}: {{#isNullable}}json[r'{{{baseName}}}'] == null ? null : {{/isNullable}} + Map.from(json[r'{{{baseName}}}']), + {{/isFreeFormObject}} + {{^isFreeFormObject}} + {{#isFloat}} + {{{name}}}: json[r'{{{baseName}}}']{{#isNullable}}?{{/isNullable}}.toDouble(), + {{/isFloat}} + {{^isFloat}} + {{{name}}}: json[r'{{{baseName}}}'], + {{/isFloat}} + {{/isFreeFormObject}} + {{/isEnum}} + {{/isNumber}} + {{/isMap}} + {{/isArray}} + {{/complexType}} + {{/isDate}} + {{/isDateTime}} + {{/vars}} + ); + } + + {{#vars}} + {{#description}} + /// {{{description}}} + {{/description}} + {{^isEnum}} + {{#minimum}} + // minimum: {{{minimum}}} + {{/minimum}} + {{#maximum}} + // maximum: {{{maximum}}} + {{/maximum}} + {{/isEnum}} + {{#isFreeFormObject}} + {{#isReadOnly}}final {{/isReadOnly}}Map{{#isNullable}}?{{/isNullable}} {{{name}}}; + {{/isFreeFormObject}} + {{^isFreeFormObject}} + {{#isArray}} + {{#items.isFreeFormObject}} + {{#isReadOnly}}final {{/isReadOnly}}List>{{#isNullable}}?{{/isNullable}} {{{name}}}; + {{/items.isFreeFormObject}} + {{^items.isFreeFormObject}} + {{#isReadOnly}}final {{/isReadOnly}}{{{datatypeWithEnum}}}{{#isNullable}}?{{/isNullable}} {{{name}}}; + {{/items.isFreeFormObject}} + {{/isArray}} + {{^isArray}} + {{#isReadOnly}}final {{/isReadOnly}}{{{datatypeWithEnum}}}{{#isNullable}}?{{/isNullable}} {{{name}}}; + {{/isArray}} + {{/isFreeFormObject}} + + {{/vars}} + @override + bool operator ==(Object other) { + // Same reference + if (identical(this, other)) { + return true; + } + + return other is {{{classname}}} {{#vars}} + {{#isContainer}} + && DeepCollectionEquality.unordered().equals({{name}}, other.{{name}}) + {{/isContainer}} + {{^isContainer}} + && other.{{{name}}} == {{{name}}} + {{/isContainer}} + {{/vars}}; + } + + + @override + int get hashCode => + {{#vars}} + {{#isNullable}}({{{name}}} == null ? 0 :{{/isNullable}} {{{name}}}.hashCode{{#isNullable}}){{/isNullable}}{{^-last}} +{{/-last}}{{#-last}};{{/-last}} + {{/vars}} + + static List<{{{classname}}}> listFromJson(Iterable? json) { + if (json == null) { + return <{{{classname}}}>[]; + } + + return json.fold(<{{{classname}}}>[], (List<{{{classname}}}> previousValue, element) { + final {{{classname}}}? object = {{{classname}}}.fromJson(element); + if (object is {{{classname}}}) { + previousValue.add(object); + } + + return previousValue; + }); + } + + static Map mapFromJson(Map? json) { + if (json == null) { + return {}; + } + + return json.entries.fold({}, (Map previousValue, element) { + final {{{classname}}}? object = {{{classname}}}.fromJson(element.value); + if (object is {{{classname}}}) { + previousValue[element.key] = object; + } + + return previousValue; + }); + } + + // maps a json object with a list of {{{classname}}}-objects as value to a dart map + static Map> mapListFromJson(Map? json) { + if (json == null) { + return >{}; + } + + return json.map((key, value) { + return MapEntry>(key, {{{classname}}}.listFromJson(value)); + }); + } + + @override + String toString() => '{{{classname}}}[{{#vars}}{{{name}}}=${{{name}}}{{^-last}}, {{/-last}}{{/vars}}]'; + + Map toJson([Iterable? keys]) { + return { + {{#vars}} + {{#isNullable}} + if (keys == null || keys. + {{#isModel}} + any((key) => RegExp(r'^{{{name}}}\.').hasMatch(key)) + {{/isModel}} + {{^isModel}} + contains(r'{{{name}}}') + {{/isModel}} + ) + {{/isNullable}} + {{#isDateTime}} + {{#pattern}} + r'{{{baseName}}}': _dateEpochMarker == '{{{pattern}}}' + ? {{{name}}}?.millisecondsSinceEpoch + : {{{name}}}?.toUtc().toIso8601String(), + {{/pattern}} + {{^pattern}} + r'{{{baseName}}}': {{{name}}}{{#isNullable}}?{{/isNullable}}.toUtc().toIso8601String(), + {{/pattern}} + {{/isDateTime}} + {{#isDate}} + {{#pattern}} + r'{{{baseName}}}': _dateEpochMarker == '{{{pattern}}}' + ? {{{name}}}?.millisecondsSinceEpoch + : _dateFormatter.format({{{name}}}.toUtc()), + {{/pattern}} + {{^pattern}} + r'{{{baseName}}}': _dateFormatter.format({{{name}}}.toUtc()), + {{/pattern}} + {{/isDate}} + {{^isDateTime}} + {{^isDate}} + r'{{{baseName}}}': + {{#complexType}} + {{#isContainer}} + {{name}}, + {{/isContainer}} + {{^isContainer}} + {{name}}{{#isNullable}}?{{/isNullable}}.toJson(keys?.fold>([], (List previousValue, String element) { + if (element.contains(RegExp(r'^{{{name}}}\.'))) { + previousValue.add(element.split(RegExp(r'^{{{name}}}\.')).last); + } + + return previousValue; + })), + {{/isContainer}} + {{/complexType}} + {{^complexType}} + {{name}}, + {{/complexType}} + {{/isDate}} + {{/isDateTime}} + {{/vars}} + }; + } +} +{{#vars}} + {{#isEnum}} + {{^isContainer}} + +{{>serialization/native/enum_inline}} + {{/isContainer}} + {{#isContainer}} + {{#mostInnerItems}} + +{{>serialization/native/enum_inline}} + {{/mostInnerItems}} + {{/isContainer}} + {{/isEnum}} +{{/vars}} \ No newline at end of file diff --git a/dart-v3-templates/serialization/native/enum.mustache b/dart-v3-templates/serialization/native/enum.mustache new file mode 100644 index 000000000..8080b8539 --- /dev/null +++ b/dart-v3-templates/serialization/native/enum.mustache @@ -0,0 +1,73 @@ +{{#description}}/// {{{description}}}{{/description}} +class {{{classname}}} { + /// Instantiate a new enum with the provided [value]. + const {{{classname}}}._(this.value); + + /// The underlying value of this enum member. + final {{{dataType}}} value; + + @override + String toString() => value{{^isString}}.toString(){{/isString}}; + + {{{dataType}}} toJson() => value; + + {{#allowableValues}} + {{#enumVars}} + static const {{{name}}} = {{{classname}}}._({{#isString}}r{{/isString}}{{{value}}}); + {{/enumVars}} + {{/allowableValues}} + + /// List of all possible values in this [enum][{{{classname}}}]. + static const values = <{{{classname}}}>[ + {{#allowableValues}} + {{#enumVars}} + {{{name}}}, + {{/enumVars}} + {{/allowableValues}} + ]; + + static {{{classname}}}? fromJson(dynamic value) => + {{{classname}}}TypeTransformer().decode(value); + + static List<{{{classname}}}> listFromJson(List json) { + return json.map((value) { + return {{{classname}}}.fromJson(value); + }).whereType<{{{classname}}}>().toList(); + } +} + +/// Transformation class that can [encode] an instance of [{{{classname}}}] to {{{dataType}}}, +/// and [decode] dynamic data back to [{{{classname}}}]. +class {{{classname}}}TypeTransformer { + const {{{classname}}}TypeTransformer._(); + + factory {{{classname}}}TypeTransformer() => _instance ??= {{{classname}}}TypeTransformer._(); + + {{{dataType}}} encode({{{classname}}} data) => data.value; + + /// Decodes a [dynamic value][data] to a {{{classname}}}. + /// + /// If [allowNull] is true and the [dynamic value][data] cannot be decoded successfully, + /// then null is returned. However, if [allowNull] is false and the [dynamic value][data] + /// cannot be decoded successfully, then an [UnimplementedError] is thrown. + /// + /// The [allowNull] is very handy when an API changes and a new enum value is added or removed, + /// and users are still using an old app with the old code. + {{{classname}}}? decode(dynamic data, {bool allowNull = true}) { + switch (data) { + {{#allowableValues}} + {{#enumVars}} + case {{#isString}}r{{/isString}}{{{value}}}: return {{{classname}}}.{{{name}}}; + {{/enumVars}} + {{/allowableValues}} + default: + if (allowNull == false) { + throw ArgumentError('Unknown enum value to decode: $data'); + } + } + return null; + } + + /// Singleton [{{{classname}}}TypeTransformer] instance. + static {{{classname}}}TypeTransformer? _instance; +} \ No newline at end of file diff --git a/dart-v3-templates/serialization/native/enum_inline.mustache b/dart-v3-templates/serialization/native/enum_inline.mustache new file mode 100644 index 000000000..87283c365 --- /dev/null +++ b/dart-v3-templates/serialization/native/enum_inline.mustache @@ -0,0 +1,73 @@ +{{#description}}/// {{{description}}}{{/description}} +class {{{enumName}}} { + /// Instantiate a new enum with the provided [value]. + const {{{enumName}}}._(this.value); + + /// The underlying value of this enum member. + final {{{dataType}}} value; + + @override + String toString() => value{{^isString}}.toString(){{/isString}}; + + {{{dataType}}} toJson() => value; + + {{#allowableValues}} + {{#enumVars}} + static const {{{name}}} = {{{enumName}}}._({{#isString}}r{{/isString}}{{{value}}}); + {{/enumVars}} + {{/allowableValues}} + + /// List of all possible values in this [enum][{{{enumName}}}]. + static const values = <{{{enumName}}}>[ + {{#allowableValues}} + {{#enumVars}} + {{{name}}}, + {{/enumVars}} + {{/allowableValues}} + ]; + + static {{{enumName}}}? fromJson(dynamic value) => + {{{enumName}}}TypeTransformer().decode(value); + + static List<{{{enumName}}}> listFromJson(List json) { + return json.map((value) { + return {{{enumName}}}.fromJson(value); + }).whereType<{{{enumName}}}>().toList(); + } +} + +/// Transformation class that can [encode] an instance of [{{{enumName}}}] to {{{dataType}}}, +/// and [decode] dynamic data back to [{{{enumName}}}]. +class {{{enumName}}}TypeTransformer { + const {{{enumName}}}TypeTransformer._(); + + factory {{{enumName}}}TypeTransformer() => _instance ??= {{{enumName}}}TypeTransformer._(); + + {{{dataType}}} encode({{{enumName}}} data) => data.value; + + /// Decodes a [dynamic value][data] to a {{{enumName}}}. + /// + /// If [allowNull] is true and the [dynamic value][data] cannot be decoded successfully, + /// then null is returned. However, if [allowNull] is false and the [dynamic value][data] + /// cannot be decoded successfully, then an [UnimplementedError] is thrown. + /// + /// The [allowNull] is very handy when an API changes and a new enum value is added or removed, + /// and users are still using an old app with the old code. + {{{enumName}}}? decode(dynamic data, {bool allowNull = true}) { + switch (data) { + {{#allowableValues}} + {{#enumVars}} + case {{#isString}}r{{/isString}}{{{value}}}: return {{{enumName}}}.{{{name}}}; + {{/enumVars}} + {{/allowableValues}} + default: + if (allowNull == false) { + throw ArgumentError('Unknown enum value to decode: $data'); + } + } + return null; + } + + /// Singleton [{{{enumName}}}TypeTransformer] instance. + static {{{enumName}}}TypeTransformer? _instance; +} \ No newline at end of file diff --git a/dart-v3/lib/model/archiving_jsonhal_organization_preference_read.dart b/dart-v3/lib/model/archiving_jsonhal_organization_preference_read.dart index 193ac0550..adda25232 100644 --- a/dart-v3/lib/model/archiving_jsonhal_organization_preference_read.dart +++ b/dart-v3/lib/model/archiving_jsonhal_organization_preference_read.dart @@ -7,7 +7,7 @@ part of keyclic_sdk_api_platform; class ArchivingJsonhalOrganizationPreferenceRead { /// Returns a new [ArchivingJsonhalOrganizationPreferenceRead] instance. ArchivingJsonhalOrganizationPreferenceRead({ - this.enabled, + required this.enabled, }); /// Returns a new [ArchivingJsonhalOrganizationPreferenceRead] instance and imports its values from @@ -22,7 +22,7 @@ class ArchivingJsonhalOrganizationPreferenceRead { ); } - bool? enabled; + bool enabled; @override bool operator ==(Object other) { @@ -36,7 +36,7 @@ class ArchivingJsonhalOrganizationPreferenceRead { } @override - int get hashCode => (enabled == null ? 0 : enabled.hashCode); + int get hashCode => enabled.hashCode; static List listFromJson( Iterable? json) { @@ -96,7 +96,7 @@ class ArchivingJsonhalOrganizationPreferenceRead { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.contains(r'enabled')) r'enabled': enabled, + r'enabled': enabled, }; } } diff --git a/dart-v3/lib/model/asset_jsonhal_read.dart b/dart-v3/lib/model/asset_jsonhal_read.dart index f69cbcc37..5b7c5452b 100644 --- a/dart-v3/lib/model/asset_jsonhal_read.dart +++ b/dart-v3/lib/model/asset_jsonhal_read.dart @@ -7,15 +7,15 @@ part of keyclic_sdk_api_platform; class AssetJsonhalRead { /// Returns a new [AssetJsonhalRead] instance. AssetJsonhalRead({ - this.links, + required this.links, this.description, required this.name, this.preferences, - this.id, - this.path, + required this.id, + this.path = const [], this.address, - this.createdAt, - this.updatedAt, + required this.createdAt, + required this.updatedAt, }); /// Returns a new [AssetJsonhalRead] instance and imports its values from @@ -26,19 +26,19 @@ class AssetJsonhalRead { } return AssetJsonhalRead( - links: AssetJsonhalReadLinks.fromJson(json[r'_links']), + links: AssetJsonhalReadLinks.fromJson(json[r'_links'])!, description: json[r'description'], name: json[r'name'], preferences: PreferencesJsonhalAssetRead.fromJson(json[r'preferences']), id: json[r'id'], path: NodeJsonhalRead.listFromJson(json[r'path']), address: PostalAddressJsonhalRead.fromJson(json[r'address']), - createdAt: mapToDateTime(json[r'createdAt']), - updatedAt: mapToDateTime(json[r'updatedAt']), + createdAt: mapToDateTime(json[r'createdAt'])!, + updatedAt: mapToDateTime(json[r'updatedAt'])!, ); } - AssetJsonhalReadLinks? links; + AssetJsonhalReadLinks links; String? description; @@ -47,17 +47,17 @@ class AssetJsonhalRead { PreferencesJsonhalAssetRead? preferences; /// The resource identifier. - final String? id; + final String id; - final List? path; + final List path; PostalAddressJsonhalRead? address; /// The date and time when the resource was created, in UTC format. - final DateTime? createdAt; + final DateTime createdAt; /// The date and time when the resource was updated, in UTC format. - final DateTime? updatedAt; + final DateTime updatedAt; @override bool operator ==(Object other) { @@ -80,15 +80,15 @@ class AssetJsonhalRead { @override int get hashCode => - (links == null ? 0 : links.hashCode) + + links.hashCode + (description == null ? 0 : description.hashCode) + name.hashCode + (preferences == null ? 0 : preferences.hashCode) + - (id == null ? 0 : id.hashCode) + - (path == null ? 0 : path.hashCode) + + id.hashCode + + path.hashCode + (address == null ? 0 : address.hashCode) + - (createdAt == null ? 0 : createdAt.hashCode) + - (updatedAt == null ? 0 : updatedAt.hashCode); + createdAt.hashCode + + updatedAt.hashCode; static List listFromJson(Iterable? json) { if (json == null) { @@ -141,15 +141,14 @@ class AssetJsonhalRead { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.any((key) => RegExp(r'^links\.').hasMatch(key))) - r'_links': links?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^links\.'))) { - previousValue.add(element.split(RegExp(r'^links\.')).last); - } - - return previousValue; - })), + r'_links': links.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^links\.'))) { + previousValue.add(element.split(RegExp(r'^links\.')).last); + } + + return previousValue; + })), if (keys == null || keys.contains(r'description')) r'description': description, r'name': name, @@ -163,8 +162,8 @@ class AssetJsonhalRead { return previousValue; })), - if (keys == null || keys.contains(r'id')) r'id': id, - if (keys == null || keys.contains(r'path')) r'path': path, + r'id': id, + r'path': path, if (keys == null || keys.any((key) => RegExp(r'^address\.').hasMatch(key))) r'address': address?.toJson(keys?.fold>([], @@ -175,10 +174,8 @@ class AssetJsonhalRead { return previousValue; })), - if (keys == null || keys.contains(r'createdAt')) - r'createdAt': createdAt?.toUtc().toIso8601String(), - if (keys == null || keys.contains(r'updatedAt')) - r'updatedAt': updatedAt?.toUtc().toIso8601String(), + r'createdAt': createdAt.toUtc().toIso8601String(), + r'updatedAt': updatedAt.toUtc().toIso8601String(), }; } } diff --git a/dart-v3/lib/model/asset_jsonhal_read_links.dart b/dart-v3/lib/model/asset_jsonhal_read_links.dart index b825e71b6..ea4653498 100644 --- a/dart-v3/lib/model/asset_jsonhal_read_links.dart +++ b/dart-v3/lib/model/asset_jsonhal_read_links.dart @@ -7,7 +7,7 @@ part of keyclic_sdk_api_platform; class AssetJsonhalReadLinks { /// Returns a new [AssetJsonhalReadLinks] instance. AssetJsonhalReadLinks({ - this.self, + required this.self, this.type, this.parent, this.state, @@ -21,14 +21,14 @@ class AssetJsonhalReadLinks { } return AssetJsonhalReadLinks( - self: GetPlaceCollection200ResponseLinksSelf.fromJson(json[r'self']), + self: GetPlaceCollection200ResponseLinksSelf.fromJson(json[r'self'])!, type: GetPlaceCollection200ResponseLinksFirst.fromJson(json[r'type']), parent: GetPlaceCollection200ResponseLinksFirst.fromJson(json[r'parent']), state: GetPlaceCollection200ResponseLinksFirst.fromJson(json[r'state']), ); } - GetPlaceCollection200ResponseLinksSelf? self; + GetPlaceCollection200ResponseLinksSelf self; GetPlaceCollection200ResponseLinksFirst? type; @@ -52,7 +52,7 @@ class AssetJsonhalReadLinks { @override int get hashCode => - (self == null ? 0 : self.hashCode) + + self.hashCode + (type == null ? 0 : type.hashCode) + (parent == null ? 0 : parent.hashCode) + (state == null ? 0 : state.hashCode); @@ -111,15 +111,14 @@ class AssetJsonhalReadLinks { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.any((key) => RegExp(r'^self\.').hasMatch(key))) - r'self': self?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^self\.'))) { - previousValue.add(element.split(RegExp(r'^self\.')).last); - } - - return previousValue; - })), + r'self': self.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^self\.'))) { + previousValue.add(element.split(RegExp(r'^self\.')).last); + } + + return previousValue; + })), if (keys == null || keys.any((key) => RegExp(r'^type\.').hasMatch(key))) r'type': type?.toJson(keys?.fold>([], (List previousValue, String element) { diff --git a/dart-v3/lib/model/asset_type_jsonhal_read.dart b/dart-v3/lib/model/asset_type_jsonhal_read.dart index 5b38d5767..bc87f8ffc 100644 --- a/dart-v3/lib/model/asset_type_jsonhal_read.dart +++ b/dart-v3/lib/model/asset_type_jsonhal_read.dart @@ -7,10 +7,10 @@ part of keyclic_sdk_api_platform; class AssetTypeJsonhalRead { /// Returns a new [AssetTypeJsonhalRead] instance. AssetTypeJsonhalRead({ - this.links, - this.id, - this.createdAt, - this.updatedAt, + required this.links, + required this.id, + required this.createdAt, + required this.updatedAt, this.description, required this.name, }); @@ -23,25 +23,25 @@ class AssetTypeJsonhalRead { } return AssetTypeJsonhalRead( - links: AssetTypeJsonhalReadLinks.fromJson(json[r'_links']), + links: AssetTypeJsonhalReadLinks.fromJson(json[r'_links'])!, id: json[r'id'], - createdAt: mapToDateTime(json[r'createdAt']), - updatedAt: mapToDateTime(json[r'updatedAt']), + createdAt: mapToDateTime(json[r'createdAt'])!, + updatedAt: mapToDateTime(json[r'updatedAt'])!, description: json[r'description'], name: json[r'name'], ); } - AssetTypeJsonhalReadLinks? links; + AssetTypeJsonhalReadLinks links; /// The resource identifier. - final String? id; + final String id; /// The date and time when the resource was created, in UTC format. - final DateTime? createdAt; + final DateTime createdAt; /// The date and time when the resource was updated, in UTC format. - final DateTime? updatedAt; + final DateTime updatedAt; String? description; @@ -65,10 +65,10 @@ class AssetTypeJsonhalRead { @override int get hashCode => - (links == null ? 0 : links.hashCode) + - (id == null ? 0 : id.hashCode) + - (createdAt == null ? 0 : createdAt.hashCode) + - (updatedAt == null ? 0 : updatedAt.hashCode) + + links.hashCode + + id.hashCode + + createdAt.hashCode + + updatedAt.hashCode + (description == null ? 0 : description.hashCode) + name.hashCode; @@ -126,20 +126,17 @@ class AssetTypeJsonhalRead { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.any((key) => RegExp(r'^links\.').hasMatch(key))) - r'_links': links?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^links\.'))) { - previousValue.add(element.split(RegExp(r'^links\.')).last); - } - - return previousValue; - })), - if (keys == null || keys.contains(r'id')) r'id': id, - if (keys == null || keys.contains(r'createdAt')) - r'createdAt': createdAt?.toUtc().toIso8601String(), - if (keys == null || keys.contains(r'updatedAt')) - r'updatedAt': updatedAt?.toUtc().toIso8601String(), + r'_links': links.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^links\.'))) { + previousValue.add(element.split(RegExp(r'^links\.')).last); + } + + return previousValue; + })), + r'id': id, + r'createdAt': createdAt.toUtc().toIso8601String(), + r'updatedAt': updatedAt.toUtc().toIso8601String(), if (keys == null || keys.contains(r'description')) r'description': description, r'name': name, diff --git a/dart-v3/lib/model/asset_type_jsonhal_read_links.dart b/dart-v3/lib/model/asset_type_jsonhal_read_links.dart index 374df0cf2..39d40b2b8 100644 --- a/dart-v3/lib/model/asset_type_jsonhal_read_links.dart +++ b/dart-v3/lib/model/asset_type_jsonhal_read_links.dart @@ -7,7 +7,7 @@ part of keyclic_sdk_api_platform; class AssetTypeJsonhalReadLinks { /// Returns a new [AssetTypeJsonhalReadLinks] instance. AssetTypeJsonhalReadLinks({ - this.self, + required this.self, }); /// Returns a new [AssetTypeJsonhalReadLinks] instance and imports its values from @@ -18,11 +18,11 @@ class AssetTypeJsonhalReadLinks { } return AssetTypeJsonhalReadLinks( - self: GetPlaceCollection200ResponseLinksSelf.fromJson(json[r'self']), + self: GetPlaceCollection200ResponseLinksSelf.fromJson(json[r'self'])!, ); } - GetPlaceCollection200ResponseLinksSelf? self; + GetPlaceCollection200ResponseLinksSelf self; @override bool operator ==(Object other) { @@ -35,7 +35,7 @@ class AssetTypeJsonhalReadLinks { } @override - int get hashCode => (self == null ? 0 : self.hashCode); + int get hashCode => self.hashCode; static List listFromJson(Iterable? json) { if (json == null) { @@ -90,15 +90,14 @@ class AssetTypeJsonhalReadLinks { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.any((key) => RegExp(r'^self\.').hasMatch(key))) - r'self': self?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^self\.'))) { - previousValue.add(element.split(RegExp(r'^self\.')).last); - } - - return previousValue; - })), + r'self': self.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^self\.'))) { + previousValue.add(element.split(RegExp(r'^self\.')).last); + } + + return previousValue; + })), }; } } diff --git a/dart-v3/lib/model/assignment_jsongeo_read.dart b/dart-v3/lib/model/assignment_jsongeo_read.dart index 2a7ccd0cc..7ab6368cb 100644 --- a/dart-v3/lib/model/assignment_jsongeo_read.dart +++ b/dart-v3/lib/model/assignment_jsongeo_read.dart @@ -11,7 +11,7 @@ class AssignmentJsongeoRead { this.member, this.outOfContract, this.service, - this.id, + required this.id, }); /// Returns a new [AssignmentJsongeoRead] instance and imports its values from @@ -39,7 +39,7 @@ class AssignmentJsongeoRead { final String? service; /// The resource identifier. - final String? id; + final String id; @override bool operator ==(Object other) { @@ -62,7 +62,7 @@ class AssignmentJsongeoRead { (member == null ? 0 : member.hashCode) + (outOfContract == null ? 0 : outOfContract.hashCode) + (service == null ? 0 : service.hashCode) + - (id == null ? 0 : id.hashCode); + id.hashCode; static List listFromJson(Iterable? json) { if (json == null) { @@ -123,7 +123,7 @@ class AssignmentJsongeoRead { if (keys == null || keys.contains(r'outOfContract')) r'outOfContract': outOfContract, if (keys == null || keys.contains(r'service')) r'service': service, - if (keys == null || keys.contains(r'id')) r'id': id, + r'id': id, }; } } diff --git a/dart-v3/lib/model/assignment_jsonhal_read.dart b/dart-v3/lib/model/assignment_jsonhal_read.dart index 674a8e060..129ed6e6b 100644 --- a/dart-v3/lib/model/assignment_jsonhal_read.dart +++ b/dart-v3/lib/model/assignment_jsonhal_read.dart @@ -7,9 +7,9 @@ part of keyclic_sdk_api_platform; class AssignmentJsonhalRead { /// Returns a new [AssignmentJsonhalRead] instance. AssignmentJsonhalRead({ - this.links, + required this.links, this.outOfContract, - this.id, + required this.id, }); /// Returns a new [AssignmentJsonhalRead] instance and imports its values from @@ -20,18 +20,18 @@ class AssignmentJsonhalRead { } return AssignmentJsonhalRead( - links: AssignmentJsonhalReadLinks.fromJson(json[r'_links']), + links: AssignmentJsonhalReadLinks.fromJson(json[r'_links'])!, outOfContract: json[r'outOfContract'], id: json[r'id'], ); } - AssignmentJsonhalReadLinks? links; + AssignmentJsonhalReadLinks links; bool? outOfContract; /// The resource identifier. - final String? id; + final String id; @override bool operator ==(Object other) { @@ -48,9 +48,9 @@ class AssignmentJsonhalRead { @override int get hashCode => - (links == null ? 0 : links.hashCode) + + links.hashCode + (outOfContract == null ? 0 : outOfContract.hashCode) + - (id == null ? 0 : id.hashCode); + id.hashCode; static List listFromJson(Iterable? json) { if (json == null) { @@ -106,18 +106,17 @@ class AssignmentJsonhalRead { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.any((key) => RegExp(r'^links\.').hasMatch(key))) - r'_links': links?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^links\.'))) { - previousValue.add(element.split(RegExp(r'^links\.')).last); - } - - return previousValue; - })), + r'_links': links.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^links\.'))) { + previousValue.add(element.split(RegExp(r'^links\.')).last); + } + + return previousValue; + })), if (keys == null || keys.contains(r'outOfContract')) r'outOfContract': outOfContract, - if (keys == null || keys.contains(r'id')) r'id': id, + r'id': id, }; } } diff --git a/dart-v3/lib/model/assignment_jsonhal_read_links.dart b/dart-v3/lib/model/assignment_jsonhal_read_links.dart index 57cc0d0bc..752aceb6c 100644 --- a/dart-v3/lib/model/assignment_jsonhal_read_links.dart +++ b/dart-v3/lib/model/assignment_jsonhal_read_links.dart @@ -7,7 +7,7 @@ part of keyclic_sdk_api_platform; class AssignmentJsonhalReadLinks { /// Returns a new [AssignmentJsonhalReadLinks] instance. AssignmentJsonhalReadLinks({ - this.self, + required this.self, this.contract, this.member, this.service, @@ -21,7 +21,7 @@ class AssignmentJsonhalReadLinks { } return AssignmentJsonhalReadLinks( - self: GetPlaceCollection200ResponseLinksSelf.fromJson(json[r'self']), + self: GetPlaceCollection200ResponseLinksSelf.fromJson(json[r'self'])!, contract: GetPlaceCollection200ResponseLinksFirst.fromJson(json[r'contract']), member: GetPlaceCollection200ResponseLinksFirst.fromJson(json[r'member']), @@ -30,7 +30,7 @@ class AssignmentJsonhalReadLinks { ); } - GetPlaceCollection200ResponseLinksSelf? self; + GetPlaceCollection200ResponseLinksSelf self; GetPlaceCollection200ResponseLinksFirst? contract; @@ -54,7 +54,7 @@ class AssignmentJsonhalReadLinks { @override int get hashCode => - (self == null ? 0 : self.hashCode) + + self.hashCode + (contract == null ? 0 : contract.hashCode) + (member == null ? 0 : member.hashCode) + (service == null ? 0 : service.hashCode); @@ -113,15 +113,14 @@ class AssignmentJsonhalReadLinks { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.any((key) => RegExp(r'^self\.').hasMatch(key))) - r'self': self?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^self\.'))) { - previousValue.add(element.split(RegExp(r'^self\.')).last); - } - - return previousValue; - })), + r'self': self.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^self\.'))) { + previousValue.add(element.split(RegExp(r'^self\.')).last); + } + + return previousValue; + })), if (keys == null || keys.any((key) => RegExp(r'^contract\.').hasMatch(key))) r'contract': contract?.toJson(keys?.fold>([], diff --git a/dart-v3/lib/model/billing_jsonhal_read.dart b/dart-v3/lib/model/billing_jsonhal_read.dart index 4f83649fe..ca0550527 100644 --- a/dart-v3/lib/model/billing_jsonhal_read.dart +++ b/dart-v3/lib/model/billing_jsonhal_read.dart @@ -7,8 +7,8 @@ part of keyclic_sdk_api_platform; class BillingJsonhalRead { /// Returns a new [BillingJsonhalRead] instance. BillingJsonhalRead({ - this.adjustedCost, - this.initialCost, + required this.adjustedCost, + required this.initialCost, this.startDate, }); @@ -20,15 +20,15 @@ class BillingJsonhalRead { } return BillingJsonhalRead( - adjustedCost: PriceJsonhalRead.fromJson(json[r'adjustedCost']), - initialCost: PriceJsonhalRead.fromJson(json[r'initialCost']), + adjustedCost: PriceJsonhalRead.fromJson(json[r'adjustedCost'])!, + initialCost: PriceJsonhalRead.fromJson(json[r'initialCost'])!, startDate: mapToDateTime(json[r'startDate']), ); } - PriceJsonhalRead? adjustedCost; + PriceJsonhalRead adjustedCost; - PriceJsonhalRead? initialCost; + PriceJsonhalRead initialCost; /// The start date of the billing cycle for the customer's account, in ISO 8601 format. DateTime? startDate; @@ -48,8 +48,8 @@ class BillingJsonhalRead { @override int get hashCode => - (adjustedCost == null ? 0 : adjustedCost.hashCode) + - (initialCost == null ? 0 : initialCost.hashCode) + + adjustedCost.hashCode + + initialCost.hashCode + (startDate == null ? 0 : startDate.hashCode); static List listFromJson(Iterable? json) { @@ -105,26 +105,22 @@ class BillingJsonhalRead { Map toJson([Iterable? keys]) { return { - if (keys == null || - keys.any((key) => RegExp(r'^adjustedCost\.').hasMatch(key))) - r'adjustedCost': adjustedCost?.toJson(keys?.fold>( - [], (List previousValue, String element) { - if (element.contains(RegExp(r'^adjustedCost\.'))) { - previousValue.add(element.split(RegExp(r'^adjustedCost\.')).last); - } - - return previousValue; - })), - if (keys == null || - keys.any((key) => RegExp(r'^initialCost\.').hasMatch(key))) - r'initialCost': initialCost?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^initialCost\.'))) { - previousValue.add(element.split(RegExp(r'^initialCost\.')).last); - } - - return previousValue; - })), + r'adjustedCost': adjustedCost.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^adjustedCost\.'))) { + previousValue.add(element.split(RegExp(r'^adjustedCost\.')).last); + } + + return previousValue; + })), + r'initialCost': initialCost.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^initialCost\.'))) { + previousValue.add(element.split(RegExp(r'^initialCost\.')).last); + } + + return previousValue; + })), if (keys == null || keys.contains(r'startDate')) r'startDate': startDate?.toUtc().toIso8601String(), }; diff --git a/dart-v3/lib/model/billing_write.dart b/dart-v3/lib/model/billing_write.dart index 809082f62..2bf91326d 100644 --- a/dart-v3/lib/model/billing_write.dart +++ b/dart-v3/lib/model/billing_write.dart @@ -7,8 +7,8 @@ part of keyclic_sdk_api_platform; class BillingWrite { /// Returns a new [BillingWrite] instance. BillingWrite({ - this.adjustedCost, - this.initialCost, + required this.adjustedCost, + required this.initialCost, this.startDate, }); @@ -20,15 +20,15 @@ class BillingWrite { } return BillingWrite( - adjustedCost: PriceWrite.fromJson(json[r'adjustedCost']), - initialCost: PriceWrite.fromJson(json[r'initialCost']), + adjustedCost: PriceWrite.fromJson(json[r'adjustedCost'])!, + initialCost: PriceWrite.fromJson(json[r'initialCost'])!, startDate: mapToDateTime(json[r'startDate']), ); } - PriceWrite? adjustedCost; + PriceWrite adjustedCost; - PriceWrite? initialCost; + PriceWrite initialCost; /// The start date of the billing cycle for the customer's account, in ISO 8601 format. DateTime? startDate; @@ -48,8 +48,8 @@ class BillingWrite { @override int get hashCode => - (adjustedCost == null ? 0 : adjustedCost.hashCode) + - (initialCost == null ? 0 : initialCost.hashCode) + + adjustedCost.hashCode + + initialCost.hashCode + (startDate == null ? 0 : startDate.hashCode); static List listFromJson(Iterable? json) { @@ -103,26 +103,22 @@ class BillingWrite { Map toJson([Iterable? keys]) { return { - if (keys == null || - keys.any((key) => RegExp(r'^adjustedCost\.').hasMatch(key))) - r'adjustedCost': adjustedCost?.toJson(keys?.fold>( - [], (List previousValue, String element) { - if (element.contains(RegExp(r'^adjustedCost\.'))) { - previousValue.add(element.split(RegExp(r'^adjustedCost\.')).last); - } - - return previousValue; - })), - if (keys == null || - keys.any((key) => RegExp(r'^initialCost\.').hasMatch(key))) - r'initialCost': initialCost?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^initialCost\.'))) { - previousValue.add(element.split(RegExp(r'^initialCost\.')).last); - } - - return previousValue; - })), + r'adjustedCost': adjustedCost.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^adjustedCost\.'))) { + previousValue.add(element.split(RegExp(r'^adjustedCost\.')).last); + } + + return previousValue; + })), + r'initialCost': initialCost.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^initialCost\.'))) { + previousValue.add(element.split(RegExp(r'^initialCost\.')).last); + } + + return previousValue; + })), if (keys == null || keys.contains(r'startDate')) r'startDate': startDate?.toUtc().toIso8601String(), }; diff --git a/dart-v3/lib/model/bookmark_jsonhal_read.dart b/dart-v3/lib/model/bookmark_jsonhal_read.dart index 937e4350d..5f704dca0 100644 --- a/dart-v3/lib/model/bookmark_jsonhal_read.dart +++ b/dart-v3/lib/model/bookmark_jsonhal_read.dart @@ -7,11 +7,11 @@ part of keyclic_sdk_api_platform; class BookmarkJsonhalRead { /// Returns a new [BookmarkJsonhalRead] instance. BookmarkJsonhalRead({ - this.links, - this.id, - this.createdAt, - this.updatedAt, - this.embedded, + required this.links, + required this.id, + required this.createdAt, + required this.updatedAt, + required this.embedded, }); /// Returns a new [BookmarkJsonhalRead] instance and imports its values from @@ -22,26 +22,26 @@ class BookmarkJsonhalRead { } return BookmarkJsonhalRead( - links: AssetTypeJsonhalReadLinks.fromJson(json[r'_links']), + links: AssetTypeJsonhalReadLinks.fromJson(json[r'_links'])!, id: json[r'id'], - createdAt: mapToDateTime(json[r'createdAt']), - updatedAt: mapToDateTime(json[r'updatedAt']), - embedded: BookmarkJsonhalReadEmbedded.fromJson(json[r'_embedded']), + createdAt: mapToDateTime(json[r'createdAt'])!, + updatedAt: mapToDateTime(json[r'updatedAt'])!, + embedded: BookmarkJsonhalReadEmbedded.fromJson(json[r'_embedded'])!, ); } - AssetTypeJsonhalReadLinks? links; + AssetTypeJsonhalReadLinks links; /// The resource identifier. - final String? id; + final String id; /// The date and time when the resource was created, in UTC format. - final DateTime? createdAt; + final DateTime createdAt; /// The date and time when the resource was updated, in UTC format. - final DateTime? updatedAt; + final DateTime updatedAt; - BookmarkJsonhalReadEmbedded? embedded; + BookmarkJsonhalReadEmbedded embedded; @override bool operator ==(Object other) { @@ -60,11 +60,11 @@ class BookmarkJsonhalRead { @override int get hashCode => - (links == null ? 0 : links.hashCode) + - (id == null ? 0 : id.hashCode) + - (createdAt == null ? 0 : createdAt.hashCode) + - (updatedAt == null ? 0 : updatedAt.hashCode) + - (embedded == null ? 0 : embedded.hashCode); + links.hashCode + + id.hashCode + + createdAt.hashCode + + updatedAt.hashCode + + embedded.hashCode; static List listFromJson(Iterable? json) { if (json == null) { @@ -119,30 +119,25 @@ class BookmarkJsonhalRead { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.any((key) => RegExp(r'^links\.').hasMatch(key))) - r'_links': links?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^links\.'))) { - previousValue.add(element.split(RegExp(r'^links\.')).last); - } - - return previousValue; - })), - if (keys == null || keys.contains(r'id')) r'id': id, - if (keys == null || keys.contains(r'createdAt')) - r'createdAt': createdAt?.toUtc().toIso8601String(), - if (keys == null || keys.contains(r'updatedAt')) - r'updatedAt': updatedAt?.toUtc().toIso8601String(), - if (keys == null || - keys.any((key) => RegExp(r'^embedded\.').hasMatch(key))) - r'_embedded': embedded?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^embedded\.'))) { - previousValue.add(element.split(RegExp(r'^embedded\.')).last); - } - - return previousValue; - })), + r'_links': links.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^links\.'))) { + previousValue.add(element.split(RegExp(r'^links\.')).last); + } + + return previousValue; + })), + r'id': id, + r'createdAt': createdAt.toUtc().toIso8601String(), + r'updatedAt': updatedAt.toUtc().toIso8601String(), + r'_embedded': embedded.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^embedded\.'))) { + previousValue.add(element.split(RegExp(r'^embedded\.')).last); + } + + return previousValue; + })), }; } } diff --git a/dart-v3/lib/model/bookmark_jsonhal_read_embedded.dart b/dart-v3/lib/model/bookmark_jsonhal_read_embedded.dart index 9c5a22395..bf9737039 100644 --- a/dart-v3/lib/model/bookmark_jsonhal_read_embedded.dart +++ b/dart-v3/lib/model/bookmark_jsonhal_read_embedded.dart @@ -7,8 +7,8 @@ part of keyclic_sdk_api_platform; class BookmarkJsonhalReadEmbedded { /// Returns a new [BookmarkJsonhalReadEmbedded] instance. BookmarkJsonhalReadEmbedded({ - this.place, - this.member, + required this.place, + required this.member, }); /// Returns a new [BookmarkJsonhalReadEmbedded] instance and imports its values from @@ -19,14 +19,14 @@ class BookmarkJsonhalReadEmbedded { } return BookmarkJsonhalReadEmbedded( - place: AssetJsonhalRead.fromJson(json[r'place']), - member: MemberJsonhalRead.fromJson(json[r'member']), + place: AssetJsonhalRead.fromJson(json[r'place'])!, + member: MemberJsonhalRead.fromJson(json[r'member'])!, ); } - AssetJsonhalRead? place; + AssetJsonhalRead place; - MemberJsonhalRead? member; + MemberJsonhalRead member; @override bool operator ==(Object other) { @@ -41,9 +41,7 @@ class BookmarkJsonhalReadEmbedded { } @override - int get hashCode => - (place == null ? 0 : place.hashCode) + - (member == null ? 0 : member.hashCode); + int get hashCode => place.hashCode + member.hashCode; static List listFromJson(Iterable? json) { if (json == null) { @@ -99,24 +97,22 @@ class BookmarkJsonhalReadEmbedded { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.any((key) => RegExp(r'^place\.').hasMatch(key))) - r'place': place?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^place\.'))) { - previousValue.add(element.split(RegExp(r'^place\.')).last); - } - - return previousValue; - })), - if (keys == null || keys.any((key) => RegExp(r'^member\.').hasMatch(key))) - r'member': member?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^member\.'))) { - previousValue.add(element.split(RegExp(r'^member\.')).last); - } - - return previousValue; - })), + r'place': place.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^place\.'))) { + previousValue.add(element.split(RegExp(r'^place\.')).last); + } + + return previousValue; + })), + r'member': member.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^member\.'))) { + previousValue.add(element.split(RegExp(r'^member\.')).last); + } + + return previousValue; + })), }; } } diff --git a/dart-v3/lib/model/brand_jsonhal_read.dart b/dart-v3/lib/model/brand_jsonhal_read.dart index d93fcf172..99f8f62dd 100644 --- a/dart-v3/lib/model/brand_jsonhal_read.dart +++ b/dart-v3/lib/model/brand_jsonhal_read.dart @@ -7,10 +7,10 @@ part of keyclic_sdk_api_platform; class BrandJsonhalRead { /// Returns a new [BrandJsonhalRead] instance. BrandJsonhalRead({ - this.links, + required this.links, this.description, required this.name, - this.id, + required this.id, }); /// Returns a new [BrandJsonhalRead] instance and imports its values from @@ -21,14 +21,14 @@ class BrandJsonhalRead { } return BrandJsonhalRead( - links: AssetTypeJsonhalReadLinks.fromJson(json[r'_links']), + links: AssetTypeJsonhalReadLinks.fromJson(json[r'_links'])!, description: json[r'description'], name: json[r'name'], id: json[r'id'], ); } - AssetTypeJsonhalReadLinks? links; + AssetTypeJsonhalReadLinks links; /// Detailed description of brand. String? description; @@ -37,7 +37,7 @@ class BrandJsonhalRead { String name; /// The resource identifier. - final String? id; + final String id; @override bool operator ==(Object other) { @@ -55,10 +55,10 @@ class BrandJsonhalRead { @override int get hashCode => - (links == null ? 0 : links.hashCode) + + links.hashCode + (description == null ? 0 : description.hashCode) + name.hashCode + - (id == null ? 0 : id.hashCode); + id.hashCode; static List listFromJson(Iterable? json) { if (json == null) { @@ -111,19 +111,18 @@ class BrandJsonhalRead { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.any((key) => RegExp(r'^links\.').hasMatch(key))) - r'_links': links?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^links\.'))) { - previousValue.add(element.split(RegExp(r'^links\.')).last); - } - - return previousValue; - })), + r'_links': links.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^links\.'))) { + previousValue.add(element.split(RegExp(r'^links\.')).last); + } + + return previousValue; + })), if (keys == null || keys.contains(r'description')) r'description': description, r'name': name, - if (keys == null || keys.contains(r'id')) r'id': id, + r'id': id, }; } } diff --git a/dart-v3/lib/model/business_hours_jsonhal_read.dart b/dart-v3/lib/model/business_hours_jsonhal_read.dart index 8a44b32cd..3eba70582 100644 --- a/dart-v3/lib/model/business_hours_jsonhal_read.dart +++ b/dart-v3/lib/model/business_hours_jsonhal_read.dart @@ -7,13 +7,13 @@ part of keyclic_sdk_api_platform; class BusinessHoursJsonhalRead { /// Returns a new [BusinessHoursJsonhalRead] instance. BusinessHoursJsonhalRead({ - this.links, + required this.links, required this.hoursPerDay, required this.name, this.openingHours = const [], - this.id, - this.createdAt, - this.updatedAt, + required this.id, + required this.createdAt, + required this.updatedAt, }); /// Returns a new [BusinessHoursJsonhalRead] instance and imports its values from @@ -24,17 +24,17 @@ class BusinessHoursJsonhalRead { } return BusinessHoursJsonhalRead( - links: AssetTypeJsonhalReadLinks.fromJson(json[r'_links']), + links: AssetTypeJsonhalReadLinks.fromJson(json[r'_links'])!, hoursPerDay: json[r'hoursPerDay'], name: json[r'name'], openingHours: List.from(json[r'openingHours']), id: json[r'id'], - createdAt: mapToDateTime(json[r'createdAt']), - updatedAt: mapToDateTime(json[r'updatedAt']), + createdAt: mapToDateTime(json[r'createdAt'])!, + updatedAt: mapToDateTime(json[r'updatedAt'])!, ); } - AssetTypeJsonhalReadLinks? links; + AssetTypeJsonhalReadLinks links; String hoursPerDay; @@ -43,13 +43,13 @@ class BusinessHoursJsonhalRead { List openingHours; /// The resource identifier. - final String? id; + final String id; /// The date and time when the resource was created, in UTC format. - final DateTime? createdAt; + final DateTime createdAt; /// The date and time when the resource was updated, in UTC format. - final DateTime? updatedAt; + final DateTime updatedAt; @override bool operator ==(Object other) { @@ -71,13 +71,13 @@ class BusinessHoursJsonhalRead { @override int get hashCode => - (links == null ? 0 : links.hashCode) + + links.hashCode + hoursPerDay.hashCode + name.hashCode + openingHours.hashCode + - (id == null ? 0 : id.hashCode) + - (createdAt == null ? 0 : createdAt.hashCode) + - (updatedAt == null ? 0 : updatedAt.hashCode); + id.hashCode + + createdAt.hashCode + + updatedAt.hashCode; static List listFromJson(Iterable? json) { if (json == null) { @@ -133,23 +133,20 @@ class BusinessHoursJsonhalRead { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.any((key) => RegExp(r'^links\.').hasMatch(key))) - r'_links': links?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^links\.'))) { - previousValue.add(element.split(RegExp(r'^links\.')).last); - } - - return previousValue; - })), + r'_links': links.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^links\.'))) { + previousValue.add(element.split(RegExp(r'^links\.')).last); + } + + return previousValue; + })), r'hoursPerDay': hoursPerDay, r'name': name, r'openingHours': openingHours, - if (keys == null || keys.contains(r'id')) r'id': id, - if (keys == null || keys.contains(r'createdAt')) - r'createdAt': createdAt?.toUtc().toIso8601String(), - if (keys == null || keys.contains(r'updatedAt')) - r'updatedAt': updatedAt?.toUtc().toIso8601String(), + r'id': id, + r'createdAt': createdAt.toUtc().toIso8601String(), + r'updatedAt': updatedAt.toUtc().toIso8601String(), }; } } diff --git a/dart-v3/lib/model/category_jsongeo_read.dart b/dart-v3/lib/model/category_jsongeo_read.dart index 868ea7f39..351bd9f8a 100644 --- a/dart-v3/lib/model/category_jsongeo_read.dart +++ b/dart-v3/lib/model/category_jsongeo_read.dart @@ -8,10 +8,10 @@ class CategoryJsongeoRead { /// Returns a new [CategoryJsongeoRead] instance. CategoryJsongeoRead({ required this.name, - this.organization, + required this.organization, this.type, - this.id, - this.path, + required this.id, + this.path = const [], }); /// Returns a new [CategoryJsongeoRead] instance and imports its values from @@ -32,14 +32,14 @@ class CategoryJsongeoRead { String name; - final String? organization; + final String organization; CategoryTypeJsongeoRead? type; /// The resource identifier. - final String? id; + final String id; - final List? path; + final List path; @override bool operator ==(Object other) { @@ -59,10 +59,10 @@ class CategoryJsongeoRead { @override int get hashCode => name.hashCode + - (organization == null ? 0 : organization.hashCode) + + organization.hashCode + (type == null ? 0 : type.hashCode) + - (id == null ? 0 : id.hashCode) + - (path == null ? 0 : path.hashCode); + id.hashCode + + path.hashCode; static List listFromJson(Iterable? json) { if (json == null) { @@ -118,8 +118,7 @@ class CategoryJsongeoRead { Map toJson([Iterable? keys]) { return { r'name': name, - if (keys == null || keys.contains(r'organization')) - r'organization': organization, + r'organization': organization, if (keys == null || keys.any((key) => RegExp(r'^type\.').hasMatch(key))) r'type': type?.toJson(keys?.fold>([], (List previousValue, String element) { @@ -129,8 +128,8 @@ class CategoryJsongeoRead { return previousValue; })), - if (keys == null || keys.contains(r'id')) r'id': id, - if (keys == null || keys.contains(r'path')) r'path': path, + r'id': id, + r'path': path, }; } } diff --git a/dart-v3/lib/model/category_jsonhal_read.dart b/dart-v3/lib/model/category_jsonhal_read.dart index 65d04a3e8..ed95304d0 100644 --- a/dart-v3/lib/model/category_jsonhal_read.dart +++ b/dart-v3/lib/model/category_jsonhal_read.dart @@ -7,13 +7,13 @@ part of keyclic_sdk_api_platform; class CategoryJsonhalRead { /// Returns a new [CategoryJsonhalRead] instance. CategoryJsonhalRead({ - this.links, + required this.links, required this.name, - this.id, + required this.id, this.identificationNumber, - this.path, - this.createdAt, - this.updatedAt, + this.path = const [], + required this.createdAt, + required this.updatedAt, this.embedded, }); @@ -25,33 +25,33 @@ class CategoryJsonhalRead { } return CategoryJsonhalRead( - links: CategoryJsonhalReadLinks.fromJson(json[r'_links']), + links: CategoryJsonhalReadLinks.fromJson(json[r'_links'])!, name: json[r'name'], id: json[r'id'], identificationNumber: json[r'identificationNumber'], path: NodeJsonhalRead.listFromJson(json[r'path']), - createdAt: mapToDateTime(json[r'createdAt']), - updatedAt: mapToDateTime(json[r'updatedAt']), + createdAt: mapToDateTime(json[r'createdAt'])!, + updatedAt: mapToDateTime(json[r'updatedAt'])!, embedded: CategoryJsonhalReadEmbedded.fromJson(json[r'_embedded']), ); } - CategoryJsonhalReadLinks? links; + CategoryJsonhalReadLinks links; String name; /// The resource identifier. - final String? id; + final String id; String? identificationNumber; - final List? path; + final List path; /// The date and time when the resource was created, in UTC format. - final DateTime? createdAt; + final DateTime createdAt; /// The date and time when the resource was updated, in UTC format. - final DateTime? updatedAt; + final DateTime updatedAt; CategoryJsonhalReadEmbedded? embedded; @@ -75,13 +75,13 @@ class CategoryJsonhalRead { @override int get hashCode => - (links == null ? 0 : links.hashCode) + + links.hashCode + name.hashCode + - (id == null ? 0 : id.hashCode) + + id.hashCode + (identificationNumber == null ? 0 : identificationNumber.hashCode) + - (path == null ? 0 : path.hashCode) + - (createdAt == null ? 0 : createdAt.hashCode) + - (updatedAt == null ? 0 : updatedAt.hashCode) + + path.hashCode + + createdAt.hashCode + + updatedAt.hashCode + (embedded == null ? 0 : embedded.hashCode); static List listFromJson(Iterable? json) { @@ -137,24 +137,21 @@ class CategoryJsonhalRead { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.any((key) => RegExp(r'^links\.').hasMatch(key))) - r'_links': links?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^links\.'))) { - previousValue.add(element.split(RegExp(r'^links\.')).last); - } - - return previousValue; - })), + r'_links': links.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^links\.'))) { + previousValue.add(element.split(RegExp(r'^links\.')).last); + } + + return previousValue; + })), r'name': name, - if (keys == null || keys.contains(r'id')) r'id': id, + r'id': id, if (keys == null || keys.contains(r'identificationNumber')) r'identificationNumber': identificationNumber, - if (keys == null || keys.contains(r'path')) r'path': path, - if (keys == null || keys.contains(r'createdAt')) - r'createdAt': createdAt?.toUtc().toIso8601String(), - if (keys == null || keys.contains(r'updatedAt')) - r'updatedAt': updatedAt?.toUtc().toIso8601String(), + r'path': path, + r'createdAt': createdAt.toUtc().toIso8601String(), + r'updatedAt': updatedAt.toUtc().toIso8601String(), if (keys == null || keys.any((key) => RegExp(r'^embedded\.').hasMatch(key))) r'_embedded': embedded?.toJson(keys?.fold>([], diff --git a/dart-v3/lib/model/category_jsonhal_read_links.dart b/dart-v3/lib/model/category_jsonhal_read_links.dart index bbfd25415..5098e1a46 100644 --- a/dart-v3/lib/model/category_jsonhal_read_links.dart +++ b/dart-v3/lib/model/category_jsonhal_read_links.dart @@ -7,8 +7,8 @@ part of keyclic_sdk_api_platform; class CategoryJsonhalReadLinks { /// Returns a new [CategoryJsonhalReadLinks] instance. CategoryJsonhalReadLinks({ - this.self, - this.organization, + required this.self, + required this.organization, this.children, }); @@ -20,17 +20,17 @@ class CategoryJsonhalReadLinks { } return CategoryJsonhalReadLinks( - self: GetPlaceCollection200ResponseLinksSelf.fromJson(json[r'self']), + self: GetPlaceCollection200ResponseLinksSelf.fromJson(json[r'self'])!, organization: GetPlaceCollection200ResponseLinksSelf.fromJson( - json[r'organization']), + json[r'organization'])!, children: GetPlaceCollection200ResponseLinksSelf.listFromJson( json[r'children']), ); } - GetPlaceCollection200ResponseLinksSelf? self; + GetPlaceCollection200ResponseLinksSelf self; - GetPlaceCollection200ResponseLinksSelf? organization; + GetPlaceCollection200ResponseLinksSelf organization; List? children; @@ -49,8 +49,8 @@ class CategoryJsonhalReadLinks { @override int get hashCode => - (self == null ? 0 : self.hashCode) + - (organization == null ? 0 : organization.hashCode) + + self.hashCode + + organization.hashCode + (children == null ? 0 : children.hashCode); static List listFromJson(Iterable? json) { @@ -107,25 +107,22 @@ class CategoryJsonhalReadLinks { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.any((key) => RegExp(r'^self\.').hasMatch(key))) - r'self': self?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^self\.'))) { - previousValue.add(element.split(RegExp(r'^self\.')).last); - } - - return previousValue; - })), - if (keys == null || - keys.any((key) => RegExp(r'^organization\.').hasMatch(key))) - r'organization': organization?.toJson(keys?.fold>( - [], (List previousValue, String element) { - if (element.contains(RegExp(r'^organization\.'))) { - previousValue.add(element.split(RegExp(r'^organization\.')).last); - } - - return previousValue; - })), + r'self': self.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^self\.'))) { + previousValue.add(element.split(RegExp(r'^self\.')).last); + } + + return previousValue; + })), + r'organization': organization.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^organization\.'))) { + previousValue.add(element.split(RegExp(r'^organization\.')).last); + } + + return previousValue; + })), if (keys == null || keys.contains(r'children')) r'children': children, }; } diff --git a/dart-v3/lib/model/category_type_jsongeo_read.dart b/dart-v3/lib/model/category_type_jsongeo_read.dart index aa501a8f5..3e1f7988d 100644 --- a/dart-v3/lib/model/category_type_jsongeo_read.dart +++ b/dart-v3/lib/model/category_type_jsongeo_read.dart @@ -7,7 +7,7 @@ part of keyclic_sdk_api_platform; class CategoryTypeJsongeoRead { /// Returns a new [CategoryTypeJsongeoRead] instance. CategoryTypeJsongeoRead({ - this.id, + required this.id, this.description, required this.name, }); @@ -27,7 +27,7 @@ class CategoryTypeJsongeoRead { } /// The resource identifier. - final String? id; + final String id; String? description; @@ -48,7 +48,7 @@ class CategoryTypeJsongeoRead { @override int get hashCode => - (id == null ? 0 : id.hashCode) + + id.hashCode + (description == null ? 0 : description.hashCode) + name.hashCode; @@ -106,7 +106,7 @@ class CategoryTypeJsongeoRead { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.contains(r'id')) r'id': id, + r'id': id, if (keys == null || keys.contains(r'description')) r'description': description, r'name': name, diff --git a/dart-v3/lib/model/category_type_jsonhal_read.dart b/dart-v3/lib/model/category_type_jsonhal_read.dart index e4e2c4aa2..175c634d9 100644 --- a/dart-v3/lib/model/category_type_jsonhal_read.dart +++ b/dart-v3/lib/model/category_type_jsonhal_read.dart @@ -7,8 +7,8 @@ part of keyclic_sdk_api_platform; class CategoryTypeJsonhalRead { /// Returns a new [CategoryTypeJsonhalRead] instance. CategoryTypeJsonhalRead({ - this.links, - this.id, + required this.links, + required this.id, this.description, required this.name, }); @@ -21,17 +21,17 @@ class CategoryTypeJsonhalRead { } return CategoryTypeJsonhalRead( - links: AssetTypeJsonhalReadLinks.fromJson(json[r'_links']), + links: AssetTypeJsonhalReadLinks.fromJson(json[r'_links'])!, id: json[r'id'], description: json[r'description'], name: json[r'name'], ); } - AssetTypeJsonhalReadLinks? links; + AssetTypeJsonhalReadLinks links; /// The resource identifier. - final String? id; + final String id; String? description; @@ -53,8 +53,8 @@ class CategoryTypeJsonhalRead { @override int get hashCode => - (links == null ? 0 : links.hashCode) + - (id == null ? 0 : id.hashCode) + + links.hashCode + + id.hashCode + (description == null ? 0 : description.hashCode) + name.hashCode; @@ -112,16 +112,15 @@ class CategoryTypeJsonhalRead { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.any((key) => RegExp(r'^links\.').hasMatch(key))) - r'_links': links?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^links\.'))) { - previousValue.add(element.split(RegExp(r'^links\.')).last); - } - - return previousValue; - })), - if (keys == null || keys.contains(r'id')) r'id': id, + r'_links': links.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^links\.'))) { + previousValue.add(element.split(RegExp(r'^links\.')).last); + } + + return previousValue; + })), + r'id': id, if (keys == null || keys.contains(r'description')) r'description': description, r'name': name, diff --git a/dart-v3/lib/model/collaborator_jsonhal_read.dart b/dart-v3/lib/model/collaborator_jsonhal_read.dart index da9b7ee89..165aac545 100644 --- a/dart-v3/lib/model/collaborator_jsonhal_read.dart +++ b/dart-v3/lib/model/collaborator_jsonhal_read.dart @@ -7,11 +7,11 @@ part of keyclic_sdk_api_platform; class CollaboratorJsonhalRead { /// Returns a new [CollaboratorJsonhalRead] instance. CollaboratorJsonhalRead({ - this.links, - this.id, - this.createdAt, - this.updatedAt, - this.contactPoint, + required this.links, + required this.id, + required this.createdAt, + required this.updatedAt, + required this.contactPoint, }); /// Returns a new [CollaboratorJsonhalRead] instance and imports its values from @@ -22,26 +22,26 @@ class CollaboratorJsonhalRead { } return CollaboratorJsonhalRead( - links: AssetTypeJsonhalReadLinks.fromJson(json[r'_links']), + links: AssetTypeJsonhalReadLinks.fromJson(json[r'_links'])!, id: json[r'id'], - createdAt: mapToDateTime(json[r'createdAt']), - updatedAt: mapToDateTime(json[r'updatedAt']), - contactPoint: ContactPointJsonhalRead.fromJson(json[r'contactPoint']), + createdAt: mapToDateTime(json[r'createdAt'])!, + updatedAt: mapToDateTime(json[r'updatedAt'])!, + contactPoint: ContactPointJsonhalRead.fromJson(json[r'contactPoint'])!, ); } - AssetTypeJsonhalReadLinks? links; + AssetTypeJsonhalReadLinks links; /// The resource identifier. - final String? id; + final String id; /// The date and time when the resource was created, in UTC format. - final DateTime? createdAt; + final DateTime createdAt; /// The date and time when the resource was updated, in UTC format. - final DateTime? updatedAt; + final DateTime updatedAt; - ContactPointJsonhalRead? contactPoint; + ContactPointJsonhalRead contactPoint; @override bool operator ==(Object other) { @@ -60,11 +60,11 @@ class CollaboratorJsonhalRead { @override int get hashCode => - (links == null ? 0 : links.hashCode) + - (id == null ? 0 : id.hashCode) + - (createdAt == null ? 0 : createdAt.hashCode) + - (updatedAt == null ? 0 : updatedAt.hashCode) + - (contactPoint == null ? 0 : contactPoint.hashCode); + links.hashCode + + id.hashCode + + createdAt.hashCode + + updatedAt.hashCode + + contactPoint.hashCode; static List listFromJson(Iterable? json) { if (json == null) { @@ -120,30 +120,25 @@ class CollaboratorJsonhalRead { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.any((key) => RegExp(r'^links\.').hasMatch(key))) - r'_links': links?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^links\.'))) { - previousValue.add(element.split(RegExp(r'^links\.')).last); - } - - return previousValue; - })), - if (keys == null || keys.contains(r'id')) r'id': id, - if (keys == null || keys.contains(r'createdAt')) - r'createdAt': createdAt?.toUtc().toIso8601String(), - if (keys == null || keys.contains(r'updatedAt')) - r'updatedAt': updatedAt?.toUtc().toIso8601String(), - if (keys == null || - keys.any((key) => RegExp(r'^contactPoint\.').hasMatch(key))) - r'contactPoint': contactPoint?.toJson(keys?.fold>( - [], (List previousValue, String element) { - if (element.contains(RegExp(r'^contactPoint\.'))) { - previousValue.add(element.split(RegExp(r'^contactPoint\.')).last); - } - - return previousValue; - })), + r'_links': links.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^links\.'))) { + previousValue.add(element.split(RegExp(r'^links\.')).last); + } + + return previousValue; + })), + r'id': id, + r'createdAt': createdAt.toUtc().toIso8601String(), + r'updatedAt': updatedAt.toUtc().toIso8601String(), + r'contactPoint': contactPoint.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^contactPoint\.'))) { + previousValue.add(element.split(RegExp(r'^contactPoint\.')).last); + } + + return previousValue; + })), }; } } diff --git a/dart-v3/lib/model/condition_jsonhal_read.dart b/dart-v3/lib/model/condition_jsonhal_read.dart index a00369018..47593b49e 100644 --- a/dart-v3/lib/model/condition_jsonhal_read.dart +++ b/dart-v3/lib/model/condition_jsonhal_read.dart @@ -9,7 +9,7 @@ class ConditionJsonhalRead { ConditionJsonhalRead({ required this.propertyPath, this.values = const {}, - this.operator_, + required this.operator_, }); /// Returns a new [ConditionJsonhalRead] instance and imports its values from @@ -22,15 +22,15 @@ class ConditionJsonhalRead { return ConditionJsonhalRead( propertyPath: json[r'propertyPath'], values: Map.from(json[r'values']), - operator_: ConditionJsonhalReadOperator_Enum.fromJson(json[r'operator']), + operator_: ConditionJsonhalReadOperator_Enum.fromJson(json[r'operator'])!, ); } - String propertyPath; + String? propertyPath; Map values; - ConditionJsonhalReadOperator_Enum? operator_; + ConditionJsonhalReadOperator_Enum operator_; @override bool operator ==(Object other) { @@ -47,9 +47,9 @@ class ConditionJsonhalRead { @override int get hashCode => - propertyPath.hashCode + + (propertyPath == null ? 0 : propertyPath.hashCode) + values.hashCode + - (operator_ == null ? 0 : operator_.hashCode); + operator_.hashCode; static List listFromJson(Iterable? json) { if (json == null) { @@ -105,9 +105,10 @@ class ConditionJsonhalRead { Map toJson([Iterable? keys]) { return { - r'propertyPath': propertyPath, + if (keys == null || keys.contains(r'propertyPath')) + r'propertyPath': propertyPath, r'values': values, - if (keys == null || keys.contains(r'operator_')) r'operator': operator_, + r'operator': operator_, }; } } diff --git a/dart-v3/lib/model/connection_jsonhal_auth_profile_read.dart b/dart-v3/lib/model/connection_jsonhal_auth_profile_read.dart index e701dd8a1..7d0b9e29d 100644 --- a/dart-v3/lib/model/connection_jsonhal_auth_profile_read.dart +++ b/dart-v3/lib/model/connection_jsonhal_auth_profile_read.dart @@ -7,10 +7,10 @@ part of keyclic_sdk_api_platform; class ConnectionJsonhalAuthProfileRead { /// Returns a new [ConnectionJsonhalAuthProfileRead] instance. ConnectionJsonhalAuthProfileRead({ - this.image, - this.text, - this.authorizationUrl, - this.type, + required this.image, + required this.text, + required this.authorizationUrl, + required this.type, }); /// Returns a new [ConnectionJsonhalAuthProfileRead] instance and imports its values from @@ -24,17 +24,17 @@ class ConnectionJsonhalAuthProfileRead { image: json[r'image'], text: json[r'text'], authorizationUrl: json[r'authorizationUrl'], - type: ConnectionJsonhalAuthProfileReadTypeEnum.fromJson(json[r'type']), + type: ConnectionJsonhalAuthProfileReadTypeEnum.fromJson(json[r'type'])!, ); } - String? image; + String image; - String? text; + String text; - final String? authorizationUrl; + final String authorizationUrl; - final ConnectionJsonhalAuthProfileReadTypeEnum? type; + final ConnectionJsonhalAuthProfileReadTypeEnum type; @override bool operator ==(Object other) { @@ -52,10 +52,10 @@ class ConnectionJsonhalAuthProfileRead { @override int get hashCode => - (image == null ? 0 : image.hashCode) + - (text == null ? 0 : text.hashCode) + - (authorizationUrl == null ? 0 : authorizationUrl.hashCode) + - (type == null ? 0 : type.hashCode); + image.hashCode + + text.hashCode + + authorizationUrl.hashCode + + type.hashCode; static List listFromJson(Iterable? json) { if (json == null) { @@ -111,11 +111,10 @@ class ConnectionJsonhalAuthProfileRead { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.contains(r'image')) r'image': image, - if (keys == null || keys.contains(r'text')) r'text': text, - if (keys == null || keys.contains(r'authorizationUrl')) - r'authorizationUrl': authorizationUrl, - if (keys == null || keys.contains(r'type')) r'type': type, + r'image': image, + r'text': text, + r'authorizationUrl': authorizationUrl, + r'type': type, }; } } diff --git a/dart-v3/lib/model/connector_jsonhal_read.dart b/dart-v3/lib/model/connector_jsonhal_read.dart index 6a971fd4c..b4490ef98 100644 --- a/dart-v3/lib/model/connector_jsonhal_read.dart +++ b/dart-v3/lib/model/connector_jsonhal_read.dart @@ -7,11 +7,11 @@ part of keyclic_sdk_api_platform; class ConnectorJsonhalRead { /// Returns a new [ConnectorJsonhalRead] instance. ConnectorJsonhalRead({ - this.links, + required this.links, required this.name, - this.id, - this.createdAt, - this.updatedAt, + required this.id, + required this.createdAt, + required this.updatedAt, }); /// Returns a new [ConnectorJsonhalRead] instance and imports its values from @@ -22,26 +22,26 @@ class ConnectorJsonhalRead { } return ConnectorJsonhalRead( - links: AssetTypeJsonhalReadLinks.fromJson(json[r'_links']), + links: AssetTypeJsonhalReadLinks.fromJson(json[r'_links'])!, name: json[r'name'], id: json[r'id'], - createdAt: mapToDateTime(json[r'createdAt']), - updatedAt: mapToDateTime(json[r'updatedAt']), + createdAt: mapToDateTime(json[r'createdAt'])!, + updatedAt: mapToDateTime(json[r'updatedAt'])!, ); } - AssetTypeJsonhalReadLinks? links; + AssetTypeJsonhalReadLinks links; String name; /// The resource identifier. - final String? id; + final String id; /// The date and time when the resource was created, in UTC format. - final DateTime? createdAt; + final DateTime createdAt; /// The date and time when the resource was updated, in UTC format. - final DateTime? updatedAt; + final DateTime updatedAt; @override bool operator ==(Object other) { @@ -60,11 +60,11 @@ class ConnectorJsonhalRead { @override int get hashCode => - (links == null ? 0 : links.hashCode) + + links.hashCode + name.hashCode + - (id == null ? 0 : id.hashCode) + - (createdAt == null ? 0 : createdAt.hashCode) + - (updatedAt == null ? 0 : updatedAt.hashCode); + id.hashCode + + createdAt.hashCode + + updatedAt.hashCode; static List listFromJson(Iterable? json) { if (json == null) { @@ -120,21 +120,18 @@ class ConnectorJsonhalRead { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.any((key) => RegExp(r'^links\.').hasMatch(key))) - r'_links': links?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^links\.'))) { - previousValue.add(element.split(RegExp(r'^links\.')).last); - } - - return previousValue; - })), + r'_links': links.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^links\.'))) { + previousValue.add(element.split(RegExp(r'^links\.')).last); + } + + return previousValue; + })), r'name': name, - if (keys == null || keys.contains(r'id')) r'id': id, - if (keys == null || keys.contains(r'createdAt')) - r'createdAt': createdAt?.toUtc().toIso8601String(), - if (keys == null || keys.contains(r'updatedAt')) - r'updatedAt': updatedAt?.toUtc().toIso8601String(), + r'id': id, + r'createdAt': createdAt.toUtc().toIso8601String(), + r'updatedAt': updatedAt.toUtc().toIso8601String(), }; } } diff --git a/dart-v3/lib/model/contact_jsonhal_read.dart b/dart-v3/lib/model/contact_jsonhal_read.dart index d650bc85a..8d681ce01 100644 --- a/dart-v3/lib/model/contact_jsonhal_read.dart +++ b/dart-v3/lib/model/contact_jsonhal_read.dart @@ -7,13 +7,13 @@ part of keyclic_sdk_api_platform; class ContactJsonhalRead { /// Returns a new [ContactJsonhalRead] instance. ContactJsonhalRead({ - this.links, - this.id, - this.createdAt, - this.updatedAt, - this.contactPoint, + required this.links, + required this.id, + required this.createdAt, + required this.updatedAt, + required this.contactPoint, this.type, - this.embedded, + required this.embedded, }); /// Returns a new [ContactJsonhalRead] instance and imports its values from @@ -24,32 +24,32 @@ class ContactJsonhalRead { } return ContactJsonhalRead( - links: AssetTypeJsonhalReadLinks.fromJson(json[r'_links']), + links: AssetTypeJsonhalReadLinks.fromJson(json[r'_links'])!, id: json[r'id'], - createdAt: mapToDateTime(json[r'createdAt']), - updatedAt: mapToDateTime(json[r'updatedAt']), - contactPoint: ContactPointJsonhalRead.fromJson(json[r'contactPoint']), + createdAt: mapToDateTime(json[r'createdAt'])!, + updatedAt: mapToDateTime(json[r'updatedAt'])!, + contactPoint: ContactPointJsonhalRead.fromJson(json[r'contactPoint'])!, type: json[r'type'], - embedded: ContactJsonhalReadEmbedded.fromJson(json[r'_embedded']), + embedded: ContactJsonhalReadEmbedded.fromJson(json[r'_embedded'])!, ); } - AssetTypeJsonhalReadLinks? links; + AssetTypeJsonhalReadLinks links; /// The resource identifier. - final String? id; + final String id; /// The date and time when the resource was created, in UTC format. - final DateTime? createdAt; + final DateTime createdAt; /// The date and time when the resource was updated, in UTC format. - final DateTime? updatedAt; + final DateTime updatedAt; - ContactPointJsonhalRead? contactPoint; + ContactPointJsonhalRead contactPoint; final String? type; - ContactJsonhalReadEmbedded? embedded; + ContactJsonhalReadEmbedded embedded; @override bool operator ==(Object other) { @@ -70,13 +70,13 @@ class ContactJsonhalRead { @override int get hashCode => - (links == null ? 0 : links.hashCode) + - (id == null ? 0 : id.hashCode) + - (createdAt == null ? 0 : createdAt.hashCode) + - (updatedAt == null ? 0 : updatedAt.hashCode) + - (contactPoint == null ? 0 : contactPoint.hashCode) + + links.hashCode + + id.hashCode + + createdAt.hashCode + + updatedAt.hashCode + + contactPoint.hashCode + (type == null ? 0 : type.hashCode) + - (embedded == null ? 0 : embedded.hashCode); + embedded.hashCode; static List listFromJson(Iterable? json) { if (json == null) { @@ -131,41 +131,34 @@ class ContactJsonhalRead { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.any((key) => RegExp(r'^links\.').hasMatch(key))) - r'_links': links?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^links\.'))) { - previousValue.add(element.split(RegExp(r'^links\.')).last); - } - - return previousValue; - })), - if (keys == null || keys.contains(r'id')) r'id': id, - if (keys == null || keys.contains(r'createdAt')) - r'createdAt': createdAt?.toUtc().toIso8601String(), - if (keys == null || keys.contains(r'updatedAt')) - r'updatedAt': updatedAt?.toUtc().toIso8601String(), - if (keys == null || - keys.any((key) => RegExp(r'^contactPoint\.').hasMatch(key))) - r'contactPoint': contactPoint?.toJson(keys?.fold>( - [], (List previousValue, String element) { - if (element.contains(RegExp(r'^contactPoint\.'))) { - previousValue.add(element.split(RegExp(r'^contactPoint\.')).last); - } - - return previousValue; - })), + r'_links': links.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^links\.'))) { + previousValue.add(element.split(RegExp(r'^links\.')).last); + } + + return previousValue; + })), + r'id': id, + r'createdAt': createdAt.toUtc().toIso8601String(), + r'updatedAt': updatedAt.toUtc().toIso8601String(), + r'contactPoint': contactPoint.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^contactPoint\.'))) { + previousValue.add(element.split(RegExp(r'^contactPoint\.')).last); + } + + return previousValue; + })), if (keys == null || keys.contains(r'type')) r'type': type, - if (keys == null || - keys.any((key) => RegExp(r'^embedded\.').hasMatch(key))) - r'_embedded': embedded?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^embedded\.'))) { - previousValue.add(element.split(RegExp(r'^embedded\.')).last); - } - - return previousValue; - })), + r'_embedded': embedded.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^embedded\.'))) { + previousValue.add(element.split(RegExp(r'^embedded\.')).last); + } + + return previousValue; + })), }; } } diff --git a/dart-v3/lib/model/contact_jsonhal_read_embedded.dart b/dart-v3/lib/model/contact_jsonhal_read_embedded.dart index 0afa4ad45..b555343ce 100644 --- a/dart-v3/lib/model/contact_jsonhal_read_embedded.dart +++ b/dart-v3/lib/model/contact_jsonhal_read_embedded.dart @@ -7,7 +7,7 @@ part of keyclic_sdk_api_platform; class ContactJsonhalReadEmbedded { /// Returns a new [ContactJsonhalReadEmbedded] instance. ContactJsonhalReadEmbedded({ - this.organization, + required this.organization, this.person, }); @@ -19,12 +19,12 @@ class ContactJsonhalReadEmbedded { } return ContactJsonhalReadEmbedded( - organization: OrganizationJsonhalRead.fromJson(json[r'organization']), + organization: OrganizationJsonhalRead.fromJson(json[r'organization'])!, person: PersonJsonhalRead.fromJson(json[r'person']), ); } - OrganizationJsonhalRead? organization; + OrganizationJsonhalRead organization; PersonJsonhalRead? person; @@ -42,8 +42,7 @@ class ContactJsonhalReadEmbedded { @override int get hashCode => - (organization == null ? 0 : organization.hashCode) + - (person == null ? 0 : person.hashCode); + organization.hashCode + (person == null ? 0 : person.hashCode); static List listFromJson(Iterable? json) { if (json == null) { @@ -99,16 +98,14 @@ class ContactJsonhalReadEmbedded { Map toJson([Iterable? keys]) { return { - if (keys == null || - keys.any((key) => RegExp(r'^organization\.').hasMatch(key))) - r'organization': organization?.toJson(keys?.fold>( - [], (List previousValue, String element) { - if (element.contains(RegExp(r'^organization\.'))) { - previousValue.add(element.split(RegExp(r'^organization\.')).last); - } - - return previousValue; - })), + r'organization': organization.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^organization\.'))) { + previousValue.add(element.split(RegExp(r'^organization\.')).last); + } + + return previousValue; + })), if (keys == null || keys.any((key) => RegExp(r'^person\.').hasMatch(key))) r'person': person?.toJson(keys?.fold>([], (List previousValue, String element) { diff --git a/dart-v3/lib/model/contract_create_contract_command_write.dart b/dart-v3/lib/model/contract_create_contract_command_write.dart index 3bb3131bf..d7ab38ff7 100644 --- a/dart-v3/lib/model/contract_create_contract_command_write.dart +++ b/dart-v3/lib/model/contract_create_contract_command_write.dart @@ -14,7 +14,7 @@ class ContractCreateContractCommandWrite { required this.name, required this.number, this.onCall, - this.places, + this.places = const [], required this.provider, this.renewal, this.signedAt, @@ -39,8 +39,7 @@ class ContractCreateContractCommandWrite { name: json[r'name'], number: json[r'number'], onCall: json[r'onCall'], - places: - json[r'places'] == null ? null : List.from(json[r'places']), + places: List.from(json[r'places']), provider: json[r'provider'], renewal: RenewalWrite.fromJson(json[r'renewal']), signedAt: mapToDateTime(json[r'signedAt']), @@ -66,7 +65,7 @@ class ContractCreateContractCommandWrite { bool? onCall; - List? places; + List places; String provider; @@ -116,7 +115,7 @@ class ContractCreateContractCommandWrite { name.hashCode + number.hashCode + (onCall == null ? 0 : onCall.hashCode) + - (places == null ? 0 : places.hashCode) + + places.hashCode + provider.hashCode + (renewal == null ? 0 : renewal.hashCode) + (signedAt == null ? 0 : signedAt.hashCode) + @@ -198,7 +197,7 @@ class ContractCreateContractCommandWrite { r'name': name, r'number': number, if (keys == null || keys.contains(r'onCall')) r'onCall': onCall, - if (keys == null || keys.contains(r'places')) r'places': places, + r'places': places, r'provider': provider, if (keys == null || keys.any((key) => RegExp(r'^renewal\.').hasMatch(key))) diff --git a/dart-v3/lib/model/contract_edit_contract_command_write.dart b/dart-v3/lib/model/contract_edit_contract_command_write.dart index 55014b672..386ccd74f 100644 --- a/dart-v3/lib/model/contract_edit_contract_command_write.dart +++ b/dart-v3/lib/model/contract_edit_contract_command_write.dart @@ -14,7 +14,7 @@ class ContractEditContractCommandWrite { this.name, this.number, this.onCall, - this.places, + this.places = const [], this.provider, this.renewal, this.signedAt, @@ -39,8 +39,7 @@ class ContractEditContractCommandWrite { name: json[r'name'], number: json[r'number'], onCall: json[r'onCall'], - places: - json[r'places'] == null ? null : List.from(json[r'places']), + places: List.from(json[r'places']), provider: json[r'provider'], renewal: RenewalWrite.fromJson(json[r'renewal']), signedAt: mapToDateTime(json[r'signedAt']), @@ -65,7 +64,7 @@ class ContractEditContractCommandWrite { bool? onCall; - List? places; + List places; String? provider; @@ -115,7 +114,7 @@ class ContractEditContractCommandWrite { (name == null ? 0 : name.hashCode) + (number == null ? 0 : number.hashCode) + (onCall == null ? 0 : onCall.hashCode) + - (places == null ? 0 : places.hashCode) + + places.hashCode + (provider == null ? 0 : provider.hashCode) + (renewal == null ? 0 : renewal.hashCode) + (signedAt == null ? 0 : signedAt.hashCode) + @@ -196,7 +195,7 @@ class ContractEditContractCommandWrite { if (keys == null || keys.contains(r'name')) r'name': name, if (keys == null || keys.contains(r'number')) r'number': number, if (keys == null || keys.contains(r'onCall')) r'onCall': onCall, - if (keys == null || keys.contains(r'places')) r'places': places, + r'places': places, if (keys == null || keys.contains(r'provider')) r'provider': provider, if (keys == null || keys.any((key) => RegExp(r'^renewal\.').hasMatch(key))) diff --git a/dart-v3/lib/model/contract_jsonhal_organization_preference_read.dart b/dart-v3/lib/model/contract_jsonhal_organization_preference_read.dart index 67c45837a..b26c9c4e8 100644 --- a/dart-v3/lib/model/contract_jsonhal_organization_preference_read.dart +++ b/dart-v3/lib/model/contract_jsonhal_organization_preference_read.dart @@ -7,7 +7,7 @@ part of keyclic_sdk_api_platform; class ContractJsonhalOrganizationPreferenceRead { /// Returns a new [ContractJsonhalOrganizationPreferenceRead] instance. ContractJsonhalOrganizationPreferenceRead({ - this.enabled, + required this.enabled, }); /// Returns a new [ContractJsonhalOrganizationPreferenceRead] instance and imports its values from @@ -22,7 +22,7 @@ class ContractJsonhalOrganizationPreferenceRead { ); } - bool? enabled; + bool enabled; @override bool operator ==(Object other) { @@ -36,7 +36,7 @@ class ContractJsonhalOrganizationPreferenceRead { } @override - int get hashCode => (enabled == null ? 0 : enabled.hashCode); + int get hashCode => enabled.hashCode; static List listFromJson( Iterable? json) { @@ -96,7 +96,7 @@ class ContractJsonhalOrganizationPreferenceRead { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.contains(r'enabled')) r'enabled': enabled, + r'enabled': enabled, }; } } diff --git a/dart-v3/lib/model/contract_jsonhal_read.dart b/dart-v3/lib/model/contract_jsonhal_read.dart index e68498248..73a18e14b 100644 --- a/dart-v3/lib/model/contract_jsonhal_read.dart +++ b/dart-v3/lib/model/contract_jsonhal_read.dart @@ -7,7 +7,7 @@ part of keyclic_sdk_api_platform; class ContractJsonhalRead { /// Returns a new [ContractJsonhalRead] instance. ContractJsonhalRead({ - this.links, + required this.links, this.billing, this.description, this.duration, @@ -15,15 +15,15 @@ class ContractJsonhalRead { this.endDate, required this.name, required this.number, - this.onCall, + required this.onCall, this.renewal, this.signedAt, this.state = const ContractJsonhalReadStateEnum._('DRAFT'), this.terminationDate, this.terminationReason, - this.id, - this.createdAt, - this.updatedAt, + required this.id, + required this.createdAt, + required this.updatedAt, }); /// Returns a new [ContractJsonhalRead] instance and imports its values from @@ -34,7 +34,7 @@ class ContractJsonhalRead { } return ContractJsonhalRead( - links: ContractJsonhalReadLinks.fromJson(json[r'_links']), + links: ContractJsonhalReadLinks.fromJson(json[r'_links'])!, billing: BillingJsonhalRead.fromJson(json[r'billing']), description: json[r'description'], duration: json[r'duration'], @@ -49,12 +49,12 @@ class ContractJsonhalRead { terminationDate: mapToDateTime(json[r'terminationDate']), terminationReason: json[r'terminationReason'], id: json[r'id'], - createdAt: mapToDateTime(json[r'createdAt']), - updatedAt: mapToDateTime(json[r'updatedAt']), + createdAt: mapToDateTime(json[r'createdAt'])!, + updatedAt: mapToDateTime(json[r'updatedAt'])!, ); } - ContractJsonhalReadLinks? links; + ContractJsonhalReadLinks links; BillingJsonhalRead? billing; @@ -77,7 +77,7 @@ class ContractJsonhalRead { String number; /// The onCall property represents whether a staff member is currently available for on-call duties. - bool? onCall; + bool onCall; RenewalJsonhalRead? renewal; @@ -93,13 +93,13 @@ class ContractJsonhalRead { String? terminationReason; /// The resource identifier. - final String? id; + final String id; /// The date and time when the resource was created, in UTC format. - final DateTime? createdAt; + final DateTime createdAt; /// The date and time when the resource was updated, in UTC format. - final DateTime? updatedAt; + final DateTime updatedAt; @override bool operator ==(Object other) { @@ -130,7 +130,7 @@ class ContractJsonhalRead { @override int get hashCode => - (links == null ? 0 : links.hashCode) + + links.hashCode + (billing == null ? 0 : billing.hashCode) + (description == null ? 0 : description.hashCode) + (duration == null ? 0 : duration.hashCode) + @@ -138,15 +138,15 @@ class ContractJsonhalRead { (endDate == null ? 0 : endDate.hashCode) + name.hashCode + number.hashCode + - (onCall == null ? 0 : onCall.hashCode) + + onCall.hashCode + (renewal == null ? 0 : renewal.hashCode) + (signedAt == null ? 0 : signedAt.hashCode) + state.hashCode + (terminationDate == null ? 0 : terminationDate.hashCode) + (terminationReason == null ? 0 : terminationReason.hashCode) + - (id == null ? 0 : id.hashCode) + - (createdAt == null ? 0 : createdAt.hashCode) + - (updatedAt == null ? 0 : updatedAt.hashCode); + id.hashCode + + createdAt.hashCode + + updatedAt.hashCode; static List listFromJson(Iterable? json) { if (json == null) { @@ -201,15 +201,14 @@ class ContractJsonhalRead { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.any((key) => RegExp(r'^links\.').hasMatch(key))) - r'_links': links?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^links\.'))) { - previousValue.add(element.split(RegExp(r'^links\.')).last); - } + r'_links': links.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^links\.'))) { + previousValue.add(element.split(RegExp(r'^links\.')).last); + } - return previousValue; - })), + return previousValue; + })), if (keys == null || keys.any((key) => RegExp(r'^billing\.').hasMatch(key))) r'billing': billing?.toJson(keys?.fold>([], @@ -229,7 +228,7 @@ class ContractJsonhalRead { r'endDate': endDate?.toUtc().toIso8601String(), r'name': name, r'number': number, - if (keys == null || keys.contains(r'onCall')) r'onCall': onCall, + r'onCall': onCall, if (keys == null || keys.any((key) => RegExp(r'^renewal\.').hasMatch(key))) r'renewal': renewal?.toJson(keys?.fold>([], @@ -247,11 +246,9 @@ class ContractJsonhalRead { r'terminationDate': terminationDate?.toUtc().toIso8601String(), if (keys == null || keys.contains(r'terminationReason')) r'terminationReason': terminationReason, - if (keys == null || keys.contains(r'id')) r'id': id, - if (keys == null || keys.contains(r'createdAt')) - r'createdAt': createdAt?.toUtc().toIso8601String(), - if (keys == null || keys.contains(r'updatedAt')) - r'updatedAt': updatedAt?.toUtc().toIso8601String(), + r'id': id, + r'createdAt': createdAt.toUtc().toIso8601String(), + r'updatedAt': updatedAt.toUtc().toIso8601String(), }; } } diff --git a/dart-v3/lib/model/contract_jsonhal_read_links.dart b/dart-v3/lib/model/contract_jsonhal_read_links.dart index a89d4d8cc..54c0e2493 100644 --- a/dart-v3/lib/model/contract_jsonhal_read_links.dart +++ b/dart-v3/lib/model/contract_jsonhal_read_links.dart @@ -7,8 +7,8 @@ part of keyclic_sdk_api_platform; class ContractJsonhalReadLinks { /// Returns a new [ContractJsonhalReadLinks] instance. ContractJsonhalReadLinks({ - this.self, - this.provider, + required this.self, + required this.provider, this.type, }); @@ -20,16 +20,16 @@ class ContractJsonhalReadLinks { } return ContractJsonhalReadLinks( - self: GetPlaceCollection200ResponseLinksSelf.fromJson(json[r'self']), + self: GetPlaceCollection200ResponseLinksSelf.fromJson(json[r'self'])!, provider: - GetPlaceCollection200ResponseLinksSelf.fromJson(json[r'provider']), + GetPlaceCollection200ResponseLinksSelf.fromJson(json[r'provider'])!, type: GetPlaceCollection200ResponseLinksFirst.fromJson(json[r'type']), ); } - GetPlaceCollection200ResponseLinksSelf? self; + GetPlaceCollection200ResponseLinksSelf self; - GetPlaceCollection200ResponseLinksSelf? provider; + GetPlaceCollection200ResponseLinksSelf provider; GetPlaceCollection200ResponseLinksFirst? type; @@ -48,9 +48,7 @@ class ContractJsonhalReadLinks { @override int get hashCode => - (self == null ? 0 : self.hashCode) + - (provider == null ? 0 : provider.hashCode) + - (type == null ? 0 : type.hashCode); + self.hashCode + provider.hashCode + (type == null ? 0 : type.hashCode); static List listFromJson(Iterable? json) { if (json == null) { @@ -106,25 +104,22 @@ class ContractJsonhalReadLinks { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.any((key) => RegExp(r'^self\.').hasMatch(key))) - r'self': self?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^self\.'))) { - previousValue.add(element.split(RegExp(r'^self\.')).last); - } - - return previousValue; - })), - if (keys == null || - keys.any((key) => RegExp(r'^provider\.').hasMatch(key))) - r'provider': provider?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^provider\.'))) { - previousValue.add(element.split(RegExp(r'^provider\.')).last); - } - - return previousValue; - })), + r'self': self.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^self\.'))) { + previousValue.add(element.split(RegExp(r'^self\.')).last); + } + + return previousValue; + })), + r'provider': provider.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^provider\.'))) { + previousValue.add(element.split(RegExp(r'^provider\.')).last); + } + + return previousValue; + })), if (keys == null || keys.any((key) => RegExp(r'^type\.').hasMatch(key))) r'type': type?.toJson(keys?.fold>([], (List previousValue, String element) { diff --git a/dart-v3/lib/model/contract_type_jsonhal_read.dart b/dart-v3/lib/model/contract_type_jsonhal_read.dart index 22400d9a4..5652945c2 100644 --- a/dart-v3/lib/model/contract_type_jsonhal_read.dart +++ b/dart-v3/lib/model/contract_type_jsonhal_read.dart @@ -7,10 +7,10 @@ part of keyclic_sdk_api_platform; class ContractTypeJsonhalRead { /// Returns a new [ContractTypeJsonhalRead] instance. ContractTypeJsonhalRead({ - this.links, - this.id, - this.createdAt, - this.updatedAt, + required this.links, + required this.id, + required this.createdAt, + required this.updatedAt, required this.name, this.description, }); @@ -23,25 +23,25 @@ class ContractTypeJsonhalRead { } return ContractTypeJsonhalRead( - links: AssetTypeJsonhalReadLinks.fromJson(json[r'_links']), + links: AssetTypeJsonhalReadLinks.fromJson(json[r'_links'])!, id: json[r'id'], - createdAt: mapToDateTime(json[r'createdAt']), - updatedAt: mapToDateTime(json[r'updatedAt']), + createdAt: mapToDateTime(json[r'createdAt'])!, + updatedAt: mapToDateTime(json[r'updatedAt'])!, name: json[r'name'], description: json[r'description'], ); } - AssetTypeJsonhalReadLinks? links; + AssetTypeJsonhalReadLinks links; /// The resource identifier. - final String? id; + final String id; /// The date and time when the resource was created, in UTC format. - final DateTime? createdAt; + final DateTime createdAt; /// The date and time when the resource was updated, in UTC format. - final DateTime? updatedAt; + final DateTime updatedAt; String name; @@ -65,10 +65,10 @@ class ContractTypeJsonhalRead { @override int get hashCode => - (links == null ? 0 : links.hashCode) + - (id == null ? 0 : id.hashCode) + - (createdAt == null ? 0 : createdAt.hashCode) + - (updatedAt == null ? 0 : updatedAt.hashCode) + + links.hashCode + + id.hashCode + + createdAt.hashCode + + updatedAt.hashCode + name.hashCode + (description == null ? 0 : description.hashCode); @@ -126,20 +126,17 @@ class ContractTypeJsonhalRead { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.any((key) => RegExp(r'^links\.').hasMatch(key))) - r'_links': links?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^links\.'))) { - previousValue.add(element.split(RegExp(r'^links\.')).last); - } - - return previousValue; - })), - if (keys == null || keys.contains(r'id')) r'id': id, - if (keys == null || keys.contains(r'createdAt')) - r'createdAt': createdAt?.toUtc().toIso8601String(), - if (keys == null || keys.contains(r'updatedAt')) - r'updatedAt': updatedAt?.toUtc().toIso8601String(), + r'_links': links.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^links\.'))) { + previousValue.add(element.split(RegExp(r'^links\.')).last); + } + + return previousValue; + })), + r'id': id, + r'createdAt': createdAt.toUtc().toIso8601String(), + r'updatedAt': updatedAt.toUtc().toIso8601String(), r'name': name, if (keys == null || keys.contains(r'description')) r'description': description, diff --git a/dart-v3/lib/model/document_type_jsonhal_read.dart b/dart-v3/lib/model/document_type_jsonhal_read.dart index 2f39b23ba..e4513e6ae 100644 --- a/dart-v3/lib/model/document_type_jsonhal_read.dart +++ b/dart-v3/lib/model/document_type_jsonhal_read.dart @@ -7,11 +7,11 @@ part of keyclic_sdk_api_platform; class DocumentTypeJsonhalRead { /// Returns a new [DocumentTypeJsonhalRead] instance. DocumentTypeJsonhalRead({ - this.links, + required this.links, this.code, this.permissions, - this.signed, - this.id, + required this.signed, + required this.id, this.description, required this.name, }); @@ -24,7 +24,7 @@ class DocumentTypeJsonhalRead { } return DocumentTypeJsonhalRead( - links: AssetTypeJsonhalReadLinks.fromJson(json[r'_links']), + links: AssetTypeJsonhalReadLinks.fromJson(json[r'_links'])!, code: json[r'code'], permissions: json[r'permissions'] == null ? null @@ -36,16 +36,16 @@ class DocumentTypeJsonhalRead { ); } - AssetTypeJsonhalReadLinks? links; + AssetTypeJsonhalReadLinks links; String? code; List? permissions; - bool? signed; + bool signed; /// The resource identifier. - final String? id; + final String id; String? description; @@ -71,11 +71,11 @@ class DocumentTypeJsonhalRead { @override int get hashCode => - (links == null ? 0 : links.hashCode) + + links.hashCode + (code == null ? 0 : code.hashCode) + (permissions == null ? 0 : permissions.hashCode) + - (signed == null ? 0 : signed.hashCode) + - (id == null ? 0 : id.hashCode) + + signed.hashCode + + id.hashCode + (description == null ? 0 : description.hashCode) + name.hashCode; @@ -133,20 +133,19 @@ class DocumentTypeJsonhalRead { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.any((key) => RegExp(r'^links\.').hasMatch(key))) - r'_links': links?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^links\.'))) { - previousValue.add(element.split(RegExp(r'^links\.')).last); - } - - return previousValue; - })), + r'_links': links.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^links\.'))) { + previousValue.add(element.split(RegExp(r'^links\.')).last); + } + + return previousValue; + })), if (keys == null || keys.contains(r'code')) r'code': code, if (keys == null || keys.contains(r'permissions')) r'permissions': permissions, - if (keys == null || keys.contains(r'signed')) r'signed': signed, - if (keys == null || keys.contains(r'id')) r'id': id, + r'signed': signed, + r'id': id, if (keys == null || keys.contains(r'description')) r'description': description, r'name': name, diff --git a/dart-v3/lib/model/duration_jsonhal_read.dart b/dart-v3/lib/model/duration_jsonhal_read.dart index 23992f64e..adc632a24 100644 --- a/dart-v3/lib/model/duration_jsonhal_read.dart +++ b/dart-v3/lib/model/duration_jsonhal_read.dart @@ -7,9 +7,9 @@ part of keyclic_sdk_api_platform; class DurationJsonhalRead { /// Returns a new [DurationJsonhalRead] instance. DurationJsonhalRead({ - this.hours, - this.minutes, - this.seconds, + required this.hours, + required this.minutes, + required this.seconds, }); /// Returns a new [DurationJsonhalRead] instance and imports its values from @@ -26,11 +26,11 @@ class DurationJsonhalRead { ); } - final num? hours; + final num hours; - final int? minutes; + final int minutes; - final int? seconds; + final int seconds; @override bool operator ==(Object other) { @@ -46,10 +46,7 @@ class DurationJsonhalRead { } @override - int get hashCode => - (hours == null ? 0 : hours.hashCode) + - (minutes == null ? 0 : minutes.hashCode) + - (seconds == null ? 0 : seconds.hashCode); + int get hashCode => hours.hashCode + minutes.hashCode + seconds.hashCode; static List listFromJson(Iterable? json) { if (json == null) { @@ -104,9 +101,9 @@ class DurationJsonhalRead { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.contains(r'hours')) r'hours': hours, - if (keys == null || keys.contains(r'minutes')) r'minutes': minutes, - if (keys == null || keys.contains(r'seconds')) r'seconds': seconds, + r'hours': hours, + r'minutes': minutes, + r'seconds': seconds, }; } } diff --git a/dart-v3/lib/model/equipment_jsongeo_read.dart b/dart-v3/lib/model/equipment_jsongeo_read.dart index b8f037d05..8ca1d0b21 100644 --- a/dart-v3/lib/model/equipment_jsongeo_read.dart +++ b/dart-v3/lib/model/equipment_jsongeo_read.dart @@ -7,11 +7,11 @@ part of keyclic_sdk_api_platform; class EquipmentJsongeoRead { /// Returns a new [EquipmentJsongeoRead] instance. EquipmentJsongeoRead({ - this.id, + required this.id, this.description, required this.name, this.preferences, - this.path, + this.path = const [], this.address, this.parent, this.state, @@ -37,7 +37,7 @@ class EquipmentJsongeoRead { } /// The resource identifier. - final String? id; + final String id; String? description; @@ -45,7 +45,7 @@ class EquipmentJsongeoRead { PreferencesJsongeoAssetRead? preferences; - final List? path; + final List path; PostalAddressJsongeoRead? address; @@ -73,11 +73,11 @@ class EquipmentJsongeoRead { @override int get hashCode => - (id == null ? 0 : id.hashCode) + + id.hashCode + (description == null ? 0 : description.hashCode) + name.hashCode + (preferences == null ? 0 : preferences.hashCode) + - (path == null ? 0 : path.hashCode) + + path.hashCode + (address == null ? 0 : address.hashCode) + (parent == null ? 0 : parent.hashCode) + (state == null ? 0 : state.hashCode); @@ -136,7 +136,7 @@ class EquipmentJsongeoRead { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.contains(r'id')) r'id': id, + r'id': id, if (keys == null || keys.contains(r'description')) r'description': description, r'name': name, @@ -150,7 +150,7 @@ class EquipmentJsongeoRead { return previousValue; })), - if (keys == null || keys.contains(r'path')) r'path': path, + r'path': path, if (keys == null || keys.any((key) => RegExp(r'^address\.').hasMatch(key))) r'address': address?.toJson(keys?.fold>([], diff --git a/dart-v3/lib/model/equipment_jsonhal_organization_preference_read.dart b/dart-v3/lib/model/equipment_jsonhal_organization_preference_read.dart index 72d378a67..563eff59a 100644 --- a/dart-v3/lib/model/equipment_jsonhal_organization_preference_read.dart +++ b/dart-v3/lib/model/equipment_jsonhal_organization_preference_read.dart @@ -7,7 +7,7 @@ part of keyclic_sdk_api_platform; class EquipmentJsonhalOrganizationPreferenceRead { /// Returns a new [EquipmentJsonhalOrganizationPreferenceRead] instance. EquipmentJsonhalOrganizationPreferenceRead({ - this.enabled, + required this.enabled, }); /// Returns a new [EquipmentJsonhalOrganizationPreferenceRead] instance and imports its values from @@ -22,7 +22,7 @@ class EquipmentJsonhalOrganizationPreferenceRead { ); } - bool? enabled; + bool enabled; @override bool operator ==(Object other) { @@ -36,7 +36,7 @@ class EquipmentJsonhalOrganizationPreferenceRead { } @override - int get hashCode => (enabled == null ? 0 : enabled.hashCode); + int get hashCode => enabled.hashCode; static List listFromJson( Iterable? json) { @@ -96,7 +96,7 @@ class EquipmentJsonhalOrganizationPreferenceRead { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.contains(r'enabled')) r'enabled': enabled, + r'enabled': enabled, }; } } diff --git a/dart-v3/lib/model/equipment_jsonhal_read.dart b/dart-v3/lib/model/equipment_jsonhal_read.dart index c71375eb1..9a757759a 100644 --- a/dart-v3/lib/model/equipment_jsonhal_read.dart +++ b/dart-v3/lib/model/equipment_jsonhal_read.dart @@ -7,7 +7,7 @@ part of keyclic_sdk_api_platform; class EquipmentJsonhalRead { /// Returns a new [EquipmentJsonhalRead] instance. EquipmentJsonhalRead({ - this.links, + required this.links, this.commissioningDate, this.lifetime, this.model, @@ -15,13 +15,13 @@ class EquipmentJsonhalRead { this.retirementDate, this.serialNumber, this.warranty, - this.id, - this.createdAt, - this.updatedAt, + required this.id, + required this.createdAt, + required this.updatedAt, this.description, required this.name, this.preferences, - this.path, + this.path = const [], this.address, }); @@ -33,7 +33,7 @@ class EquipmentJsonhalRead { } return EquipmentJsonhalRead( - links: EquipmentJsonhalReadLinks.fromJson(json[r'_links']), + links: EquipmentJsonhalReadLinks.fromJson(json[r'_links'])!, commissioningDate: mapToDateTime(json[r'commissioningDate']), lifetime: json[r'lifetime'], model: json[r'model'], @@ -42,8 +42,8 @@ class EquipmentJsonhalRead { serialNumber: json[r'serialNumber'], warranty: WarrantyJsonhalRead.fromJson(json[r'warranty']), id: json[r'id'], - createdAt: mapToDateTime(json[r'createdAt']), - updatedAt: mapToDateTime(json[r'updatedAt']), + createdAt: mapToDateTime(json[r'createdAt'])!, + updatedAt: mapToDateTime(json[r'updatedAt'])!, description: json[r'description'], name: json[r'name'], preferences: PreferencesJsonhalAssetRead.fromJson(json[r'preferences']), @@ -52,7 +52,7 @@ class EquipmentJsonhalRead { ); } - EquipmentJsonhalReadLinks? links; + EquipmentJsonhalReadLinks links; /// The date when an asset is officially put into service or operation. DateTime? commissioningDate; @@ -75,13 +75,13 @@ class EquipmentJsonhalRead { WarrantyJsonhalRead? warranty; /// The resource identifier. - final String? id; + final String id; /// The date and time when the resource was created, in UTC format. - final DateTime? createdAt; + final DateTime createdAt; /// The date and time when the resource was updated, in UTC format. - final DateTime? updatedAt; + final DateTime updatedAt; String? description; @@ -89,7 +89,7 @@ class EquipmentJsonhalRead { PreferencesJsonhalAssetRead? preferences; - final List? path; + final List path; PostalAddressJsonhalRead? address; @@ -121,7 +121,7 @@ class EquipmentJsonhalRead { @override int get hashCode => - (links == null ? 0 : links.hashCode) + + links.hashCode + (commissioningDate == null ? 0 : commissioningDate.hashCode) + (lifetime == null ? 0 : lifetime.hashCode) + (model == null ? 0 : model.hashCode) + @@ -129,13 +129,13 @@ class EquipmentJsonhalRead { (retirementDate == null ? 0 : retirementDate.hashCode) + (serialNumber == null ? 0 : serialNumber.hashCode) + (warranty == null ? 0 : warranty.hashCode) + - (id == null ? 0 : id.hashCode) + - (createdAt == null ? 0 : createdAt.hashCode) + - (updatedAt == null ? 0 : updatedAt.hashCode) + + id.hashCode + + createdAt.hashCode + + updatedAt.hashCode + (description == null ? 0 : description.hashCode) + name.hashCode + (preferences == null ? 0 : preferences.hashCode) + - (path == null ? 0 : path.hashCode) + + path.hashCode + (address == null ? 0 : address.hashCode); static List listFromJson(Iterable? json) { @@ -192,15 +192,14 @@ class EquipmentJsonhalRead { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.any((key) => RegExp(r'^links\.').hasMatch(key))) - r'_links': links?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^links\.'))) { - previousValue.add(element.split(RegExp(r'^links\.')).last); - } - - return previousValue; - })), + r'_links': links.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^links\.'))) { + previousValue.add(element.split(RegExp(r'^links\.')).last); + } + + return previousValue; + })), if (keys == null || keys.contains(r'commissioningDate')) r'commissioningDate': commissioningDate?.toUtc().toIso8601String(), if (keys == null || keys.contains(r'lifetime')) r'lifetime': lifetime, @@ -220,11 +219,9 @@ class EquipmentJsonhalRead { return previousValue; })), - if (keys == null || keys.contains(r'id')) r'id': id, - if (keys == null || keys.contains(r'createdAt')) - r'createdAt': createdAt?.toUtc().toIso8601String(), - if (keys == null || keys.contains(r'updatedAt')) - r'updatedAt': updatedAt?.toUtc().toIso8601String(), + r'id': id, + r'createdAt': createdAt.toUtc().toIso8601String(), + r'updatedAt': updatedAt.toUtc().toIso8601String(), if (keys == null || keys.contains(r'description')) r'description': description, r'name': name, @@ -238,7 +235,7 @@ class EquipmentJsonhalRead { return previousValue; })), - if (keys == null || keys.contains(r'path')) r'path': path, + r'path': path, if (keys == null || keys.any((key) => RegExp(r'^address\.').hasMatch(key))) r'address': address?.toJson(keys?.fold>([], diff --git a/dart-v3/lib/model/equipment_jsonhal_read_links.dart b/dart-v3/lib/model/equipment_jsonhal_read_links.dart index c55444d92..8bdd191b4 100644 --- a/dart-v3/lib/model/equipment_jsonhal_read_links.dart +++ b/dart-v3/lib/model/equipment_jsonhal_read_links.dart @@ -7,7 +7,7 @@ part of keyclic_sdk_api_platform; class EquipmentJsonhalReadLinks { /// Returns a new [EquipmentJsonhalReadLinks] instance. EquipmentJsonhalReadLinks({ - this.self, + required this.self, this.brand, this.type, this.parent, @@ -22,7 +22,7 @@ class EquipmentJsonhalReadLinks { } return EquipmentJsonhalReadLinks( - self: GetPlaceCollection200ResponseLinksSelf.fromJson(json[r'self']), + self: GetPlaceCollection200ResponseLinksSelf.fromJson(json[r'self'])!, brand: GetPlaceCollection200ResponseLinksFirst.fromJson(json[r'brand']), type: GetPlaceCollection200ResponseLinksFirst.fromJson(json[r'type']), parent: GetPlaceCollection200ResponseLinksFirst.fromJson(json[r'parent']), @@ -30,7 +30,7 @@ class EquipmentJsonhalReadLinks { ); } - GetPlaceCollection200ResponseLinksSelf? self; + GetPlaceCollection200ResponseLinksSelf self; GetPlaceCollection200ResponseLinksFirst? brand; @@ -57,7 +57,7 @@ class EquipmentJsonhalReadLinks { @override int get hashCode => - (self == null ? 0 : self.hashCode) + + self.hashCode + (brand == null ? 0 : brand.hashCode) + (type == null ? 0 : type.hashCode) + (parent == null ? 0 : parent.hashCode) + @@ -117,15 +117,14 @@ class EquipmentJsonhalReadLinks { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.any((key) => RegExp(r'^self\.').hasMatch(key))) - r'self': self?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^self\.'))) { - previousValue.add(element.split(RegExp(r'^self\.')).last); - } - - return previousValue; - })), + r'self': self.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^self\.'))) { + previousValue.add(element.split(RegExp(r'^self\.')).last); + } + + return previousValue; + })), if (keys == null || keys.any((key) => RegExp(r'^brand\.').hasMatch(key))) r'brand': brand?.toJson(keys?.fold>([], (List previousValue, String element) { diff --git a/dart-v3/lib/model/export_jsonhal_read.dart b/dart-v3/lib/model/export_jsonhal_read.dart index 04530823f..15e38e4b2 100644 --- a/dart-v3/lib/model/export_jsonhal_read.dart +++ b/dart-v3/lib/model/export_jsonhal_read.dart @@ -7,16 +7,16 @@ part of keyclic_sdk_api_platform; class ExportJsonhalRead { /// Returns a new [ExportJsonhalRead] instance. ExportJsonhalRead({ - this.links, - this.id, + required this.links, + required this.id, this.contentType = const ExportJsonhalReadContentTypeEnum._('application/vnd.ms-excel'), this.downloadUrl, - this.expiredAt, + required this.expiredAt, this.groupBy, - this.name, - this.createdAt, - this.updatedAt, + required this.name, + required this.createdAt, + required this.updatedAt, }); /// Returns a new [ExportJsonhalRead] instance and imports its values from @@ -27,39 +27,39 @@ class ExportJsonhalRead { } return ExportJsonhalRead( - links: AssetTypeJsonhalReadLinks.fromJson(json[r'_links']), + links: AssetTypeJsonhalReadLinks.fromJson(json[r'_links'])!, id: json[r'id'], contentType: ExportJsonhalReadContentTypeEnum.fromJson(json[r'contentType'])!, downloadUrl: json[r'downloadUrl'], - expiredAt: mapToDateTime(json[r'expiredAt']), + expiredAt: mapToDateTime(json[r'expiredAt'])!, groupBy: ExportJsonhalReadGroupByEnum.fromJson(json[r'groupBy']), name: json[r'name'], - createdAt: mapToDateTime(json[r'createdAt']), - updatedAt: mapToDateTime(json[r'updatedAt']), + createdAt: mapToDateTime(json[r'createdAt'])!, + updatedAt: mapToDateTime(json[r'updatedAt'])!, ); } - AssetTypeJsonhalReadLinks? links; + AssetTypeJsonhalReadLinks links; /// The resource identifier. - final String? id; + final String id; ExportJsonhalReadContentTypeEnum contentType; String? downloadUrl; - final DateTime? expiredAt; + final DateTime expiredAt; ExportJsonhalReadGroupByEnum? groupBy; - String? name; + String name; /// The date and time when the resource was created, in UTC format. - final DateTime? createdAt; + final DateTime createdAt; /// The date and time when the resource was updated, in UTC format. - final DateTime? updatedAt; + final DateTime updatedAt; @override bool operator ==(Object other) { @@ -82,15 +82,15 @@ class ExportJsonhalRead { @override int get hashCode => - (links == null ? 0 : links.hashCode) + - (id == null ? 0 : id.hashCode) + + links.hashCode + + id.hashCode + contentType.hashCode + (downloadUrl == null ? 0 : downloadUrl.hashCode) + - (expiredAt == null ? 0 : expiredAt.hashCode) + + expiredAt.hashCode + (groupBy == null ? 0 : groupBy.hashCode) + - (name == null ? 0 : name.hashCode) + - (createdAt == null ? 0 : createdAt.hashCode) + - (updatedAt == null ? 0 : updatedAt.hashCode); + name.hashCode + + createdAt.hashCode + + updatedAt.hashCode; static List listFromJson(Iterable? json) { if (json == null) { @@ -145,27 +145,23 @@ class ExportJsonhalRead { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.any((key) => RegExp(r'^links\.').hasMatch(key))) - r'_links': links?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^links\.'))) { - previousValue.add(element.split(RegExp(r'^links\.')).last); - } - - return previousValue; - })), - if (keys == null || keys.contains(r'id')) r'id': id, + r'_links': links.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^links\.'))) { + previousValue.add(element.split(RegExp(r'^links\.')).last); + } + + return previousValue; + })), + r'id': id, r'contentType': contentType, if (keys == null || keys.contains(r'downloadUrl')) r'downloadUrl': downloadUrl, - if (keys == null || keys.contains(r'expiredAt')) - r'expiredAt': expiredAt?.toUtc().toIso8601String(), + r'expiredAt': expiredAt.toUtc().toIso8601String(), if (keys == null || keys.contains(r'groupBy')) r'groupBy': groupBy, - if (keys == null || keys.contains(r'name')) r'name': name, - if (keys == null || keys.contains(r'createdAt')) - r'createdAt': createdAt?.toUtc().toIso8601String(), - if (keys == null || keys.contains(r'updatedAt')) - r'updatedAt': updatedAt?.toUtc().toIso8601String(), + r'name': name, + r'createdAt': createdAt.toUtc().toIso8601String(), + r'updatedAt': updatedAt.toUtc().toIso8601String(), }; } } diff --git a/dart-v3/lib/model/export_read.dart b/dart-v3/lib/model/export_read.dart index 97e05ac54..004e5b528 100644 --- a/dart-v3/lib/model/export_read.dart +++ b/dart-v3/lib/model/export_read.dart @@ -7,15 +7,15 @@ part of keyclic_sdk_api_platform; class ExportRead { /// Returns a new [ExportRead] instance. ExportRead({ - this.id, + required this.id, this.contentType = const ExportReadContentTypeEnum._('application/vnd.ms-excel'), this.downloadUrl, - this.expiredAt, + required this.expiredAt, this.groupBy, - this.name, - this.createdAt, - this.updatedAt, + required this.name, + required this.createdAt, + required this.updatedAt, }); /// Returns a new [ExportRead] instance and imports its values from @@ -29,32 +29,32 @@ class ExportRead { id: json[r'id'], contentType: ExportReadContentTypeEnum.fromJson(json[r'contentType'])!, downloadUrl: json[r'downloadUrl'], - expiredAt: mapToDateTime(json[r'expiredAt']), + expiredAt: mapToDateTime(json[r'expiredAt'])!, groupBy: ExportReadGroupByEnum.fromJson(json[r'groupBy']), name: json[r'name'], - createdAt: mapToDateTime(json[r'createdAt']), - updatedAt: mapToDateTime(json[r'updatedAt']), + createdAt: mapToDateTime(json[r'createdAt'])!, + updatedAt: mapToDateTime(json[r'updatedAt'])!, ); } /// The resource identifier. - final String? id; + final String id; ExportReadContentTypeEnum contentType; String? downloadUrl; - final DateTime? expiredAt; + final DateTime expiredAt; ExportReadGroupByEnum? groupBy; - String? name; + String name; /// The date and time when the resource was created, in UTC format. - final DateTime? createdAt; + final DateTime createdAt; /// The date and time when the resource was updated, in UTC format. - final DateTime? updatedAt; + final DateTime updatedAt; @override bool operator ==(Object other) { @@ -76,14 +76,14 @@ class ExportRead { @override int get hashCode => - (id == null ? 0 : id.hashCode) + + id.hashCode + contentType.hashCode + (downloadUrl == null ? 0 : downloadUrl.hashCode) + - (expiredAt == null ? 0 : expiredAt.hashCode) + + expiredAt.hashCode + (groupBy == null ? 0 : groupBy.hashCode) + - (name == null ? 0 : name.hashCode) + - (createdAt == null ? 0 : createdAt.hashCode) + - (updatedAt == null ? 0 : updatedAt.hashCode); + name.hashCode + + createdAt.hashCode + + updatedAt.hashCode; static List listFromJson(Iterable? json) { if (json == null) { @@ -135,18 +135,15 @@ class ExportRead { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.contains(r'id')) r'id': id, + r'id': id, r'contentType': contentType, if (keys == null || keys.contains(r'downloadUrl')) r'downloadUrl': downloadUrl, - if (keys == null || keys.contains(r'expiredAt')) - r'expiredAt': expiredAt?.toUtc().toIso8601String(), + r'expiredAt': expiredAt.toUtc().toIso8601String(), if (keys == null || keys.contains(r'groupBy')) r'groupBy': groupBy, - if (keys == null || keys.contains(r'name')) r'name': name, - if (keys == null || keys.contains(r'createdAt')) - r'createdAt': createdAt?.toUtc().toIso8601String(), - if (keys == null || keys.contains(r'updatedAt')) - r'updatedAt': updatedAt?.toUtc().toIso8601String(), + r'name': name, + r'createdAt': createdAt.toUtc().toIso8601String(), + r'updatedAt': updatedAt.toUtc().toIso8601String(), }; } } diff --git a/dart-v3/lib/model/feedback_jsongeo_read.dart b/dart-v3/lib/model/feedback_jsongeo_read.dart index 2b1b217f9..a0150253a 100644 --- a/dart-v3/lib/model/feedback_jsongeo_read.dart +++ b/dart-v3/lib/model/feedback_jsongeo_read.dart @@ -9,13 +9,13 @@ class FeedbackJsongeoRead { FeedbackJsongeoRead({ this.description, this.geoCoordinates, - this.markers, + this.markers = const [], this.metadata, this.reporter, required this.visibility, - this.id, - this.createdAt, - this.updatedAt, + required this.id, + required this.createdAt, + required this.updatedAt, }); /// Returns a new [FeedbackJsongeoRead] instance and imports its values from @@ -35,10 +35,10 @@ class FeedbackJsongeoRead { : Map.from(json[r'metadata']), reporter: json[r'reporter'], visibility: - FeedbackJsongeoReadVisibilityEnum.fromJson(json[r'visibility'])!, + FeedbackJsongeoReadVisibilityEnum.fromJson(json[r'visibility']), id: json[r'id'], - createdAt: mapToDateTime(json[r'createdAt']), - updatedAt: mapToDateTime(json[r'updatedAt']), + createdAt: mapToDateTime(json[r'createdAt'])!, + updatedAt: mapToDateTime(json[r'updatedAt'])!, ); } @@ -46,22 +46,22 @@ class FeedbackJsongeoRead { GeoCoordinatesJsongeoRead? geoCoordinates; - final List? markers; + final List markers; Map? metadata; String? reporter; - FeedbackJsongeoReadVisibilityEnum visibility; + FeedbackJsongeoReadVisibilityEnum? visibility; /// The resource identifier. - final String? id; + final String id; /// The date and time when the resource was created, in UTC format. - final DateTime? createdAt; + final DateTime createdAt; /// The date and time when the resource was updated, in UTC format. - final DateTime? updatedAt; + final DateTime updatedAt; @override bool operator ==(Object other) { @@ -86,13 +86,13 @@ class FeedbackJsongeoRead { int get hashCode => (description == null ? 0 : description.hashCode) + (geoCoordinates == null ? 0 : geoCoordinates.hashCode) + - (markers == null ? 0 : markers.hashCode) + + markers.hashCode + (metadata == null ? 0 : metadata.hashCode) + (reporter == null ? 0 : reporter.hashCode) + - visibility.hashCode + - (id == null ? 0 : id.hashCode) + - (createdAt == null ? 0 : createdAt.hashCode) + - (updatedAt == null ? 0 : updatedAt.hashCode); + (visibility == null ? 0 : visibility.hashCode) + + id.hashCode + + createdAt.hashCode + + updatedAt.hashCode; static List listFromJson(Iterable? json) { if (json == null) { @@ -159,15 +159,14 @@ class FeedbackJsongeoRead { return previousValue; })), - if (keys == null || keys.contains(r'markers')) r'markers': markers, + r'markers': markers, if (keys == null || keys.contains(r'metadata')) r'metadata': metadata, if (keys == null || keys.contains(r'reporter')) r'reporter': reporter, - r'visibility': visibility, - if (keys == null || keys.contains(r'id')) r'id': id, - if (keys == null || keys.contains(r'createdAt')) - r'createdAt': createdAt?.toUtc().toIso8601String(), - if (keys == null || keys.contains(r'updatedAt')) - r'updatedAt': updatedAt?.toUtc().toIso8601String(), + if (keys == null || keys.contains(r'visibility')) + r'visibility': visibility, + r'id': id, + r'createdAt': createdAt.toUtc().toIso8601String(), + r'updatedAt': updatedAt.toUtc().toIso8601String(), }; } } diff --git a/dart-v3/lib/model/feedback_jsonhal_read.dart b/dart-v3/lib/model/feedback_jsonhal_read.dart index 38a579407..ab81bc592 100644 --- a/dart-v3/lib/model/feedback_jsonhal_read.dart +++ b/dart-v3/lib/model/feedback_jsonhal_read.dart @@ -7,15 +7,15 @@ part of keyclic_sdk_api_platform; class FeedbackJsonhalRead { /// Returns a new [FeedbackJsonhalRead] instance. FeedbackJsonhalRead({ - this.links, + required this.links, this.description, this.geoCoordinates, - this.markers, + this.markers = const [], this.metadata, required this.visibility, - this.id, - this.createdAt, - this.updatedAt, + required this.id, + required this.createdAt, + required this.updatedAt, }); /// Returns a new [FeedbackJsonhalRead] instance and imports its values from @@ -26,7 +26,7 @@ class FeedbackJsonhalRead { } return FeedbackJsonhalRead( - links: FeedbackJsonhalReadLinks.fromJson(json[r'_links']), + links: FeedbackJsonhalReadLinks.fromJson(json[r'_links'])!, description: json[r'description'], geoCoordinates: GeoCoordinatesJsonhalRead.fromJson(json[r'geoCoordinates']), @@ -35,33 +35,33 @@ class FeedbackJsonhalRead { ? null : Map.from(json[r'metadata']), visibility: - FeedbackJsonhalReadVisibilityEnum.fromJson(json[r'visibility'])!, + FeedbackJsonhalReadVisibilityEnum.fromJson(json[r'visibility']), id: json[r'id'], - createdAt: mapToDateTime(json[r'createdAt']), - updatedAt: mapToDateTime(json[r'updatedAt']), + createdAt: mapToDateTime(json[r'createdAt'])!, + updatedAt: mapToDateTime(json[r'updatedAt'])!, ); } - FeedbackJsonhalReadLinks? links; + FeedbackJsonhalReadLinks links; String? description; GeoCoordinatesJsonhalRead? geoCoordinates; - final List? markers; + final List markers; Map? metadata; - FeedbackJsonhalReadVisibilityEnum visibility; + FeedbackJsonhalReadVisibilityEnum? visibility; /// The resource identifier. - final String? id; + final String id; /// The date and time when the resource was created, in UTC format. - final DateTime? createdAt; + final DateTime createdAt; /// The date and time when the resource was updated, in UTC format. - final DateTime? updatedAt; + final DateTime updatedAt; @override bool operator ==(Object other) { @@ -84,15 +84,15 @@ class FeedbackJsonhalRead { @override int get hashCode => - (links == null ? 0 : links.hashCode) + + links.hashCode + (description == null ? 0 : description.hashCode) + (geoCoordinates == null ? 0 : geoCoordinates.hashCode) + - (markers == null ? 0 : markers.hashCode) + + markers.hashCode + (metadata == null ? 0 : metadata.hashCode) + - visibility.hashCode + - (id == null ? 0 : id.hashCode) + - (createdAt == null ? 0 : createdAt.hashCode) + - (updatedAt == null ? 0 : updatedAt.hashCode); + (visibility == null ? 0 : visibility.hashCode) + + id.hashCode + + createdAt.hashCode + + updatedAt.hashCode; static List listFromJson(Iterable? json) { if (json == null) { @@ -147,15 +147,14 @@ class FeedbackJsonhalRead { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.any((key) => RegExp(r'^links\.').hasMatch(key))) - r'_links': links?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^links\.'))) { - previousValue.add(element.split(RegExp(r'^links\.')).last); - } + r'_links': links.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^links\.'))) { + previousValue.add(element.split(RegExp(r'^links\.')).last); + } - return previousValue; - })), + return previousValue; + })), if (keys == null || keys.contains(r'description')) r'description': description, if (keys == null || @@ -168,14 +167,13 @@ class FeedbackJsonhalRead { return previousValue; })), - if (keys == null || keys.contains(r'markers')) r'markers': markers, + r'markers': markers, if (keys == null || keys.contains(r'metadata')) r'metadata': metadata, - r'visibility': visibility, - if (keys == null || keys.contains(r'id')) r'id': id, - if (keys == null || keys.contains(r'createdAt')) - r'createdAt': createdAt?.toUtc().toIso8601String(), - if (keys == null || keys.contains(r'updatedAt')) - r'updatedAt': updatedAt?.toUtc().toIso8601String(), + if (keys == null || keys.contains(r'visibility')) + r'visibility': visibility, + r'id': id, + r'createdAt': createdAt.toUtc().toIso8601String(), + r'updatedAt': updatedAt.toUtc().toIso8601String(), }; } } diff --git a/dart-v3/lib/model/feedback_jsonhal_read_links.dart b/dart-v3/lib/model/feedback_jsonhal_read_links.dart index e0494dc77..2e2a4a148 100644 --- a/dart-v3/lib/model/feedback_jsonhal_read_links.dart +++ b/dart-v3/lib/model/feedback_jsonhal_read_links.dart @@ -7,7 +7,7 @@ part of keyclic_sdk_api_platform; class FeedbackJsonhalReadLinks { /// Returns a new [FeedbackJsonhalReadLinks] instance. FeedbackJsonhalReadLinks({ - this.self, + required this.self, this.reporter, }); @@ -19,13 +19,13 @@ class FeedbackJsonhalReadLinks { } return FeedbackJsonhalReadLinks( - self: GetPlaceCollection200ResponseLinksSelf.fromJson(json[r'self']), + self: GetPlaceCollection200ResponseLinksSelf.fromJson(json[r'self'])!, reporter: GetPlaceCollection200ResponseLinksFirst.fromJson(json[r'reporter']), ); } - GetPlaceCollection200ResponseLinksSelf? self; + GetPlaceCollection200ResponseLinksSelf self; GetPlaceCollection200ResponseLinksFirst? reporter; @@ -43,8 +43,7 @@ class FeedbackJsonhalReadLinks { @override int get hashCode => - (self == null ? 0 : self.hashCode) + - (reporter == null ? 0 : reporter.hashCode); + self.hashCode + (reporter == null ? 0 : reporter.hashCode); static List listFromJson(Iterable? json) { if (json == null) { @@ -100,15 +99,14 @@ class FeedbackJsonhalReadLinks { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.any((key) => RegExp(r'^self\.').hasMatch(key))) - r'self': self?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^self\.'))) { - previousValue.add(element.split(RegExp(r'^self\.')).last); - } - - return previousValue; - })), + r'self': self.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^self\.'))) { + previousValue.add(element.split(RegExp(r'^self\.')).last); + } + + return previousValue; + })), if (keys == null || keys.any((key) => RegExp(r'^reporter\.').hasMatch(key))) r'reporter': reporter?.toJson(keys?.fold>([], diff --git a/dart-v3/lib/model/form_jsonhal_organization_preference_read.dart b/dart-v3/lib/model/form_jsonhal_organization_preference_read.dart index 411856edd..d450b93f8 100644 --- a/dart-v3/lib/model/form_jsonhal_organization_preference_read.dart +++ b/dart-v3/lib/model/form_jsonhal_organization_preference_read.dart @@ -7,9 +7,9 @@ part of keyclic_sdk_api_platform; class FormJsonhalOrganizationPreferenceRead { /// Returns a new [FormJsonhalOrganizationPreferenceRead] instance. FormJsonhalOrganizationPreferenceRead({ - this.contract, + required this.contract, this.hidden, - this.manualDispatch, + this.manualDispatch = true, this.required_, }); @@ -32,12 +32,12 @@ class FormJsonhalOrganizationPreferenceRead { } /// Allow authorized user to provide a contract on feedback form. - bool? contract; + bool contract; List? hidden; /// Allow authorized user to provide a service to dispatch to on feedback form. - bool? manualDispatch; + bool manualDispatch; List? required_; @@ -57,9 +57,9 @@ class FormJsonhalOrganizationPreferenceRead { @override int get hashCode => - (contract == null ? 0 : contract.hashCode) + + contract.hashCode + (hidden == null ? 0 : hidden.hashCode) + - (manualDispatch == null ? 0 : manualDispatch.hashCode) + + manualDispatch.hashCode + (required_ == null ? 0 : required_.hashCode); static List listFromJson( @@ -118,10 +118,9 @@ class FormJsonhalOrganizationPreferenceRead { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.contains(r'contract')) r'contract': contract, + r'contract': contract, if (keys == null || keys.contains(r'hidden')) r'hidden': hidden, - if (keys == null || keys.contains(r'manualDispatch')) - r'manualDispatch': manualDispatch, + r'manualDispatch': manualDispatch, if (keys == null || keys.contains(r'required_')) r'required': required_, }; } diff --git a/dart-v3/lib/model/geo_coordinates_jsongeo_read.dart b/dart-v3/lib/model/geo_coordinates_jsongeo_read.dart index c0cb3f78c..b220637bd 100644 --- a/dart-v3/lib/model/geo_coordinates_jsongeo_read.dart +++ b/dart-v3/lib/model/geo_coordinates_jsongeo_read.dart @@ -8,7 +8,7 @@ class GeoCoordinatesJsongeoRead { /// Returns a new [GeoCoordinatesJsongeoRead] instance. GeoCoordinatesJsongeoRead({ this.elevation, - this.point, + required this.point, }); /// Returns a new [GeoCoordinatesJsongeoRead] instance and imports its values from @@ -21,7 +21,7 @@ class GeoCoordinatesJsongeoRead { return GeoCoordinatesJsongeoRead( elevation: json[r'elevation'] == null ? null : json[r'elevation'].toDouble(), - point: PointJsongeoRead.fromJson(json[r'point']), + point: PointJsongeoRead.fromJson(json[r'point'])!, ); } @@ -30,7 +30,7 @@ class GeoCoordinatesJsongeoRead { // maximum: 8000 num? elevation; - PointJsongeoRead? point; + PointJsongeoRead point; @override bool operator ==(Object other) { @@ -46,8 +46,7 @@ class GeoCoordinatesJsongeoRead { @override int get hashCode => - (elevation == null ? 0 : elevation.hashCode) + - (point == null ? 0 : point.hashCode); + (elevation == null ? 0 : elevation.hashCode) + point.hashCode; static List listFromJson(Iterable? json) { if (json == null) { @@ -104,15 +103,14 @@ class GeoCoordinatesJsongeoRead { Map toJson([Iterable? keys]) { return { if (keys == null || keys.contains(r'elevation')) r'elevation': elevation, - if (keys == null || keys.any((key) => RegExp(r'^point\.').hasMatch(key))) - r'point': point?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^point\.'))) { - previousValue.add(element.split(RegExp(r'^point\.')).last); - } - - return previousValue; - })), + r'point': point.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^point\.'))) { + previousValue.add(element.split(RegExp(r'^point\.')).last); + } + + return previousValue; + })), }; } } diff --git a/dart-v3/lib/model/geo_coordinates_jsonhal_read.dart b/dart-v3/lib/model/geo_coordinates_jsonhal_read.dart index e87055940..40ff9e984 100644 --- a/dart-v3/lib/model/geo_coordinates_jsonhal_read.dart +++ b/dart-v3/lib/model/geo_coordinates_jsonhal_read.dart @@ -8,7 +8,7 @@ class GeoCoordinatesJsonhalRead { /// Returns a new [GeoCoordinatesJsonhalRead] instance. GeoCoordinatesJsonhalRead({ this.elevation, - this.point, + required this.point, }); /// Returns a new [GeoCoordinatesJsonhalRead] instance and imports its values from @@ -21,7 +21,7 @@ class GeoCoordinatesJsonhalRead { return GeoCoordinatesJsonhalRead( elevation: json[r'elevation'] == null ? null : json[r'elevation'].toDouble(), - point: PointJsonhalRead.fromJson(json[r'point']), + point: PointJsonhalRead.fromJson(json[r'point'])!, ); } @@ -30,7 +30,7 @@ class GeoCoordinatesJsonhalRead { // maximum: 8000 num? elevation; - PointJsonhalRead? point; + PointJsonhalRead point; @override bool operator ==(Object other) { @@ -46,8 +46,7 @@ class GeoCoordinatesJsonhalRead { @override int get hashCode => - (elevation == null ? 0 : elevation.hashCode) + - (point == null ? 0 : point.hashCode); + (elevation == null ? 0 : elevation.hashCode) + point.hashCode; static List listFromJson(Iterable? json) { if (json == null) { @@ -104,15 +103,14 @@ class GeoCoordinatesJsonhalRead { Map toJson([Iterable? keys]) { return { if (keys == null || keys.contains(r'elevation')) r'elevation': elevation, - if (keys == null || keys.any((key) => RegExp(r'^point\.').hasMatch(key))) - r'point': point?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^point\.'))) { - previousValue.add(element.split(RegExp(r'^point\.')).last); - } - - return previousValue; - })), + r'point': point.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^point\.'))) { + previousValue.add(element.split(RegExp(r'^point\.')).last); + } + + return previousValue; + })), }; } } diff --git a/dart-v3/lib/model/get_asset_collection200_response.dart b/dart-v3/lib/model/get_asset_collection200_response.dart index 1a8e6f8b2..e8f32e126 100644 --- a/dart-v3/lib/model/get_asset_collection200_response.dart +++ b/dart-v3/lib/model/get_asset_collection200_response.dart @@ -8,7 +8,7 @@ class GetAssetCollection200Response { /// Returns a new [GetAssetCollection200Response] instance. GetAssetCollection200Response({ this.embedded, - this.totalItems, + required this.totalItems, this.itemsPerPage, required this.links, }); @@ -32,7 +32,7 @@ class GetAssetCollection200Response { GetAssetCollection200ResponseEmbedded? embedded; // minimum: 0 - int? totalItems; + int totalItems; // minimum: 0 int? itemsPerPage; @@ -56,7 +56,7 @@ class GetAssetCollection200Response { @override int get hashCode => (embedded == null ? 0 : embedded.hashCode) + - (totalItems == null ? 0 : totalItems.hashCode) + + totalItems.hashCode + (itemsPerPage == null ? 0 : itemsPerPage.hashCode) + links.hashCode; @@ -124,8 +124,7 @@ class GetAssetCollection200Response { return previousValue; })), - if (keys == null || keys.contains(r'totalItems')) - r'totalItems': totalItems, + r'totalItems': totalItems, if (keys == null || keys.contains(r'itemsPerPage')) r'itemsPerPage': itemsPerPage, r'_links': links.toJson(keys?.fold>([], diff --git a/dart-v3/lib/model/get_asset_type_collection200_response.dart b/dart-v3/lib/model/get_asset_type_collection200_response.dart index 5c990c269..bca68db31 100644 --- a/dart-v3/lib/model/get_asset_type_collection200_response.dart +++ b/dart-v3/lib/model/get_asset_type_collection200_response.dart @@ -8,7 +8,7 @@ class GetAssetTypeCollection200Response { /// Returns a new [GetAssetTypeCollection200Response] instance. GetAssetTypeCollection200Response({ this.embedded, - this.totalItems, + required this.totalItems, this.itemsPerPage, required this.links, }); @@ -32,7 +32,7 @@ class GetAssetTypeCollection200Response { GetAssetTypeCollection200ResponseEmbedded? embedded; // minimum: 0 - int? totalItems; + int totalItems; // minimum: 0 int? itemsPerPage; @@ -56,7 +56,7 @@ class GetAssetTypeCollection200Response { @override int get hashCode => (embedded == null ? 0 : embedded.hashCode) + - (totalItems == null ? 0 : totalItems.hashCode) + + totalItems.hashCode + (itemsPerPage == null ? 0 : itemsPerPage.hashCode) + links.hashCode; @@ -125,8 +125,7 @@ class GetAssetTypeCollection200Response { return previousValue; })), - if (keys == null || keys.contains(r'totalItems')) - r'totalItems': totalItems, + r'totalItems': totalItems, if (keys == null || keys.contains(r'itemsPerPage')) r'itemsPerPage': itemsPerPage, r'_links': links.toJson(keys?.fold>([], diff --git a/dart-v3/lib/model/get_auth_token200_response.dart b/dart-v3/lib/model/get_auth_token200_response.dart index 22bbde765..24cd6ccfd 100644 --- a/dart-v3/lib/model/get_auth_token200_response.dart +++ b/dart-v3/lib/model/get_auth_token200_response.dart @@ -7,9 +7,9 @@ part of keyclic_sdk_api_platform; class GetAuthToken200Response { /// Returns a new [GetAuthToken200Response] instance. GetAuthToken200Response({ - this.accessToken, - this.idToken, - this.tokenType, + required this.accessToken, + required this.idToken, + this.tokenType = 'Bearer', }); /// Returns a new [GetAuthToken200Response] instance and imports its values from @@ -26,11 +26,11 @@ class GetAuthToken200Response { ); } - String? accessToken; + String accessToken; - String? idToken; + String idToken; - String? tokenType; + String tokenType; @override bool operator ==(Object other) { @@ -47,9 +47,7 @@ class GetAuthToken200Response { @override int get hashCode => - (accessToken == null ? 0 : accessToken.hashCode) + - (idToken == null ? 0 : idToken.hashCode) + - (tokenType == null ? 0 : tokenType.hashCode); + accessToken.hashCode + idToken.hashCode + tokenType.hashCode; static List listFromJson(Iterable? json) { if (json == null) { @@ -105,10 +103,9 @@ class GetAuthToken200Response { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.contains(r'accessToken')) - r'accessToken': accessToken, - if (keys == null || keys.contains(r'idToken')) r'idToken': idToken, - if (keys == null || keys.contains(r'tokenType')) r'tokenType': tokenType, + r'accessToken': accessToken, + r'idToken': idToken, + r'tokenType': tokenType, }; } } diff --git a/dart-v3/lib/model/get_auth_token_request.dart b/dart-v3/lib/model/get_auth_token_request.dart index 5ba92c583..615bdae5d 100644 --- a/dart-v3/lib/model/get_auth_token_request.dart +++ b/dart-v3/lib/model/get_auth_token_request.dart @@ -7,8 +7,8 @@ part of keyclic_sdk_api_platform; class GetAuthTokenRequest { /// Returns a new [GetAuthTokenRequest] instance. GetAuthTokenRequest({ - this.grantType, - this.idToken, + required this.grantType, + required this.idToken, }); /// Returns a new [GetAuthTokenRequest] instance and imports its values from @@ -19,14 +19,14 @@ class GetAuthTokenRequest { } return GetAuthTokenRequest( - grantType: GetAuthTokenRequestGrantTypeEnum.fromJson(json[r'grantType']), + grantType: GetAuthTokenRequestGrantTypeEnum.fromJson(json[r'grantType'])!, idToken: json[r'idToken'], ); } - GetAuthTokenRequestGrantTypeEnum? grantType; + GetAuthTokenRequestGrantTypeEnum grantType; - String? idToken; + String idToken; @override bool operator ==(Object other) { @@ -41,9 +41,7 @@ class GetAuthTokenRequest { } @override - int get hashCode => - (grantType == null ? 0 : grantType.hashCode) + - (idToken == null ? 0 : idToken.hashCode); + int get hashCode => grantType.hashCode + idToken.hashCode; static List listFromJson(Iterable? json) { if (json == null) { @@ -98,8 +96,8 @@ class GetAuthTokenRequest { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.contains(r'grantType')) r'grantType': grantType, - if (keys == null || keys.contains(r'idToken')) r'idToken': idToken, + r'grantType': grantType, + r'idToken': idToken, }; } } diff --git a/dart-v3/lib/model/get_bookmark_collection200_response.dart b/dart-v3/lib/model/get_bookmark_collection200_response.dart index b1e06ef4e..8cb695e0d 100644 --- a/dart-v3/lib/model/get_bookmark_collection200_response.dart +++ b/dart-v3/lib/model/get_bookmark_collection200_response.dart @@ -8,7 +8,7 @@ class GetBookmarkCollection200Response { /// Returns a new [GetBookmarkCollection200Response] instance. GetBookmarkCollection200Response({ this.embedded, - this.totalItems, + required this.totalItems, this.itemsPerPage, required this.links, }); @@ -32,7 +32,7 @@ class GetBookmarkCollection200Response { GetBookmarkCollection200ResponseEmbedded? embedded; // minimum: 0 - int? totalItems; + int totalItems; // minimum: 0 int? itemsPerPage; @@ -56,7 +56,7 @@ class GetBookmarkCollection200Response { @override int get hashCode => (embedded == null ? 0 : embedded.hashCode) + - (totalItems == null ? 0 : totalItems.hashCode) + + totalItems.hashCode + (itemsPerPage == null ? 0 : itemsPerPage.hashCode) + links.hashCode; @@ -124,8 +124,7 @@ class GetBookmarkCollection200Response { return previousValue; })), - if (keys == null || keys.contains(r'totalItems')) - r'totalItems': totalItems, + r'totalItems': totalItems, if (keys == null || keys.contains(r'itemsPerPage')) r'itemsPerPage': itemsPerPage, r'_links': links.toJson(keys?.fold>([], diff --git a/dart-v3/lib/model/get_brand_collection200_response.dart b/dart-v3/lib/model/get_brand_collection200_response.dart index dce782c84..46028e207 100644 --- a/dart-v3/lib/model/get_brand_collection200_response.dart +++ b/dart-v3/lib/model/get_brand_collection200_response.dart @@ -8,7 +8,7 @@ class GetBrandCollection200Response { /// Returns a new [GetBrandCollection200Response] instance. GetBrandCollection200Response({ this.embedded, - this.totalItems, + required this.totalItems, this.itemsPerPage, required this.links, }); @@ -32,7 +32,7 @@ class GetBrandCollection200Response { GetBrandCollection200ResponseEmbedded? embedded; // minimum: 0 - int? totalItems; + int totalItems; // minimum: 0 int? itemsPerPage; @@ -56,7 +56,7 @@ class GetBrandCollection200Response { @override int get hashCode => (embedded == null ? 0 : embedded.hashCode) + - (totalItems == null ? 0 : totalItems.hashCode) + + totalItems.hashCode + (itemsPerPage == null ? 0 : itemsPerPage.hashCode) + links.hashCode; @@ -124,8 +124,7 @@ class GetBrandCollection200Response { return previousValue; })), - if (keys == null || keys.contains(r'totalItems')) - r'totalItems': totalItems, + r'totalItems': totalItems, if (keys == null || keys.contains(r'itemsPerPage')) r'itemsPerPage': itemsPerPage, r'_links': links.toJson(keys?.fold>([], diff --git a/dart-v3/lib/model/get_business_hours_collection200_response.dart b/dart-v3/lib/model/get_business_hours_collection200_response.dart index dd17df289..03c0dd74e 100644 --- a/dart-v3/lib/model/get_business_hours_collection200_response.dart +++ b/dart-v3/lib/model/get_business_hours_collection200_response.dart @@ -8,7 +8,7 @@ class GetBusinessHoursCollection200Response { /// Returns a new [GetBusinessHoursCollection200Response] instance. GetBusinessHoursCollection200Response({ this.embedded, - this.totalItems, + required this.totalItems, this.itemsPerPage, required this.links, }); @@ -32,7 +32,7 @@ class GetBusinessHoursCollection200Response { GetBusinessHoursCollection200ResponseEmbedded? embedded; // minimum: 0 - int? totalItems; + int totalItems; // minimum: 0 int? itemsPerPage; @@ -56,7 +56,7 @@ class GetBusinessHoursCollection200Response { @override int get hashCode => (embedded == null ? 0 : embedded.hashCode) + - (totalItems == null ? 0 : totalItems.hashCode) + + totalItems.hashCode + (itemsPerPage == null ? 0 : itemsPerPage.hashCode) + links.hashCode; @@ -126,8 +126,7 @@ class GetBusinessHoursCollection200Response { return previousValue; })), - if (keys == null || keys.contains(r'totalItems')) - r'totalItems': totalItems, + r'totalItems': totalItems, if (keys == null || keys.contains(r'itemsPerPage')) r'itemsPerPage': itemsPerPage, r'_links': links.toJson(keys?.fold>([], diff --git a/dart-v3/lib/model/get_category_collection200_response.dart b/dart-v3/lib/model/get_category_collection200_response.dart index 0a8a9b95c..b5f7e125e 100644 --- a/dart-v3/lib/model/get_category_collection200_response.dart +++ b/dart-v3/lib/model/get_category_collection200_response.dart @@ -8,7 +8,7 @@ class GetCategoryCollection200Response { /// Returns a new [GetCategoryCollection200Response] instance. GetCategoryCollection200Response({ this.embedded, - this.totalItems, + required this.totalItems, this.itemsPerPage, required this.links, }); @@ -32,7 +32,7 @@ class GetCategoryCollection200Response { GetCategoryCollection200ResponseEmbedded? embedded; // minimum: 0 - int? totalItems; + int totalItems; // minimum: 0 int? itemsPerPage; @@ -56,7 +56,7 @@ class GetCategoryCollection200Response { @override int get hashCode => (embedded == null ? 0 : embedded.hashCode) + - (totalItems == null ? 0 : totalItems.hashCode) + + totalItems.hashCode + (itemsPerPage == null ? 0 : itemsPerPage.hashCode) + links.hashCode; @@ -124,8 +124,7 @@ class GetCategoryCollection200Response { return previousValue; })), - if (keys == null || keys.contains(r'totalItems')) - r'totalItems': totalItems, + r'totalItems': totalItems, if (keys == null || keys.contains(r'itemsPerPage')) r'itemsPerPage': itemsPerPage, r'_links': links.toJson(keys?.fold>([], diff --git a/dart-v3/lib/model/get_category_type_collection200_response.dart b/dart-v3/lib/model/get_category_type_collection200_response.dart index 4c9fec044..3bfa8764a 100644 --- a/dart-v3/lib/model/get_category_type_collection200_response.dart +++ b/dart-v3/lib/model/get_category_type_collection200_response.dart @@ -8,7 +8,7 @@ class GetCategoryTypeCollection200Response { /// Returns a new [GetCategoryTypeCollection200Response] instance. GetCategoryTypeCollection200Response({ this.embedded, - this.totalItems, + required this.totalItems, this.itemsPerPage, required this.links, }); @@ -32,7 +32,7 @@ class GetCategoryTypeCollection200Response { GetCategoryTypeCollection200ResponseEmbedded? embedded; // minimum: 0 - int? totalItems; + int totalItems; // minimum: 0 int? itemsPerPage; @@ -56,7 +56,7 @@ class GetCategoryTypeCollection200Response { @override int get hashCode => (embedded == null ? 0 : embedded.hashCode) + - (totalItems == null ? 0 : totalItems.hashCode) + + totalItems.hashCode + (itemsPerPage == null ? 0 : itemsPerPage.hashCode) + links.hashCode; @@ -126,8 +126,7 @@ class GetCategoryTypeCollection200Response { return previousValue; })), - if (keys == null || keys.contains(r'totalItems')) - r'totalItems': totalItems, + r'totalItems': totalItems, if (keys == null || keys.contains(r'itemsPerPage')) r'itemsPerPage': itemsPerPage, r'_links': links.toJson(keys?.fold>([], diff --git a/dart-v3/lib/model/get_contract_collection200_response.dart b/dart-v3/lib/model/get_contract_collection200_response.dart index adb198ccd..bdc4b22e8 100644 --- a/dart-v3/lib/model/get_contract_collection200_response.dart +++ b/dart-v3/lib/model/get_contract_collection200_response.dart @@ -8,7 +8,7 @@ class GetContractCollection200Response { /// Returns a new [GetContractCollection200Response] instance. GetContractCollection200Response({ this.embedded, - this.totalItems, + required this.totalItems, this.itemsPerPage, required this.links, }); @@ -32,7 +32,7 @@ class GetContractCollection200Response { GetContractCollection200ResponseEmbedded? embedded; // minimum: 0 - int? totalItems; + int totalItems; // minimum: 0 int? itemsPerPage; @@ -56,7 +56,7 @@ class GetContractCollection200Response { @override int get hashCode => (embedded == null ? 0 : embedded.hashCode) + - (totalItems == null ? 0 : totalItems.hashCode) + + totalItems.hashCode + (itemsPerPage == null ? 0 : itemsPerPage.hashCode) + links.hashCode; @@ -124,8 +124,7 @@ class GetContractCollection200Response { return previousValue; })), - if (keys == null || keys.contains(r'totalItems')) - r'totalItems': totalItems, + r'totalItems': totalItems, if (keys == null || keys.contains(r'itemsPerPage')) r'itemsPerPage': itemsPerPage, r'_links': links.toJson(keys?.fold>([], diff --git a/dart-v3/lib/model/get_contract_type_collection200_response.dart b/dart-v3/lib/model/get_contract_type_collection200_response.dart index 03fd39c4b..a308159fb 100644 --- a/dart-v3/lib/model/get_contract_type_collection200_response.dart +++ b/dart-v3/lib/model/get_contract_type_collection200_response.dart @@ -8,7 +8,7 @@ class GetContractTypeCollection200Response { /// Returns a new [GetContractTypeCollection200Response] instance. GetContractTypeCollection200Response({ this.embedded, - this.totalItems, + required this.totalItems, this.itemsPerPage, required this.links, }); @@ -32,7 +32,7 @@ class GetContractTypeCollection200Response { GetContractTypeCollection200ResponseEmbedded? embedded; // minimum: 0 - int? totalItems; + int totalItems; // minimum: 0 int? itemsPerPage; @@ -56,7 +56,7 @@ class GetContractTypeCollection200Response { @override int get hashCode => (embedded == null ? 0 : embedded.hashCode) + - (totalItems == null ? 0 : totalItems.hashCode) + + totalItems.hashCode + (itemsPerPage == null ? 0 : itemsPerPage.hashCode) + links.hashCode; @@ -126,8 +126,7 @@ class GetContractTypeCollection200Response { return previousValue; })), - if (keys == null || keys.contains(r'totalItems')) - r'totalItems': totalItems, + r'totalItems': totalItems, if (keys == null || keys.contains(r'itemsPerPage')) r'itemsPerPage': itemsPerPage, r'_links': links.toJson(keys?.fold>([], diff --git a/dart-v3/lib/model/get_equipment_collection200_response.dart b/dart-v3/lib/model/get_equipment_collection200_response.dart index 2619df051..107e13442 100644 --- a/dart-v3/lib/model/get_equipment_collection200_response.dart +++ b/dart-v3/lib/model/get_equipment_collection200_response.dart @@ -8,7 +8,7 @@ class GetEquipmentCollection200Response { /// Returns a new [GetEquipmentCollection200Response] instance. GetEquipmentCollection200Response({ this.embedded, - this.totalItems, + required this.totalItems, this.itemsPerPage, required this.links, }); @@ -32,7 +32,7 @@ class GetEquipmentCollection200Response { GetEquipmentCollection200ResponseEmbedded? embedded; // minimum: 0 - int? totalItems; + int totalItems; // minimum: 0 int? itemsPerPage; @@ -56,7 +56,7 @@ class GetEquipmentCollection200Response { @override int get hashCode => (embedded == null ? 0 : embedded.hashCode) + - (totalItems == null ? 0 : totalItems.hashCode) + + totalItems.hashCode + (itemsPerPage == null ? 0 : itemsPerPage.hashCode) + links.hashCode; @@ -125,8 +125,7 @@ class GetEquipmentCollection200Response { return previousValue; })), - if (keys == null || keys.contains(r'totalItems')) - r'totalItems': totalItems, + r'totalItems': totalItems, if (keys == null || keys.contains(r'itemsPerPage')) r'itemsPerPage': itemsPerPage, r'_links': links.toJson(keys?.fold>([], diff --git a/dart-v3/lib/model/get_export_collection200_response.dart b/dart-v3/lib/model/get_export_collection200_response.dart index 0fb27f42d..6bdc825dd 100644 --- a/dart-v3/lib/model/get_export_collection200_response.dart +++ b/dart-v3/lib/model/get_export_collection200_response.dart @@ -8,7 +8,7 @@ class GetExportCollection200Response { /// Returns a new [GetExportCollection200Response] instance. GetExportCollection200Response({ this.embedded, - this.totalItems, + required this.totalItems, this.itemsPerPage, required this.links, }); @@ -32,7 +32,7 @@ class GetExportCollection200Response { GetExportCollection200ResponseEmbedded? embedded; // minimum: 0 - int? totalItems; + int totalItems; // minimum: 0 int? itemsPerPage; @@ -56,7 +56,7 @@ class GetExportCollection200Response { @override int get hashCode => (embedded == null ? 0 : embedded.hashCode) + - (totalItems == null ? 0 : totalItems.hashCode) + + totalItems.hashCode + (itemsPerPage == null ? 0 : itemsPerPage.hashCode) + links.hashCode; @@ -124,8 +124,7 @@ class GetExportCollection200Response { return previousValue; })), - if (keys == null || keys.contains(r'totalItems')) - r'totalItems': totalItems, + r'totalItems': totalItems, if (keys == null || keys.contains(r'itemsPerPage')) r'itemsPerPage': itemsPerPage, r'_links': links.toJson(keys?.fold>([], diff --git a/dart-v3/lib/model/get_integration_collection200_response.dart b/dart-v3/lib/model/get_integration_collection200_response.dart index 5376f8cbc..edcff4661 100644 --- a/dart-v3/lib/model/get_integration_collection200_response.dart +++ b/dart-v3/lib/model/get_integration_collection200_response.dart @@ -8,7 +8,7 @@ class GetIntegrationCollection200Response { /// Returns a new [GetIntegrationCollection200Response] instance. GetIntegrationCollection200Response({ this.embedded, - this.totalItems, + required this.totalItems, this.itemsPerPage, required this.links, }); @@ -32,7 +32,7 @@ class GetIntegrationCollection200Response { GetIntegrationCollection200ResponseEmbedded? embedded; // minimum: 0 - int? totalItems; + int totalItems; // minimum: 0 int? itemsPerPage; @@ -56,7 +56,7 @@ class GetIntegrationCollection200Response { @override int get hashCode => (embedded == null ? 0 : embedded.hashCode) + - (totalItems == null ? 0 : totalItems.hashCode) + + totalItems.hashCode + (itemsPerPage == null ? 0 : itemsPerPage.hashCode) + links.hashCode; @@ -126,8 +126,7 @@ class GetIntegrationCollection200Response { return previousValue; })), - if (keys == null || keys.contains(r'totalItems')) - r'totalItems': totalItems, + r'totalItems': totalItems, if (keys == null || keys.contains(r'itemsPerPage')) r'itemsPerPage': itemsPerPage, r'_links': links.toJson(keys?.fold>([], diff --git a/dart-v3/lib/model/get_integration_link_collection200_response.dart b/dart-v3/lib/model/get_integration_link_collection200_response.dart index 7eb56575b..cf07c89ed 100644 --- a/dart-v3/lib/model/get_integration_link_collection200_response.dart +++ b/dart-v3/lib/model/get_integration_link_collection200_response.dart @@ -8,7 +8,7 @@ class GetIntegrationLinkCollection200Response { /// Returns a new [GetIntegrationLinkCollection200Response] instance. GetIntegrationLinkCollection200Response({ this.embedded, - this.totalItems, + required this.totalItems, this.itemsPerPage, required this.links, }); @@ -32,7 +32,7 @@ class GetIntegrationLinkCollection200Response { GetIntegrationLinkCollection200ResponseEmbedded? embedded; // minimum: 0 - int? totalItems; + int totalItems; // minimum: 0 int? itemsPerPage; @@ -56,7 +56,7 @@ class GetIntegrationLinkCollection200Response { @override int get hashCode => (embedded == null ? 0 : embedded.hashCode) + - (totalItems == null ? 0 : totalItems.hashCode) + + totalItems.hashCode + (itemsPerPage == null ? 0 : itemsPerPage.hashCode) + links.hashCode; @@ -127,8 +127,7 @@ class GetIntegrationLinkCollection200Response { return previousValue; })), - if (keys == null || keys.contains(r'totalItems')) - r'totalItems': totalItems, + r'totalItems': totalItems, if (keys == null || keys.contains(r'itemsPerPage')) r'itemsPerPage': itemsPerPage, r'_links': links.toJson(keys?.fold>([], diff --git a/dart-v3/lib/model/get_member_collection200_response.dart b/dart-v3/lib/model/get_member_collection200_response.dart index be1ff083c..9a921cde6 100644 --- a/dart-v3/lib/model/get_member_collection200_response.dart +++ b/dart-v3/lib/model/get_member_collection200_response.dart @@ -8,7 +8,7 @@ class GetMemberCollection200Response { /// Returns a new [GetMemberCollection200Response] instance. GetMemberCollection200Response({ this.embedded, - this.totalItems, + required this.totalItems, this.itemsPerPage, required this.links, }); @@ -32,7 +32,7 @@ class GetMemberCollection200Response { GetMemberCollection200ResponseEmbedded? embedded; // minimum: 0 - int? totalItems; + int totalItems; // minimum: 0 int? itemsPerPage; @@ -56,7 +56,7 @@ class GetMemberCollection200Response { @override int get hashCode => (embedded == null ? 0 : embedded.hashCode) + - (totalItems == null ? 0 : totalItems.hashCode) + + totalItems.hashCode + (itemsPerPage == null ? 0 : itemsPerPage.hashCode) + links.hashCode; @@ -124,8 +124,7 @@ class GetMemberCollection200Response { return previousValue; })), - if (keys == null || keys.contains(r'totalItems')) - r'totalItems': totalItems, + r'totalItems': totalItems, if (keys == null || keys.contains(r'itemsPerPage')) r'itemsPerPage': itemsPerPage, r'_links': links.toJson(keys?.fold>([], diff --git a/dart-v3/lib/model/get_occupant_collection200_response.dart b/dart-v3/lib/model/get_occupant_collection200_response.dart index b1365bf47..4c95bf7d3 100644 --- a/dart-v3/lib/model/get_occupant_collection200_response.dart +++ b/dart-v3/lib/model/get_occupant_collection200_response.dart @@ -8,7 +8,7 @@ class GetOccupantCollection200Response { /// Returns a new [GetOccupantCollection200Response] instance. GetOccupantCollection200Response({ this.embedded, - this.totalItems, + required this.totalItems, this.itemsPerPage, required this.links, }); @@ -32,7 +32,7 @@ class GetOccupantCollection200Response { GetOccupantCollection200ResponseEmbedded? embedded; // minimum: 0 - int? totalItems; + int totalItems; // minimum: 0 int? itemsPerPage; @@ -56,7 +56,7 @@ class GetOccupantCollection200Response { @override int get hashCode => (embedded == null ? 0 : embedded.hashCode) + - (totalItems == null ? 0 : totalItems.hashCode) + + totalItems.hashCode + (itemsPerPage == null ? 0 : itemsPerPage.hashCode) + links.hashCode; @@ -124,8 +124,7 @@ class GetOccupantCollection200Response { return previousValue; })), - if (keys == null || keys.contains(r'totalItems')) - r'totalItems': totalItems, + r'totalItems': totalItems, if (keys == null || keys.contains(r'itemsPerPage')) r'itemsPerPage': itemsPerPage, r'_links': links.toJson(keys?.fold>([], diff --git a/dart-v3/lib/model/get_place_collection200_response.dart b/dart-v3/lib/model/get_place_collection200_response.dart index 8af28c31a..0476c44c6 100644 --- a/dart-v3/lib/model/get_place_collection200_response.dart +++ b/dart-v3/lib/model/get_place_collection200_response.dart @@ -8,7 +8,7 @@ class GetPlaceCollection200Response { /// Returns a new [GetPlaceCollection200Response] instance. GetPlaceCollection200Response({ this.embedded, - this.totalItems, + required this.totalItems, this.itemsPerPage, required this.links, }); @@ -32,7 +32,7 @@ class GetPlaceCollection200Response { GetPlaceCollection200ResponseEmbedded? embedded; // minimum: 0 - int? totalItems; + int totalItems; // minimum: 0 int? itemsPerPage; @@ -56,7 +56,7 @@ class GetPlaceCollection200Response { @override int get hashCode => (embedded == null ? 0 : embedded.hashCode) + - (totalItems == null ? 0 : totalItems.hashCode) + + totalItems.hashCode + (itemsPerPage == null ? 0 : itemsPerPage.hashCode) + links.hashCode; @@ -124,8 +124,7 @@ class GetPlaceCollection200Response { return previousValue; })), - if (keys == null || keys.contains(r'totalItems')) - r'totalItems': totalItems, + r'totalItems': totalItems, if (keys == null || keys.contains(r'itemsPerPage')) r'itemsPerPage': itemsPerPage, r'_links': links.toJson(keys?.fold>([], diff --git a/dart-v3/lib/model/get_place_collection200_response_links.dart b/dart-v3/lib/model/get_place_collection200_response_links.dart index 8831fa795..a1d973937 100644 --- a/dart-v3/lib/model/get_place_collection200_response_links.dart +++ b/dart-v3/lib/model/get_place_collection200_response_links.dart @@ -7,12 +7,12 @@ part of keyclic_sdk_api_platform; class GetPlaceCollection200ResponseLinks { /// Returns a new [GetPlaceCollection200ResponseLinks] instance. GetPlaceCollection200ResponseLinks({ - this.self, + required this.self, this.first, this.last, this.next, this.previous, - this.item, + this.item = const [], }); /// Returns a new [GetPlaceCollection200ResponseLinks] instance and imports its values from @@ -23,7 +23,7 @@ class GetPlaceCollection200ResponseLinks { } return GetPlaceCollection200ResponseLinks( - self: GetPlaceCollection200ResponseLinksSelf.fromJson(json[r'self']), + self: GetPlaceCollection200ResponseLinksSelf.fromJson(json[r'self'])!, first: GetPlaceCollection200ResponseLinksFirst.fromJson(json[r'first']), last: GetPlaceCollection200ResponseLinksFirst.fromJson(json[r'last']), next: GetPlaceCollection200ResponseLinksFirst.fromJson(json[r'next']), @@ -33,7 +33,7 @@ class GetPlaceCollection200ResponseLinks { ); } - GetPlaceCollection200ResponseLinksSelf? self; + GetPlaceCollection200ResponseLinksSelf self; GetPlaceCollection200ResponseLinksFirst? first; @@ -43,7 +43,7 @@ class GetPlaceCollection200ResponseLinks { GetPlaceCollection200ResponseLinksFirst? previous; - List? item; + List item; @override bool operator ==(Object other) { @@ -63,12 +63,12 @@ class GetPlaceCollection200ResponseLinks { @override int get hashCode => - (self == null ? 0 : self.hashCode) + + self.hashCode + (first == null ? 0 : first.hashCode) + (last == null ? 0 : last.hashCode) + (next == null ? 0 : next.hashCode) + (previous == null ? 0 : previous.hashCode) + - (item == null ? 0 : item.hashCode); + item.hashCode; static List listFromJson(Iterable? json) { if (json == null) { @@ -125,15 +125,14 @@ class GetPlaceCollection200ResponseLinks { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.any((key) => RegExp(r'^self\.').hasMatch(key))) - r'self': self?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^self\.'))) { - previousValue.add(element.split(RegExp(r'^self\.')).last); - } - - return previousValue; - })), + r'self': self.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^self\.'))) { + previousValue.add(element.split(RegExp(r'^self\.')).last); + } + + return previousValue; + })), if (keys == null || keys.any((key) => RegExp(r'^first\.').hasMatch(key))) r'first': first?.toJson(keys?.fold>([], (List previousValue, String element) { @@ -171,7 +170,7 @@ class GetPlaceCollection200ResponseLinks { return previousValue; })), - if (keys == null || keys.contains(r'item')) r'item': item, + r'item': item, }; } } diff --git a/dart-v3/lib/model/get_place_collection200_response_links_first.dart b/dart-v3/lib/model/get_place_collection200_response_links_first.dart index 8deb5eb03..a4f6547a9 100644 --- a/dart-v3/lib/model/get_place_collection200_response_links_first.dart +++ b/dart-v3/lib/model/get_place_collection200_response_links_first.dart @@ -7,7 +7,7 @@ part of keyclic_sdk_api_platform; class GetPlaceCollection200ResponseLinksFirst { /// Returns a new [GetPlaceCollection200ResponseLinksFirst] instance. GetPlaceCollection200ResponseLinksFirst({ - this.href, + required this.href, }); /// Returns a new [GetPlaceCollection200ResponseLinksFirst] instance and imports its values from @@ -22,7 +22,7 @@ class GetPlaceCollection200ResponseLinksFirst { ); } - String? href; + String href; @override bool operator ==(Object other) { @@ -36,7 +36,7 @@ class GetPlaceCollection200ResponseLinksFirst { } @override - int get hashCode => (href == null ? 0 : href.hashCode); + int get hashCode => href.hashCode; static List listFromJson( Iterable? json) { @@ -94,7 +94,7 @@ class GetPlaceCollection200ResponseLinksFirst { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.contains(r'href')) r'href': href, + r'href': href, }; } } diff --git a/dart-v3/lib/model/get_place_collection200_response_links_self.dart b/dart-v3/lib/model/get_place_collection200_response_links_self.dart index 83ea12742..7784fe38e 100644 --- a/dart-v3/lib/model/get_place_collection200_response_links_self.dart +++ b/dart-v3/lib/model/get_place_collection200_response_links_self.dart @@ -7,7 +7,7 @@ part of keyclic_sdk_api_platform; class GetPlaceCollection200ResponseLinksSelf { /// Returns a new [GetPlaceCollection200ResponseLinksSelf] instance. GetPlaceCollection200ResponseLinksSelf({ - this.href, + required this.href, }); /// Returns a new [GetPlaceCollection200ResponseLinksSelf] instance and imports its values from @@ -22,7 +22,7 @@ class GetPlaceCollection200ResponseLinksSelf { ); } - String? href; + String href; @override bool operator ==(Object other) { @@ -36,7 +36,7 @@ class GetPlaceCollection200ResponseLinksSelf { } @override - int get hashCode => (href == null ? 0 : href.hashCode); + int get hashCode => href.hashCode; static List listFromJson( Iterable? json) { @@ -93,7 +93,7 @@ class GetPlaceCollection200ResponseLinksSelf { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.contains(r'href')) r'href': href, + r'href': href, }; } } diff --git a/dart-v3/lib/model/get_publication_collection200_response.dart b/dart-v3/lib/model/get_publication_collection200_response.dart index deb9cb7d9..e6984233b 100644 --- a/dart-v3/lib/model/get_publication_collection200_response.dart +++ b/dart-v3/lib/model/get_publication_collection200_response.dart @@ -8,7 +8,7 @@ class GetPublicationCollection200Response { /// Returns a new [GetPublicationCollection200Response] instance. GetPublicationCollection200Response({ this.embedded, - this.totalItems, + required this.totalItems, this.itemsPerPage, required this.links, }); @@ -32,7 +32,7 @@ class GetPublicationCollection200Response { GetPublicationCollection200ResponseEmbedded? embedded; // minimum: 0 - int? totalItems; + int totalItems; // minimum: 0 int? itemsPerPage; @@ -56,7 +56,7 @@ class GetPublicationCollection200Response { @override int get hashCode => (embedded == null ? 0 : embedded.hashCode) + - (totalItems == null ? 0 : totalItems.hashCode) + + totalItems.hashCode + (itemsPerPage == null ? 0 : itemsPerPage.hashCode) + links.hashCode; @@ -126,8 +126,7 @@ class GetPublicationCollection200Response { return previousValue; })), - if (keys == null || keys.contains(r'totalItems')) - r'totalItems': totalItems, + r'totalItems': totalItems, if (keys == null || keys.contains(r'itemsPerPage')) r'itemsPerPage': itemsPerPage, r'_links': links.toJson(keys?.fold>([], diff --git a/dart-v3/lib/model/get_review_collection200_response.dart b/dart-v3/lib/model/get_review_collection200_response.dart index 156d6aabf..d6c08a0b5 100644 --- a/dart-v3/lib/model/get_review_collection200_response.dart +++ b/dart-v3/lib/model/get_review_collection200_response.dart @@ -8,7 +8,7 @@ class GetReviewCollection200Response { /// Returns a new [GetReviewCollection200Response] instance. GetReviewCollection200Response({ this.embedded, - this.totalItems, + required this.totalItems, this.itemsPerPage, required this.links, }); @@ -32,7 +32,7 @@ class GetReviewCollection200Response { GetReviewCollection200ResponseEmbedded? embedded; // minimum: 0 - int? totalItems; + int totalItems; // minimum: 0 int? itemsPerPage; @@ -56,7 +56,7 @@ class GetReviewCollection200Response { @override int get hashCode => (embedded == null ? 0 : embedded.hashCode) + - (totalItems == null ? 0 : totalItems.hashCode) + + totalItems.hashCode + (itemsPerPage == null ? 0 : itemsPerPage.hashCode) + links.hashCode; @@ -124,8 +124,7 @@ class GetReviewCollection200Response { return previousValue; })), - if (keys == null || keys.contains(r'totalItems')) - r'totalItems': totalItems, + r'totalItems': totalItems, if (keys == null || keys.contains(r'itemsPerPage')) r'itemsPerPage': itemsPerPage, r'_links': links.toJson(keys?.fold>([], diff --git a/dart-v3/lib/model/get_review_request_collection200_response.dart b/dart-v3/lib/model/get_review_request_collection200_response.dart index 970d93c06..82bb3dd35 100644 --- a/dart-v3/lib/model/get_review_request_collection200_response.dart +++ b/dart-v3/lib/model/get_review_request_collection200_response.dart @@ -8,7 +8,7 @@ class GetReviewRequestCollection200Response { /// Returns a new [GetReviewRequestCollection200Response] instance. GetReviewRequestCollection200Response({ this.embedded, - this.totalItems, + required this.totalItems, this.itemsPerPage, required this.links, }); @@ -32,7 +32,7 @@ class GetReviewRequestCollection200Response { GetReviewRequestCollection200ResponseEmbedded? embedded; // minimum: 0 - int? totalItems; + int totalItems; // minimum: 0 int? itemsPerPage; @@ -56,7 +56,7 @@ class GetReviewRequestCollection200Response { @override int get hashCode => (embedded == null ? 0 : embedded.hashCode) + - (totalItems == null ? 0 : totalItems.hashCode) + + totalItems.hashCode + (itemsPerPage == null ? 0 : itemsPerPage.hashCode) + links.hashCode; @@ -126,8 +126,7 @@ class GetReviewRequestCollection200Response { return previousValue; })), - if (keys == null || keys.contains(r'totalItems')) - r'totalItems': totalItems, + r'totalItems': totalItems, if (keys == null || keys.contains(r'itemsPerPage')) r'itemsPerPage': itemsPerPage, r'_links': links.toJson(keys?.fold>([], diff --git a/dart-v3/lib/model/get_service_collection200_response.dart b/dart-v3/lib/model/get_service_collection200_response.dart index 829c9ad06..8b490a895 100644 --- a/dart-v3/lib/model/get_service_collection200_response.dart +++ b/dart-v3/lib/model/get_service_collection200_response.dart @@ -8,7 +8,7 @@ class GetServiceCollection200Response { /// Returns a new [GetServiceCollection200Response] instance. GetServiceCollection200Response({ this.embedded, - this.totalItems, + required this.totalItems, this.itemsPerPage, required this.links, }); @@ -32,7 +32,7 @@ class GetServiceCollection200Response { GetServiceCollection200ResponseEmbedded? embedded; // minimum: 0 - int? totalItems; + int totalItems; // minimum: 0 int? itemsPerPage; @@ -56,7 +56,7 @@ class GetServiceCollection200Response { @override int get hashCode => (embedded == null ? 0 : embedded.hashCode) + - (totalItems == null ? 0 : totalItems.hashCode) + + totalItems.hashCode + (itemsPerPage == null ? 0 : itemsPerPage.hashCode) + links.hashCode; @@ -124,8 +124,7 @@ class GetServiceCollection200Response { return previousValue; })), - if (keys == null || keys.contains(r'totalItems')) - r'totalItems': totalItems, + r'totalItems': totalItems, if (keys == null || keys.contains(r'itemsPerPage')) r'itemsPerPage': itemsPerPage, r'_links': links.toJson(keys?.fold>([], diff --git a/dart-v3/lib/model/get_sla_policy_collection200_response.dart b/dart-v3/lib/model/get_sla_policy_collection200_response.dart index 3c5651f34..6e1d69265 100644 --- a/dart-v3/lib/model/get_sla_policy_collection200_response.dart +++ b/dart-v3/lib/model/get_sla_policy_collection200_response.dart @@ -8,7 +8,7 @@ class GetSlaPolicyCollection200Response { /// Returns a new [GetSlaPolicyCollection200Response] instance. GetSlaPolicyCollection200Response({ this.embedded, - this.totalItems, + required this.totalItems, this.itemsPerPage, required this.links, }); @@ -32,7 +32,7 @@ class GetSlaPolicyCollection200Response { GetSlaPolicyCollection200ResponseEmbedded? embedded; // minimum: 0 - int? totalItems; + int totalItems; // minimum: 0 int? itemsPerPage; @@ -56,7 +56,7 @@ class GetSlaPolicyCollection200Response { @override int get hashCode => (embedded == null ? 0 : embedded.hashCode) + - (totalItems == null ? 0 : totalItems.hashCode) + + totalItems.hashCode + (itemsPerPage == null ? 0 : itemsPerPage.hashCode) + links.hashCode; @@ -125,8 +125,7 @@ class GetSlaPolicyCollection200Response { return previousValue; })), - if (keys == null || keys.contains(r'totalItems')) - r'totalItems': totalItems, + r'totalItems': totalItems, if (keys == null || keys.contains(r'itemsPerPage')) r'itemsPerPage': itemsPerPage, r'_links': links.toJson(keys?.fold>([], diff --git a/dart-v3/lib/model/get_ticket_collection200_response.dart b/dart-v3/lib/model/get_ticket_collection200_response.dart index 4c7ead04a..f463fb157 100644 --- a/dart-v3/lib/model/get_ticket_collection200_response.dart +++ b/dart-v3/lib/model/get_ticket_collection200_response.dart @@ -8,7 +8,7 @@ class GetTicketCollection200Response { /// Returns a new [GetTicketCollection200Response] instance. GetTicketCollection200Response({ this.embedded, - this.totalItems, + required this.totalItems, this.itemsPerPage, required this.links, }); @@ -32,7 +32,7 @@ class GetTicketCollection200Response { GetTicketCollection200ResponseEmbedded? embedded; // minimum: 0 - int? totalItems; + int totalItems; // minimum: 0 int? itemsPerPage; @@ -56,7 +56,7 @@ class GetTicketCollection200Response { @override int get hashCode => (embedded == null ? 0 : embedded.hashCode) + - (totalItems == null ? 0 : totalItems.hashCode) + + totalItems.hashCode + (itemsPerPage == null ? 0 : itemsPerPage.hashCode) + links.hashCode; @@ -124,8 +124,7 @@ class GetTicketCollection200Response { return previousValue; })), - if (keys == null || keys.contains(r'totalItems')) - r'totalItems': totalItems, + r'totalItems': totalItems, if (keys == null || keys.contains(r'itemsPerPage')) r'itemsPerPage': itemsPerPage, r'_links': links.toJson(keys?.fold>([], diff --git a/dart-v3/lib/model/get_ticket_document_types200_response.dart b/dart-v3/lib/model/get_ticket_document_types200_response.dart index 8acadee63..9e99371df 100644 --- a/dart-v3/lib/model/get_ticket_document_types200_response.dart +++ b/dart-v3/lib/model/get_ticket_document_types200_response.dart @@ -8,7 +8,7 @@ class GetTicketDocumentTypes200Response { /// Returns a new [GetTicketDocumentTypes200Response] instance. GetTicketDocumentTypes200Response({ this.embedded, - this.totalItems, + required this.totalItems, this.itemsPerPage, required this.links, }); @@ -32,7 +32,7 @@ class GetTicketDocumentTypes200Response { GetTicketDocumentTypes200ResponseEmbedded? embedded; // minimum: 0 - int? totalItems; + int totalItems; // minimum: 0 int? itemsPerPage; @@ -56,7 +56,7 @@ class GetTicketDocumentTypes200Response { @override int get hashCode => (embedded == null ? 0 : embedded.hashCode) + - (totalItems == null ? 0 : totalItems.hashCode) + + totalItems.hashCode + (itemsPerPage == null ? 0 : itemsPerPage.hashCode) + links.hashCode; @@ -125,8 +125,7 @@ class GetTicketDocumentTypes200Response { return previousValue; })), - if (keys == null || keys.contains(r'totalItems')) - r'totalItems': totalItems, + r'totalItems': totalItems, if (keys == null || keys.contains(r'itemsPerPage')) r'itemsPerPage': itemsPerPage, r'_links': links.toJson(keys?.fold>([], diff --git a/dart-v3/lib/model/get_ticket_geo_collection200_response.dart b/dart-v3/lib/model/get_ticket_geo_collection200_response.dart index d4d72341b..81af72d04 100644 --- a/dart-v3/lib/model/get_ticket_geo_collection200_response.dart +++ b/dart-v3/lib/model/get_ticket_geo_collection200_response.dart @@ -7,10 +7,10 @@ part of keyclic_sdk_api_platform; class GetTicketGeoCollection200Response { /// Returns a new [GetTicketGeoCollection200Response] instance. GetTicketGeoCollection200Response({ - this.type, + this.type = 'FeatureCollection', this.features = const [], - this.totalItems, - this.itemsPerPage, + required this.totalItems, + required this.itemsPerPage, }); /// Returns a new [GetTicketGeoCollection200Response] instance and imports its values from @@ -28,15 +28,15 @@ class GetTicketGeoCollection200Response { ); } - String? type; + String type; List features; // minimum: 0 - int? totalItems; + int totalItems; // minimum: 0 - int? itemsPerPage; + int itemsPerPage; @override bool operator ==(Object other) { @@ -54,10 +54,10 @@ class GetTicketGeoCollection200Response { @override int get hashCode => - (type == null ? 0 : type.hashCode) + + type.hashCode + features.hashCode + - (totalItems == null ? 0 : totalItems.hashCode) + - (itemsPerPage == null ? 0 : itemsPerPage.hashCode); + totalItems.hashCode + + itemsPerPage.hashCode; static List listFromJson(Iterable? json) { if (json == null) { @@ -114,12 +114,10 @@ class GetTicketGeoCollection200Response { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.contains(r'type')) r'type': type, + r'type': type, r'features': features, - if (keys == null || keys.contains(r'totalItems')) - r'totalItems': totalItems, - if (keys == null || keys.contains(r'itemsPerPage')) - r'itemsPerPage': itemsPerPage, + r'totalItems': totalItems, + r'itemsPerPage': itemsPerPage, }; } } diff --git a/dart-v3/lib/model/get_ticket_metrics200_response.dart b/dart-v3/lib/model/get_ticket_metrics200_response.dart index 1efed75a0..229339d4c 100644 --- a/dart-v3/lib/model/get_ticket_metrics200_response.dart +++ b/dart-v3/lib/model/get_ticket_metrics200_response.dart @@ -8,7 +8,7 @@ class GetTicketMetrics200Response { /// Returns a new [GetTicketMetrics200Response] instance. GetTicketMetrics200Response({ this.embedded, - this.totalItems, + required this.totalItems, this.itemsPerPage, required this.links, }); @@ -32,7 +32,7 @@ class GetTicketMetrics200Response { GetTicketMetrics200ResponseEmbedded? embedded; // minimum: 0 - int? totalItems; + int totalItems; // minimum: 0 int? itemsPerPage; @@ -56,7 +56,7 @@ class GetTicketMetrics200Response { @override int get hashCode => (embedded == null ? 0 : embedded.hashCode) + - (totalItems == null ? 0 : totalItems.hashCode) + + totalItems.hashCode + (itemsPerPage == null ? 0 : itemsPerPage.hashCode) + links.hashCode; @@ -124,8 +124,7 @@ class GetTicketMetrics200Response { return previousValue; })), - if (keys == null || keys.contains(r'totalItems')) - r'totalItems': totalItems, + r'totalItems': totalItems, if (keys == null || keys.contains(r'itemsPerPage')) r'itemsPerPage': itemsPerPage, r'_links': links.toJson(keys?.fold>([], diff --git a/dart-v3/lib/model/get_ticket_target_groups200_response.dart b/dart-v3/lib/model/get_ticket_target_groups200_response.dart index 206d0d1b4..f3df5467f 100644 --- a/dart-v3/lib/model/get_ticket_target_groups200_response.dart +++ b/dart-v3/lib/model/get_ticket_target_groups200_response.dart @@ -8,7 +8,7 @@ class GetTicketTargetGroups200Response { /// Returns a new [GetTicketTargetGroups200Response] instance. GetTicketTargetGroups200Response({ this.embedded, - this.totalItems, + required this.totalItems, this.itemsPerPage, required this.links, }); @@ -32,7 +32,7 @@ class GetTicketTargetGroups200Response { GetTicketTargetGroups200ResponseEmbedded? embedded; // minimum: 0 - int? totalItems; + int totalItems; // minimum: 0 int? itemsPerPage; @@ -56,7 +56,7 @@ class GetTicketTargetGroups200Response { @override int get hashCode => (embedded == null ? 0 : embedded.hashCode) + - (totalItems == null ? 0 : totalItems.hashCode) + + totalItems.hashCode + (itemsPerPage == null ? 0 : itemsPerPage.hashCode) + links.hashCode; @@ -124,8 +124,7 @@ class GetTicketTargetGroups200Response { return previousValue; })), - if (keys == null || keys.contains(r'totalItems')) - r'totalItems': totalItems, + r'totalItems': totalItems, if (keys == null || keys.contains(r'itemsPerPage')) r'itemsPerPage': itemsPerPage, r'_links': links.toJson(keys?.fold>([], diff --git a/dart-v3/lib/model/get_ticket_type_collection200_response.dart b/dart-v3/lib/model/get_ticket_type_collection200_response.dart index f757d3fbb..2e68da760 100644 --- a/dart-v3/lib/model/get_ticket_type_collection200_response.dart +++ b/dart-v3/lib/model/get_ticket_type_collection200_response.dart @@ -8,7 +8,7 @@ class GetTicketTypeCollection200Response { /// Returns a new [GetTicketTypeCollection200Response] instance. GetTicketTypeCollection200Response({ this.embedded, - this.totalItems, + required this.totalItems, this.itemsPerPage, required this.links, }); @@ -32,7 +32,7 @@ class GetTicketTypeCollection200Response { GetTicketTypeCollection200ResponseEmbedded? embedded; // minimum: 0 - int? totalItems; + int totalItems; // minimum: 0 int? itemsPerPage; @@ -56,7 +56,7 @@ class GetTicketTypeCollection200Response { @override int get hashCode => (embedded == null ? 0 : embedded.hashCode) + - (totalItems == null ? 0 : totalItems.hashCode) + + totalItems.hashCode + (itemsPerPage == null ? 0 : itemsPerPage.hashCode) + links.hashCode; @@ -125,8 +125,7 @@ class GetTicketTypeCollection200Response { return previousValue; })), - if (keys == null || keys.contains(r'totalItems')) - r'totalItems': totalItems, + r'totalItems': totalItems, if (keys == null || keys.contains(r'itemsPerPage')) r'itemsPerPage': itemsPerPage, r'_links': links.toJson(keys?.fold>([], diff --git a/dart-v3/lib/model/get_ticket_workflow_transitions200_response.dart b/dart-v3/lib/model/get_ticket_workflow_transitions200_response.dart index e4253e9fb..20be72f9b 100644 --- a/dart-v3/lib/model/get_ticket_workflow_transitions200_response.dart +++ b/dart-v3/lib/model/get_ticket_workflow_transitions200_response.dart @@ -8,7 +8,7 @@ class GetTicketWorkflowTransitions200Response { /// Returns a new [GetTicketWorkflowTransitions200Response] instance. GetTicketWorkflowTransitions200Response({ this.embedded, - this.totalItems, + required this.totalItems, this.itemsPerPage, required this.links, }); @@ -32,7 +32,7 @@ class GetTicketWorkflowTransitions200Response { GetTicketWorkflowTransitions200ResponseEmbedded? embedded; // minimum: 0 - int? totalItems; + int totalItems; // minimum: 0 int? itemsPerPage; @@ -56,7 +56,7 @@ class GetTicketWorkflowTransitions200Response { @override int get hashCode => (embedded == null ? 0 : embedded.hashCode) + - (totalItems == null ? 0 : totalItems.hashCode) + + totalItems.hashCode + (itemsPerPage == null ? 0 : itemsPerPage.hashCode) + links.hashCode; @@ -127,8 +127,7 @@ class GetTicketWorkflowTransitions200Response { return previousValue; })), - if (keys == null || keys.contains(r'totalItems')) - r'totalItems': totalItems, + r'totalItems': totalItems, if (keys == null || keys.contains(r'itemsPerPage')) r'itemsPerPage': itemsPerPage, r'_links': links.toJson(keys?.fold>([], diff --git a/dart-v3/lib/model/integration_jsonhal_integration_read.dart b/dart-v3/lib/model/integration_jsonhal_integration_read.dart index 4d0da851b..9352dabf0 100644 --- a/dart-v3/lib/model/integration_jsonhal_integration_read.dart +++ b/dart-v3/lib/model/integration_jsonhal_integration_read.dart @@ -7,11 +7,11 @@ part of keyclic_sdk_api_platform; class IntegrationJsonhalIntegrationRead { /// Returns a new [IntegrationJsonhalIntegrationRead] instance. IntegrationJsonhalIntegrationRead({ - this.links, - this.inputs, - this.id, - this.createdAt, - this.updatedAt, + required this.links, + this.inputs = const {}, + required this.id, + required this.createdAt, + required this.updatedAt, this.name, }); @@ -23,29 +23,27 @@ class IntegrationJsonhalIntegrationRead { } return IntegrationJsonhalIntegrationRead( - links: IntegrationJsonhalIntegrationReadLinks.fromJson(json[r'_links']), - inputs: json[r'inputs'] == null - ? null - : Map.from(json[r'inputs']), + links: IntegrationJsonhalIntegrationReadLinks.fromJson(json[r'_links'])!, + inputs: Map.from(json[r'inputs']), id: json[r'id'], - createdAt: mapToDateTime(json[r'createdAt']), - updatedAt: mapToDateTime(json[r'updatedAt']), + createdAt: mapToDateTime(json[r'createdAt'])!, + updatedAt: mapToDateTime(json[r'updatedAt'])!, name: json[r'name'], ); } - IntegrationJsonhalIntegrationReadLinks? links; + IntegrationJsonhalIntegrationReadLinks links; - Map? inputs; + Map inputs; /// The resource identifier. - final String? id; + final String id; /// The date and time when the resource was created, in UTC format. - final DateTime? createdAt; + final DateTime createdAt; /// The date and time when the resource was updated, in UTC format. - final DateTime? updatedAt; + final DateTime updatedAt; final String? name; @@ -67,11 +65,11 @@ class IntegrationJsonhalIntegrationRead { @override int get hashCode => - (links == null ? 0 : links.hashCode) + - (inputs == null ? 0 : inputs.hashCode) + - (id == null ? 0 : id.hashCode) + - (createdAt == null ? 0 : createdAt.hashCode) + - (updatedAt == null ? 0 : updatedAt.hashCode) + + links.hashCode + + inputs.hashCode + + id.hashCode + + createdAt.hashCode + + updatedAt.hashCode + (name == null ? 0 : name.hashCode); static List listFromJson(Iterable? json) { @@ -129,21 +127,18 @@ class IntegrationJsonhalIntegrationRead { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.any((key) => RegExp(r'^links\.').hasMatch(key))) - r'_links': links?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^links\.'))) { - previousValue.add(element.split(RegExp(r'^links\.')).last); - } - - return previousValue; - })), - if (keys == null || keys.contains(r'inputs')) r'inputs': inputs, - if (keys == null || keys.contains(r'id')) r'id': id, - if (keys == null || keys.contains(r'createdAt')) - r'createdAt': createdAt?.toUtc().toIso8601String(), - if (keys == null || keys.contains(r'updatedAt')) - r'updatedAt': updatedAt?.toUtc().toIso8601String(), + r'_links': links.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^links\.'))) { + previousValue.add(element.split(RegExp(r'^links\.')).last); + } + + return previousValue; + })), + r'inputs': inputs, + r'id': id, + r'createdAt': createdAt.toUtc().toIso8601String(), + r'updatedAt': updatedAt.toUtc().toIso8601String(), if (keys == null || keys.contains(r'name')) r'name': name, }; } diff --git a/dart-v3/lib/model/integration_jsonhal_integration_read_links.dart b/dart-v3/lib/model/integration_jsonhal_integration_read_links.dart index 265430d59..0e90dd26f 100644 --- a/dart-v3/lib/model/integration_jsonhal_integration_read_links.dart +++ b/dart-v3/lib/model/integration_jsonhal_integration_read_links.dart @@ -7,9 +7,9 @@ part of keyclic_sdk_api_platform; class IntegrationJsonhalIntegrationReadLinks { /// Returns a new [IntegrationJsonhalIntegrationReadLinks] instance. IntegrationJsonhalIntegrationReadLinks({ - this.self, - this.connector, - this.organization, + required this.self, + required this.connector, + required this.organization, }); /// Returns a new [IntegrationJsonhalIntegrationReadLinks] instance and imports its values from @@ -20,19 +20,19 @@ class IntegrationJsonhalIntegrationReadLinks { } return IntegrationJsonhalIntegrationReadLinks( - self: GetPlaceCollection200ResponseLinksSelf.fromJson(json[r'self']), + self: GetPlaceCollection200ResponseLinksSelf.fromJson(json[r'self'])!, connector: - GetPlaceCollection200ResponseLinksSelf.fromJson(json[r'connector']), + GetPlaceCollection200ResponseLinksSelf.fromJson(json[r'connector'])!, organization: GetPlaceCollection200ResponseLinksSelf.fromJson( - json[r'organization']), + json[r'organization'])!, ); } - GetPlaceCollection200ResponseLinksSelf? self; + GetPlaceCollection200ResponseLinksSelf self; - GetPlaceCollection200ResponseLinksSelf? connector; + GetPlaceCollection200ResponseLinksSelf connector; - GetPlaceCollection200ResponseLinksSelf? organization; + GetPlaceCollection200ResponseLinksSelf organization; @override bool operator ==(Object other) { @@ -49,9 +49,7 @@ class IntegrationJsonhalIntegrationReadLinks { @override int get hashCode => - (self == null ? 0 : self.hashCode) + - (connector == null ? 0 : connector.hashCode) + - (organization == null ? 0 : organization.hashCode); + self.hashCode + connector.hashCode + organization.hashCode; static List listFromJson( Iterable? json) { @@ -109,35 +107,30 @@ class IntegrationJsonhalIntegrationReadLinks { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.any((key) => RegExp(r'^self\.').hasMatch(key))) - r'self': self?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^self\.'))) { - previousValue.add(element.split(RegExp(r'^self\.')).last); - } - - return previousValue; - })), - if (keys == null || - keys.any((key) => RegExp(r'^connector\.').hasMatch(key))) - r'connector': connector?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^connector\.'))) { - previousValue.add(element.split(RegExp(r'^connector\.')).last); - } - - return previousValue; - })), - if (keys == null || - keys.any((key) => RegExp(r'^organization\.').hasMatch(key))) - r'organization': organization?.toJson(keys?.fold>( - [], (List previousValue, String element) { - if (element.contains(RegExp(r'^organization\.'))) { - previousValue.add(element.split(RegExp(r'^organization\.')).last); - } - - return previousValue; - })), + r'self': self.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^self\.'))) { + previousValue.add(element.split(RegExp(r'^self\.')).last); + } + + return previousValue; + })), + r'connector': connector.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^connector\.'))) { + previousValue.add(element.split(RegExp(r'^connector\.')).last); + } + + return previousValue; + })), + r'organization': organization.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^organization\.'))) { + previousValue.add(element.split(RegExp(r'^organization\.')).last); + } + + return previousValue; + })), }; } } diff --git a/dart-v3/lib/model/integration_link_create_link_command_write.dart b/dart-v3/lib/model/integration_link_create_link_command_write.dart index 3dfb59e5a..9a80dd6c9 100644 --- a/dart-v3/lib/model/integration_link_create_link_command_write.dart +++ b/dart-v3/lib/model/integration_link_create_link_command_write.dart @@ -7,9 +7,9 @@ part of keyclic_sdk_api_platform; class IntegrationLinkCreateLinkCommandWrite { /// Returns a new [IntegrationLinkCreateLinkCommandWrite] instance. IntegrationLinkCreateLinkCommandWrite({ - this.data, + this.data = const {}, required this.integration, - this.metadata, + this.metadata = const {}, this.name, required this.source_, this.state, @@ -24,13 +24,9 @@ class IntegrationLinkCreateLinkCommandWrite { } return IntegrationLinkCreateLinkCommandWrite( - data: json[r'data'] == null - ? null - : Map.from(json[r'data']), + data: Map.from(json[r'data']), integration: json[r'integration'], - metadata: json[r'metadata'] == null - ? null - : Map.from(json[r'metadata']), + metadata: Map.from(json[r'metadata']), name: json[r'name'], source_: json[r'source'], state: IntegrationLinkCreateLinkCommandWriteStateEnum.fromJson( @@ -39,11 +35,11 @@ class IntegrationLinkCreateLinkCommandWrite { ); } - Map? data; + Map data; String integration; - Map? metadata; + Map metadata; String? name; @@ -72,9 +68,9 @@ class IntegrationLinkCreateLinkCommandWrite { @override int get hashCode => - (data == null ? 0 : data.hashCode) + + data.hashCode + integration.hashCode + - (metadata == null ? 0 : metadata.hashCode) + + metadata.hashCode + (name == null ? 0 : name.hashCode) + source_.hashCode + (state == null ? 0 : state.hashCode) + @@ -136,9 +132,9 @@ class IntegrationLinkCreateLinkCommandWrite { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.contains(r'data')) r'data': data, + r'data': data, r'integration': integration, - if (keys == null || keys.contains(r'metadata')) r'metadata': metadata, + r'metadata': metadata, if (keys == null || keys.contains(r'name')) r'name': name, r'source': source_, if (keys == null || keys.contains(r'state')) r'state': state, diff --git a/dart-v3/lib/model/integration_link_jsonhal_read.dart b/dart-v3/lib/model/integration_link_jsonhal_read.dart index 0dc098653..ebc65a662 100644 --- a/dart-v3/lib/model/integration_link_jsonhal_read.dart +++ b/dart-v3/lib/model/integration_link_jsonhal_read.dart @@ -7,16 +7,16 @@ part of keyclic_sdk_api_platform; class IntegrationLinkJsonhalRead { /// Returns a new [IntegrationLinkJsonhalRead] instance. IntegrationLinkJsonhalRead({ - this.links, - this.data, - this.metadata, + required this.links, + this.data = const {}, + this.metadata = const {}, this.name, required this.source_, - this.state, + this.state = const IntegrationLinkJsonhalReadStateEnum._('INACTIVE'), this.target, - this.id, - this.createdAt, - this.updatedAt, + required this.id, + required this.createdAt, + required this.updatedAt, }); /// Returns a new [IntegrationLinkJsonhalRead] instance and imports its values from @@ -27,47 +27,43 @@ class IntegrationLinkJsonhalRead { } return IntegrationLinkJsonhalRead( - links: AssetTypeJsonhalReadLinks.fromJson(json[r'_links']), - data: json[r'data'] == null - ? null - : Map.from(json[r'data']), - metadata: json[r'metadata'] == null - ? null - : Map.from(json[r'metadata']), + links: AssetTypeJsonhalReadLinks.fromJson(json[r'_links'])!, + data: Map.from(json[r'data']), + metadata: Map.from(json[r'metadata']), name: json[r'name'], source_: json[r'source'], - state: IntegrationLinkJsonhalReadStateEnum.fromJson(json[r'state']), + state: IntegrationLinkJsonhalReadStateEnum.fromJson(json[r'state'])!, target: json[r'target'], id: json[r'id'], - createdAt: mapToDateTime(json[r'createdAt']), - updatedAt: mapToDateTime(json[r'updatedAt']), + createdAt: mapToDateTime(json[r'createdAt'])!, + updatedAt: mapToDateTime(json[r'updatedAt'])!, ); } - AssetTypeJsonhalReadLinks? links; + AssetTypeJsonhalReadLinks links; - Map? data; + Map data; - Map? metadata; + Map metadata; String? name; /// Identify the unique identifier of the resource in the source system. String source_; - IntegrationLinkJsonhalReadStateEnum? state; + IntegrationLinkJsonhalReadStateEnum state; /// Identify the unique identifier of the resource in the target system. String? target; /// The resource identifier. - final String? id; + final String id; /// The date and time when the resource was created, in UTC format. - final DateTime? createdAt; + final DateTime createdAt; /// The date and time when the resource was updated, in UTC format. - final DateTime? updatedAt; + final DateTime updatedAt; @override bool operator ==(Object other) { @@ -91,16 +87,16 @@ class IntegrationLinkJsonhalRead { @override int get hashCode => - (links == null ? 0 : links.hashCode) + - (data == null ? 0 : data.hashCode) + - (metadata == null ? 0 : metadata.hashCode) + + links.hashCode + + data.hashCode + + metadata.hashCode + (name == null ? 0 : name.hashCode) + source_.hashCode + - (state == null ? 0 : state.hashCode) + + state.hashCode + (target == null ? 0 : target.hashCode) + - (id == null ? 0 : id.hashCode) + - (createdAt == null ? 0 : createdAt.hashCode) + - (updatedAt == null ? 0 : updatedAt.hashCode); + id.hashCode + + createdAt.hashCode + + updatedAt.hashCode; static List listFromJson(Iterable? json) { if (json == null) { @@ -156,26 +152,23 @@ class IntegrationLinkJsonhalRead { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.any((key) => RegExp(r'^links\.').hasMatch(key))) - r'_links': links?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^links\.'))) { - previousValue.add(element.split(RegExp(r'^links\.')).last); - } - - return previousValue; - })), - if (keys == null || keys.contains(r'data')) r'data': data, - if (keys == null || keys.contains(r'metadata')) r'metadata': metadata, + r'_links': links.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^links\.'))) { + previousValue.add(element.split(RegExp(r'^links\.')).last); + } + + return previousValue; + })), + r'data': data, + r'metadata': metadata, if (keys == null || keys.contains(r'name')) r'name': name, r'source': source_, - if (keys == null || keys.contains(r'state')) r'state': state, + r'state': state, if (keys == null || keys.contains(r'target')) r'target': target, - if (keys == null || keys.contains(r'id')) r'id': id, - if (keys == null || keys.contains(r'createdAt')) - r'createdAt': createdAt?.toUtc().toIso8601String(), - if (keys == null || keys.contains(r'updatedAt')) - r'updatedAt': updatedAt?.toUtc().toIso8601String(), + r'id': id, + r'createdAt': createdAt.toUtc().toIso8601String(), + r'updatedAt': updatedAt.toUtc().toIso8601String(), }; } } diff --git a/dart-v3/lib/model/marker_jsongeo_read.dart b/dart-v3/lib/model/marker_jsongeo_read.dart index e2aed0a01..0f76b7217 100644 --- a/dart-v3/lib/model/marker_jsongeo_read.dart +++ b/dart-v3/lib/model/marker_jsongeo_read.dart @@ -7,8 +7,8 @@ part of keyclic_sdk_api_platform; class MarkerJsongeoRead { /// Returns a new [MarkerJsongeoRead] instance. MarkerJsongeoRead({ - this.point, - this.id, + required this.point, + required this.id, }); /// Returns a new [MarkerJsongeoRead] instance and imports its values from @@ -19,15 +19,15 @@ class MarkerJsongeoRead { } return MarkerJsongeoRead( - point: PointJsongeoRead.fromJson(json[r'point']), + point: PointJsongeoRead.fromJson(json[r'point'])!, id: json[r'id'], ); } - PointJsongeoRead? point; + PointJsongeoRead point; /// The resource identifier. - final String? id; + final String id; @override bool operator ==(Object other) { @@ -40,8 +40,7 @@ class MarkerJsongeoRead { } @override - int get hashCode => - (point == null ? 0 : point.hashCode) + (id == null ? 0 : id.hashCode); + int get hashCode => point.hashCode + id.hashCode; static List listFromJson(Iterable? json) { if (json == null) { @@ -95,16 +94,15 @@ class MarkerJsongeoRead { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.any((key) => RegExp(r'^point\.').hasMatch(key))) - r'point': point?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^point\.'))) { - previousValue.add(element.split(RegExp(r'^point\.')).last); - } - - return previousValue; - })), - if (keys == null || keys.contains(r'id')) r'id': id, + r'point': point.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^point\.'))) { + previousValue.add(element.split(RegExp(r'^point\.')).last); + } + + return previousValue; + })), + r'id': id, }; } } diff --git a/dart-v3/lib/model/marker_jsonhal_read.dart b/dart-v3/lib/model/marker_jsonhal_read.dart index 4d3ac8af7..73d7667fd 100644 --- a/dart-v3/lib/model/marker_jsonhal_read.dart +++ b/dart-v3/lib/model/marker_jsonhal_read.dart @@ -7,8 +7,8 @@ part of keyclic_sdk_api_platform; class MarkerJsonhalRead { /// Returns a new [MarkerJsonhalRead] instance. MarkerJsonhalRead({ - this.point, - this.id, + required this.point, + required this.id, }); /// Returns a new [MarkerJsonhalRead] instance and imports its values from @@ -19,15 +19,15 @@ class MarkerJsonhalRead { } return MarkerJsonhalRead( - point: PointJsonhalRead.fromJson(json[r'point']), + point: PointJsonhalRead.fromJson(json[r'point'])!, id: json[r'id'], ); } - PointJsonhalRead? point; + PointJsonhalRead point; /// The resource identifier. - final String? id; + final String id; @override bool operator ==(Object other) { @@ -40,8 +40,7 @@ class MarkerJsonhalRead { } @override - int get hashCode => - (point == null ? 0 : point.hashCode) + (id == null ? 0 : id.hashCode); + int get hashCode => point.hashCode + id.hashCode; static List listFromJson(Iterable? json) { if (json == null) { @@ -95,16 +94,15 @@ class MarkerJsonhalRead { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.any((key) => RegExp(r'^point\.').hasMatch(key))) - r'point': point?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^point\.'))) { - previousValue.add(element.split(RegExp(r'^point\.')).last); - } - - return previousValue; - })), - if (keys == null || keys.contains(r'id')) r'id': id, + r'point': point.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^point\.'))) { + previousValue.add(element.split(RegExp(r'^point\.')).last); + } + + return previousValue; + })), + r'id': id, }; } } diff --git a/dart-v3/lib/model/member_jsonhal_read.dart b/dart-v3/lib/model/member_jsonhal_read.dart index 4b90272aa..959639bc5 100644 --- a/dart-v3/lib/model/member_jsonhal_read.dart +++ b/dart-v3/lib/model/member_jsonhal_read.dart @@ -7,13 +7,13 @@ part of keyclic_sdk_api_platform; class MemberJsonhalRead { /// Returns a new [MemberJsonhalRead] instance. MemberJsonhalRead({ - this.links, - this.contactPoint, - this.id, - this.createdAt, - this.updatedAt, + required this.links, + required this.contactPoint, + required this.id, + required this.createdAt, + required this.updatedAt, this.type, - this.embedded, + required this.embedded, }); /// Returns a new [MemberJsonhalRead] instance and imports its values from @@ -24,32 +24,32 @@ class MemberJsonhalRead { } return MemberJsonhalRead( - links: MemberJsonhalReadLinks.fromJson(json[r'_links']), - contactPoint: ContactPointJsonhalRead.fromJson(json[r'contactPoint']), + links: MemberJsonhalReadLinks.fromJson(json[r'_links'])!, + contactPoint: ContactPointJsonhalRead.fromJson(json[r'contactPoint'])!, id: json[r'id'], - createdAt: mapToDateTime(json[r'createdAt']), - updatedAt: mapToDateTime(json[r'updatedAt']), + createdAt: mapToDateTime(json[r'createdAt'])!, + updatedAt: mapToDateTime(json[r'updatedAt'])!, type: json[r'type'], - embedded: MemberJsonhalReadEmbedded.fromJson(json[r'_embedded']), + embedded: MemberJsonhalReadEmbedded.fromJson(json[r'_embedded'])!, ); } - MemberJsonhalReadLinks? links; + MemberJsonhalReadLinks links; - ContactPointJsonhalRead? contactPoint; + ContactPointJsonhalRead contactPoint; /// The resource identifier. - final String? id; + final String id; /// The date and time when the resource was created, in UTC format. - final DateTime? createdAt; + final DateTime createdAt; /// The date and time when the resource was updated, in UTC format. - final DateTime? updatedAt; + final DateTime updatedAt; final String? type; - MemberJsonhalReadEmbedded? embedded; + MemberJsonhalReadEmbedded embedded; @override bool operator ==(Object other) { @@ -70,13 +70,13 @@ class MemberJsonhalRead { @override int get hashCode => - (links == null ? 0 : links.hashCode) + - (contactPoint == null ? 0 : contactPoint.hashCode) + - (id == null ? 0 : id.hashCode) + - (createdAt == null ? 0 : createdAt.hashCode) + - (updatedAt == null ? 0 : updatedAt.hashCode) + + links.hashCode + + contactPoint.hashCode + + id.hashCode + + createdAt.hashCode + + updatedAt.hashCode + (type == null ? 0 : type.hashCode) + - (embedded == null ? 0 : embedded.hashCode); + embedded.hashCode; static List listFromJson(Iterable? json) { if (json == null) { @@ -131,41 +131,34 @@ class MemberJsonhalRead { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.any((key) => RegExp(r'^links\.').hasMatch(key))) - r'_links': links?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^links\.'))) { - previousValue.add(element.split(RegExp(r'^links\.')).last); - } - - return previousValue; - })), - if (keys == null || - keys.any((key) => RegExp(r'^contactPoint\.').hasMatch(key))) - r'contactPoint': contactPoint?.toJson(keys?.fold>( - [], (List previousValue, String element) { - if (element.contains(RegExp(r'^contactPoint\.'))) { - previousValue.add(element.split(RegExp(r'^contactPoint\.')).last); - } - - return previousValue; - })), - if (keys == null || keys.contains(r'id')) r'id': id, - if (keys == null || keys.contains(r'createdAt')) - r'createdAt': createdAt?.toUtc().toIso8601String(), - if (keys == null || keys.contains(r'updatedAt')) - r'updatedAt': updatedAt?.toUtc().toIso8601String(), + r'_links': links.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^links\.'))) { + previousValue.add(element.split(RegExp(r'^links\.')).last); + } + + return previousValue; + })), + r'contactPoint': contactPoint.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^contactPoint\.'))) { + previousValue.add(element.split(RegExp(r'^contactPoint\.')).last); + } + + return previousValue; + })), + r'id': id, + r'createdAt': createdAt.toUtc().toIso8601String(), + r'updatedAt': updatedAt.toUtc().toIso8601String(), if (keys == null || keys.contains(r'type')) r'type': type, - if (keys == null || - keys.any((key) => RegExp(r'^embedded\.').hasMatch(key))) - r'_embedded': embedded?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^embedded\.'))) { - previousValue.add(element.split(RegExp(r'^embedded\.')).last); - } - - return previousValue; - })), + r'_embedded': embedded.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^embedded\.'))) { + previousValue.add(element.split(RegExp(r'^embedded\.')).last); + } + + return previousValue; + })), }; } } diff --git a/dart-v3/lib/model/member_jsonhal_read_embedded.dart b/dart-v3/lib/model/member_jsonhal_read_embedded.dart index 2a1bd7b73..13804603d 100644 --- a/dart-v3/lib/model/member_jsonhal_read_embedded.dart +++ b/dart-v3/lib/model/member_jsonhal_read_embedded.dart @@ -7,7 +7,7 @@ part of keyclic_sdk_api_platform; class MemberJsonhalReadEmbedded { /// Returns a new [MemberJsonhalReadEmbedded] instance. MemberJsonhalReadEmbedded({ - this.organization, + required this.organization, this.person, this.roles, }); @@ -20,13 +20,13 @@ class MemberJsonhalReadEmbedded { } return MemberJsonhalReadEmbedded( - organization: OrganizationJsonhalRead.fromJson(json[r'organization']), + organization: OrganizationJsonhalRead.fromJson(json[r'organization'])!, person: PersonJsonhalRead.fromJson(json[r'person']), roles: RoleJsonhalRead.listFromJson(json[r'roles']), ); } - OrganizationJsonhalRead? organization; + OrganizationJsonhalRead organization; PersonJsonhalRead? person; @@ -47,7 +47,7 @@ class MemberJsonhalReadEmbedded { @override int get hashCode => - (organization == null ? 0 : organization.hashCode) + + organization.hashCode + (person == null ? 0 : person.hashCode) + (roles == null ? 0 : roles.hashCode); @@ -105,16 +105,14 @@ class MemberJsonhalReadEmbedded { Map toJson([Iterable? keys]) { return { - if (keys == null || - keys.any((key) => RegExp(r'^organization\.').hasMatch(key))) - r'organization': organization?.toJson(keys?.fold>( - [], (List previousValue, String element) { - if (element.contains(RegExp(r'^organization\.'))) { - previousValue.add(element.split(RegExp(r'^organization\.')).last); - } - - return previousValue; - })), + r'organization': organization.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^organization\.'))) { + previousValue.add(element.split(RegExp(r'^organization\.')).last); + } + + return previousValue; + })), if (keys == null || keys.any((key) => RegExp(r'^person\.').hasMatch(key))) r'person': person?.toJson(keys?.fold>([], (List previousValue, String element) { diff --git a/dart-v3/lib/model/member_jsonhal_read_links.dart b/dart-v3/lib/model/member_jsonhal_read_links.dart index 8561169f7..2fd361399 100644 --- a/dart-v3/lib/model/member_jsonhal_read_links.dart +++ b/dart-v3/lib/model/member_jsonhal_read_links.dart @@ -7,7 +7,7 @@ part of keyclic_sdk_api_platform; class MemberJsonhalReadLinks { /// Returns a new [MemberJsonhalReadLinks] instance. MemberJsonhalReadLinks({ - this.self, + required this.self, this.roles, }); @@ -19,13 +19,13 @@ class MemberJsonhalReadLinks { } return MemberJsonhalReadLinks( - self: GetPlaceCollection200ResponseLinksSelf.fromJson(json[r'self']), + self: GetPlaceCollection200ResponseLinksSelf.fromJson(json[r'self'])!, roles: GetPlaceCollection200ResponseLinksSelf.listFromJson(json[r'roles']), ); } - GetPlaceCollection200ResponseLinksSelf? self; + GetPlaceCollection200ResponseLinksSelf self; List? roles; @@ -42,8 +42,7 @@ class MemberJsonhalReadLinks { } @override - int get hashCode => - (self == null ? 0 : self.hashCode) + (roles == null ? 0 : roles.hashCode); + int get hashCode => self.hashCode + (roles == null ? 0 : roles.hashCode); static List listFromJson(Iterable? json) { if (json == null) { @@ -98,15 +97,14 @@ class MemberJsonhalReadLinks { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.any((key) => RegExp(r'^self\.').hasMatch(key))) - r'self': self?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^self\.'))) { - previousValue.add(element.split(RegExp(r'^self\.')).last); - } - - return previousValue; - })), + r'self': self.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^self\.'))) { + previousValue.add(element.split(RegExp(r'^self\.')).last); + } + + return previousValue; + })), if (keys == null || keys.contains(r'roles')) r'roles': roles, }; } diff --git a/dart-v3/lib/model/metric_jsonhal_read.dart b/dart-v3/lib/model/metric_jsonhal_read.dart index f801ccb88..fad56afef 100644 --- a/dart-v3/lib/model/metric_jsonhal_read.dart +++ b/dart-v3/lib/model/metric_jsonhal_read.dart @@ -7,8 +7,8 @@ part of keyclic_sdk_api_platform; class MetricJsonhalRead { /// Returns a new [MetricJsonhalRead] instance. MetricJsonhalRead({ - this.links, - this.duration, + required this.links, + required this.duration, required this.name, }); @@ -20,15 +20,15 @@ class MetricJsonhalRead { } return MetricJsonhalRead( - links: AssetTypeJsonhalReadLinks.fromJson(json[r'_links']), - duration: DurationJsonhalRead.fromJson(json[r'duration']), + links: AssetTypeJsonhalReadLinks.fromJson(json[r'_links'])!, + duration: DurationJsonhalRead.fromJson(json[r'duration'])!, name: json[r'name'], ); } - AssetTypeJsonhalReadLinks? links; + AssetTypeJsonhalReadLinks links; - DurationJsonhalRead? duration; + DurationJsonhalRead duration; String name; @@ -46,10 +46,7 @@ class MetricJsonhalRead { } @override - int get hashCode => - (links == null ? 0 : links.hashCode) + - (duration == null ? 0 : duration.hashCode) + - name.hashCode; + int get hashCode => links.hashCode + duration.hashCode + name.hashCode; static List listFromJson(Iterable? json) { if (json == null) { @@ -104,25 +101,22 @@ class MetricJsonhalRead { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.any((key) => RegExp(r'^links\.').hasMatch(key))) - r'_links': links?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^links\.'))) { - previousValue.add(element.split(RegExp(r'^links\.')).last); - } - - return previousValue; - })), - if (keys == null || - keys.any((key) => RegExp(r'^duration\.').hasMatch(key))) - r'duration': duration?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^duration\.'))) { - previousValue.add(element.split(RegExp(r'^duration\.')).last); - } - - return previousValue; - })), + r'_links': links.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^links\.'))) { + previousValue.add(element.split(RegExp(r'^links\.')).last); + } + + return previousValue; + })), + r'duration': duration.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^duration\.'))) { + previousValue.add(element.split(RegExp(r'^duration\.')).last); + } + + return previousValue; + })), r'name': name, }; } diff --git a/dart-v3/lib/model/node_jsongeo_read.dart b/dart-v3/lib/model/node_jsongeo_read.dart index 0b4584e76..77c486cdf 100644 --- a/dart-v3/lib/model/node_jsongeo_read.dart +++ b/dart-v3/lib/model/node_jsongeo_read.dart @@ -7,8 +7,8 @@ part of keyclic_sdk_api_platform; class NodeJsongeoRead { /// Returns a new [NodeJsongeoRead] instance. NodeJsongeoRead({ - this.id, - this.name, + required this.id, + required this.name, }); /// Returns a new [NodeJsongeoRead] instance and imports its values from @@ -24,9 +24,9 @@ class NodeJsongeoRead { ); } - String? id; + String id; - String? name; + String name; @override bool operator ==(Object other) { @@ -39,8 +39,7 @@ class NodeJsongeoRead { } @override - int get hashCode => - (id == null ? 0 : id.hashCode) + (name == null ? 0 : name.hashCode); + int get hashCode => id.hashCode + name.hashCode; static List listFromJson(Iterable? json) { if (json == null) { @@ -92,8 +91,8 @@ class NodeJsongeoRead { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.contains(r'id')) r'id': id, - if (keys == null || keys.contains(r'name')) r'name': name, + r'id': id, + r'name': name, }; } } diff --git a/dart-v3/lib/model/node_jsonhal_read.dart b/dart-v3/lib/model/node_jsonhal_read.dart index 361ced924..af147cba2 100644 --- a/dart-v3/lib/model/node_jsonhal_read.dart +++ b/dart-v3/lib/model/node_jsonhal_read.dart @@ -7,8 +7,8 @@ part of keyclic_sdk_api_platform; class NodeJsonhalRead { /// Returns a new [NodeJsonhalRead] instance. NodeJsonhalRead({ - this.id, - this.name, + required this.id, + required this.name, }); /// Returns a new [NodeJsonhalRead] instance and imports its values from @@ -24,9 +24,9 @@ class NodeJsonhalRead { ); } - String? id; + String id; - String? name; + String name; @override bool operator ==(Object other) { @@ -39,8 +39,7 @@ class NodeJsonhalRead { } @override - int get hashCode => - (id == null ? 0 : id.hashCode) + (name == null ? 0 : name.hashCode); + int get hashCode => id.hashCode + name.hashCode; static List listFromJson(Iterable? json) { if (json == null) { @@ -92,8 +91,8 @@ class NodeJsonhalRead { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.contains(r'id')) r'id': id, - if (keys == null || keys.contains(r'name')) r'name': name, + r'id': id, + r'name': name, }; } } diff --git a/dart-v3/lib/model/occupant_jsonhal_read.dart b/dart-v3/lib/model/occupant_jsonhal_read.dart index 2fa0b9a39..04125642c 100644 --- a/dart-v3/lib/model/occupant_jsonhal_read.dart +++ b/dart-v3/lib/model/occupant_jsonhal_read.dart @@ -7,12 +7,12 @@ part of keyclic_sdk_api_platform; class OccupantJsonhalRead { /// Returns a new [OccupantJsonhalRead] instance. OccupantJsonhalRead({ - this.links, - this.id, - this.createdAt, - this.updatedAt, + required this.links, + required this.id, + required this.createdAt, + required this.updatedAt, this.type, - this.embedded, + required this.embedded, }); /// Returns a new [OccupantJsonhalRead] instance and imports its values from @@ -23,29 +23,29 @@ class OccupantJsonhalRead { } return OccupantJsonhalRead( - links: AssetTypeJsonhalReadLinks.fromJson(json[r'_links']), + links: AssetTypeJsonhalReadLinks.fromJson(json[r'_links'])!, id: json[r'id'], - createdAt: mapToDateTime(json[r'createdAt']), - updatedAt: mapToDateTime(json[r'updatedAt']), + createdAt: mapToDateTime(json[r'createdAt'])!, + updatedAt: mapToDateTime(json[r'updatedAt'])!, type: json[r'type'], - embedded: OccupantJsonhalReadEmbedded.fromJson(json[r'_embedded']), + embedded: OccupantJsonhalReadEmbedded.fromJson(json[r'_embedded'])!, ); } - AssetTypeJsonhalReadLinks? links; + AssetTypeJsonhalReadLinks links; /// The resource identifier. - final String? id; + final String id; /// The date and time when the resource was created, in UTC format. - final DateTime? createdAt; + final DateTime createdAt; /// The date and time when the resource was updated, in UTC format. - final DateTime? updatedAt; + final DateTime updatedAt; final String? type; - OccupantJsonhalReadEmbedded? embedded; + OccupantJsonhalReadEmbedded embedded; @override bool operator ==(Object other) { @@ -65,12 +65,12 @@ class OccupantJsonhalRead { @override int get hashCode => - (links == null ? 0 : links.hashCode) + - (id == null ? 0 : id.hashCode) + - (createdAt == null ? 0 : createdAt.hashCode) + - (updatedAt == null ? 0 : updatedAt.hashCode) + + links.hashCode + + id.hashCode + + createdAt.hashCode + + updatedAt.hashCode + (type == null ? 0 : type.hashCode) + - (embedded == null ? 0 : embedded.hashCode); + embedded.hashCode; static List listFromJson(Iterable? json) { if (json == null) { @@ -125,31 +125,26 @@ class OccupantJsonhalRead { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.any((key) => RegExp(r'^links\.').hasMatch(key))) - r'_links': links?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^links\.'))) { - previousValue.add(element.split(RegExp(r'^links\.')).last); - } - - return previousValue; - })), - if (keys == null || keys.contains(r'id')) r'id': id, - if (keys == null || keys.contains(r'createdAt')) - r'createdAt': createdAt?.toUtc().toIso8601String(), - if (keys == null || keys.contains(r'updatedAt')) - r'updatedAt': updatedAt?.toUtc().toIso8601String(), + r'_links': links.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^links\.'))) { + previousValue.add(element.split(RegExp(r'^links\.')).last); + } + + return previousValue; + })), + r'id': id, + r'createdAt': createdAt.toUtc().toIso8601String(), + r'updatedAt': updatedAt.toUtc().toIso8601String(), if (keys == null || keys.contains(r'type')) r'type': type, - if (keys == null || - keys.any((key) => RegExp(r'^embedded\.').hasMatch(key))) - r'_embedded': embedded?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^embedded\.'))) { - previousValue.add(element.split(RegExp(r'^embedded\.')).last); - } - - return previousValue; - })), + r'_embedded': embedded.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^embedded\.'))) { + previousValue.add(element.split(RegExp(r'^embedded\.')).last); + } + + return previousValue; + })), }; } } diff --git a/dart-v3/lib/model/occupant_jsonhal_read_embedded.dart b/dart-v3/lib/model/occupant_jsonhal_read_embedded.dart index f5455f00f..ebf45b7e1 100644 --- a/dart-v3/lib/model/occupant_jsonhal_read_embedded.dart +++ b/dart-v3/lib/model/occupant_jsonhal_read_embedded.dart @@ -7,8 +7,8 @@ part of keyclic_sdk_api_platform; class OccupantJsonhalReadEmbedded { /// Returns a new [OccupantJsonhalReadEmbedded] instance. OccupantJsonhalReadEmbedded({ - this.place, - this.member, + required this.place, + required this.member, }); /// Returns a new [OccupantJsonhalReadEmbedded] instance and imports its values from @@ -19,14 +19,14 @@ class OccupantJsonhalReadEmbedded { } return OccupantJsonhalReadEmbedded( - place: AssetJsonhalRead.fromJson(json[r'place']), - member: ContactJsonhalRead.fromJson(json[r'member']), + place: AssetJsonhalRead.fromJson(json[r'place'])!, + member: ContactJsonhalRead.fromJson(json[r'member'])!, ); } - AssetJsonhalRead? place; + AssetJsonhalRead place; - ContactJsonhalRead? member; + ContactJsonhalRead member; @override bool operator ==(Object other) { @@ -41,9 +41,7 @@ class OccupantJsonhalReadEmbedded { } @override - int get hashCode => - (place == null ? 0 : place.hashCode) + - (member == null ? 0 : member.hashCode); + int get hashCode => place.hashCode + member.hashCode; static List listFromJson(Iterable? json) { if (json == null) { @@ -99,24 +97,22 @@ class OccupantJsonhalReadEmbedded { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.any((key) => RegExp(r'^place\.').hasMatch(key))) - r'place': place?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^place\.'))) { - previousValue.add(element.split(RegExp(r'^place\.')).last); - } - - return previousValue; - })), - if (keys == null || keys.any((key) => RegExp(r'^member\.').hasMatch(key))) - r'member': member?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^member\.'))) { - previousValue.add(element.split(RegExp(r'^member\.')).last); - } - - return previousValue; - })), + r'place': place.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^place\.'))) { + previousValue.add(element.split(RegExp(r'^place\.')).last); + } + + return previousValue; + })), + r'member': member.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^member\.'))) { + previousValue.add(element.split(RegExp(r'^member\.')).last); + } + + return previousValue; + })), }; } } diff --git a/dart-v3/lib/model/organization_jsonhal_read.dart b/dart-v3/lib/model/organization_jsonhal_read.dart index 678e81bc4..1bc8cf8bc 100644 --- a/dart-v3/lib/model/organization_jsonhal_read.dart +++ b/dart-v3/lib/model/organization_jsonhal_read.dart @@ -7,15 +7,15 @@ part of keyclic_sdk_api_platform; class OrganizationJsonhalRead { /// Returns a new [OrganizationJsonhalRead] instance. OrganizationJsonhalRead({ - this.links, + required this.links, this.alternateName, this.description, this.logo, required this.name, - this.preferences, - this.id, + required this.preferences, + required this.id, this.address, - this.archived, + required this.archived, }); /// Returns a new [OrganizationJsonhalRead] instance and imports its values from @@ -26,20 +26,20 @@ class OrganizationJsonhalRead { } return OrganizationJsonhalRead( - links: OrganizationJsonhalReadLinks.fromJson(json[r'_links']), + links: OrganizationJsonhalReadLinks.fromJson(json[r'_links'])!, alternateName: json[r'alternateName'], description: json[r'description'], logo: json[r'logo'], name: json[r'name'], preferences: - PreferencesJsonhalOrganizationRead.fromJson(json[r'preferences']), + PreferencesJsonhalOrganizationRead.fromJson(json[r'preferences'])!, id: json[r'id'], address: PostalAddressJsonhalRead.fromJson(json[r'address']), archived: json[r'archived'], ); } - OrganizationJsonhalReadLinks? links; + OrganizationJsonhalReadLinks links; String? alternateName; @@ -49,14 +49,14 @@ class OrganizationJsonhalRead { String name; - PreferencesJsonhalOrganizationRead? preferences; + PreferencesJsonhalOrganizationRead preferences; /// The resource identifier. - final String? id; + final String id; PostalAddressJsonhalRead? address; - bool? archived; + bool archived; @override bool operator ==(Object other) { @@ -79,15 +79,15 @@ class OrganizationJsonhalRead { @override int get hashCode => - (links == null ? 0 : links.hashCode) + + links.hashCode + (alternateName == null ? 0 : alternateName.hashCode) + (description == null ? 0 : description.hashCode) + (logo == null ? 0 : logo.hashCode) + name.hashCode + - (preferences == null ? 0 : preferences.hashCode) + - (id == null ? 0 : id.hashCode) + + preferences.hashCode + + id.hashCode + (address == null ? 0 : address.hashCode) + - (archived == null ? 0 : archived.hashCode); + archived.hashCode; static List listFromJson(Iterable? json) { if (json == null) { @@ -143,32 +143,29 @@ class OrganizationJsonhalRead { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.any((key) => RegExp(r'^links\.').hasMatch(key))) - r'_links': links?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^links\.'))) { - previousValue.add(element.split(RegExp(r'^links\.')).last); - } - - return previousValue; - })), + r'_links': links.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^links\.'))) { + previousValue.add(element.split(RegExp(r'^links\.')).last); + } + + return previousValue; + })), if (keys == null || keys.contains(r'alternateName')) r'alternateName': alternateName, if (keys == null || keys.contains(r'description')) r'description': description, if (keys == null || keys.contains(r'logo')) r'logo': logo, r'name': name, - if (keys == null || - keys.any((key) => RegExp(r'^preferences\.').hasMatch(key))) - r'preferences': preferences?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^preferences\.'))) { - previousValue.add(element.split(RegExp(r'^preferences\.')).last); - } - - return previousValue; - })), - if (keys == null || keys.contains(r'id')) r'id': id, + r'preferences': preferences.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^preferences\.'))) { + previousValue.add(element.split(RegExp(r'^preferences\.')).last); + } + + return previousValue; + })), + r'id': id, if (keys == null || keys.any((key) => RegExp(r'^address\.').hasMatch(key))) r'address': address?.toJson(keys?.fold>([], @@ -179,7 +176,7 @@ class OrganizationJsonhalRead { return previousValue; })), - if (keys == null || keys.contains(r'archived')) r'archived': archived, + r'archived': archived, }; } } diff --git a/dart-v3/lib/model/organization_jsonhal_read_links.dart b/dart-v3/lib/model/organization_jsonhal_read_links.dart index 3d5c08f56..e81c88daa 100644 --- a/dart-v3/lib/model/organization_jsonhal_read_links.dart +++ b/dart-v3/lib/model/organization_jsonhal_read_links.dart @@ -7,7 +7,7 @@ part of keyclic_sdk_api_platform; class OrganizationJsonhalReadLinks { /// Returns a new [OrganizationJsonhalReadLinks] instance. OrganizationJsonhalReadLinks({ - this.self, + required this.self, this.dispatcher, }); @@ -19,13 +19,13 @@ class OrganizationJsonhalReadLinks { } return OrganizationJsonhalReadLinks( - self: GetPlaceCollection200ResponseLinksSelf.fromJson(json[r'self']), + self: GetPlaceCollection200ResponseLinksSelf.fromJson(json[r'self'])!, dispatcher: GetPlaceCollection200ResponseLinksFirst.fromJson(json[r'dispatcher']), ); } - GetPlaceCollection200ResponseLinksSelf? self; + GetPlaceCollection200ResponseLinksSelf self; GetPlaceCollection200ResponseLinksFirst? dispatcher; @@ -43,8 +43,7 @@ class OrganizationJsonhalReadLinks { @override int get hashCode => - (self == null ? 0 : self.hashCode) + - (dispatcher == null ? 0 : dispatcher.hashCode); + self.hashCode + (dispatcher == null ? 0 : dispatcher.hashCode); static List listFromJson(Iterable? json) { if (json == null) { @@ -100,15 +99,14 @@ class OrganizationJsonhalReadLinks { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.any((key) => RegExp(r'^self\.').hasMatch(key))) - r'self': self?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^self\.'))) { - previousValue.add(element.split(RegExp(r'^self\.')).last); - } - - return previousValue; - })), + r'self': self.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^self\.'))) { + previousValue.add(element.split(RegExp(r'^self\.')).last); + } + + return previousValue; + })), if (keys == null || keys.any((key) => RegExp(r'^dispatcher\.').hasMatch(key))) r'dispatcher': dispatcher?.toJson(keys?.fold>([], diff --git a/dart-v3/lib/model/person_jsonhal_read.dart b/dart-v3/lib/model/person_jsonhal_read.dart index 7210c34f9..7ef912bb2 100644 --- a/dart-v3/lib/model/person_jsonhal_read.dart +++ b/dart-v3/lib/model/person_jsonhal_read.dart @@ -7,19 +7,19 @@ part of keyclic_sdk_api_platform; class PersonJsonhalRead { /// Returns a new [PersonJsonhalRead] instance. PersonJsonhalRead({ - this.links, - this.id, + required this.links, + required this.id, this.image, this.jobTitle, - this.optIn, + required this.optIn, this.telephone, - this.email, - this.username, - this.enabled, + required this.email, + required this.username, + required this.enabled, this.familyName, this.givenName, - this.createdAt, - this.updatedAt, + required this.createdAt, + required this.updatedAt, }); /// Returns a new [PersonJsonhalRead] instance and imports its values from @@ -30,7 +30,7 @@ class PersonJsonhalRead { } return PersonJsonhalRead( - links: AssetTypeJsonhalReadLinks.fromJson(json[r'_links']), + links: AssetTypeJsonhalReadLinks.fromJson(json[r'_links'])!, id: json[r'id'], image: json[r'image'], jobTitle: json[r'jobTitle'], @@ -41,28 +41,28 @@ class PersonJsonhalRead { enabled: json[r'enabled'], familyName: json[r'familyName'], givenName: json[r'givenName'], - createdAt: mapToDateTime(json[r'createdAt']), - updatedAt: mapToDateTime(json[r'updatedAt']), + createdAt: mapToDateTime(json[r'createdAt'])!, + updatedAt: mapToDateTime(json[r'updatedAt'])!, ); } - AssetTypeJsonhalReadLinks? links; + AssetTypeJsonhalReadLinks links; - final String? id; + final String id; String? image; String? jobTitle; - bool? optIn; + bool optIn; String? telephone; - String? email; + String email; - String? username; + String username; - bool? enabled; + bool enabled; /// Family name. In the U.S., the last name of a Person. String? familyName; @@ -71,10 +71,10 @@ class PersonJsonhalRead { String? givenName; /// The date and time when the resource was created, in UTC format. - final DateTime? createdAt; + final DateTime createdAt; /// The date and time when the resource was updated, in UTC format. - final DateTime? updatedAt; + final DateTime updatedAt; @override bool operator ==(Object other) { @@ -101,19 +101,19 @@ class PersonJsonhalRead { @override int get hashCode => - (links == null ? 0 : links.hashCode) + - (id == null ? 0 : id.hashCode) + + links.hashCode + + id.hashCode + (image == null ? 0 : image.hashCode) + (jobTitle == null ? 0 : jobTitle.hashCode) + - (optIn == null ? 0 : optIn.hashCode) + + optIn.hashCode + (telephone == null ? 0 : telephone.hashCode) + - (email == null ? 0 : email.hashCode) + - (username == null ? 0 : username.hashCode) + - (enabled == null ? 0 : enabled.hashCode) + + email.hashCode + + username.hashCode + + enabled.hashCode + (familyName == null ? 0 : familyName.hashCode) + (givenName == null ? 0 : givenName.hashCode) + - (createdAt == null ? 0 : createdAt.hashCode) + - (updatedAt == null ? 0 : updatedAt.hashCode); + createdAt.hashCode + + updatedAt.hashCode; static List listFromJson(Iterable? json) { if (json == null) { @@ -168,30 +168,27 @@ class PersonJsonhalRead { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.any((key) => RegExp(r'^links\.').hasMatch(key))) - r'_links': links?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^links\.'))) { - previousValue.add(element.split(RegExp(r'^links\.')).last); - } - - return previousValue; - })), - if (keys == null || keys.contains(r'id')) r'id': id, + r'_links': links.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^links\.'))) { + previousValue.add(element.split(RegExp(r'^links\.')).last); + } + + return previousValue; + })), + r'id': id, if (keys == null || keys.contains(r'image')) r'image': image, if (keys == null || keys.contains(r'jobTitle')) r'jobTitle': jobTitle, - if (keys == null || keys.contains(r'optIn')) r'optIn': optIn, + r'optIn': optIn, if (keys == null || keys.contains(r'telephone')) r'telephone': telephone, - if (keys == null || keys.contains(r'email')) r'email': email, - if (keys == null || keys.contains(r'username')) r'username': username, - if (keys == null || keys.contains(r'enabled')) r'enabled': enabled, + r'email': email, + r'username': username, + r'enabled': enabled, if (keys == null || keys.contains(r'familyName')) r'familyName': familyName, if (keys == null || keys.contains(r'givenName')) r'givenName': givenName, - if (keys == null || keys.contains(r'createdAt')) - r'createdAt': createdAt?.toUtc().toIso8601String(), - if (keys == null || keys.contains(r'updatedAt')) - r'updatedAt': updatedAt?.toUtc().toIso8601String(), + r'createdAt': createdAt.toUtc().toIso8601String(), + r'updatedAt': updatedAt.toUtc().toIso8601String(), }; } } diff --git a/dart-v3/lib/model/place_jsongeo_read.dart b/dart-v3/lib/model/place_jsongeo_read.dart index 88b57a9b6..a1f6b12c5 100644 --- a/dart-v3/lib/model/place_jsongeo_read.dart +++ b/dart-v3/lib/model/place_jsongeo_read.dart @@ -7,11 +7,11 @@ part of keyclic_sdk_api_platform; class PlaceJsongeoRead { /// Returns a new [PlaceJsongeoRead] instance. PlaceJsongeoRead({ - this.id, + required this.id, this.description, required this.name, this.preferences, - this.path, + this.path = const [], this.address, this.parent, this.state, @@ -37,7 +37,7 @@ class PlaceJsongeoRead { } /// The resource identifier. - final String? id; + final String id; String? description; @@ -45,7 +45,7 @@ class PlaceJsongeoRead { PreferencesJsongeoAssetRead? preferences; - final List? path; + final List path; PostalAddressJsongeoRead? address; @@ -73,11 +73,11 @@ class PlaceJsongeoRead { @override int get hashCode => - (id == null ? 0 : id.hashCode) + + id.hashCode + (description == null ? 0 : description.hashCode) + name.hashCode + (preferences == null ? 0 : preferences.hashCode) + - (path == null ? 0 : path.hashCode) + + path.hashCode + (address == null ? 0 : address.hashCode) + (parent == null ? 0 : parent.hashCode) + (state == null ? 0 : state.hashCode); @@ -133,7 +133,7 @@ class PlaceJsongeoRead { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.contains(r'id')) r'id': id, + r'id': id, if (keys == null || keys.contains(r'description')) r'description': description, r'name': name, @@ -147,7 +147,7 @@ class PlaceJsongeoRead { return previousValue; })), - if (keys == null || keys.contains(r'path')) r'path': path, + r'path': path, if (keys == null || keys.any((key) => RegExp(r'^address\.').hasMatch(key))) r'address': address?.toJson(keys?.fold>([], diff --git a/dart-v3/lib/model/place_jsonhal_read.dart b/dart-v3/lib/model/place_jsonhal_read.dart index 62d7ff866..6d294f465 100644 --- a/dart-v3/lib/model/place_jsonhal_read.dart +++ b/dart-v3/lib/model/place_jsonhal_read.dart @@ -7,15 +7,15 @@ part of keyclic_sdk_api_platform; class PlaceJsonhalRead { /// Returns a new [PlaceJsonhalRead] instance. PlaceJsonhalRead({ - this.links, + required this.links, this.branchCode, - this.id, - this.createdAt, - this.updatedAt, + required this.id, + required this.createdAt, + required this.updatedAt, this.description, required this.name, this.preferences, - this.path, + this.path = const [], this.address, }); @@ -27,11 +27,11 @@ class PlaceJsonhalRead { } return PlaceJsonhalRead( - links: AssetJsonhalReadLinks.fromJson(json[r'_links']), + links: AssetJsonhalReadLinks.fromJson(json[r'_links'])!, branchCode: json[r'branchCode'], id: json[r'id'], - createdAt: mapToDateTime(json[r'createdAt']), - updatedAt: mapToDateTime(json[r'updatedAt']), + createdAt: mapToDateTime(json[r'createdAt'])!, + updatedAt: mapToDateTime(json[r'updatedAt'])!, description: json[r'description'], name: json[r'name'], preferences: PreferencesJsonhalAssetRead.fromJson(json[r'preferences']), @@ -40,18 +40,18 @@ class PlaceJsonhalRead { ); } - AssetJsonhalReadLinks? links; + AssetJsonhalReadLinks links; String? branchCode; /// The resource identifier. - final String? id; + final String id; /// The date and time when the resource was created, in UTC format. - final DateTime? createdAt; + final DateTime createdAt; /// The date and time when the resource was updated, in UTC format. - final DateTime? updatedAt; + final DateTime updatedAt; String? description; @@ -59,7 +59,7 @@ class PlaceJsonhalRead { PreferencesJsonhalAssetRead? preferences; - final List? path; + final List path; PostalAddressJsonhalRead? address; @@ -85,15 +85,15 @@ class PlaceJsonhalRead { @override int get hashCode => - (links == null ? 0 : links.hashCode) + + links.hashCode + (branchCode == null ? 0 : branchCode.hashCode) + - (id == null ? 0 : id.hashCode) + - (createdAt == null ? 0 : createdAt.hashCode) + - (updatedAt == null ? 0 : updatedAt.hashCode) + + id.hashCode + + createdAt.hashCode + + updatedAt.hashCode + (description == null ? 0 : description.hashCode) + name.hashCode + (preferences == null ? 0 : preferences.hashCode) + - (path == null ? 0 : path.hashCode) + + path.hashCode + (address == null ? 0 : address.hashCode); static List listFromJson(Iterable? json) { @@ -147,22 +147,19 @@ class PlaceJsonhalRead { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.any((key) => RegExp(r'^links\.').hasMatch(key))) - r'_links': links?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^links\.'))) { - previousValue.add(element.split(RegExp(r'^links\.')).last); - } - - return previousValue; - })), + r'_links': links.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^links\.'))) { + previousValue.add(element.split(RegExp(r'^links\.')).last); + } + + return previousValue; + })), if (keys == null || keys.contains(r'branchCode')) r'branchCode': branchCode, - if (keys == null || keys.contains(r'id')) r'id': id, - if (keys == null || keys.contains(r'createdAt')) - r'createdAt': createdAt?.toUtc().toIso8601String(), - if (keys == null || keys.contains(r'updatedAt')) - r'updatedAt': updatedAt?.toUtc().toIso8601String(), + r'id': id, + r'createdAt': createdAt.toUtc().toIso8601String(), + r'updatedAt': updatedAt.toUtc().toIso8601String(), if (keys == null || keys.contains(r'description')) r'description': description, r'name': name, @@ -176,7 +173,7 @@ class PlaceJsonhalRead { return previousValue; })), - if (keys == null || keys.contains(r'path')) r'path': path, + r'path': path, if (keys == null || keys.any((key) => RegExp(r'^address\.').hasMatch(key))) r'address': address?.toJson(keys?.fold>([], diff --git a/dart-v3/lib/model/point_jsongeo_read.dart b/dart-v3/lib/model/point_jsongeo_read.dart index 097b429a4..19c5a9685 100644 --- a/dart-v3/lib/model/point_jsongeo_read.dart +++ b/dart-v3/lib/model/point_jsongeo_read.dart @@ -7,9 +7,9 @@ part of keyclic_sdk_api_platform; class PointJsongeoRead { /// Returns a new [PointJsongeoRead] instance. PointJsongeoRead({ - this.srid, - this.latitude, - this.longitude, + required this.srid, + required this.latitude, + required this.longitude, }); /// Returns a new [PointJsongeoRead] instance and imports its values from @@ -27,11 +27,11 @@ class PointJsongeoRead { ); } - int? srid; + int srid; - num? latitude; + num latitude; - num? longitude; + num longitude; @override bool operator ==(Object other) { @@ -47,10 +47,7 @@ class PointJsongeoRead { } @override - int get hashCode => - (srid == null ? 0 : srid.hashCode) + - (latitude == null ? 0 : latitude.hashCode) + - (longitude == null ? 0 : longitude.hashCode); + int get hashCode => srid.hashCode + latitude.hashCode + longitude.hashCode; static List listFromJson(Iterable? json) { if (json == null) { @@ -103,9 +100,9 @@ class PointJsongeoRead { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.contains(r'srid')) r'srid': srid, - if (keys == null || keys.contains(r'latitude')) r'latitude': latitude, - if (keys == null || keys.contains(r'longitude')) r'longitude': longitude, + r'srid': srid, + r'latitude': latitude, + r'longitude': longitude, }; } } diff --git a/dart-v3/lib/model/point_jsonhal_read.dart b/dart-v3/lib/model/point_jsonhal_read.dart index 19b19c573..b47906c52 100644 --- a/dart-v3/lib/model/point_jsonhal_read.dart +++ b/dart-v3/lib/model/point_jsonhal_read.dart @@ -7,9 +7,9 @@ part of keyclic_sdk_api_platform; class PointJsonhalRead { /// Returns a new [PointJsonhalRead] instance. PointJsonhalRead({ - this.srid, - this.latitude, - this.longitude, + required this.srid, + required this.latitude, + required this.longitude, }); /// Returns a new [PointJsonhalRead] instance and imports its values from @@ -27,11 +27,11 @@ class PointJsonhalRead { ); } - int? srid; + int srid; - num? latitude; + num latitude; - num? longitude; + num longitude; @override bool operator ==(Object other) { @@ -47,10 +47,7 @@ class PointJsonhalRead { } @override - int get hashCode => - (srid == null ? 0 : srid.hashCode) + - (latitude == null ? 0 : latitude.hashCode) + - (longitude == null ? 0 : longitude.hashCode); + int get hashCode => srid.hashCode + latitude.hashCode + longitude.hashCode; static List listFromJson(Iterable? json) { if (json == null) { @@ -103,9 +100,9 @@ class PointJsonhalRead { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.contains(r'srid')) r'srid': srid, - if (keys == null || keys.contains(r'latitude')) r'latitude': latitude, - if (keys == null || keys.contains(r'longitude')) r'longitude': longitude, + r'srid': srid, + r'latitude': latitude, + r'longitude': longitude, }; } } diff --git a/dart-v3/lib/model/preferences_jsonhal_organization_read.dart b/dart-v3/lib/model/preferences_jsonhal_organization_read.dart index 9e77dacee..481e9a56f 100644 --- a/dart-v3/lib/model/preferences_jsonhal_organization_read.dart +++ b/dart-v3/lib/model/preferences_jsonhal_organization_read.dart @@ -7,17 +7,17 @@ part of keyclic_sdk_api_platform; class PreferencesJsonhalOrganizationRead { /// Returns a new [PreferencesJsonhalOrganizationRead] instance. PreferencesJsonhalOrganizationRead({ - this.archiving, - this.contract, - this.equipment, - this.feedbackParentPlace, - this.form, - this.offline, - this.public, - this.reference, - this.reverseGeocoding, - this.review, - this.sla, + required this.archiving, + required this.contract, + required this.equipment, + required this.feedbackParentPlace, + required this.form, + required this.offline, + required this.public, + required this.reference, + required this.reverseGeocoding, + required this.review, + required this.sla, }); /// Returns a new [PreferencesJsonhalOrganizationRead] instance and imports its values from @@ -29,44 +29,45 @@ class PreferencesJsonhalOrganizationRead { return PreferencesJsonhalOrganizationRead( archiving: ArchivingJsonhalOrganizationPreferenceRead.fromJson( - json[r'archiving']), - contract: - ContractJsonhalOrganizationPreferenceRead.fromJson(json[r'contract']), + json[r'archiving'])!, + contract: ContractJsonhalOrganizationPreferenceRead.fromJson( + json[r'contract'])!, equipment: EquipmentJsonhalOrganizationPreferenceRead.fromJson( - json[r'equipment']), + json[r'equipment'])!, feedbackParentPlace: json[r'feedbackParentPlace'], - form: FormJsonhalOrganizationPreferenceRead.fromJson(json[r'form']), + form: FormJsonhalOrganizationPreferenceRead.fromJson(json[r'form'])!, offline: json[r'offline'], public: json[r'public'], reference: ReferenceJsonhalOrganizationPreferenceRead.fromJson( - json[r'reference']), + json[r'reference'])!, reverseGeocoding: json[r'reverseGeocoding'], - review: ReviewJsonhalOrganizationPreferenceRead.fromJson(json[r'review']), - sla: SlaJsonhalOrganizationPreferenceRead.fromJson(json[r'sla']), + review: + ReviewJsonhalOrganizationPreferenceRead.fromJson(json[r'review'])!, + sla: SlaJsonhalOrganizationPreferenceRead.fromJson(json[r'sla'])!, ); } - ArchivingJsonhalOrganizationPreferenceRead? archiving; + ArchivingJsonhalOrganizationPreferenceRead archiving; - ContractJsonhalOrganizationPreferenceRead? contract; + ContractJsonhalOrganizationPreferenceRead contract; - EquipmentJsonhalOrganizationPreferenceRead? equipment; + EquipmentJsonhalOrganizationPreferenceRead equipment; - bool? feedbackParentPlace; + bool feedbackParentPlace; - FormJsonhalOrganizationPreferenceRead? form; + FormJsonhalOrganizationPreferenceRead form; - bool? offline; + bool offline; - bool? public; + bool public; - ReferenceJsonhalOrganizationPreferenceRead? reference; + ReferenceJsonhalOrganizationPreferenceRead reference; - bool? reverseGeocoding; + bool reverseGeocoding; - ReviewJsonhalOrganizationPreferenceRead? review; + ReviewJsonhalOrganizationPreferenceRead review; - SlaJsonhalOrganizationPreferenceRead? sla; + SlaJsonhalOrganizationPreferenceRead sla; @override bool operator ==(Object other) { @@ -91,17 +92,17 @@ class PreferencesJsonhalOrganizationRead { @override int get hashCode => - (archiving == null ? 0 : archiving.hashCode) + - (contract == null ? 0 : contract.hashCode) + - (equipment == null ? 0 : equipment.hashCode) + - (feedbackParentPlace == null ? 0 : feedbackParentPlace.hashCode) + - (form == null ? 0 : form.hashCode) + - (offline == null ? 0 : offline.hashCode) + - (public == null ? 0 : public.hashCode) + - (reference == null ? 0 : reference.hashCode) + - (reverseGeocoding == null ? 0 : reverseGeocoding.hashCode) + - (review == null ? 0 : review.hashCode) + - (sla == null ? 0 : sla.hashCode); + archiving.hashCode + + contract.hashCode + + equipment.hashCode + + feedbackParentPlace.hashCode + + form.hashCode + + offline.hashCode + + public.hashCode + + reference.hashCode + + reverseGeocoding.hashCode + + review.hashCode + + sla.hashCode; static List listFromJson(Iterable? json) { if (json == null) { @@ -158,79 +159,66 @@ class PreferencesJsonhalOrganizationRead { Map toJson([Iterable? keys]) { return { - if (keys == null || - keys.any((key) => RegExp(r'^archiving\.').hasMatch(key))) - r'archiving': archiving?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^archiving\.'))) { - previousValue.add(element.split(RegExp(r'^archiving\.')).last); - } - - return previousValue; - })), - if (keys == null || - keys.any((key) => RegExp(r'^contract\.').hasMatch(key))) - r'contract': contract?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^contract\.'))) { - previousValue.add(element.split(RegExp(r'^contract\.')).last); - } - - return previousValue; - })), - if (keys == null || - keys.any((key) => RegExp(r'^equipment\.').hasMatch(key))) - r'equipment': equipment?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^equipment\.'))) { - previousValue.add(element.split(RegExp(r'^equipment\.')).last); - } - - return previousValue; - })), - if (keys == null || keys.contains(r'feedbackParentPlace')) - r'feedbackParentPlace': feedbackParentPlace, - if (keys == null || keys.any((key) => RegExp(r'^form\.').hasMatch(key))) - r'form': form?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^form\.'))) { - previousValue.add(element.split(RegExp(r'^form\.')).last); - } - - return previousValue; - })), - if (keys == null || keys.contains(r'offline')) r'offline': offline, - if (keys == null || keys.contains(r'public')) r'public': public, - if (keys == null || - keys.any((key) => RegExp(r'^reference\.').hasMatch(key))) - r'reference': reference?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^reference\.'))) { - previousValue.add(element.split(RegExp(r'^reference\.')).last); - } - - return previousValue; - })), - if (keys == null || keys.contains(r'reverseGeocoding')) - r'reverseGeocoding': reverseGeocoding, - if (keys == null || keys.any((key) => RegExp(r'^review\.').hasMatch(key))) - r'review': review?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^review\.'))) { - previousValue.add(element.split(RegExp(r'^review\.')).last); - } - - return previousValue; - })), - if (keys == null || keys.any((key) => RegExp(r'^sla\.').hasMatch(key))) - r'sla': sla?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^sla\.'))) { - previousValue.add(element.split(RegExp(r'^sla\.')).last); - } - - return previousValue; - })), + r'archiving': archiving.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^archiving\.'))) { + previousValue.add(element.split(RegExp(r'^archiving\.')).last); + } + + return previousValue; + })), + r'contract': contract.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^contract\.'))) { + previousValue.add(element.split(RegExp(r'^contract\.')).last); + } + + return previousValue; + })), + r'equipment': equipment.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^equipment\.'))) { + previousValue.add(element.split(RegExp(r'^equipment\.')).last); + } + + return previousValue; + })), + r'feedbackParentPlace': feedbackParentPlace, + r'form': form.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^form\.'))) { + previousValue.add(element.split(RegExp(r'^form\.')).last); + } + + return previousValue; + })), + r'offline': offline, + r'public': public, + r'reference': reference.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^reference\.'))) { + previousValue.add(element.split(RegExp(r'^reference\.')).last); + } + + return previousValue; + })), + r'reverseGeocoding': reverseGeocoding, + r'review': review.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^review\.'))) { + previousValue.add(element.split(RegExp(r'^review\.')).last); + } + + return previousValue; + })), + r'sla': sla.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^sla\.'))) { + previousValue.add(element.split(RegExp(r'^sla\.')).last); + } + + return previousValue; + })), }; } } diff --git a/dart-v3/lib/model/price_jsonhal_read.dart b/dart-v3/lib/model/price_jsonhal_read.dart index 85ba6b4c6..8814ab892 100644 --- a/dart-v3/lib/model/price_jsonhal_read.dart +++ b/dart-v3/lib/model/price_jsonhal_read.dart @@ -7,8 +7,8 @@ part of keyclic_sdk_api_platform; class PriceJsonhalRead { /// Returns a new [PriceJsonhalRead] instance. PriceJsonhalRead({ - this.currencyCode, - this.value, + this.currencyCode = const PriceJsonhalReadCurrencyCodeEnum._('EUR'), + required this.value, }); /// Returns a new [PriceJsonhalRead] instance and imports its values from @@ -20,16 +20,16 @@ class PriceJsonhalRead { return PriceJsonhalRead( currencyCode: - PriceJsonhalReadCurrencyCodeEnum.fromJson(json[r'currencyCode']), + PriceJsonhalReadCurrencyCodeEnum.fromJson(json[r'currencyCode'])!, value: json[r'value'] == null ? null : json[r'value'].toDouble(), ); } /// The currency code, in ISO 4217 format. - final PriceJsonhalReadCurrencyCodeEnum? currencyCode; + final PriceJsonhalReadCurrencyCodeEnum currencyCode; // minimum: 0 - num? value; + num value; @override bool operator ==(Object other) { @@ -44,9 +44,7 @@ class PriceJsonhalRead { } @override - int get hashCode => - (currencyCode == null ? 0 : currencyCode.hashCode) + - (value == null ? 0 : value.hashCode); + int get hashCode => currencyCode.hashCode + value.hashCode; static List listFromJson(Iterable? json) { if (json == null) { @@ -99,9 +97,8 @@ class PriceJsonhalRead { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.contains(r'currencyCode')) - r'currencyCode': currencyCode, - if (keys == null || keys.contains(r'value')) r'value': value, + r'currencyCode': currencyCode, + r'value': value, }; } } diff --git a/dart-v3/lib/model/price_write.dart b/dart-v3/lib/model/price_write.dart index 4a387b7ac..07bb9c24c 100644 --- a/dart-v3/lib/model/price_write.dart +++ b/dart-v3/lib/model/price_write.dart @@ -7,7 +7,7 @@ part of keyclic_sdk_api_platform; class PriceWrite { /// Returns a new [PriceWrite] instance. PriceWrite({ - this.value, + required this.value, }); /// Returns a new [PriceWrite] instance and imports its values from @@ -23,7 +23,7 @@ class PriceWrite { } // minimum: 0 - num? value; + num value; @override bool operator ==(Object other) { @@ -36,7 +36,7 @@ class PriceWrite { } @override - int get hashCode => (value == null ? 0 : value.hashCode); + int get hashCode => value.hashCode; static List listFromJson(Iterable? json) { if (json == null) { @@ -87,7 +87,7 @@ class PriceWrite { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.contains(r'value')) r'value': value, + r'value': value, }; } } diff --git a/dart-v3/lib/model/profile_jsonhal_auth_profile_read.dart b/dart-v3/lib/model/profile_jsonhal_auth_profile_read.dart index bc67e54aa..39764b639 100644 --- a/dart-v3/lib/model/profile_jsonhal_auth_profile_read.dart +++ b/dart-v3/lib/model/profile_jsonhal_auth_profile_read.dart @@ -7,11 +7,11 @@ part of keyclic_sdk_api_platform; class ProfileJsonhalAuthProfileRead { /// Returns a new [ProfileJsonhalAuthProfileRead] instance. ProfileJsonhalAuthProfileRead({ - this.links, - this.types, - this.connections, + required this.links, + this.types = const [], + this.connections = const [], this.user, - this.firstConnection, + required this.firstConnection, }); /// Returns a new [ProfileJsonhalAuthProfileRead] instance and imports its values from @@ -22,8 +22,8 @@ class ProfileJsonhalAuthProfileRead { } return ProfileJsonhalAuthProfileRead( - links: AssetTypeJsonhalReadLinks.fromJson(json[r'_links']), - types: json[r'types'] == null ? null : List.from(json[r'types']), + links: AssetTypeJsonhalReadLinks.fromJson(json[r'_links'])!, + types: List.from(json[r'types']), connections: ConnectionJsonhalAuthProfileRead.listFromJson(json[r'connections']), user: UserJsonhalAuthProfileRead.fromJson(json[r'user']), @@ -31,17 +31,17 @@ class ProfileJsonhalAuthProfileRead { ); } - AssetTypeJsonhalReadLinks? links; + AssetTypeJsonhalReadLinks links; /// Available connection types for the given email address. These might include password, enterprise, social. - final List? types; + final List types; - List? connections; + List connections; UserJsonhalAuthProfileRead? user; /// Represents whether a user is making their first connection or interaction with the service. - final bool? firstConnection; + final bool firstConnection; @override bool operator ==(Object other) { @@ -61,11 +61,11 @@ class ProfileJsonhalAuthProfileRead { @override int get hashCode => - (links == null ? 0 : links.hashCode) + - (types == null ? 0 : types.hashCode) + - (connections == null ? 0 : connections.hashCode) + + links.hashCode + + types.hashCode + + connections.hashCode + (user == null ? 0 : user.hashCode) + - (firstConnection == null ? 0 : firstConnection.hashCode); + firstConnection.hashCode; static List listFromJson(Iterable? json) { if (json == null) { @@ -121,18 +121,16 @@ class ProfileJsonhalAuthProfileRead { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.any((key) => RegExp(r'^links\.').hasMatch(key))) - r'_links': links?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^links\.'))) { - previousValue.add(element.split(RegExp(r'^links\.')).last); - } - - return previousValue; - })), - if (keys == null || keys.contains(r'types')) r'types': types, - if (keys == null || keys.contains(r'connections')) - r'connections': connections, + r'_links': links.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^links\.'))) { + previousValue.add(element.split(RegExp(r'^links\.')).last); + } + + return previousValue; + })), + r'types': types, + r'connections': connections, if (keys == null || keys.any((key) => RegExp(r'^user\.').hasMatch(key))) r'user': user?.toJson(keys?.fold>([], (List previousValue, String element) { @@ -142,8 +140,7 @@ class ProfileJsonhalAuthProfileRead { return previousValue; })), - if (keys == null || keys.contains(r'firstConnection')) - r'firstConnection': firstConnection, + r'firstConnection': firstConnection, }; } } diff --git a/dart-v3/lib/model/publication_jsonhal_read.dart b/dart-v3/lib/model/publication_jsonhal_read.dart index f2070f6c1..7189b28f1 100644 --- a/dart-v3/lib/model/publication_jsonhal_read.dart +++ b/dart-v3/lib/model/publication_jsonhal_read.dart @@ -7,14 +7,14 @@ part of keyclic_sdk_api_platform; class PublicationJsonhalRead { /// Returns a new [PublicationJsonhalRead] instance. PublicationJsonhalRead({ - this.links, + required this.links, required this.message, - this.read, + required this.read, required this.title, - this.id, - this.createdAt, - this.updatedAt, - this.embedded, + required this.id, + required this.createdAt, + required this.updatedAt, + required this.embedded, }); /// Returns a new [PublicationJsonhalRead] instance and imports its values from @@ -25,35 +25,35 @@ class PublicationJsonhalRead { } return PublicationJsonhalRead( - links: PublicationJsonhalReadLinks.fromJson(json[r'_links']), + links: PublicationJsonhalReadLinks.fromJson(json[r'_links'])!, message: json[r'message'], read: json[r'read'], title: json[r'title'], id: json[r'id'], - createdAt: mapToDateTime(json[r'createdAt']), - updatedAt: mapToDateTime(json[r'updatedAt']), - embedded: PublicationJsonhalReadEmbedded.fromJson(json[r'_embedded']), + createdAt: mapToDateTime(json[r'createdAt'])!, + updatedAt: mapToDateTime(json[r'updatedAt'])!, + embedded: PublicationJsonhalReadEmbedded.fromJson(json[r'_embedded'])!, ); } - PublicationJsonhalReadLinks? links; + PublicationJsonhalReadLinks links; String message; - int? read; + int read; String title; /// The resource identifier. - final String? id; + final String id; /// The date and time when the resource was created, in UTC format. - final DateTime? createdAt; + final DateTime createdAt; /// The date and time when the resource was updated, in UTC format. - final DateTime? updatedAt; + final DateTime updatedAt; - PublicationJsonhalReadEmbedded? embedded; + PublicationJsonhalReadEmbedded embedded; @override bool operator ==(Object other) { @@ -75,14 +75,14 @@ class PublicationJsonhalRead { @override int get hashCode => - (links == null ? 0 : links.hashCode) + + links.hashCode + message.hashCode + - (read == null ? 0 : read.hashCode) + + read.hashCode + title.hashCode + - (id == null ? 0 : id.hashCode) + - (createdAt == null ? 0 : createdAt.hashCode) + - (updatedAt == null ? 0 : updatedAt.hashCode) + - (embedded == null ? 0 : embedded.hashCode); + id.hashCode + + createdAt.hashCode + + updatedAt.hashCode + + embedded.hashCode; static List listFromJson(Iterable? json) { if (json == null) { @@ -138,33 +138,28 @@ class PublicationJsonhalRead { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.any((key) => RegExp(r'^links\.').hasMatch(key))) - r'_links': links?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^links\.'))) { - previousValue.add(element.split(RegExp(r'^links\.')).last); - } - - return previousValue; - })), + r'_links': links.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^links\.'))) { + previousValue.add(element.split(RegExp(r'^links\.')).last); + } + + return previousValue; + })), r'message': message, - if (keys == null || keys.contains(r'read')) r'read': read, + r'read': read, r'title': title, - if (keys == null || keys.contains(r'id')) r'id': id, - if (keys == null || keys.contains(r'createdAt')) - r'createdAt': createdAt?.toUtc().toIso8601String(), - if (keys == null || keys.contains(r'updatedAt')) - r'updatedAt': updatedAt?.toUtc().toIso8601String(), - if (keys == null || - keys.any((key) => RegExp(r'^embedded\.').hasMatch(key))) - r'_embedded': embedded?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^embedded\.'))) { - previousValue.add(element.split(RegExp(r'^embedded\.')).last); - } - - return previousValue; - })), + r'id': id, + r'createdAt': createdAt.toUtc().toIso8601String(), + r'updatedAt': updatedAt.toUtc().toIso8601String(), + r'_embedded': embedded.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^embedded\.'))) { + previousValue.add(element.split(RegExp(r'^embedded\.')).last); + } + + return previousValue; + })), }; } } diff --git a/dart-v3/lib/model/publication_jsonhal_read_embedded.dart b/dart-v3/lib/model/publication_jsonhal_read_embedded.dart index e2682306f..109f3c447 100644 --- a/dart-v3/lib/model/publication_jsonhal_read_embedded.dart +++ b/dart-v3/lib/model/publication_jsonhal_read_embedded.dart @@ -8,7 +8,7 @@ class PublicationJsonhalReadEmbedded { /// Returns a new [PublicationJsonhalReadEmbedded] instance. PublicationJsonhalReadEmbedded({ this.author, - this.place, + required this.place, }); /// Returns a new [PublicationJsonhalReadEmbedded] instance and imports its values from @@ -20,13 +20,13 @@ class PublicationJsonhalReadEmbedded { return PublicationJsonhalReadEmbedded( author: PersonJsonhalRead.fromJson(json[r'author']), - place: PlaceJsonhalRead.fromJson(json[r'place']), + place: PlaceJsonhalRead.fromJson(json[r'place'])!, ); } PersonJsonhalRead? author; - PlaceJsonhalRead? place; + PlaceJsonhalRead place; @override bool operator ==(Object other) { @@ -41,9 +41,7 @@ class PublicationJsonhalReadEmbedded { } @override - int get hashCode => - (author == null ? 0 : author.hashCode) + - (place == null ? 0 : place.hashCode); + int get hashCode => (author == null ? 0 : author.hashCode) + place.hashCode; static List listFromJson(Iterable? json) { if (json == null) { @@ -108,15 +106,14 @@ class PublicationJsonhalReadEmbedded { return previousValue; })), - if (keys == null || keys.any((key) => RegExp(r'^place\.').hasMatch(key))) - r'place': place?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^place\.'))) { - previousValue.add(element.split(RegExp(r'^place\.')).last); - } - - return previousValue; - })), + r'place': place.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^place\.'))) { + previousValue.add(element.split(RegExp(r'^place\.')).last); + } + + return previousValue; + })), }; } } diff --git a/dart-v3/lib/model/publication_jsonhal_read_links.dart b/dart-v3/lib/model/publication_jsonhal_read_links.dart index b05cbc1dc..144340f65 100644 --- a/dart-v3/lib/model/publication_jsonhal_read_links.dart +++ b/dart-v3/lib/model/publication_jsonhal_read_links.dart @@ -7,8 +7,8 @@ part of keyclic_sdk_api_platform; class PublicationJsonhalReadLinks { /// Returns a new [PublicationJsonhalReadLinks] instance. PublicationJsonhalReadLinks({ - this.self, - this.organization, + required this.self, + required this.organization, }); /// Returns a new [PublicationJsonhalReadLinks] instance and imports its values from @@ -19,15 +19,15 @@ class PublicationJsonhalReadLinks { } return PublicationJsonhalReadLinks( - self: GetPlaceCollection200ResponseLinksSelf.fromJson(json[r'self']), + self: GetPlaceCollection200ResponseLinksSelf.fromJson(json[r'self'])!, organization: GetPlaceCollection200ResponseLinksSelf.fromJson( - json[r'organization']), + json[r'organization'])!, ); } - GetPlaceCollection200ResponseLinksSelf? self; + GetPlaceCollection200ResponseLinksSelf self; - GetPlaceCollection200ResponseLinksSelf? organization; + GetPlaceCollection200ResponseLinksSelf organization; @override bool operator ==(Object other) { @@ -42,9 +42,7 @@ class PublicationJsonhalReadLinks { } @override - int get hashCode => - (self == null ? 0 : self.hashCode) + - (organization == null ? 0 : organization.hashCode); + int get hashCode => self.hashCode + organization.hashCode; static List listFromJson(Iterable? json) { if (json == null) { @@ -100,25 +98,22 @@ class PublicationJsonhalReadLinks { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.any((key) => RegExp(r'^self\.').hasMatch(key))) - r'self': self?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^self\.'))) { - previousValue.add(element.split(RegExp(r'^self\.')).last); - } - - return previousValue; - })), - if (keys == null || - keys.any((key) => RegExp(r'^organization\.').hasMatch(key))) - r'organization': organization?.toJson(keys?.fold>( - [], (List previousValue, String element) { - if (element.contains(RegExp(r'^organization\.'))) { - previousValue.add(element.split(RegExp(r'^organization\.')).last); - } - - return previousValue; - })), + r'self': self.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^self\.'))) { + previousValue.add(element.split(RegExp(r'^self\.')).last); + } + + return previousValue; + })), + r'organization': organization.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^organization\.'))) { + previousValue.add(element.split(RegExp(r'^organization\.')).last); + } + + return previousValue; + })), }; } } diff --git a/dart-v3/lib/model/review_jsonhal_organization_preference_read.dart b/dart-v3/lib/model/review_jsonhal_organization_preference_read.dart index 80e02e746..910c5b6de 100644 --- a/dart-v3/lib/model/review_jsonhal_organization_preference_read.dart +++ b/dart-v3/lib/model/review_jsonhal_organization_preference_read.dart @@ -7,7 +7,7 @@ part of keyclic_sdk_api_platform; class ReviewJsonhalOrganizationPreferenceRead { /// Returns a new [ReviewJsonhalOrganizationPreferenceRead] instance. ReviewJsonhalOrganizationPreferenceRead({ - this.enabled, + required this.enabled, }); /// Returns a new [ReviewJsonhalOrganizationPreferenceRead] instance and imports its values from @@ -22,7 +22,7 @@ class ReviewJsonhalOrganizationPreferenceRead { ); } - bool? enabled; + bool enabled; @override bool operator ==(Object other) { @@ -36,7 +36,7 @@ class ReviewJsonhalOrganizationPreferenceRead { } @override - int get hashCode => (enabled == null ? 0 : enabled.hashCode); + int get hashCode => enabled.hashCode; static List listFromJson( Iterable? json) { @@ -95,7 +95,7 @@ class ReviewJsonhalOrganizationPreferenceRead { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.contains(r'enabled')) r'enabled': enabled, + r'enabled': enabled, }; } } diff --git a/dart-v3/lib/model/review_jsonhal_read.dart b/dart-v3/lib/model/review_jsonhal_read.dart index dcb17530a..deb90af93 100644 --- a/dart-v3/lib/model/review_jsonhal_read.dart +++ b/dart-v3/lib/model/review_jsonhal_read.dart @@ -7,12 +7,12 @@ part of keyclic_sdk_api_platform; class ReviewJsonhalRead { /// Returns a new [ReviewJsonhalRead] instance. ReviewJsonhalRead({ - this.links, - this.id, - this.createdAt, - this.updatedAt, + required this.links, + required this.id, + required this.createdAt, + required this.updatedAt, this.reviewBody, - this.reviewRating, + required this.reviewRating, }); /// Returns a new [ReviewJsonhalRead] instance and imports its values from @@ -23,31 +23,31 @@ class ReviewJsonhalRead { } return ReviewJsonhalRead( - links: ReviewJsonhalReadLinks.fromJson(json[r'_links']), + links: ReviewJsonhalReadLinks.fromJson(json[r'_links'])!, id: json[r'id'], - createdAt: mapToDateTime(json[r'createdAt']), - updatedAt: mapToDateTime(json[r'updatedAt']), + createdAt: mapToDateTime(json[r'createdAt'])!, + updatedAt: mapToDateTime(json[r'updatedAt'])!, reviewBody: json[r'reviewBody'], reviewRating: json[r'reviewRating'], ); } - ReviewJsonhalReadLinks? links; + ReviewJsonhalReadLinks links; /// The resource identifier. - final String? id; + final String id; /// The date and time when the resource was created, in UTC format. - final DateTime? createdAt; + final DateTime createdAt; /// The date and time when the resource was updated, in UTC format. - final DateTime? updatedAt; + final DateTime updatedAt; String? reviewBody; // minimum: 1 // maximum: 5 - int? reviewRating; + int reviewRating; @override bool operator ==(Object other) { @@ -67,12 +67,12 @@ class ReviewJsonhalRead { @override int get hashCode => - (links == null ? 0 : links.hashCode) + - (id == null ? 0 : id.hashCode) + - (createdAt == null ? 0 : createdAt.hashCode) + - (updatedAt == null ? 0 : updatedAt.hashCode) + + links.hashCode + + id.hashCode + + createdAt.hashCode + + updatedAt.hashCode + (reviewBody == null ? 0 : reviewBody.hashCode) + - (reviewRating == null ? 0 : reviewRating.hashCode); + reviewRating.hashCode; static List listFromJson(Iterable? json) { if (json == null) { @@ -127,24 +127,20 @@ class ReviewJsonhalRead { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.any((key) => RegExp(r'^links\.').hasMatch(key))) - r'_links': links?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^links\.'))) { - previousValue.add(element.split(RegExp(r'^links\.')).last); - } - - return previousValue; - })), - if (keys == null || keys.contains(r'id')) r'id': id, - if (keys == null || keys.contains(r'createdAt')) - r'createdAt': createdAt?.toUtc().toIso8601String(), - if (keys == null || keys.contains(r'updatedAt')) - r'updatedAt': updatedAt?.toUtc().toIso8601String(), + r'_links': links.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^links\.'))) { + previousValue.add(element.split(RegExp(r'^links\.')).last); + } + + return previousValue; + })), + r'id': id, + r'createdAt': createdAt.toUtc().toIso8601String(), + r'updatedAt': updatedAt.toUtc().toIso8601String(), if (keys == null || keys.contains(r'reviewBody')) r'reviewBody': reviewBody, - if (keys == null || keys.contains(r'reviewRating')) - r'reviewRating': reviewRating, + r'reviewRating': reviewRating, }; } } diff --git a/dart-v3/lib/model/review_jsonhal_read_links.dart b/dart-v3/lib/model/review_jsonhal_read_links.dart index 696d30b54..9f9cafde2 100644 --- a/dart-v3/lib/model/review_jsonhal_read_links.dart +++ b/dart-v3/lib/model/review_jsonhal_read_links.dart @@ -7,7 +7,7 @@ part of keyclic_sdk_api_platform; class ReviewJsonhalReadLinks { /// Returns a new [ReviewJsonhalReadLinks] instance. ReviewJsonhalReadLinks({ - this.self, + required this.self, this.itemReviewed, this.author, }); @@ -20,14 +20,14 @@ class ReviewJsonhalReadLinks { } return ReviewJsonhalReadLinks( - self: GetPlaceCollection200ResponseLinksSelf.fromJson(json[r'self']), + self: GetPlaceCollection200ResponseLinksSelf.fromJson(json[r'self'])!, itemReviewed: GetPlaceCollection200ResponseLinksFirst.fromJson( json[r'itemReviewed']), author: GetPlaceCollection200ResponseLinksFirst.fromJson(json[r'author']), ); } - GetPlaceCollection200ResponseLinksSelf? self; + GetPlaceCollection200ResponseLinksSelf self; GetPlaceCollection200ResponseLinksFirst? itemReviewed; @@ -48,7 +48,7 @@ class ReviewJsonhalReadLinks { @override int get hashCode => - (self == null ? 0 : self.hashCode) + + self.hashCode + (itemReviewed == null ? 0 : itemReviewed.hashCode) + (author == null ? 0 : author.hashCode); @@ -106,15 +106,14 @@ class ReviewJsonhalReadLinks { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.any((key) => RegExp(r'^self\.').hasMatch(key))) - r'self': self?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^self\.'))) { - previousValue.add(element.split(RegExp(r'^self\.')).last); - } - - return previousValue; - })), + r'self': self.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^self\.'))) { + previousValue.add(element.split(RegExp(r'^self\.')).last); + } + + return previousValue; + })), if (keys == null || keys.any((key) => RegExp(r'^itemReviewed\.').hasMatch(key))) r'itemReviewed': itemReviewed?.toJson(keys?.fold>( diff --git a/dart-v3/lib/model/review_request_jsonhal_read.dart b/dart-v3/lib/model/review_request_jsonhal_read.dart index a4c874423..571ef2d2f 100644 --- a/dart-v3/lib/model/review_request_jsonhal_read.dart +++ b/dart-v3/lib/model/review_request_jsonhal_read.dart @@ -7,10 +7,10 @@ part of keyclic_sdk_api_platform; class ReviewRequestJsonhalRead { /// Returns a new [ReviewRequestJsonhalRead] instance. ReviewRequestJsonhalRead({ - this.links, - this.id, - this.createdAt, - this.updatedAt, + required this.links, + required this.id, + required this.createdAt, + required this.updatedAt, this.embedded, }); @@ -22,24 +22,24 @@ class ReviewRequestJsonhalRead { } return ReviewRequestJsonhalRead( - links: ReviewRequestJsonhalReadLinks.fromJson(json[r'_links']), + links: ReviewRequestJsonhalReadLinks.fromJson(json[r'_links'])!, id: json[r'id'], - createdAt: mapToDateTime(json[r'createdAt']), - updatedAt: mapToDateTime(json[r'updatedAt']), + createdAt: mapToDateTime(json[r'createdAt'])!, + updatedAt: mapToDateTime(json[r'updatedAt'])!, embedded: ReviewRequestJsonhalReadEmbedded.fromJson(json[r'_embedded']), ); } - ReviewRequestJsonhalReadLinks? links; + ReviewRequestJsonhalReadLinks links; /// The resource identifier. - final String? id; + final String id; /// The date and time when the resource was created, in UTC format. - final DateTime? createdAt; + final DateTime createdAt; /// The date and time when the resource was updated, in UTC format. - final DateTime? updatedAt; + final DateTime updatedAt; ReviewRequestJsonhalReadEmbedded? embedded; @@ -60,10 +60,10 @@ class ReviewRequestJsonhalRead { @override int get hashCode => - (links == null ? 0 : links.hashCode) + - (id == null ? 0 : id.hashCode) + - (createdAt == null ? 0 : createdAt.hashCode) + - (updatedAt == null ? 0 : updatedAt.hashCode) + + links.hashCode + + id.hashCode + + createdAt.hashCode + + updatedAt.hashCode + (embedded == null ? 0 : embedded.hashCode); static List listFromJson(Iterable? json) { @@ -120,20 +120,17 @@ class ReviewRequestJsonhalRead { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.any((key) => RegExp(r'^links\.').hasMatch(key))) - r'_links': links?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^links\.'))) { - previousValue.add(element.split(RegExp(r'^links\.')).last); - } - - return previousValue; - })), - if (keys == null || keys.contains(r'id')) r'id': id, - if (keys == null || keys.contains(r'createdAt')) - r'createdAt': createdAt?.toUtc().toIso8601String(), - if (keys == null || keys.contains(r'updatedAt')) - r'updatedAt': updatedAt?.toUtc().toIso8601String(), + r'_links': links.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^links\.'))) { + previousValue.add(element.split(RegExp(r'^links\.')).last); + } + + return previousValue; + })), + r'id': id, + r'createdAt': createdAt.toUtc().toIso8601String(), + r'updatedAt': updatedAt.toUtc().toIso8601String(), if (keys == null || keys.any((key) => RegExp(r'^embedded\.').hasMatch(key))) r'_embedded': embedded?.toJson(keys?.fold>([], diff --git a/dart-v3/lib/model/review_request_jsonhal_read_links.dart b/dart-v3/lib/model/review_request_jsonhal_read_links.dart index 7f6370feb..7c371f758 100644 --- a/dart-v3/lib/model/review_request_jsonhal_read_links.dart +++ b/dart-v3/lib/model/review_request_jsonhal_read_links.dart @@ -7,10 +7,10 @@ part of keyclic_sdk_api_platform; class ReviewRequestJsonhalReadLinks { /// Returns a new [ReviewRequestJsonhalReadLinks] instance. ReviewRequestJsonhalReadLinks({ - this.self, + required this.self, this.itemToReview, - this.reviewer, - this.organization, + required this.reviewer, + required this.organization, }); /// Returns a new [ReviewRequestJsonhalReadLinks] instance and imports its values from @@ -21,23 +21,23 @@ class ReviewRequestJsonhalReadLinks { } return ReviewRequestJsonhalReadLinks( - self: GetPlaceCollection200ResponseLinksSelf.fromJson(json[r'self']), + self: GetPlaceCollection200ResponseLinksSelf.fromJson(json[r'self'])!, itemToReview: GetPlaceCollection200ResponseLinksFirst.fromJson( json[r'itemToReview']), reviewer: - GetPlaceCollection200ResponseLinksSelf.fromJson(json[r'reviewer']), + GetPlaceCollection200ResponseLinksSelf.fromJson(json[r'reviewer'])!, organization: GetPlaceCollection200ResponseLinksSelf.fromJson( - json[r'organization']), + json[r'organization'])!, ); } - GetPlaceCollection200ResponseLinksSelf? self; + GetPlaceCollection200ResponseLinksSelf self; GetPlaceCollection200ResponseLinksFirst? itemToReview; - GetPlaceCollection200ResponseLinksSelf? reviewer; + GetPlaceCollection200ResponseLinksSelf reviewer; - GetPlaceCollection200ResponseLinksSelf? organization; + GetPlaceCollection200ResponseLinksSelf organization; @override bool operator ==(Object other) { @@ -55,10 +55,10 @@ class ReviewRequestJsonhalReadLinks { @override int get hashCode => - (self == null ? 0 : self.hashCode) + + self.hashCode + (itemToReview == null ? 0 : itemToReview.hashCode) + - (reviewer == null ? 0 : reviewer.hashCode) + - (organization == null ? 0 : organization.hashCode); + reviewer.hashCode + + organization.hashCode; static List listFromJson(Iterable? json) { if (json == null) { @@ -114,15 +114,14 @@ class ReviewRequestJsonhalReadLinks { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.any((key) => RegExp(r'^self\.').hasMatch(key))) - r'self': self?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^self\.'))) { - previousValue.add(element.split(RegExp(r'^self\.')).last); - } - - return previousValue; - })), + r'self': self.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^self\.'))) { + previousValue.add(element.split(RegExp(r'^self\.')).last); + } + + return previousValue; + })), if (keys == null || keys.any((key) => RegExp(r'^itemToReview\.').hasMatch(key))) r'itemToReview': itemToReview?.toJson(keys?.fold>( @@ -133,26 +132,22 @@ class ReviewRequestJsonhalReadLinks { return previousValue; })), - if (keys == null || - keys.any((key) => RegExp(r'^reviewer\.').hasMatch(key))) - r'reviewer': reviewer?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^reviewer\.'))) { - previousValue.add(element.split(RegExp(r'^reviewer\.')).last); - } - - return previousValue; - })), - if (keys == null || - keys.any((key) => RegExp(r'^organization\.').hasMatch(key))) - r'organization': organization?.toJson(keys?.fold>( - [], (List previousValue, String element) { - if (element.contains(RegExp(r'^organization\.'))) { - previousValue.add(element.split(RegExp(r'^organization\.')).last); - } - - return previousValue; - })), + r'reviewer': reviewer.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^reviewer\.'))) { + previousValue.add(element.split(RegExp(r'^reviewer\.')).last); + } + + return previousValue; + })), + r'organization': organization.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^organization\.'))) { + previousValue.add(element.split(RegExp(r'^organization\.')).last); + } + + return previousValue; + })), }; } } diff --git a/dart-v3/lib/model/role_jsonhal_read.dart b/dart-v3/lib/model/role_jsonhal_read.dart index aaf019d33..dedb12c1f 100644 --- a/dart-v3/lib/model/role_jsonhal_read.dart +++ b/dart-v3/lib/model/role_jsonhal_read.dart @@ -7,10 +7,10 @@ part of keyclic_sdk_api_platform; class RoleJsonhalRead { /// Returns a new [RoleJsonhalRead] instance. RoleJsonhalRead({ - this.links, - this.id, - this.createdAt, - this.updatedAt, + required this.links, + required this.id, + required this.createdAt, + required this.updatedAt, this.description, required this.name, this.permissions, @@ -24,10 +24,10 @@ class RoleJsonhalRead { } return RoleJsonhalRead( - links: AssetTypeJsonhalReadLinks.fromJson(json[r'_links']), + links: AssetTypeJsonhalReadLinks.fromJson(json[r'_links'])!, id: json[r'id'], - createdAt: mapToDateTime(json[r'createdAt']), - updatedAt: mapToDateTime(json[r'updatedAt']), + createdAt: mapToDateTime(json[r'createdAt'])!, + updatedAt: mapToDateTime(json[r'updatedAt'])!, description: json[r'description'], name: json[r'name'], permissions: json[r'permissions'] == null @@ -36,16 +36,16 @@ class RoleJsonhalRead { ); } - AssetTypeJsonhalReadLinks? links; + AssetTypeJsonhalReadLinks links; /// The resource identifier. - final String? id; + final String id; /// The date and time when the resource was created, in UTC format. - final DateTime? createdAt; + final DateTime createdAt; /// The date and time when the resource was updated, in UTC format. - final DateTime? updatedAt; + final DateTime updatedAt; String? description; @@ -73,10 +73,10 @@ class RoleJsonhalRead { @override int get hashCode => - (links == null ? 0 : links.hashCode) + - (id == null ? 0 : id.hashCode) + - (createdAt == null ? 0 : createdAt.hashCode) + - (updatedAt == null ? 0 : updatedAt.hashCode) + + links.hashCode + + id.hashCode + + createdAt.hashCode + + updatedAt.hashCode + (description == null ? 0 : description.hashCode) + name.hashCode + (permissions == null ? 0 : permissions.hashCode); @@ -132,20 +132,17 @@ class RoleJsonhalRead { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.any((key) => RegExp(r'^links\.').hasMatch(key))) - r'_links': links?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^links\.'))) { - previousValue.add(element.split(RegExp(r'^links\.')).last); - } - - return previousValue; - })), - if (keys == null || keys.contains(r'id')) r'id': id, - if (keys == null || keys.contains(r'createdAt')) - r'createdAt': createdAt?.toUtc().toIso8601String(), - if (keys == null || keys.contains(r'updatedAt')) - r'updatedAt': updatedAt?.toUtc().toIso8601String(), + r'_links': links.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^links\.'))) { + previousValue.add(element.split(RegExp(r'^links\.')).last); + } + + return previousValue; + })), + r'id': id, + r'createdAt': createdAt.toUtc().toIso8601String(), + r'updatedAt': updatedAt.toUtc().toIso8601String(), if (keys == null || keys.contains(r'description')) r'description': description, r'name': name, diff --git a/dart-v3/lib/model/service_jsonhal_read.dart b/dart-v3/lib/model/service_jsonhal_read.dart index 6d134e80f..090e009f9 100644 --- a/dart-v3/lib/model/service_jsonhal_read.dart +++ b/dart-v3/lib/model/service_jsonhal_read.dart @@ -7,17 +7,17 @@ part of keyclic_sdk_api_platform; class ServiceJsonhalRead { /// Returns a new [ServiceJsonhalRead] instance. ServiceJsonhalRead({ - this.links, - this.contactPoint, + required this.links, + required this.contactPoint, this.description, required this.name, - this.onCall, - this.id, + required this.onCall, + required this.id, this.address, - this.createdAt, - this.updatedAt, + required this.createdAt, + required this.updatedAt, this.type, - this.embedded, + required this.embedded, }); /// Returns a new [ServiceJsonhalRead] instance and imports its values from @@ -28,44 +28,44 @@ class ServiceJsonhalRead { } return ServiceJsonhalRead( - links: AssetTypeJsonhalReadLinks.fromJson(json[r'_links']), - contactPoint: ContactPointJsonhalRead.fromJson(json[r'contactPoint']), + links: AssetTypeJsonhalReadLinks.fromJson(json[r'_links'])!, + contactPoint: ContactPointJsonhalRead.fromJson(json[r'contactPoint'])!, description: json[r'description'], name: json[r'name'], - onCall: ContactPointJsonhalRead.fromJson(json[r'onCall']), + onCall: ContactPointJsonhalRead.fromJson(json[r'onCall'])!, id: json[r'id'], address: PostalAddressJsonhalRead.fromJson(json[r'address']), - createdAt: mapToDateTime(json[r'createdAt']), - updatedAt: mapToDateTime(json[r'updatedAt']), + createdAt: mapToDateTime(json[r'createdAt'])!, + updatedAt: mapToDateTime(json[r'updatedAt'])!, type: json[r'type'], - embedded: ServiceJsonhalReadEmbedded.fromJson(json[r'_embedded']), + embedded: ServiceJsonhalReadEmbedded.fromJson(json[r'_embedded'])!, ); } - AssetTypeJsonhalReadLinks? links; + AssetTypeJsonhalReadLinks links; - ContactPointJsonhalRead? contactPoint; + ContactPointJsonhalRead contactPoint; String? description; String name; - ContactPointJsonhalRead? onCall; + ContactPointJsonhalRead onCall; /// The resource identifier. - final String? id; + final String id; PostalAddressJsonhalRead? address; /// The date and time when the resource was created, in UTC format. - final DateTime? createdAt; + final DateTime createdAt; /// The date and time when the resource was updated, in UTC format. - final DateTime? updatedAt; + final DateTime updatedAt; final String? type; - ServiceJsonhalReadEmbedded? embedded; + ServiceJsonhalReadEmbedded embedded; @override bool operator ==(Object other) { @@ -90,17 +90,17 @@ class ServiceJsonhalRead { @override int get hashCode => - (links == null ? 0 : links.hashCode) + - (contactPoint == null ? 0 : contactPoint.hashCode) + + links.hashCode + + contactPoint.hashCode + (description == null ? 0 : description.hashCode) + name.hashCode + - (onCall == null ? 0 : onCall.hashCode) + - (id == null ? 0 : id.hashCode) + + onCall.hashCode + + id.hashCode + (address == null ? 0 : address.hashCode) + - (createdAt == null ? 0 : createdAt.hashCode) + - (updatedAt == null ? 0 : updatedAt.hashCode) + + createdAt.hashCode + + updatedAt.hashCode + (type == null ? 0 : type.hashCode) + - (embedded == null ? 0 : embedded.hashCode); + embedded.hashCode; static List listFromJson(Iterable? json) { if (json == null) { @@ -155,38 +155,34 @@ class ServiceJsonhalRead { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.any((key) => RegExp(r'^links\.').hasMatch(key))) - r'_links': links?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^links\.'))) { - previousValue.add(element.split(RegExp(r'^links\.')).last); - } - - return previousValue; - })), - if (keys == null || - keys.any((key) => RegExp(r'^contactPoint\.').hasMatch(key))) - r'contactPoint': contactPoint?.toJson(keys?.fold>( - [], (List previousValue, String element) { - if (element.contains(RegExp(r'^contactPoint\.'))) { - previousValue.add(element.split(RegExp(r'^contactPoint\.')).last); - } - - return previousValue; - })), + r'_links': links.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^links\.'))) { + previousValue.add(element.split(RegExp(r'^links\.')).last); + } + + return previousValue; + })), + r'contactPoint': contactPoint.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^contactPoint\.'))) { + previousValue.add(element.split(RegExp(r'^contactPoint\.')).last); + } + + return previousValue; + })), if (keys == null || keys.contains(r'description')) r'description': description, r'name': name, - if (keys == null || keys.any((key) => RegExp(r'^onCall\.').hasMatch(key))) - r'onCall': onCall?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^onCall\.'))) { - previousValue.add(element.split(RegExp(r'^onCall\.')).last); - } - - return previousValue; - })), - if (keys == null || keys.contains(r'id')) r'id': id, + r'onCall': onCall.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^onCall\.'))) { + previousValue.add(element.split(RegExp(r'^onCall\.')).last); + } + + return previousValue; + })), + r'id': id, if (keys == null || keys.any((key) => RegExp(r'^address\.').hasMatch(key))) r'address': address?.toJson(keys?.fold>([], @@ -197,21 +193,17 @@ class ServiceJsonhalRead { return previousValue; })), - if (keys == null || keys.contains(r'createdAt')) - r'createdAt': createdAt?.toUtc().toIso8601String(), - if (keys == null || keys.contains(r'updatedAt')) - r'updatedAt': updatedAt?.toUtc().toIso8601String(), + r'createdAt': createdAt.toUtc().toIso8601String(), + r'updatedAt': updatedAt.toUtc().toIso8601String(), if (keys == null || keys.contains(r'type')) r'type': type, - if (keys == null || - keys.any((key) => RegExp(r'^embedded\.').hasMatch(key))) - r'_embedded': embedded?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^embedded\.'))) { - previousValue.add(element.split(RegExp(r'^embedded\.')).last); - } - - return previousValue; - })), + r'_embedded': embedded.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^embedded\.'))) { + previousValue.add(element.split(RegExp(r'^embedded\.')).last); + } + + return previousValue; + })), }; } } diff --git a/dart-v3/lib/model/service_jsonhal_read_embedded.dart b/dart-v3/lib/model/service_jsonhal_read_embedded.dart index 3f9c42fcc..01a706929 100644 --- a/dart-v3/lib/model/service_jsonhal_read_embedded.dart +++ b/dart-v3/lib/model/service_jsonhal_read_embedded.dart @@ -7,9 +7,9 @@ part of keyclic_sdk_api_platform; class ServiceJsonhalReadEmbedded { /// Returns a new [ServiceJsonhalReadEmbedded] instance. ServiceJsonhalReadEmbedded({ - this.provider, + required this.provider, this.manager, - this.organization, + required this.organization, }); /// Returns a new [ServiceJsonhalReadEmbedded] instance and imports its values from @@ -20,17 +20,17 @@ class ServiceJsonhalReadEmbedded { } return ServiceJsonhalReadEmbedded( - provider: OrganizationJsonhalRead.fromJson(json[r'provider']), + provider: OrganizationJsonhalRead.fromJson(json[r'provider'])!, manager: CollaboratorJsonhalRead.fromJson(json[r'manager']), - organization: OrganizationJsonhalRead.fromJson(json[r'organization']), + organization: OrganizationJsonhalRead.fromJson(json[r'organization'])!, ); } - OrganizationJsonhalRead? provider; + OrganizationJsonhalRead provider; CollaboratorJsonhalRead? manager; - OrganizationJsonhalRead? organization; + OrganizationJsonhalRead organization; @override bool operator ==(Object other) { @@ -47,9 +47,9 @@ class ServiceJsonhalReadEmbedded { @override int get hashCode => - (provider == null ? 0 : provider.hashCode) + + provider.hashCode + (manager == null ? 0 : manager.hashCode) + - (organization == null ? 0 : organization.hashCode); + organization.hashCode; static List listFromJson(Iterable? json) { if (json == null) { @@ -105,16 +105,14 @@ class ServiceJsonhalReadEmbedded { Map toJson([Iterable? keys]) { return { - if (keys == null || - keys.any((key) => RegExp(r'^provider\.').hasMatch(key))) - r'provider': provider?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^provider\.'))) { - previousValue.add(element.split(RegExp(r'^provider\.')).last); - } - - return previousValue; - })), + r'provider': provider.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^provider\.'))) { + previousValue.add(element.split(RegExp(r'^provider\.')).last); + } + + return previousValue; + })), if (keys == null || keys.any((key) => RegExp(r'^manager\.').hasMatch(key))) r'manager': manager?.toJson(keys?.fold>([], @@ -125,16 +123,14 @@ class ServiceJsonhalReadEmbedded { return previousValue; })), - if (keys == null || - keys.any((key) => RegExp(r'^organization\.').hasMatch(key))) - r'organization': organization?.toJson(keys?.fold>( - [], (List previousValue, String element) { - if (element.contains(RegExp(r'^organization\.'))) { - previousValue.add(element.split(RegExp(r'^organization\.')).last); - } - - return previousValue; - })), + r'organization': organization.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^organization\.'))) { + previousValue.add(element.split(RegExp(r'^organization\.')).last); + } + + return previousValue; + })), }; } } diff --git a/dart-v3/lib/model/service_offer_jsonhal_read.dart b/dart-v3/lib/model/service_offer_jsonhal_read.dart index eb2285d8a..4b8bb4e4c 100644 --- a/dart-v3/lib/model/service_offer_jsonhal_read.dart +++ b/dart-v3/lib/model/service_offer_jsonhal_read.dart @@ -7,11 +7,11 @@ part of keyclic_sdk_api_platform; class ServiceOfferJsonhalRead { /// Returns a new [ServiceOfferJsonhalRead] instance. ServiceOfferJsonhalRead({ - this.links, + required this.links, required this.name, - this.id, - this.createdAt, - this.updatedAt, + required this.id, + required this.createdAt, + required this.updatedAt, }); /// Returns a new [ServiceOfferJsonhalRead] instance and imports its values from @@ -22,26 +22,26 @@ class ServiceOfferJsonhalRead { } return ServiceOfferJsonhalRead( - links: ServiceOfferJsonhalReadLinks.fromJson(json[r'_links']), + links: ServiceOfferJsonhalReadLinks.fromJson(json[r'_links'])!, name: json[r'name'], id: json[r'id'], - createdAt: mapToDateTime(json[r'createdAt']), - updatedAt: mapToDateTime(json[r'updatedAt']), + createdAt: mapToDateTime(json[r'createdAt'])!, + updatedAt: mapToDateTime(json[r'updatedAt'])!, ); } - ServiceOfferJsonhalReadLinks? links; + ServiceOfferJsonhalReadLinks links; String name; /// The resource identifier. - final String? id; + final String id; /// The date and time when the resource was created, in UTC format. - final DateTime? createdAt; + final DateTime createdAt; /// The date and time when the resource was updated, in UTC format. - final DateTime? updatedAt; + final DateTime updatedAt; @override bool operator ==(Object other) { @@ -60,11 +60,11 @@ class ServiceOfferJsonhalRead { @override int get hashCode => - (links == null ? 0 : links.hashCode) + + links.hashCode + name.hashCode + - (id == null ? 0 : id.hashCode) + - (createdAt == null ? 0 : createdAt.hashCode) + - (updatedAt == null ? 0 : updatedAt.hashCode); + id.hashCode + + createdAt.hashCode + + updatedAt.hashCode; static List listFromJson(Iterable? json) { if (json == null) { @@ -120,21 +120,18 @@ class ServiceOfferJsonhalRead { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.any((key) => RegExp(r'^links\.').hasMatch(key))) - r'_links': links?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^links\.'))) { - previousValue.add(element.split(RegExp(r'^links\.')).last); - } - - return previousValue; - })), + r'_links': links.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^links\.'))) { + previousValue.add(element.split(RegExp(r'^links\.')).last); + } + + return previousValue; + })), r'name': name, - if (keys == null || keys.contains(r'id')) r'id': id, - if (keys == null || keys.contains(r'createdAt')) - r'createdAt': createdAt?.toUtc().toIso8601String(), - if (keys == null || keys.contains(r'updatedAt')) - r'updatedAt': updatedAt?.toUtc().toIso8601String(), + r'id': id, + r'createdAt': createdAt.toUtc().toIso8601String(), + r'updatedAt': updatedAt.toUtc().toIso8601String(), }; } } diff --git a/dart-v3/lib/model/service_offer_jsonhal_read_links.dart b/dart-v3/lib/model/service_offer_jsonhal_read_links.dart index e9ab8638b..8cc3d7459 100644 --- a/dart-v3/lib/model/service_offer_jsonhal_read_links.dart +++ b/dart-v3/lib/model/service_offer_jsonhal_read_links.dart @@ -7,8 +7,8 @@ part of keyclic_sdk_api_platform; class ServiceOfferJsonhalReadLinks { /// Returns a new [ServiceOfferJsonhalReadLinks] instance. ServiceOfferJsonhalReadLinks({ - this.self, - this.service, + required this.self, + required this.service, }); /// Returns a new [ServiceOfferJsonhalReadLinks] instance and imports its values from @@ -19,15 +19,15 @@ class ServiceOfferJsonhalReadLinks { } return ServiceOfferJsonhalReadLinks( - self: GetPlaceCollection200ResponseLinksSelf.fromJson(json[r'self']), + self: GetPlaceCollection200ResponseLinksSelf.fromJson(json[r'self'])!, service: - GetPlaceCollection200ResponseLinksSelf.fromJson(json[r'service']), + GetPlaceCollection200ResponseLinksSelf.fromJson(json[r'service'])!, ); } - GetPlaceCollection200ResponseLinksSelf? self; + GetPlaceCollection200ResponseLinksSelf self; - GetPlaceCollection200ResponseLinksSelf? service; + GetPlaceCollection200ResponseLinksSelf service; @override bool operator ==(Object other) { @@ -42,9 +42,7 @@ class ServiceOfferJsonhalReadLinks { } @override - int get hashCode => - (self == null ? 0 : self.hashCode) + - (service == null ? 0 : service.hashCode); + int get hashCode => self.hashCode + service.hashCode; static List listFromJson(Iterable? json) { if (json == null) { @@ -100,25 +98,22 @@ class ServiceOfferJsonhalReadLinks { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.any((key) => RegExp(r'^self\.').hasMatch(key))) - r'self': self?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^self\.'))) { - previousValue.add(element.split(RegExp(r'^self\.')).last); - } - - return previousValue; - })), - if (keys == null || - keys.any((key) => RegExp(r'^service\.').hasMatch(key))) - r'service': service?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^service\.'))) { - previousValue.add(element.split(RegExp(r'^service\.')).last); - } - - return previousValue; - })), + r'self': self.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^self\.'))) { + previousValue.add(element.split(RegExp(r'^self\.')).last); + } + + return previousValue; + })), + r'service': service.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^service\.'))) { + previousValue.add(element.split(RegExp(r'^service\.')).last); + } + + return previousValue; + })), }; } } diff --git a/dart-v3/lib/model/sla_jsonhal_organization_preference_read.dart b/dart-v3/lib/model/sla_jsonhal_organization_preference_read.dart index a76f4d7de..8860f6ad0 100644 --- a/dart-v3/lib/model/sla_jsonhal_organization_preference_read.dart +++ b/dart-v3/lib/model/sla_jsonhal_organization_preference_read.dart @@ -7,7 +7,7 @@ part of keyclic_sdk_api_platform; class SlaJsonhalOrganizationPreferenceRead { /// Returns a new [SlaJsonhalOrganizationPreferenceRead] instance. SlaJsonhalOrganizationPreferenceRead({ - this.enabled, + required this.enabled, }); /// Returns a new [SlaJsonhalOrganizationPreferenceRead] instance and imports its values from @@ -22,7 +22,7 @@ class SlaJsonhalOrganizationPreferenceRead { ); } - bool? enabled; + bool enabled; @override bool operator ==(Object other) { @@ -36,7 +36,7 @@ class SlaJsonhalOrganizationPreferenceRead { } @override - int get hashCode => (enabled == null ? 0 : enabled.hashCode); + int get hashCode => enabled.hashCode; static List listFromJson( Iterable? json) { @@ -93,7 +93,7 @@ class SlaJsonhalOrganizationPreferenceRead { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.contains(r'enabled')) r'enabled': enabled, + r'enabled': enabled, }; } } diff --git a/dart-v3/lib/model/sla_policy_jsonhal_read.dart b/dart-v3/lib/model/sla_policy_jsonhal_read.dart index a8249422a..5da0756fb 100644 --- a/dart-v3/lib/model/sla_policy_jsonhal_read.dart +++ b/dart-v3/lib/model/sla_policy_jsonhal_read.dart @@ -7,15 +7,15 @@ part of keyclic_sdk_api_platform; class SlaPolicyJsonhalRead { /// Returns a new [SlaPolicyJsonhalRead] instance. SlaPolicyJsonhalRead({ - this.links, - this.id, + required this.links, + required this.id, required this.timeTarget, this.description, required this.name, - this.enabled, - this.conditions, - this.createdAt, - this.updatedAt, + required this.enabled, + this.conditions = const [], + required this.createdAt, + required this.updatedAt, this.embedded, }); @@ -27,23 +27,23 @@ class SlaPolicyJsonhalRead { } return SlaPolicyJsonhalRead( - links: SlaPolicyJsonhalReadLinks.fromJson(json[r'_links']), + links: SlaPolicyJsonhalReadLinks.fromJson(json[r'_links'])!, id: json[r'id'], timeTarget: json[r'timeTarget'], description: json[r'description'], name: json[r'name'], enabled: json[r'enabled'], conditions: ConditionJsonhalRead.listFromJson(json[r'conditions']), - createdAt: mapToDateTime(json[r'createdAt']), - updatedAt: mapToDateTime(json[r'updatedAt']), + createdAt: mapToDateTime(json[r'createdAt'])!, + updatedAt: mapToDateTime(json[r'updatedAt'])!, embedded: SlaPolicyJsonhalReadEmbedded.fromJson(json[r'_embedded']), ); } - SlaPolicyJsonhalReadLinks? links; + SlaPolicyJsonhalReadLinks links; /// The resource identifier. - final String? id; + final String id; String timeTarget; @@ -51,15 +51,15 @@ class SlaPolicyJsonhalRead { String name; - bool? enabled; + bool enabled; - List? conditions; + List conditions; /// The date and time when the resource was created, in UTC format. - final DateTime? createdAt; + final DateTime createdAt; /// The date and time when the resource was updated, in UTC format. - final DateTime? updatedAt; + final DateTime updatedAt; SlaPolicyJsonhalReadEmbedded? embedded; @@ -86,15 +86,15 @@ class SlaPolicyJsonhalRead { @override int get hashCode => - (links == null ? 0 : links.hashCode) + - (id == null ? 0 : id.hashCode) + + links.hashCode + + id.hashCode + timeTarget.hashCode + (description == null ? 0 : description.hashCode) + name.hashCode + - (enabled == null ? 0 : enabled.hashCode) + - (conditions == null ? 0 : conditions.hashCode) + - (createdAt == null ? 0 : createdAt.hashCode) + - (updatedAt == null ? 0 : updatedAt.hashCode) + + enabled.hashCode + + conditions.hashCode + + createdAt.hashCode + + updatedAt.hashCode + (embedded == null ? 0 : embedded.hashCode); static List listFromJson(Iterable? json) { @@ -151,27 +151,23 @@ class SlaPolicyJsonhalRead { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.any((key) => RegExp(r'^links\.').hasMatch(key))) - r'_links': links?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^links\.'))) { - previousValue.add(element.split(RegExp(r'^links\.')).last); - } - - return previousValue; - })), - if (keys == null || keys.contains(r'id')) r'id': id, + r'_links': links.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^links\.'))) { + previousValue.add(element.split(RegExp(r'^links\.')).last); + } + + return previousValue; + })), + r'id': id, r'timeTarget': timeTarget, if (keys == null || keys.contains(r'description')) r'description': description, r'name': name, - if (keys == null || keys.contains(r'enabled')) r'enabled': enabled, - if (keys == null || keys.contains(r'conditions')) - r'conditions': conditions, - if (keys == null || keys.contains(r'createdAt')) - r'createdAt': createdAt?.toUtc().toIso8601String(), - if (keys == null || keys.contains(r'updatedAt')) - r'updatedAt': updatedAt?.toUtc().toIso8601String(), + r'enabled': enabled, + r'conditions': conditions, + r'createdAt': createdAt.toUtc().toIso8601String(), + r'updatedAt': updatedAt.toUtc().toIso8601String(), if (keys == null || keys.any((key) => RegExp(r'^embedded\.').hasMatch(key))) r'_embedded': embedded?.toJson(keys?.fold>([], diff --git a/dart-v3/lib/model/sla_policy_jsonhal_read_links.dart b/dart-v3/lib/model/sla_policy_jsonhal_read_links.dart index ab7b8d25c..ad2077cc0 100644 --- a/dart-v3/lib/model/sla_policy_jsonhal_read_links.dart +++ b/dart-v3/lib/model/sla_policy_jsonhal_read_links.dart @@ -7,7 +7,7 @@ part of keyclic_sdk_api_platform; class SlaPolicyJsonhalReadLinks { /// Returns a new [SlaPolicyJsonhalReadLinks] instance. SlaPolicyJsonhalReadLinks({ - this.self, + required this.self, this.fromStates, this.toStates, }); @@ -20,7 +20,7 @@ class SlaPolicyJsonhalReadLinks { } return SlaPolicyJsonhalReadLinks( - self: GetPlaceCollection200ResponseLinksSelf.fromJson(json[r'self']), + self: GetPlaceCollection200ResponseLinksSelf.fromJson(json[r'self'])!, fromStates: GetPlaceCollection200ResponseLinksSelf.listFromJson( json[r'fromStates']), toStates: GetPlaceCollection200ResponseLinksSelf.listFromJson( @@ -28,7 +28,7 @@ class SlaPolicyJsonhalReadLinks { ); } - GetPlaceCollection200ResponseLinksSelf? self; + GetPlaceCollection200ResponseLinksSelf self; List? fromStates; @@ -50,7 +50,7 @@ class SlaPolicyJsonhalReadLinks { @override int get hashCode => - (self == null ? 0 : self.hashCode) + + self.hashCode + (fromStates == null ? 0 : fromStates.hashCode) + (toStates == null ? 0 : toStates.hashCode); @@ -108,15 +108,14 @@ class SlaPolicyJsonhalReadLinks { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.any((key) => RegExp(r'^self\.').hasMatch(key))) - r'self': self?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^self\.'))) { - previousValue.add(element.split(RegExp(r'^self\.')).last); - } - - return previousValue; - })), + r'self': self.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^self\.'))) { + previousValue.add(element.split(RegExp(r'^self\.')).last); + } + + return previousValue; + })), if (keys == null || keys.contains(r'fromStates')) r'fromStates': fromStates, if (keys == null || keys.contains(r'toStates')) r'toStates': toStates, diff --git a/dart-v3/lib/model/target_group_jsonhal_read.dart b/dart-v3/lib/model/target_group_jsonhal_read.dart index 2f5bcdd16..1c9ea62f8 100644 --- a/dart-v3/lib/model/target_group_jsonhal_read.dart +++ b/dart-v3/lib/model/target_group_jsonhal_read.dart @@ -7,9 +7,9 @@ part of keyclic_sdk_api_platform; class TargetGroupJsonhalRead { /// Returns a new [TargetGroupJsonhalRead] instance. TargetGroupJsonhalRead({ - this.links, - this.description, - this.id, + required this.links, + required this.description, + required this.id, this.name, }); @@ -21,18 +21,18 @@ class TargetGroupJsonhalRead { } return TargetGroupJsonhalRead( - links: AssetTypeJsonhalReadLinks.fromJson(json[r'_links']), + links: AssetTypeJsonhalReadLinks.fromJson(json[r'_links'])!, description: json[r'description'], id: json[r'id'], name: json[r'name'], ); } - AssetTypeJsonhalReadLinks? links; + AssetTypeJsonhalReadLinks links; - final String? description; + final String description; - String? id; + String id; String? name; @@ -52,9 +52,9 @@ class TargetGroupJsonhalRead { @override int get hashCode => - (links == null ? 0 : links.hashCode) + - (description == null ? 0 : description.hashCode) + - (id == null ? 0 : id.hashCode) + + links.hashCode + + description.hashCode + + id.hashCode + (name == null ? 0 : name.hashCode); static List listFromJson(Iterable? json) { @@ -111,18 +111,16 @@ class TargetGroupJsonhalRead { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.any((key) => RegExp(r'^links\.').hasMatch(key))) - r'_links': links?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^links\.'))) { - previousValue.add(element.split(RegExp(r'^links\.')).last); - } - - return previousValue; - })), - if (keys == null || keys.contains(r'description')) - r'description': description, - if (keys == null || keys.contains(r'id')) r'id': id, + r'_links': links.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^links\.'))) { + previousValue.add(element.split(RegExp(r'^links\.')).last); + } + + return previousValue; + })), + r'description': description, + r'id': id, if (keys == null || keys.contains(r'name')) r'name': name, }; } diff --git a/dart-v3/lib/model/ticket_create_ticket_command_write.dart b/dart-v3/lib/model/ticket_create_ticket_command_write.dart index fd3ae081b..7ae41d8f8 100644 --- a/dart-v3/lib/model/ticket_create_ticket_command_write.dart +++ b/dart-v3/lib/model/ticket_create_ticket_command_write.dart @@ -8,7 +8,7 @@ class TicketCreateTicketCommandWrite { /// Returns a new [TicketCreateTicketCommandWrite] instance. TicketCreateTicketCommandWrite({ this.description, - this.equipments, + this.equipments = const [], this.member, this.name, required this.parent, @@ -25,9 +25,7 @@ class TicketCreateTicketCommandWrite { return TicketCreateTicketCommandWrite( description: json[r'description'], - equipments: json[r'equipments'] == null - ? null - : List.from(json[r'equipments']), + equipments: List.from(json[r'equipments']), member: json[r'member'], name: json[r'name'], parent: json[r'parent'], @@ -38,7 +36,7 @@ class TicketCreateTicketCommandWrite { String? description; - List? equipments; + List equipments; String? member; @@ -71,7 +69,7 @@ class TicketCreateTicketCommandWrite { @override int get hashCode => (description == null ? 0 : description.hashCode) + - (equipments == null ? 0 : equipments.hashCode) + + equipments.hashCode + (member == null ? 0 : member.hashCode) + (name == null ? 0 : name.hashCode) + parent.hashCode + @@ -134,8 +132,7 @@ class TicketCreateTicketCommandWrite { return { if (keys == null || keys.contains(r'description')) r'description': description, - if (keys == null || keys.contains(r'equipments')) - r'equipments': equipments, + r'equipments': equipments, if (keys == null || keys.contains(r'member')) r'member': member, if (keys == null || keys.contains(r'name')) r'name': name, r'parent': parent, diff --git a/dart-v3/lib/model/ticket_jsongeo_read.dart b/dart-v3/lib/model/ticket_jsongeo_read.dart index 71064784b..3d9e08f8f 100644 --- a/dart-v3/lib/model/ticket_jsongeo_read.dart +++ b/dart-v3/lib/model/ticket_jsongeo_read.dart @@ -9,7 +9,7 @@ class TicketJsongeoRead { TicketJsongeoRead({ this.type = 'Feature', required this.geometry, - this.properties, + this.properties = const {}, }); /// Returns a new [TicketJsongeoRead] instance and imports its values from @@ -22,9 +22,7 @@ class TicketJsongeoRead { return TicketJsongeoRead( type: json[r'type'], geometry: TicketJsongeoReadGeometry.fromJson(json[r'geometry'])!, - properties: json[r'properties'] == null - ? null - : Map.from(json[r'properties']), + properties: Map.from(json[r'properties']), ); } @@ -32,7 +30,7 @@ class TicketJsongeoRead { TicketJsongeoReadGeometry geometry; - Map? properties; + Map properties; @override bool operator ==(Object other) { @@ -48,10 +46,7 @@ class TicketJsongeoRead { } @override - int get hashCode => - type.hashCode + - geometry.hashCode + - (properties == null ? 0 : properties.hashCode); + int get hashCode => type.hashCode + geometry.hashCode + properties.hashCode; static List listFromJson(Iterable? json) { if (json == null) { @@ -115,8 +110,7 @@ class TicketJsongeoRead { return previousValue; })), - if (keys == null || keys.contains(r'properties')) - r'properties': properties, + r'properties': properties, }; } } diff --git a/dart-v3/lib/model/ticket_jsongeo_read_geometry.dart b/dart-v3/lib/model/ticket_jsongeo_read_geometry.dart index 6aec627cc..698f72231 100644 --- a/dart-v3/lib/model/ticket_jsongeo_read_geometry.dart +++ b/dart-v3/lib/model/ticket_jsongeo_read_geometry.dart @@ -7,8 +7,8 @@ part of keyclic_sdk_api_platform; class TicketJsongeoReadGeometry { /// Returns a new [TicketJsongeoReadGeometry] instance. TicketJsongeoReadGeometry({ - this.type, - this.coordinates, + required this.type, + this.coordinates = const [], }); /// Returns a new [TicketJsongeoReadGeometry] instance and imports its values from @@ -19,16 +19,14 @@ class TicketJsongeoReadGeometry { } return TicketJsongeoReadGeometry( - type: TicketJsongeoReadGeometryTypeEnum.fromJson(json[r'type']), - coordinates: json[r'coordinates'] == null - ? null - : List.from(json[r'coordinates']), + type: TicketJsongeoReadGeometryTypeEnum.fromJson(json[r'type'])!, + coordinates: List.from(json[r'coordinates']), ); } - TicketJsongeoReadGeometryTypeEnum? type; + TicketJsongeoReadGeometryTypeEnum type; - List? coordinates; + List coordinates; @override bool operator ==(Object other) { @@ -44,9 +42,7 @@ class TicketJsongeoReadGeometry { } @override - int get hashCode => - (type == null ? 0 : type.hashCode) + - (coordinates == null ? 0 : coordinates.hashCode); + int get hashCode => type.hashCode + coordinates.hashCode; static List listFromJson(Iterable? json) { if (json == null) { @@ -102,9 +98,8 @@ class TicketJsongeoReadGeometry { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.contains(r'type')) r'type': type, - if (keys == null || keys.contains(r'coordinates')) - r'coordinates': coordinates, + r'type': type, + r'coordinates': coordinates, }; } } diff --git a/dart-v3/lib/model/ticket_jsonhal_read.dart b/dart-v3/lib/model/ticket_jsonhal_read.dart index 5cedaa19a..a73d0fee8 100644 --- a/dart-v3/lib/model/ticket_jsonhal_read.dart +++ b/dart-v3/lib/model/ticket_jsonhal_read.dart @@ -7,20 +7,20 @@ part of keyclic_sdk_api_platform; class TicketJsonhalRead { /// Returns a new [TicketJsonhalRead] instance. TicketJsonhalRead({ - this.links, + required this.links, this.description, this.dueBy, this.name, this.scheduledAt, - this.completed, - this.id, + required this.completed, + required this.id, this.tags, - this.createdAt, - this.updatedAt, + required this.createdAt, + required this.updatedAt, this.reference, - this.archived, - this.images, - this.embedded, + required this.archived, + this.images = const [], + required this.embedded, }); /// Returns a new [TicketJsonhalRead] instance and imports its values from @@ -31,7 +31,7 @@ class TicketJsonhalRead { } return TicketJsonhalRead( - links: TicketJsonhalReadLinks.fromJson(json[r'_links']), + links: TicketJsonhalReadLinks.fromJson(json[r'_links'])!, description: json[r'description'], dueBy: mapToDateTime(json[r'dueBy']), name: json[r'name'], @@ -39,17 +39,16 @@ class TicketJsonhalRead { completed: json[r'completed'], id: json[r'id'], tags: json[r'tags'] == null ? null : List.from(json[r'tags']), - createdAt: mapToDateTime(json[r'createdAt']), - updatedAt: mapToDateTime(json[r'updatedAt']), + createdAt: mapToDateTime(json[r'createdAt'])!, + updatedAt: mapToDateTime(json[r'updatedAt'])!, reference: json[r'reference'], archived: json[r'archived'], - images: - json[r'images'] == null ? null : List.from(json[r'images']), - embedded: TicketJsonhalReadEmbedded.fromJson(json[r'_embedded']), + images: List.from(json[r'images']), + embedded: TicketJsonhalReadEmbedded.fromJson(json[r'_embedded'])!, ); } - TicketJsonhalReadLinks? links; + TicketJsonhalReadLinks links; String? description; @@ -59,26 +58,26 @@ class TicketJsonhalRead { DateTime? scheduledAt; - bool? completed; + bool completed; /// The resource identifier. - final String? id; + final String id; List? tags; /// The date and time when the resource was created, in UTC format. - final DateTime? createdAt; + final DateTime createdAt; /// The date and time when the resource was updated, in UTC format. - final DateTime? updatedAt; + final DateTime updatedAt; final String? reference; - bool? archived; + bool archived; - final List? images; + final List images; - TicketJsonhalReadEmbedded? embedded; + TicketJsonhalReadEmbedded embedded; @override bool operator ==(Object other) { @@ -106,20 +105,20 @@ class TicketJsonhalRead { @override int get hashCode => - (links == null ? 0 : links.hashCode) + + links.hashCode + (description == null ? 0 : description.hashCode) + (dueBy == null ? 0 : dueBy.hashCode) + (name == null ? 0 : name.hashCode) + (scheduledAt == null ? 0 : scheduledAt.hashCode) + - (completed == null ? 0 : completed.hashCode) + - (id == null ? 0 : id.hashCode) + + completed.hashCode + + id.hashCode + (tags == null ? 0 : tags.hashCode) + - (createdAt == null ? 0 : createdAt.hashCode) + - (updatedAt == null ? 0 : updatedAt.hashCode) + + createdAt.hashCode + + updatedAt.hashCode + (reference == null ? 0 : reference.hashCode) + - (archived == null ? 0 : archived.hashCode) + - (images == null ? 0 : images.hashCode) + - (embedded == null ? 0 : embedded.hashCode); + archived.hashCode + + images.hashCode + + embedded.hashCode; static List listFromJson(Iterable? json) { if (json == null) { @@ -174,15 +173,14 @@ class TicketJsonhalRead { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.any((key) => RegExp(r'^links\.').hasMatch(key))) - r'_links': links?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^links\.'))) { - previousValue.add(element.split(RegExp(r'^links\.')).last); - } - - return previousValue; - })), + r'_links': links.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^links\.'))) { + previousValue.add(element.split(RegExp(r'^links\.')).last); + } + + return previousValue; + })), if (keys == null || keys.contains(r'description')) r'description': description, if (keys == null || keys.contains(r'dueBy')) @@ -190,26 +188,22 @@ class TicketJsonhalRead { if (keys == null || keys.contains(r'name')) r'name': name, if (keys == null || keys.contains(r'scheduledAt')) r'scheduledAt': scheduledAt?.toUtc().toIso8601String(), - if (keys == null || keys.contains(r'completed')) r'completed': completed, - if (keys == null || keys.contains(r'id')) r'id': id, + r'completed': completed, + r'id': id, if (keys == null || keys.contains(r'tags')) r'tags': tags, - if (keys == null || keys.contains(r'createdAt')) - r'createdAt': createdAt?.toUtc().toIso8601String(), - if (keys == null || keys.contains(r'updatedAt')) - r'updatedAt': updatedAt?.toUtc().toIso8601String(), + r'createdAt': createdAt.toUtc().toIso8601String(), + r'updatedAt': updatedAt.toUtc().toIso8601String(), if (keys == null || keys.contains(r'reference')) r'reference': reference, - if (keys == null || keys.contains(r'archived')) r'archived': archived, - if (keys == null || keys.contains(r'images')) r'images': images, - if (keys == null || - keys.any((key) => RegExp(r'^embedded\.').hasMatch(key))) - r'_embedded': embedded?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^embedded\.'))) { - previousValue.add(element.split(RegExp(r'^embedded\.')).last); - } - - return previousValue; - })), + r'archived': archived, + r'images': images, + r'_embedded': embedded.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^embedded\.'))) { + previousValue.add(element.split(RegExp(r'^embedded\.')).last); + } + + return previousValue; + })), }; } } diff --git a/dart-v3/lib/model/ticket_jsonhal_read_embedded.dart b/dart-v3/lib/model/ticket_jsonhal_read_embedded.dart index 5a9447aa8..0e7567a33 100644 --- a/dart-v3/lib/model/ticket_jsonhal_read_embedded.dart +++ b/dart-v3/lib/model/ticket_jsonhal_read_embedded.dart @@ -11,9 +11,9 @@ class TicketJsonhalReadEmbedded { this.category, this.equipments, this.phase, - this.place, + required this.place, this.priority, - this.feedback, + required this.feedback, this.children, this.state, }); @@ -30,9 +30,9 @@ class TicketJsonhalReadEmbedded { category: CategoryJsonhalRead.fromJson(json[r'category']), equipments: EquipmentJsonhalRead.listFromJson(json[r'equipments']), phase: WorkflowStateJsonhalRead.fromJson(json[r'phase']), - place: PlaceJsonhalRead.fromJson(json[r'place']), + place: PlaceJsonhalRead.fromJson(json[r'place'])!, priority: TicketPriorityJsonhalRead.fromJson(json[r'priority']), - feedback: FeedbackJsonhalRead.fromJson(json[r'feedback']), + feedback: FeedbackJsonhalRead.fromJson(json[r'feedback'])!, children: json[r'children'] == null ? null : List.from(json[r'children']), @@ -48,11 +48,11 @@ class TicketJsonhalReadEmbedded { WorkflowStateJsonhalRead? phase; - PlaceJsonhalRead? place; + PlaceJsonhalRead place; TicketPriorityJsonhalRead? priority; - FeedbackJsonhalRead? feedback; + FeedbackJsonhalRead feedback; final List? children; @@ -85,9 +85,9 @@ class TicketJsonhalReadEmbedded { (category == null ? 0 : category.hashCode) + (equipments == null ? 0 : equipments.hashCode) + (phase == null ? 0 : phase.hashCode) + - (place == null ? 0 : place.hashCode) + + place.hashCode + (priority == null ? 0 : priority.hashCode) + - (feedback == null ? 0 : feedback.hashCode) + + feedback.hashCode + (children == null ? 0 : children.hashCode) + (state == null ? 0 : state.hashCode); @@ -168,15 +168,14 @@ class TicketJsonhalReadEmbedded { return previousValue; })), - if (keys == null || keys.any((key) => RegExp(r'^place\.').hasMatch(key))) - r'place': place?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^place\.'))) { - previousValue.add(element.split(RegExp(r'^place\.')).last); - } - - return previousValue; - })), + r'place': place.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^place\.'))) { + previousValue.add(element.split(RegExp(r'^place\.')).last); + } + + return previousValue; + })), if (keys == null || keys.any((key) => RegExp(r'^priority\.').hasMatch(key))) r'priority': priority?.toJson(keys?.fold>([], @@ -187,16 +186,14 @@ class TicketJsonhalReadEmbedded { return previousValue; })), - if (keys == null || - keys.any((key) => RegExp(r'^feedback\.').hasMatch(key))) - r'feedback': feedback?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^feedback\.'))) { - previousValue.add(element.split(RegExp(r'^feedback\.')).last); - } - - return previousValue; - })), + r'feedback': feedback.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^feedback\.'))) { + previousValue.add(element.split(RegExp(r'^feedback\.')).last); + } + + return previousValue; + })), if (keys == null || keys.contains(r'children')) r'children': children, if (keys == null || keys.any((key) => RegExp(r'^state\.').hasMatch(key))) r'state': state?.toJson(keys?.fold>([], diff --git a/dart-v3/lib/model/ticket_jsonhal_read_links.dart b/dart-v3/lib/model/ticket_jsonhal_read_links.dart index 74ea298a1..0a9bd9fe4 100644 --- a/dart-v3/lib/model/ticket_jsonhal_read_links.dart +++ b/dart-v3/lib/model/ticket_jsonhal_read_links.dart @@ -7,8 +7,8 @@ part of keyclic_sdk_api_platform; class TicketJsonhalReadLinks { /// Returns a new [TicketJsonhalReadLinks] instance. TicketJsonhalReadLinks({ - this.self, - this.organization, + required this.self, + required this.organization, this.parent, this.assignments, this.equipments, @@ -23,9 +23,9 @@ class TicketJsonhalReadLinks { } return TicketJsonhalReadLinks( - self: GetPlaceCollection200ResponseLinksSelf.fromJson(json[r'self']), + self: GetPlaceCollection200ResponseLinksSelf.fromJson(json[r'self'])!, organization: GetPlaceCollection200ResponseLinksSelf.fromJson( - json[r'organization']), + json[r'organization'])!, parent: GetPlaceCollection200ResponseLinksFirst.fromJson(json[r'parent']), assignments: GetPlaceCollection200ResponseLinksSelf.listFromJson( json[r'assignments']), @@ -36,9 +36,9 @@ class TicketJsonhalReadLinks { ); } - GetPlaceCollection200ResponseLinksSelf? self; + GetPlaceCollection200ResponseLinksSelf self; - GetPlaceCollection200ResponseLinksSelf? organization; + GetPlaceCollection200ResponseLinksSelf organization; GetPlaceCollection200ResponseLinksFirst? parent; @@ -68,8 +68,8 @@ class TicketJsonhalReadLinks { @override int get hashCode => - (self == null ? 0 : self.hashCode) + - (organization == null ? 0 : organization.hashCode) + + self.hashCode + + organization.hashCode + (parent == null ? 0 : parent.hashCode) + (assignments == null ? 0 : assignments.hashCode) + (equipments == null ? 0 : equipments.hashCode) + @@ -129,25 +129,22 @@ class TicketJsonhalReadLinks { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.any((key) => RegExp(r'^self\.').hasMatch(key))) - r'self': self?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^self\.'))) { - previousValue.add(element.split(RegExp(r'^self\.')).last); - } - - return previousValue; - })), - if (keys == null || - keys.any((key) => RegExp(r'^organization\.').hasMatch(key))) - r'organization': organization?.toJson(keys?.fold>( - [], (List previousValue, String element) { - if (element.contains(RegExp(r'^organization\.'))) { - previousValue.add(element.split(RegExp(r'^organization\.')).last); - } - - return previousValue; - })), + r'self': self.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^self\.'))) { + previousValue.add(element.split(RegExp(r'^self\.')).last); + } + + return previousValue; + })), + r'organization': organization.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^organization\.'))) { + previousValue.add(element.split(RegExp(r'^organization\.')).last); + } + + return previousValue; + })), if (keys == null || keys.any((key) => RegExp(r'^parent\.').hasMatch(key))) r'parent': parent?.toJson(keys?.fold>([], (List previousValue, String element) { diff --git a/dart-v3/lib/model/ticket_priority_jsongeo_read.dart b/dart-v3/lib/model/ticket_priority_jsongeo_read.dart index 7f971a6c8..666e09fed 100644 --- a/dart-v3/lib/model/ticket_priority_jsongeo_read.dart +++ b/dart-v3/lib/model/ticket_priority_jsongeo_read.dart @@ -9,8 +9,8 @@ class TicketPriorityJsongeoRead { TicketPriorityJsongeoRead({ this.color, required this.name, - this.id, - this.position, + required this.id, + required this.position, }); /// Returns a new [TicketPriorityJsongeoRead] instance and imports its values from @@ -33,9 +33,9 @@ class TicketPriorityJsongeoRead { String name; /// The resource identifier. - final String? id; + final String id; - int? position; + int position; @override bool operator ==(Object other) { @@ -55,8 +55,8 @@ class TicketPriorityJsongeoRead { int get hashCode => (color == null ? 0 : color.hashCode) + name.hashCode + - (id == null ? 0 : id.hashCode) + - (position == null ? 0 : position.hashCode); + id.hashCode + + position.hashCode; static List listFromJson(Iterable? json) { if (json == null) { @@ -114,8 +114,8 @@ class TicketPriorityJsongeoRead { return { if (keys == null || keys.contains(r'color')) r'color': color, r'name': name, - if (keys == null || keys.contains(r'id')) r'id': id, - if (keys == null || keys.contains(r'position')) r'position': position, + r'id': id, + r'position': position, }; } } diff --git a/dart-v3/lib/model/ticket_priority_jsonhal_read.dart b/dart-v3/lib/model/ticket_priority_jsonhal_read.dart index 30ac84fe7..f4dd34931 100644 --- a/dart-v3/lib/model/ticket_priority_jsonhal_read.dart +++ b/dart-v3/lib/model/ticket_priority_jsonhal_read.dart @@ -7,11 +7,11 @@ part of keyclic_sdk_api_platform; class TicketPriorityJsonhalRead { /// Returns a new [TicketPriorityJsonhalRead] instance. TicketPriorityJsonhalRead({ - this.links, + required this.links, this.color, required this.name, - this.id, - this.position, + required this.id, + required this.position, }); /// Returns a new [TicketPriorityJsonhalRead] instance and imports its values from @@ -22,7 +22,7 @@ class TicketPriorityJsonhalRead { } return TicketPriorityJsonhalRead( - links: AssetTypeJsonhalReadLinks.fromJson(json[r'_links']), + links: AssetTypeJsonhalReadLinks.fromJson(json[r'_links'])!, color: json[r'color'], name: json[r'name'], id: json[r'id'], @@ -30,16 +30,16 @@ class TicketPriorityJsonhalRead { ); } - AssetTypeJsonhalReadLinks? links; + AssetTypeJsonhalReadLinks links; String? color; String name; /// The resource identifier. - final String? id; + final String id; - int? position; + int position; @override bool operator ==(Object other) { @@ -58,11 +58,11 @@ class TicketPriorityJsonhalRead { @override int get hashCode => - (links == null ? 0 : links.hashCode) + + links.hashCode + (color == null ? 0 : color.hashCode) + name.hashCode + - (id == null ? 0 : id.hashCode) + - (position == null ? 0 : position.hashCode); + id.hashCode + + position.hashCode; static List listFromJson(Iterable? json) { if (json == null) { @@ -118,19 +118,18 @@ class TicketPriorityJsonhalRead { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.any((key) => RegExp(r'^links\.').hasMatch(key))) - r'_links': links?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^links\.'))) { - previousValue.add(element.split(RegExp(r'^links\.')).last); - } - - return previousValue; - })), + r'_links': links.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^links\.'))) { + previousValue.add(element.split(RegExp(r'^links\.')).last); + } + + return previousValue; + })), if (keys == null || keys.contains(r'color')) r'color': color, r'name': name, - if (keys == null || keys.contains(r'id')) r'id': id, - if (keys == null || keys.contains(r'position')) r'position': position, + r'id': id, + r'position': position, }; } } diff --git a/dart-v3/lib/model/ticket_type_jsonhal_read.dart b/dart-v3/lib/model/ticket_type_jsonhal_read.dart index b72a676a3..09df0f380 100644 --- a/dart-v3/lib/model/ticket_type_jsonhal_read.dart +++ b/dart-v3/lib/model/ticket_type_jsonhal_read.dart @@ -7,10 +7,10 @@ part of keyclic_sdk_api_platform; class TicketTypeJsonhalRead { /// Returns a new [TicketTypeJsonhalRead] instance. TicketTypeJsonhalRead({ - this.links, - this.id, - this.createdAt, - this.updatedAt, + required this.links, + required this.id, + required this.createdAt, + required this.updatedAt, required this.name, this.description, }); @@ -23,25 +23,25 @@ class TicketTypeJsonhalRead { } return TicketTypeJsonhalRead( - links: AssetTypeJsonhalReadLinks.fromJson(json[r'_links']), + links: AssetTypeJsonhalReadLinks.fromJson(json[r'_links'])!, id: json[r'id'], - createdAt: mapToDateTime(json[r'createdAt']), - updatedAt: mapToDateTime(json[r'updatedAt']), + createdAt: mapToDateTime(json[r'createdAt'])!, + updatedAt: mapToDateTime(json[r'updatedAt'])!, name: json[r'name'], description: json[r'description'], ); } - AssetTypeJsonhalReadLinks? links; + AssetTypeJsonhalReadLinks links; /// The resource identifier. - final String? id; + final String id; /// The date and time when the resource was created, in UTC format. - final DateTime? createdAt; + final DateTime createdAt; /// The date and time when the resource was updated, in UTC format. - final DateTime? updatedAt; + final DateTime updatedAt; String name; @@ -65,10 +65,10 @@ class TicketTypeJsonhalRead { @override int get hashCode => - (links == null ? 0 : links.hashCode) + - (id == null ? 0 : id.hashCode) + - (createdAt == null ? 0 : createdAt.hashCode) + - (updatedAt == null ? 0 : updatedAt.hashCode) + + links.hashCode + + id.hashCode + + createdAt.hashCode + + updatedAt.hashCode + name.hashCode + (description == null ? 0 : description.hashCode); @@ -126,20 +126,17 @@ class TicketTypeJsonhalRead { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.any((key) => RegExp(r'^links\.').hasMatch(key))) - r'_links': links?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^links\.'))) { - previousValue.add(element.split(RegExp(r'^links\.')).last); - } - - return previousValue; - })), - if (keys == null || keys.contains(r'id')) r'id': id, - if (keys == null || keys.contains(r'createdAt')) - r'createdAt': createdAt?.toUtc().toIso8601String(), - if (keys == null || keys.contains(r'updatedAt')) - r'updatedAt': updatedAt?.toUtc().toIso8601String(), + r'_links': links.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^links\.'))) { + previousValue.add(element.split(RegExp(r'^links\.')).last); + } + + return previousValue; + })), + r'id': id, + r'createdAt': createdAt.toUtc().toIso8601String(), + r'updatedAt': updatedAt.toUtc().toIso8601String(), r'name': name, if (keys == null || keys.contains(r'description')) r'description': description, diff --git a/dart-v3/lib/model/user_jsonhal_auth_profile_read.dart b/dart-v3/lib/model/user_jsonhal_auth_profile_read.dart index 1255a7137..3496eecd7 100644 --- a/dart-v3/lib/model/user_jsonhal_auth_profile_read.dart +++ b/dart-v3/lib/model/user_jsonhal_auth_profile_read.dart @@ -7,8 +7,8 @@ part of keyclic_sdk_api_platform; class UserJsonhalAuthProfileRead { /// Returns a new [UserJsonhalAuthProfileRead] instance. UserJsonhalAuthProfileRead({ - this.email, - this.username, + required this.email, + required this.username, }); /// Returns a new [UserJsonhalAuthProfileRead] instance and imports its values from @@ -24,9 +24,9 @@ class UserJsonhalAuthProfileRead { ); } - String? email; + String email; - String? username; + String username; @override bool operator ==(Object other) { @@ -41,9 +41,7 @@ class UserJsonhalAuthProfileRead { } @override - int get hashCode => - (email == null ? 0 : email.hashCode) + - (username == null ? 0 : username.hashCode); + int get hashCode => email.hashCode + username.hashCode; static List listFromJson(Iterable? json) { if (json == null) { @@ -99,8 +97,8 @@ class UserJsonhalAuthProfileRead { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.contains(r'email')) r'email': email, - if (keys == null || keys.contains(r'username')) r'username': username, + r'email': email, + r'username': username, }; } } diff --git a/dart-v3/lib/model/workflow_state_jsongeo_read.dart b/dart-v3/lib/model/workflow_state_jsongeo_read.dart index c461f4de6..10e66b280 100644 --- a/dart-v3/lib/model/workflow_state_jsongeo_read.dart +++ b/dart-v3/lib/model/workflow_state_jsongeo_read.dart @@ -7,16 +7,16 @@ part of keyclic_sdk_api_platform; class WorkflowStateJsongeoRead { /// Returns a new [WorkflowStateJsongeoRead] instance. WorkflowStateJsongeoRead({ - this.allowAdd, - this.allowDispatch, - this.end, + required this.allowAdd, + this.allowDispatch = true, + required this.end, this.backgroundColor, this.color, this.description, required this.name, this.progression, this.reference, - this.id, + required this.id, }); /// Returns a new [WorkflowStateJsongeoRead] instance and imports its values from @@ -41,11 +41,11 @@ class WorkflowStateJsongeoRead { ); } - bool? allowAdd; + bool allowAdd; - bool? allowDispatch; + bool allowDispatch; - bool? end; + bool end; String? backgroundColor; @@ -60,7 +60,7 @@ class WorkflowStateJsongeoRead { String? reference; /// The resource identifier. - final String? id; + final String id; @override bool operator ==(Object other) { @@ -84,16 +84,16 @@ class WorkflowStateJsongeoRead { @override int get hashCode => - (allowAdd == null ? 0 : allowAdd.hashCode) + - (allowDispatch == null ? 0 : allowDispatch.hashCode) + - (end == null ? 0 : end.hashCode) + + allowAdd.hashCode + + allowDispatch.hashCode + + end.hashCode + (backgroundColor == null ? 0 : backgroundColor.hashCode) + (color == null ? 0 : color.hashCode) + (description == null ? 0 : description.hashCode) + name.hashCode + (progression == null ? 0 : progression.hashCode) + (reference == null ? 0 : reference.hashCode) + - (id == null ? 0 : id.hashCode); + id.hashCode; static List listFromJson(Iterable? json) { if (json == null) { @@ -149,10 +149,9 @@ class WorkflowStateJsongeoRead { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.contains(r'allowAdd')) r'allowAdd': allowAdd, - if (keys == null || keys.contains(r'allowDispatch')) - r'allowDispatch': allowDispatch, - if (keys == null || keys.contains(r'end')) r'end': end, + r'allowAdd': allowAdd, + r'allowDispatch': allowDispatch, + r'end': end, if (keys == null || keys.contains(r'backgroundColor')) r'backgroundColor': backgroundColor, if (keys == null || keys.contains(r'color')) r'color': color, @@ -162,7 +161,7 @@ class WorkflowStateJsongeoRead { if (keys == null || keys.contains(r'progression')) r'progression': progression, if (keys == null || keys.contains(r'reference')) r'reference': reference, - if (keys == null || keys.contains(r'id')) r'id': id, + r'id': id, }; } } diff --git a/dart-v3/lib/model/workflow_state_jsonhal_read.dart b/dart-v3/lib/model/workflow_state_jsonhal_read.dart index a3abc20c3..54f6e8c13 100644 --- a/dart-v3/lib/model/workflow_state_jsonhal_read.dart +++ b/dart-v3/lib/model/workflow_state_jsonhal_read.dart @@ -7,17 +7,17 @@ part of keyclic_sdk_api_platform; class WorkflowStateJsonhalRead { /// Returns a new [WorkflowStateJsonhalRead] instance. WorkflowStateJsonhalRead({ - this.links, - this.allowAdd, - this.allowDispatch, - this.end, + required this.links, + required this.allowAdd, + this.allowDispatch = true, + required this.end, this.backgroundColor, this.color, this.description, required this.name, this.progression, this.reference, - this.id, + required this.id, }); /// Returns a new [WorkflowStateJsonhalRead] instance and imports its values from @@ -28,7 +28,7 @@ class WorkflowStateJsonhalRead { } return WorkflowStateJsonhalRead( - links: AssetTypeJsonhalReadLinks.fromJson(json[r'_links']), + links: AssetTypeJsonhalReadLinks.fromJson(json[r'_links'])!, allowAdd: json[r'allowAdd'], allowDispatch: json[r'allowDispatch'], end: json[r'end'], @@ -43,13 +43,13 @@ class WorkflowStateJsonhalRead { ); } - AssetTypeJsonhalReadLinks? links; + AssetTypeJsonhalReadLinks links; - bool? allowAdd; + bool allowAdd; - bool? allowDispatch; + bool allowDispatch; - bool? end; + bool end; String? backgroundColor; @@ -64,7 +64,7 @@ class WorkflowStateJsonhalRead { String? reference; /// The resource identifier. - final String? id; + final String id; @override bool operator ==(Object other) { @@ -89,17 +89,17 @@ class WorkflowStateJsonhalRead { @override int get hashCode => - (links == null ? 0 : links.hashCode) + - (allowAdd == null ? 0 : allowAdd.hashCode) + - (allowDispatch == null ? 0 : allowDispatch.hashCode) + - (end == null ? 0 : end.hashCode) + + links.hashCode + + allowAdd.hashCode + + allowDispatch.hashCode + + end.hashCode + (backgroundColor == null ? 0 : backgroundColor.hashCode) + (color == null ? 0 : color.hashCode) + (description == null ? 0 : description.hashCode) + name.hashCode + (progression == null ? 0 : progression.hashCode) + (reference == null ? 0 : reference.hashCode) + - (id == null ? 0 : id.hashCode); + id.hashCode; static List listFromJson(Iterable? json) { if (json == null) { @@ -155,19 +155,17 @@ class WorkflowStateJsonhalRead { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.any((key) => RegExp(r'^links\.').hasMatch(key))) - r'_links': links?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^links\.'))) { - previousValue.add(element.split(RegExp(r'^links\.')).last); - } - - return previousValue; - })), - if (keys == null || keys.contains(r'allowAdd')) r'allowAdd': allowAdd, - if (keys == null || keys.contains(r'allowDispatch')) - r'allowDispatch': allowDispatch, - if (keys == null || keys.contains(r'end')) r'end': end, + r'_links': links.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^links\.'))) { + previousValue.add(element.split(RegExp(r'^links\.')).last); + } + + return previousValue; + })), + r'allowAdd': allowAdd, + r'allowDispatch': allowDispatch, + r'end': end, if (keys == null || keys.contains(r'backgroundColor')) r'backgroundColor': backgroundColor, if (keys == null || keys.contains(r'color')) r'color': color, @@ -177,7 +175,7 @@ class WorkflowStateJsonhalRead { if (keys == null || keys.contains(r'progression')) r'progression': progression, if (keys == null || keys.contains(r'reference')) r'reference': reference, - if (keys == null || keys.contains(r'id')) r'id': id, + r'id': id, }; } } diff --git a/dart-v3/lib/model/workflow_transition_jsonhal_read.dart b/dart-v3/lib/model/workflow_transition_jsonhal_read.dart index eeddddff1..99a54f443 100644 --- a/dart-v3/lib/model/workflow_transition_jsonhal_read.dart +++ b/dart-v3/lib/model/workflow_transition_jsonhal_read.dart @@ -7,13 +7,13 @@ part of keyclic_sdk_api_platform; class WorkflowTransitionJsonhalRead { /// Returns a new [WorkflowTransitionJsonhalRead] instance. WorkflowTransitionJsonhalRead({ - this.links, + required this.links, this.description, this.fields, required this.name, this.required_, - this.id, - this.embedded, + required this.id, + required this.embedded, }); /// Returns a new [WorkflowTransitionJsonhalRead] instance and imports its values from @@ -24,7 +24,7 @@ class WorkflowTransitionJsonhalRead { } return WorkflowTransitionJsonhalRead( - links: AssetTypeJsonhalReadLinks.fromJson(json[r'_links']), + links: AssetTypeJsonhalReadLinks.fromJson(json[r'_links'])!, description: json[r'description'], fields: json[r'fields'] == null ? null : List.from(json[r'fields']), @@ -34,11 +34,11 @@ class WorkflowTransitionJsonhalRead { : List.from(json[r'required']), id: json[r'id'], embedded: - WorkflowTransitionJsonhalReadEmbedded.fromJson(json[r'_embedded']), + WorkflowTransitionJsonhalReadEmbedded.fromJson(json[r'_embedded'])!, ); } - AssetTypeJsonhalReadLinks? links; + AssetTypeJsonhalReadLinks links; String? description; @@ -49,9 +49,9 @@ class WorkflowTransitionJsonhalRead { List? required_; /// The resource identifier. - final String? id; + final String id; - WorkflowTransitionJsonhalReadEmbedded? embedded; + WorkflowTransitionJsonhalReadEmbedded embedded; @override bool operator ==(Object other) { @@ -72,13 +72,13 @@ class WorkflowTransitionJsonhalRead { @override int get hashCode => - (links == null ? 0 : links.hashCode) + + links.hashCode + (description == null ? 0 : description.hashCode) + (fields == null ? 0 : fields.hashCode) + name.hashCode + (required_ == null ? 0 : required_.hashCode) + - (id == null ? 0 : id.hashCode) + - (embedded == null ? 0 : embedded.hashCode); + id.hashCode + + embedded.hashCode; static List listFromJson(Iterable? json) { if (json == null) { @@ -134,31 +134,28 @@ class WorkflowTransitionJsonhalRead { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.any((key) => RegExp(r'^links\.').hasMatch(key))) - r'_links': links?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^links\.'))) { - previousValue.add(element.split(RegExp(r'^links\.')).last); - } - - return previousValue; - })), + r'_links': links.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^links\.'))) { + previousValue.add(element.split(RegExp(r'^links\.')).last); + } + + return previousValue; + })), if (keys == null || keys.contains(r'description')) r'description': description, if (keys == null || keys.contains(r'fields')) r'fields': fields, r'name': name, if (keys == null || keys.contains(r'required_')) r'required': required_, - if (keys == null || keys.contains(r'id')) r'id': id, - if (keys == null || - keys.any((key) => RegExp(r'^embedded\.').hasMatch(key))) - r'_embedded': embedded?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^embedded\.'))) { - previousValue.add(element.split(RegExp(r'^embedded\.')).last); - } - - return previousValue; - })), + r'id': id, + r'_embedded': embedded.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^embedded\.'))) { + previousValue.add(element.split(RegExp(r'^embedded\.')).last); + } + + return previousValue; + })), }; } } diff --git a/dart-v3/lib/model/workflow_transition_jsonhal_read_embedded.dart b/dart-v3/lib/model/workflow_transition_jsonhal_read_embedded.dart index 6f0d6a09a..2ab62c521 100644 --- a/dart-v3/lib/model/workflow_transition_jsonhal_read_embedded.dart +++ b/dart-v3/lib/model/workflow_transition_jsonhal_read_embedded.dart @@ -7,8 +7,8 @@ part of keyclic_sdk_api_platform; class WorkflowTransitionJsonhalReadEmbedded { /// Returns a new [WorkflowTransitionJsonhalReadEmbedded] instance. WorkflowTransitionJsonhalReadEmbedded({ - this.from, - this.to, + required this.from, + required this.to, }); /// Returns a new [WorkflowTransitionJsonhalReadEmbedded] instance and imports its values from @@ -19,14 +19,14 @@ class WorkflowTransitionJsonhalReadEmbedded { } return WorkflowTransitionJsonhalReadEmbedded( - from: WorkflowStateJsonhalRead.fromJson(json[r'from']), - to: WorkflowStateJsonhalRead.fromJson(json[r'to']), + from: WorkflowStateJsonhalRead.fromJson(json[r'from'])!, + to: WorkflowStateJsonhalRead.fromJson(json[r'to'])!, ); } - WorkflowStateJsonhalRead? from; + WorkflowStateJsonhalRead from; - WorkflowStateJsonhalRead? to; + WorkflowStateJsonhalRead to; @override bool operator ==(Object other) { @@ -41,8 +41,7 @@ class WorkflowTransitionJsonhalReadEmbedded { } @override - int get hashCode => - (from == null ? 0 : from.hashCode) + (to == null ? 0 : to.hashCode); + int get hashCode => from.hashCode + to.hashCode; static List listFromJson( Iterable? json) { @@ -100,24 +99,22 @@ class WorkflowTransitionJsonhalReadEmbedded { Map toJson([Iterable? keys]) { return { - if (keys == null || keys.any((key) => RegExp(r'^from\.').hasMatch(key))) - r'from': from?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^from\.'))) { - previousValue.add(element.split(RegExp(r'^from\.')).last); - } - - return previousValue; - })), - if (keys == null || keys.any((key) => RegExp(r'^to\.').hasMatch(key))) - r'to': to?.toJson(keys?.fold>([], - (List previousValue, String element) { - if (element.contains(RegExp(r'^to\.'))) { - previousValue.add(element.split(RegExp(r'^to\.')).last); - } - - return previousValue; - })), + r'from': from.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^from\.'))) { + previousValue.add(element.split(RegExp(r'^from\.')).last); + } + + return previousValue; + })), + r'to': to.toJson(keys?.fold>([], + (List previousValue, String element) { + if (element.contains(RegExp(r'^to\.'))) { + previousValue.add(element.split(RegExp(r'^to\.')).last); + } + + return previousValue; + })), }; } }