From 5ebc782591f2c9c86a3444fc0feaa530240192fe Mon Sep 17 00:00:00 2001 From: Thomas Fransolet Date: Tue, 26 Dec 2023 15:49:10 +0100 Subject: [PATCH] update service generation --- lib/api/swagger.yaml | 15 ++++++- manager_api/.openapi-generator/FILES | 4 -- manager_api/doc/ConfigurationDTO.md | 2 + manager_api/doc/ExportConfigurationDTO.md | 2 + manager_api/doc/ResponseDTO.md | 3 ++ manager_api/lib/model/configuration_dto.dart | 40 ++++++++++++++++-- .../lib/model/export_configuration_dto.dart | 36 +++++++++++++++- manager_api/lib/model/response_dto.dart | 41 ++++++++++++++++++- 8 files changed, 133 insertions(+), 10 deletions(-) diff --git a/lib/api/swagger.yaml b/lib/api/swagger.yaml index 86fbead..e873dc2 100644 --- a/lib/api/swagger.yaml +++ b/lib/api/swagger.yaml @@ -1814,6 +1814,10 @@ components: weatherCity: type: string nullable: true + isDate: + type: boolean + isHour: + type: boolean TranslationDTO: type: object additionalProperties: false @@ -1885,6 +1889,7 @@ components: order: type: integer format: int32 + nullable: true instanceId: type: string nullable: true @@ -2163,7 +2168,7 @@ components: resourceUrl: type: string nullable: true - latitude: + resourceName: type: string nullable: true CategorieDTO: @@ -2302,6 +2307,14 @@ components: $ref: '#/components/schemas/TranslationDTO' isGood: type: boolean + resourceId: + type: string + nullable: true + resourceType: + $ref: '#/components/schemas/ResourceType' + resourceUrl: + type: string + nullable: true order: type: integer format: int32 diff --git a/manager_api/.openapi-generator/FILES b/manager_api/.openapi-generator/FILES index 4dbee0b..0fd499a 100644 --- a/manager_api/.openapi-generator/FILES +++ b/manager_api/.openapi-generator/FILES @@ -105,7 +105,3 @@ lib/model/user_detail_dto.dart lib/model/video_dto.dart lib/model/web_dto.dart pubspec.yaml -test/categorie_dto_test.dart -test/content_dto_test.dart -test/content_geo_point_test.dart -test/geo_point_dto_categorie_test.dart diff --git a/manager_api/doc/ConfigurationDTO.md b/manager_api/doc/ConfigurationDTO.md index 4184c42..5faaf68 100644 --- a/manager_api/doc/ConfigurationDTO.md +++ b/manager_api/doc/ConfigurationDTO.md @@ -25,6 +25,8 @@ Name | Type | Description | Notes **loaderImageId** | **String** | | [optional] **loaderImageUrl** | **String** | | [optional] **weatherCity** | **String** | | [optional] +**isDate** | **bool** | | [optional] +**isHour** | **bool** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/manager_api/doc/ExportConfigurationDTO.md b/manager_api/doc/ExportConfigurationDTO.md index 732381d..d1df2ea 100644 --- a/manager_api/doc/ExportConfigurationDTO.md +++ b/manager_api/doc/ExportConfigurationDTO.md @@ -25,6 +25,8 @@ Name | Type | Description | Notes **loaderImageId** | **String** | | [optional] **loaderImageUrl** | **String** | | [optional] **weatherCity** | **String** | | [optional] +**isDate** | **bool** | | [optional] +**isHour** | **bool** | | [optional] **sections** | [**List**](SectionDTO.md) | | [optional] [default to const []] **resources** | [**List**](ResourceDTO.md) | | [optional] [default to const []] diff --git a/manager_api/doc/ResponseDTO.md b/manager_api/doc/ResponseDTO.md index 7e6ed27..91d84ba 100644 --- a/manager_api/doc/ResponseDTO.md +++ b/manager_api/doc/ResponseDTO.md @@ -10,6 +10,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **label** | [**List**](TranslationDTO.md) | | [optional] [default to const []] **isGood** | **bool** | | [optional] +**resourceId** | **String** | | [optional] +**resourceType** | [**ResourceType**](ResourceType.md) | | [optional] +**resourceUrl** | **String** | | [optional] **order** | **int** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/manager_api/lib/model/configuration_dto.dart b/manager_api/lib/model/configuration_dto.dart index a7196bd..074ab24 100644 --- a/manager_api/lib/model/configuration_dto.dart +++ b/manager_api/lib/model/configuration_dto.dart @@ -30,6 +30,8 @@ class ConfigurationDTO { this.loaderImageId, this.loaderImageUrl, this.weatherCity, + this.isDate, + this.isHour, }); String? id; @@ -90,6 +92,22 @@ class ConfigurationDTO { String? weatherCity; + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + bool? isDate; + + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + bool? isHour; + @override bool operator ==(Object other) => identical(this, other) || other is ConfigurationDTO && other.id == id && @@ -108,7 +126,9 @@ class ConfigurationDTO { other.sectionIds == sectionIds && other.loaderImageId == loaderImageId && other.loaderImageUrl == loaderImageUrl && - other.weatherCity == weatherCity; + other.weatherCity == weatherCity && + other.isDate == isDate && + other.isHour == isHour; @override int get hashCode => @@ -129,10 +149,12 @@ class ConfigurationDTO { (sectionIds == null ? 0 : sectionIds!.hashCode) + (loaderImageId == null ? 0 : loaderImageId!.hashCode) + (loaderImageUrl == null ? 0 : loaderImageUrl!.hashCode) + - (weatherCity == null ? 0 : weatherCity!.hashCode); + (weatherCity == null ? 0 : weatherCity!.hashCode) + + (isDate == null ? 0 : isDate!.hashCode) + + (isHour == null ? 0 : isHour!.hashCode); @override - String toString() => 'ConfigurationDTO[id=$id, label=$label, title=$title, imageId=$imageId, imageSource=$imageSource, primaryColor=$primaryColor, secondaryColor=$secondaryColor, languages=$languages, dateCreation=$dateCreation, isMobile=$isMobile, isTablet=$isTablet, isOffline=$isOffline, instanceId=$instanceId, sectionIds=$sectionIds, loaderImageId=$loaderImageId, loaderImageUrl=$loaderImageUrl, weatherCity=$weatherCity]'; + String toString() => 'ConfigurationDTO[id=$id, label=$label, title=$title, imageId=$imageId, imageSource=$imageSource, primaryColor=$primaryColor, secondaryColor=$secondaryColor, languages=$languages, dateCreation=$dateCreation, isMobile=$isMobile, isTablet=$isTablet, isOffline=$isOffline, instanceId=$instanceId, sectionIds=$sectionIds, loaderImageId=$loaderImageId, loaderImageUrl=$loaderImageUrl, weatherCity=$weatherCity, isDate=$isDate, isHour=$isHour]'; Map toJson() { final json = {}; @@ -221,6 +243,16 @@ class ConfigurationDTO { } else { json[r'weatherCity'] = null; } + if (this.isDate != null) { + json[r'isDate'] = this.isDate; + } else { + json[r'isDate'] = null; + } + if (this.isHour != null) { + json[r'isHour'] = this.isHour; + } else { + json[r'isHour'] = null; + } return json; } @@ -264,6 +296,8 @@ class ConfigurationDTO { loaderImageId: mapValueOfType(json, r'loaderImageId'), loaderImageUrl: mapValueOfType(json, r'loaderImageUrl'), weatherCity: mapValueOfType(json, r'weatherCity'), + isDate: mapValueOfType(json, r'isDate'), + isHour: mapValueOfType(json, r'isHour'), ); } return null; diff --git a/manager_api/lib/model/export_configuration_dto.dart b/manager_api/lib/model/export_configuration_dto.dart index dd16d90..4efa6a3 100644 --- a/manager_api/lib/model/export_configuration_dto.dart +++ b/manager_api/lib/model/export_configuration_dto.dart @@ -30,6 +30,8 @@ class ExportConfigurationDTO { this.loaderImageId, this.loaderImageUrl, this.weatherCity, + this.isDate, + this.isHour, this.sections = const [], this.resources = const [], }); @@ -92,6 +94,22 @@ class ExportConfigurationDTO { String? weatherCity; + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + bool? isDate; + + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + bool? isHour; + List? sections; List? resources; @@ -115,6 +133,8 @@ class ExportConfigurationDTO { other.loaderImageId == loaderImageId && other.loaderImageUrl == loaderImageUrl && other.weatherCity == weatherCity && + other.isDate == isDate && + other.isHour == isHour && other.sections == sections && other.resources == resources; @@ -138,11 +158,13 @@ class ExportConfigurationDTO { (loaderImageId == null ? 0 : loaderImageId!.hashCode) + (loaderImageUrl == null ? 0 : loaderImageUrl!.hashCode) + (weatherCity == null ? 0 : weatherCity!.hashCode) + + (isDate == null ? 0 : isDate!.hashCode) + + (isHour == null ? 0 : isHour!.hashCode) + (sections == null ? 0 : sections!.hashCode) + (resources == null ? 0 : resources!.hashCode); @override - String toString() => 'ExportConfigurationDTO[id=$id, label=$label, title=$title, imageId=$imageId, imageSource=$imageSource, primaryColor=$primaryColor, secondaryColor=$secondaryColor, languages=$languages, dateCreation=$dateCreation, isMobile=$isMobile, isTablet=$isTablet, isOffline=$isOffline, instanceId=$instanceId, sectionIds=$sectionIds, loaderImageId=$loaderImageId, loaderImageUrl=$loaderImageUrl, weatherCity=$weatherCity, sections=$sections, resources=$resources]'; + String toString() => 'ExportConfigurationDTO[id=$id, label=$label, title=$title, imageId=$imageId, imageSource=$imageSource, primaryColor=$primaryColor, secondaryColor=$secondaryColor, languages=$languages, dateCreation=$dateCreation, isMobile=$isMobile, isTablet=$isTablet, isOffline=$isOffline, instanceId=$instanceId, sectionIds=$sectionIds, loaderImageId=$loaderImageId, loaderImageUrl=$loaderImageUrl, weatherCity=$weatherCity, isDate=$isDate, isHour=$isHour, sections=$sections, resources=$resources]'; Map toJson() { final json = {}; @@ -231,6 +253,16 @@ class ExportConfigurationDTO { } else { json[r'weatherCity'] = null; } + if (this.isDate != null) { + json[r'isDate'] = this.isDate; + } else { + json[r'isDate'] = null; + } + if (this.isHour != null) { + json[r'isHour'] = this.isHour; + } else { + json[r'isHour'] = null; + } if (this.sections != null) { json[r'sections'] = this.sections; } else { @@ -284,6 +316,8 @@ class ExportConfigurationDTO { loaderImageId: mapValueOfType(json, r'loaderImageId'), loaderImageUrl: mapValueOfType(json, r'loaderImageUrl'), weatherCity: mapValueOfType(json, r'weatherCity'), + isDate: mapValueOfType(json, r'isDate'), + isHour: mapValueOfType(json, r'isHour'), sections: SectionDTO.listFromJson(json[r'sections']), resources: ResourceDTO.listFromJson(json[r'resources']), ); diff --git a/manager_api/lib/model/response_dto.dart b/manager_api/lib/model/response_dto.dart index df2f4cd..d72237a 100644 --- a/manager_api/lib/model/response_dto.dart +++ b/manager_api/lib/model/response_dto.dart @@ -15,6 +15,9 @@ class ResponseDTO { ResponseDTO({ this.label = const [], this.isGood, + this.resourceId, + this.resourceType, + this.resourceUrl, this.order, }); @@ -28,6 +31,18 @@ class ResponseDTO { /// bool? isGood; + String? resourceId; + + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + ResourceType? resourceType; + + String? resourceUrl; + /// /// Please note: This property should have been non-nullable! Since the specification file /// does not include a default value (using the "default:" property), however, the generated @@ -40,6 +55,9 @@ class ResponseDTO { bool operator ==(Object other) => identical(this, other) || other is ResponseDTO && other.label == label && other.isGood == isGood && + other.resourceId == resourceId && + other.resourceType == resourceType && + other.resourceUrl == resourceUrl && other.order == order; @override @@ -47,10 +65,13 @@ class ResponseDTO { // ignore: unnecessary_parenthesis (label == null ? 0 : label!.hashCode) + (isGood == null ? 0 : isGood!.hashCode) + + (resourceId == null ? 0 : resourceId!.hashCode) + + (resourceType == null ? 0 : resourceType!.hashCode) + + (resourceUrl == null ? 0 : resourceUrl!.hashCode) + (order == null ? 0 : order!.hashCode); @override - String toString() => 'ResponseDTO[label=$label, isGood=$isGood, order=$order]'; + String toString() => 'ResponseDTO[label=$label, isGood=$isGood, resourceId=$resourceId, resourceType=$resourceType, resourceUrl=$resourceUrl, order=$order]'; Map toJson() { final json = {}; @@ -64,6 +85,21 @@ class ResponseDTO { } else { json[r'isGood'] = null; } + if (this.resourceId != null) { + json[r'resourceId'] = this.resourceId; + } else { + json[r'resourceId'] = null; + } + if (this.resourceType != null) { + json[r'resourceType'] = this.resourceType; + } else { + json[r'resourceType'] = null; + } + if (this.resourceUrl != null) { + json[r'resourceUrl'] = this.resourceUrl; + } else { + json[r'resourceUrl'] = null; + } if (this.order != null) { json[r'order'] = this.order; } else { @@ -93,6 +129,9 @@ class ResponseDTO { return ResponseDTO( label: TranslationDTO.listFromJson(json[r'label']), isGood: mapValueOfType(json, r'isGood'), + resourceId: mapValueOfType(json, r'resourceId'), + resourceType: ResourceType.fromJson(json[r'resourceType']), + resourceUrl: mapValueOfType(json, r'resourceUrl'), order: mapValueOfType(json, r'order'), ); }