Update openapi generation .. + update code + fix issue on authenticate try on build

This commit is contained in:
Fransolet Thomas 2022-12-22 17:30:37 +01:00
parent 294a1a3b40
commit ed9c4bfc15
269 changed files with 13098 additions and 9920 deletions

1
.gitignore vendored
View File

@ -32,7 +32,6 @@
/build/ /build/
# Web related # Web related
lib/generated_plugin_registrant.dart
# Symbolication related # Symbolication related
app.*.symbols app.*.symbols

View File

@ -4,7 +4,7 @@ import 'package:manager_app/Components/loading_common.dart';
import 'package:manager_app/app_context.dart'; import 'package:manager_app/app_context.dart';
import 'package:manager_app/constants.dart'; import 'package:manager_app/constants.dart';
import 'package:manager_app/Screens/Resources/select_resource_modal.dart'; import 'package:manager_app/Screens/Resources/select_resource_modal.dart';
import 'package:managerapi/api.dart'; import 'package:manager_api_new/api.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class AudioInputContainer extends StatefulWidget { class AudioInputContainer extends StatefulWidget {
@ -67,7 +67,7 @@ class _AudioInputContainerState extends State<AudioInputContainer> {
var result = await showSelectResourceModal( var result = await showSelectResourceModal(
"Sélectionner une ressource", "Sélectionner une ressource",
1, 1,
[ResourceType.audio], [ResourceType.Audio],
context context
); );

View File

@ -6,7 +6,7 @@ import 'package:flutter/material.dart';
import 'package:manager_app/Models/managerContext.dart'; import 'package:manager_app/Models/managerContext.dart';
import 'package:manager_app/app_context.dart'; import 'package:manager_app/app_context.dart';
import 'package:manager_app/constants.dart'; import 'package:manager_app/constants.dart';
import 'package:managerapi/api.dart'; import 'package:manager_api_new/api.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:http/http.dart' as http; import 'package:http/http.dart' as http;

View File

@ -1,21 +1,21 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:managerapi/api.dart'; import 'package:manager_api_new/api.dart';
IconData getResourceIcon(elementType) { IconData getResourceIcon(elementType) {
switch(elementType) { switch(elementType) {
case ResourceType.image: case ResourceType.Image:
return Icons.image; return Icons.image;
break; break;
case ResourceType.imageUrl: case ResourceType.ImageUrl:
return Icons.image_search; // art_track return Icons.image_search; // art_track
break; break;
case ResourceType.audio: case ResourceType.Audio:
return Icons.audiotrack; // art_track return Icons.audiotrack; // art_track
break; break;
case ResourceType.video: case ResourceType.Video:
return Icons.slow_motion_video; return Icons.slow_motion_video;
break; break;
case ResourceType.videoUrl: case ResourceType.VideoUrl:
return Icons.ondemand_video_sharp; return Icons.ondemand_video_sharp;
break; break;
} }

View File

@ -1,27 +1,27 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:managerapi/api.dart'; import 'package:manager_api_new/api.dart';
IconData getSectionIcon(elementType) { IconData getSectionIcon(elementType) {
switch(elementType) { switch(elementType) {
case SectionType.map: case SectionType.Map:
return Icons.location_on; return Icons.location_on;
break; break;
case SectionType.slider: case SectionType.Slider:
return Icons.collections; // art_track return Icons.collections; // art_track
break; break;
case SectionType.video: case SectionType.Video:
return Icons.ondemand_video_rounded; return Icons.ondemand_video_rounded;
break; break;
case SectionType.web: case SectionType.Web:
return Icons.web; return Icons.web;
break; break;
case SectionType.menu: case SectionType.Menu:
return Icons.apps_sharp; return Icons.apps_sharp;
break; break;
case SectionType.quizz: case SectionType.Quizz:
return Icons.question_answer; return Icons.question_answer;
break; break;
case SectionType.article: case SectionType.Article:
return Icons.article_outlined; return Icons.article_outlined;
break; break;
} }

View File

@ -4,7 +4,7 @@ import 'package:manager_app/Components/loading_common.dart';
import 'package:manager_app/app_context.dart'; import 'package:manager_app/app_context.dart';
import 'package:manager_app/constants.dart'; import 'package:manager_app/constants.dart';
import 'package:manager_app/Screens/Resources/select_resource_modal.dart'; import 'package:manager_app/Screens/Resources/select_resource_modal.dart';
import 'package:managerapi/api.dart'; import 'package:manager_api_new/api.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class ImageInputContainer extends StatefulWidget { class ImageInputContainer extends StatefulWidget {
@ -67,7 +67,7 @@ class _ImageInputContainerState extends State<ImageInputContainer> {
var result = await showSelectResourceModal( var result = await showSelectResourceModal(
"Sélectionner une ressource", "Sélectionner une ressource",
1, 1,
[ResourceType.image, ResourceType.imageUrl], [ResourceType.Image, ResourceType.ImageUrl],
context context
); );
@ -149,7 +149,7 @@ class _ImageInputContainerState extends State<ImageInputContainer> {
image: new DecorationImage( image: new DecorationImage(
fit: widget.imageFit, fit: widget.imageFit,
image: resourceDTO.type != null ? new NetworkImage( image: resourceDTO.type != null ? new NetworkImage(
resourceDTO.type == ResourceType.image ? appContext.getContext().clientAPI.resourceApi.apiClient.basePath+"/api/Resource/"+ resourceDTO.id : resourceDTO.data, resourceDTO.type == ResourceType.Image ? appContext.getContext().clientAPI.resourceApi.apiClient.basePath+"/api/Resource/"+ resourceDTO.id : resourceDTO.data,
) : null, ) : null,
), ),
boxShadow: [ boxShadow: [

View File

@ -8,7 +8,7 @@ import 'package:manager_app/Models/managerContext.dart';
import 'package:manager_app/Screens/Resources/select_resource_modal.dart'; import 'package:manager_app/Screens/Resources/select_resource_modal.dart';
import 'package:manager_app/app_context.dart'; import 'package:manager_app/app_context.dart';
import 'package:manager_app/constants.dart'; import 'package:manager_app/constants.dart';
import 'package:managerapi/api.dart'; import 'package:manager_api_new/api.dart';
import 'package:collection/collection.dart'; import 'package:collection/collection.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';

View File

@ -4,7 +4,7 @@ import 'package:auto_size_text/auto_size_text.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:manager_app/Components/multi_input_modal.dart'; import 'package:manager_app/Components/multi_input_modal.dart';
import 'package:manager_app/constants.dart'; import 'package:manager_app/constants.dart';
import 'package:managerapi/api.dart'; import 'package:manager_api_new/api.dart';
class MultiStringContainer extends StatelessWidget { class MultiStringContainer extends StatelessWidget {
final Color color; final Color color;

View File

@ -6,7 +6,7 @@ import 'package:manager_app/Components/upload_audio_container.dart';
import 'package:manager_app/Components/upload_image_container.dart'; import 'package:manager_app/Components/upload_image_container.dart';
import 'package:manager_app/Components/upload_online_resources_container.dart'; import 'package:manager_app/Components/upload_online_resources_container.dart';
import 'package:manager_app/constants.dart'; import 'package:manager_app/constants.dart';
import 'package:managerapi/api.dart'; import 'package:manager_api_new/api.dart';
class ResourceTab extends StatefulWidget { class ResourceTab extends StatefulWidget {
final ResourceDTO resourceDTO; final ResourceDTO resourceDTO;
final Function onFileUpload; final Function onFileUpload;
@ -71,19 +71,19 @@ class _ResourceTabState extends State<ResourceTab> with SingleTickerProviderStat
case 0: case 0:
setState(() { setState(() {
widget.resourceDTO.data = null; widget.resourceDTO.data = null;
widget.resourceDTO.type = ResourceType.image; widget.resourceDTO.type = ResourceType.Image;
}); });
break; break;
case 1: case 1:
setState(() { setState(() {
widget.resourceDTO.data = null; widget.resourceDTO.data = null;
widget.resourceDTO.type = ResourceType.imageUrl; widget.resourceDTO.type = ResourceType.ImageUrl;
}); });
break; break;
case 2: case 2:
setState(() { setState(() {
widget.resourceDTO.data = null; widget.resourceDTO.data = null;
widget.resourceDTO.type = ResourceType.audio; widget.resourceDTO.type = ResourceType.Audio;
}); });
break; break;
} }
@ -100,11 +100,11 @@ getContent(ResourceDTO resourceDTO, Function onFileUpload, Function onFileUpload
child: UploadImageContainer( child: UploadImageContainer(
onChanged: (List<File> files) { onChanged: (List<File> files) {
onFileUpload(files); onFileUpload(files);
resourceDTO.type = ResourceType.image; resourceDTO.type = ResourceType.Image;
}, },
onChangedWeb: (List<PlatformFile> files) { onChangedWeb: (List<PlatformFile> files) {
onFileUploadWeb(files); onFileUploadWeb(files);
resourceDTO.type = ResourceType.image; resourceDTO.type = ResourceType.Image;
}, },
), ),
) )
@ -116,7 +116,7 @@ getContent(ResourceDTO resourceDTO, Function onFileUpload, Function onFileUpload
padding: EdgeInsets.symmetric(horizontal: 8, vertical: 16), padding: EdgeInsets.symmetric(horizontal: 8, vertical: 16),
child: UploadOnlineResourceContainer( child: UploadOnlineResourceContainer(
resourceDTO: resourceDTO, resourceDTO: resourceDTO,
onChanged: (ResourceDTO value) { onChanged: (ResourceDTO value) {
resourceDTO = value; resourceDTO = value;
}, },
), ),
@ -130,11 +130,11 @@ getContent(ResourceDTO resourceDTO, Function onFileUpload, Function onFileUpload
child: UploadAudioContainer( child: UploadAudioContainer(
onChanged: (List<File> files) { onChanged: (List<File> files) {
onFileUpload(files); onFileUpload(files);
resourceDTO.type = ResourceType.audio; resourceDTO.type = ResourceType.Audio;
}, },
onChangedWeb: (List<PlatformFile> files) { onChangedWeb: (List<PlatformFile> files) {
onFileUploadWeb(files); onFileUploadWeb(files);
resourceDTO.type = ResourceType.audio; resourceDTO.type = ResourceType.Audio;
}, },
), ),
) )

View File

@ -1,6 +1,6 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:manager_app/constants.dart'; import 'package:manager_app/constants.dart';
import 'package:managerapi/api.dart'; import 'package:manager_api_new/api.dart';
class TranslationTab extends StatefulWidget { class TranslationTab extends StatefulWidget {
final List<TranslationDTO> translations; final List<TranslationDTO> translations;
final int maxLines; final int maxLines;

View File

@ -1,6 +1,6 @@
import 'package:manager_app/Components/rounded_input_field.dart'; import 'package:manager_app/Components/rounded_input_field.dart';
import 'package:manager_app/constants.dart'; import 'package:manager_app/constants.dart';
import 'package:managerapi/api.dart'; import 'package:manager_api_new/api.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class UploadOnlineResourceContainer extends StatefulWidget { class UploadOnlineResourceContainer extends StatefulWidget {
@ -32,7 +32,7 @@ class _UploadOnlineResourceContainerState extends State<UploadOnlineResourceCont
} }
showFile() { showFile() {
if (widget.resourceDTO.type == ResourceType.videoUrl || widget.resourceDTO.type == ResourceType.video) { if (widget.resourceDTO.type == ResourceType.VideoUrl || widget.resourceDTO.type == ResourceType.Video) {
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
@ -105,8 +105,8 @@ class _UploadOnlineResourceContainerState extends State<UploadOnlineResourceCont
child: Container( child: Container(
width: size.width *0.35, // TODO GET SIZE width: size.width *0.35, // TODO GET SIZE
child: RoundedInputField( child: RoundedInputField(
hintText: widget.resourceDTO.type == ResourceType.imageUrl ? "Url de l'image" : "Url de la vidéo", hintText: widget.resourceDTO.type == ResourceType.ImageUrl ? "Url de l'image" : "Url de la vidéo",
icon: widget.resourceDTO.type == ResourceType.imageUrl ? Icons.image : Icons.ondemand_video, // TODO: TBD icon: widget.resourceDTO.type == ResourceType.ImageUrl ? Icons.image : Icons.ondemand_video, // TODO: TBD
onChanged: (String text) { onChanged: (String text) {
//print("onchanged url"); //print("onchanged url");
widget.resourceDTO.data = text; widget.resourceDTO.data = text;

View File

@ -7,7 +7,7 @@ import 'package:manager_app/Components/message_notification.dart';
import 'package:manager_app/Models/session.dart'; import 'package:manager_app/Models/session.dart';
import 'package:manager_app/client.dart'; import 'package:manager_app/client.dart';
import 'package:manager_app/constants.dart'; import 'package:manager_app/constants.dart';
import 'package:managerapi/api.dart'; import 'package:manager_api_new/api.dart';
class FileHelper { class FileHelper {
final key = Key.fromUtf8('aVs:ZMe3EK-yS<y:;k>vCGrj3T8]yG6E'); final key = Key.fromUtf8('aVs:ZMe3EK-yS<y:;k>vCGrj3T8]yG6E');

View File

@ -1,5 +1,5 @@
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:managerapi/api.dart'; import 'package:manager_api_new/api.dart';
import 'dart:convert'; import 'dart:convert';
import 'package:pdf/pdf.dart'; import 'package:pdf/pdf.dart';
import 'package:pdf/widgets.dart' as pw; import 'package:pdf/widgets.dart' as pw;
@ -7,7 +7,7 @@ import 'dart:html' as html;
class PDFHelper { class PDFHelper {
static downloadPDF(List<SectionDTO> sections) async { static downloadPDF(List<SectionDTO> sections) async {
var sectionsArticle = sections.where((section) => section.type == SectionType.article); var sectionsArticle = sections.where((section) => section.type == SectionType.Article);
if(sectionsArticle.length > 0) { if(sectionsArticle.length > 0) {
//final font = await rootBundle.load("fonts/OpenSans-Medium.ttf"); //final font = await rootBundle.load("fonts/OpenSans-Medium.ttf");
//Uint8List byteData = new File("fonts/OpenSans-Medium.ttf").readAsBytesSync(); //Uint8List byteData = new File("fonts/OpenSans-Medium.ttf").readAsBytesSync();

View File

@ -1,24 +1,24 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:manager_app/client.dart'; import 'package:manager_app/client.dart';
import 'package:managerapi/api.dart'; import 'package:manager_api_new/api.dart';
class ManagerAppContext with ChangeNotifier{ class ManagerAppContext with ChangeNotifier{
String email; String email;
String instanceId; String instanceId;
String host; String host;
TokenDTO token; String accessToken;
Client clientAPI; Client clientAPI;
String currentRoute; String currentRoute;
ConfigurationDTO selectedConfiguration; ConfigurationDTO selectedConfiguration;
SectionDTO selectedSection; SectionDTO selectedSection;
bool isLoading = false; bool isLoading = false;
ManagerAppContext({this.email, this.token, this.currentRoute}); ManagerAppContext({this.email, this.accessToken, this.currentRoute});
// Implement toString to make it easier to see information about // Implement toString to make it easier to see information about
@override @override
String toString() { String toString() {
return 'ManagerAppContext{email: $email, host: $host, token: $token, currentRoute: $currentRoute}, selectedConfiguration: $selectedConfiguration, selectedSection: $selectedSection}'; return 'ManagerAppContext{email: $email, host: $host, token: $accessToken, instanceId: $instanceId, currentRoute: $currentRoute}, selectedConfiguration: $selectedConfiguration, selectedSection: $selectedSection}';
} }
} }

View File

@ -1,4 +1,4 @@
import 'package:managerapi/api.dart'; import 'package:manager_api_new/api.dart';
class ResourceTypeModel { class ResourceTypeModel {
String label; String label;

View File

@ -6,7 +6,7 @@ import 'package:manager_app/Screens/Configurations/Section/SubSection/Slider/lis
import 'package:manager_app/Screens/Configurations/Section/SubSection/Slider/new_update_image_slider.dart'; import 'package:manager_app/Screens/Configurations/Section/SubSection/Slider/new_update_image_slider.dart';
import 'package:manager_app/app_context.dart'; import 'package:manager_app/app_context.dart';
import 'package:manager_app/constants.dart'; import 'package:manager_app/constants.dart';
import 'package:managerapi/api.dart'; import 'package:manager_api_new/api.dart';
import 'dart:convert'; import 'dart:convert';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';

View File

@ -1,7 +1,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:manager_app/Helpers/PDFHelper.dart'; import 'package:manager_app/Helpers/PDFHelper.dart';
import 'package:manager_app/constants.dart'; import 'package:manager_app/constants.dart';
import 'package:managerapi/api.dart'; import 'package:manager_api_new/api.dart';
class DownloadPDF extends StatefulWidget { class DownloadPDF extends StatefulWidget {
final List<SectionDTO> sections; final List<SectionDTO> sections;

View File

@ -3,7 +3,7 @@ import 'package:manager_app/Screens/Configurations/Section/SubSection/Map/listVi
import 'package:manager_app/Screens/Resources/select_resource_modal.dart'; import 'package:manager_app/Screens/Resources/select_resource_modal.dart';
import 'package:manager_app/app_context.dart'; import 'package:manager_app/app_context.dart';
import 'package:manager_app/constants.dart'; import 'package:manager_app/constants.dart';
import 'package:managerapi/api.dart'; import 'package:manager_api_new/api.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class GeoPointImageList extends StatefulWidget { class GeoPointImageList extends StatefulWidget {
@ -91,12 +91,12 @@ class _GeoPointImageListState extends State<GeoPointImageList> {
var result = await showSelectResourceModal( var result = await showSelectResourceModal(
"Sélectionner une ressource", "Sélectionner une ressource",
1, 1,
[ResourceType.image, ResourceType.imageUrl], [ResourceType.Image, ResourceType.ImageUrl],
context context
); );
if (result != null) { if (result != null) {
setState(() { setState(() {
ImageGeoPoint newImage = new ImageGeoPoint(imageResourceId: result.id, imageSource: result.type == ResourceType.imageUrl ? result.data : appContext.getContext().clientAPI.resourceApi.apiClient.basePath+"/api/Resource/"+ result.id); ImageGeoPoint newImage = new ImageGeoPoint(imageResourceId: result.id, imageSource: result.type == ResourceType.ImageUrl ? result.data : appContext.getContext().clientAPI.resourceApi.apiClient.basePath+"/api/Resource/"+ result.id);
//print("REULT IMAGES = "); //print("REULT IMAGES = ");
//print(newImage); //print(newImage);
imagesGeo.add(newImage); imagesGeo.add(newImage);

View File

@ -1,7 +1,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:manager_app/app_context.dart'; import 'package:manager_app/app_context.dart';
import 'package:manager_app/constants.dart'; import 'package:manager_app/constants.dart';
import 'package:managerapi/api.dart'; import 'package:manager_api_new/api.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class ListViewCardGeoPointImages extends StatefulWidget { class ListViewCardGeoPointImages extends StatefulWidget {

View File

@ -7,7 +7,7 @@ import 'package:manager_app/Components/slider_input_container.dart';
import 'package:manager_app/Screens/Configurations/Section/SubSection/Map/showNewOrUpdateGeoPoint.dart'; import 'package:manager_app/Screens/Configurations/Section/SubSection/Map/showNewOrUpdateGeoPoint.dart';
import 'package:manager_app/app_context.dart'; import 'package:manager_app/app_context.dart';
import 'package:manager_app/constants.dart'; import 'package:manager_app/constants.dart';
import 'package:managerapi/api.dart'; import 'package:manager_api_new/api.dart';
import 'dart:convert'; import 'dart:convert';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -66,7 +66,7 @@ class _MapConfigState extends State<MapConfig> {
color: kPrimaryColor, color: kPrimaryColor,
imageFit: BoxFit.contain, imageFit: BoxFit.contain,
onChanged: (ResourceDTO resource) { onChanged: (ResourceDTO resource) {
mapDTO.iconSource = resource.type == ResourceType.imageUrl ? resource.data : appContext.getContext().clientAPI.resourceApi.apiClient.basePath+"/api/Resource/"+ resource.id; mapDTO.iconSource = resource.type == ResourceType.ImageUrl ? resource.data : appContext.getContext().clientAPI.resourceApi.apiClient.basePath+"/api/Resource/"+ resource.id;
mapDTO.iconResourceId = resource.id; mapDTO.iconResourceId = resource.id;
widget.onChanged(jsonEncode(mapDTO).toString()); widget.onChanged(jsonEncode(mapDTO).toString());
}, },
@ -202,7 +202,7 @@ class _MapConfigState extends State<MapConfig> {
top: 0, top: 0,
right: 0, right: 0,
child: Icon( child: Icon(
getSectionIcon(SectionType.map), getSectionIcon(SectionType.Map),
color: kSecond, color: kSecond,
size: 18.0, size: 18.0,
), ),

View File

@ -7,7 +7,7 @@ import 'package:manager_app/Models/managerContext.dart';
import 'package:manager_app/Screens/Configurations/Section/SubSection/Map/geopoint_image_list.dart'; import 'package:manager_app/Screens/Configurations/Section/SubSection/Map/geopoint_image_list.dart';
import 'package:manager_app/app_context.dart'; import 'package:manager_app/app_context.dart';
import 'package:manager_app/constants.dart'; import 'package:manager_app/constants.dart';
import 'package:managerapi/api.dart'; import 'package:manager_api_new/api.dart';
void showNewOrUpdateGeoPoint(GeoPointDTO inputGeoPointDTO, Function getResult, AppContext appContext, BuildContext context) { void showNewOrUpdateGeoPoint(GeoPointDTO inputGeoPointDTO, Function getResult, AppContext appContext, BuildContext context) {
GeoPointDTO geoPointDTO = new GeoPointDTO(); GeoPointDTO geoPointDTO = new GeoPointDTO();

View File

@ -4,7 +4,7 @@ import 'package:manager_app/Components/fetch_section_icon.dart';
import 'package:manager_app/Screens/Configurations/Section/SubSection/Menu/showEditSubSection.dart'; import 'package:manager_app/Screens/Configurations/Section/SubSection/Menu/showEditSubSection.dart';
import 'package:manager_app/app_context.dart'; import 'package:manager_app/app_context.dart';
import 'package:manager_app/constants.dart'; import 'package:manager_app/constants.dart';
import 'package:managerapi/api.dart'; import 'package:manager_api_new/api.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class ListViewCardSubSection extends StatefulWidget { class ListViewCardSubSection extends StatefulWidget {

View File

@ -5,7 +5,7 @@ import 'package:manager_app/Screens/Configurations/Section/SubSection/Menu/listV
import 'package:manager_app/Screens/Configurations/new_section_popup.dart'; import 'package:manager_app/Screens/Configurations/new_section_popup.dart';
import 'package:manager_app/app_context.dart'; import 'package:manager_app/app_context.dart';
import 'package:manager_app/constants.dart'; import 'package:manager_app/constants.dart';
import 'package:managerapi/api.dart'; import 'package:manager_api_new/api.dart';
import 'dart:convert'; import 'dart:convert';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';

View File

@ -9,7 +9,7 @@ import 'package:manager_app/Screens/Configurations/Section/SubSection/Slider/sli
import 'package:manager_app/Screens/Configurations/Section/SubSection/WebOrVideo/web_video_config.dart'; import 'package:manager_app/Screens/Configurations/Section/SubSection/WebOrVideo/web_video_config.dart';
import 'package:manager_app/app_context.dart'; import 'package:manager_app/app_context.dart';
import 'package:manager_app/constants.dart'; import 'package:manager_app/constants.dart';
import 'package:managerapi/api.dart'; import 'package:manager_api_new/api.dart';
import '../Map/map_config.dart'; import '../Map/map_config.dart';
import 'menu_config.dart'; import 'menu_config.dart';
@ -47,7 +47,7 @@ void showEditSubSection(SectionDTO subSectionDTO, Function getResult, AppContext
color: kPrimaryColor, color: kPrimaryColor,
onChanged: (ResourceDTO resource) { onChanged: (ResourceDTO resource) {
subSectionDTO.imageId = resource.id; subSectionDTO.imageId = resource.id;
subSectionDTO.imageSource = resource.type == ResourceType.imageUrl ? resource.data : appContext.getContext().clientAPI.resourceApi.apiClient.basePath+"/api/Resource/"+ resource.id; subSectionDTO.imageSource = resource.type == ResourceType.ImageUrl ? resource.data : appContext.getContext().clientAPI.resourceApi.apiClient.basePath+"/api/Resource/"+ resource.id;
}, },
isSmall: true, isSmall: true,
), ),
@ -125,7 +125,7 @@ void showEditSubSection(SectionDTO subSectionDTO, Function getResult, AppContext
getSpecificData(SectionDTO sectionDTO, BuildContext context, AppContext appContext) { getSpecificData(SectionDTO sectionDTO, BuildContext context, AppContext appContext) {
switch(sectionDTO.type) { switch(sectionDTO.type) {
case SectionType.map: case SectionType.Map:
return MapConfig( return MapConfig(
initialValue: sectionDTO.data, initialValue: sectionDTO.data,
onChanged: (String data) { onChanged: (String data) {
@ -134,7 +134,7 @@ getSpecificData(SectionDTO sectionDTO, BuildContext context, AppContext appConte
sectionDTO.data = data; sectionDTO.data = data;
}, },
); );
case SectionType.slider: case SectionType.Slider:
return Container( return Container(
width: MediaQuery.of(context).size.width * 0.5, width: MediaQuery.of(context).size.width * 0.5,
height: MediaQuery.of(context).size.height * 0.5, height: MediaQuery.of(context).size.height * 0.5,
@ -147,16 +147,16 @@ getSpecificData(SectionDTO sectionDTO, BuildContext context, AppContext appConte
}, },
), ),
); );
case SectionType.video: case SectionType.Video:
case SectionType.web: case SectionType.Web:
return WebOrVideoConfig( return WebOrVideoConfig(
label: sectionDTO.type == SectionType.video ? "Url de la vidéo:": "Url du site web:", label: sectionDTO.type == SectionType.Video ? "Url de la vidéo:": "Url du site web:",
initialValue: sectionDTO.data, initialValue: sectionDTO.data,
onChanged: (String data) { onChanged: (String data) {
sectionDTO.data = data; sectionDTO.data = data;
}, },
); );
case SectionType.menu: case SectionType.Menu:
return MenuConfig( return MenuConfig(
initialValue: sectionDTO.data, initialValue: sectionDTO.data,
onChanged: (String data) { onChanged: (String data) {

View File

@ -8,7 +8,7 @@ import 'package:manager_app/Models/managerContext.dart';
import 'package:manager_app/Screens/Configurations/Section/SubSection/Quizz/quizz_answer_list.dart'; import 'package:manager_app/Screens/Configurations/Section/SubSection/Quizz/quizz_answer_list.dart';
import 'package:manager_app/app_context.dart'; import 'package:manager_app/app_context.dart';
import 'package:manager_app/constants.dart'; import 'package:manager_app/constants.dart';
import 'package:managerapi/api.dart'; import 'package:manager_api_new/api.dart';
Future<QuestionDTO> showNewOrUpdateQuestionQuizz(QuestionDTO inputQuestionDTO, AppContext appContext, BuildContext context, String text) async { Future<QuestionDTO> showNewOrUpdateQuestionQuizz(QuestionDTO inputQuestionDTO, AppContext appContext, BuildContext context, String text) async {
QuestionDTO questionDTO = new QuestionDTO(); QuestionDTO questionDTO = new QuestionDTO();
@ -55,7 +55,7 @@ Future<QuestionDTO> showNewOrUpdateQuestionQuizz(QuestionDTO inputQuestionDTO, A
color: kPrimaryColor, color: kPrimaryColor,
onChanged: (ResourceDTO resource) { onChanged: (ResourceDTO resource) {
var result = resource; var result = resource;
questionDTO.source_ = result.type == ResourceType.imageUrl ? result.data : appContext.getContext().clientAPI.resourceApi.apiClient.basePath+"/api/Resource/"+ result.id; questionDTO.source_ = result.type == ResourceType.ImageUrl ? result.data : appContext.getContext().clientAPI.resourceApi.apiClient.basePath+"/api/Resource/"+ result.id;
questionDTO.resourceId = result.id; questionDTO.resourceId = result.id;
}, },
isSmall: true isSmall: true

View File

@ -6,7 +6,7 @@ import 'package:manager_app/Components/text_form_input_container.dart';
import 'package:manager_app/Models/managerContext.dart'; import 'package:manager_app/Models/managerContext.dart';
import 'package:manager_app/app_context.dart'; import 'package:manager_app/app_context.dart';
import 'package:manager_app/constants.dart'; import 'package:manager_app/constants.dart';
import 'package:managerapi/api.dart'; import 'package:manager_api_new/api.dart';
Future<ResponseDTO> showNewOrUpdateResponseQuizz(ResponseDTO inputResponseDTO, AppContext appContext, BuildContext context, String text) async { Future<ResponseDTO> showNewOrUpdateResponseQuizz(ResponseDTO inputResponseDTO, AppContext appContext, BuildContext context, String text) async {
ResponseDTO responseDTO = new ResponseDTO(); ResponseDTO responseDTO = new ResponseDTO();

View File

@ -6,7 +6,7 @@ import 'package:manager_app/Components/text_form_input_container.dart';
import 'package:manager_app/Models/managerContext.dart'; import 'package:manager_app/Models/managerContext.dart';
import 'package:manager_app/app_context.dart'; import 'package:manager_app/app_context.dart';
import 'package:manager_app/constants.dart'; import 'package:manager_app/constants.dart';
import 'package:managerapi/api.dart'; import 'package:manager_api_new/api.dart';
Future<LevelDTO> showNewOrUpdateScoreQuizz(LevelDTO inputLevelDTO, AppContext appContext, BuildContext context, String text) async { Future<LevelDTO> showNewOrUpdateScoreQuizz(LevelDTO inputLevelDTO, AppContext appContext, BuildContext context, String text) async {
LevelDTO levelDTO = new LevelDTO(); LevelDTO levelDTO = new LevelDTO();
@ -49,7 +49,7 @@ Future<LevelDTO> showNewOrUpdateScoreQuizz(LevelDTO inputLevelDTO, AppContext ap
color: kPrimaryColor, color: kPrimaryColor,
onChanged: (ResourceDTO resource) { onChanged: (ResourceDTO resource) {
var result = resource; var result = resource;
levelDTO.source_ = result.type == ResourceType.imageUrl ? result.data : appContext.getContext().clientAPI.resourceApi.apiClient.basePath+"/api/Resource/"+ result.id; levelDTO.source_ = result.type == ResourceType.ImageUrl ? result.data : appContext.getContext().clientAPI.resourceApi.apiClient.basePath+"/api/Resource/"+ result.id;
levelDTO.resourceId = result.id; levelDTO.resourceId = result.id;
}, },
isSmall: true isSmall: true

View File

@ -2,7 +2,7 @@ import 'package:auto_size_text/auto_size_text.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:manager_app/app_context.dart'; import 'package:manager_app/app_context.dart';
import 'package:manager_app/constants.dart'; import 'package:manager_app/constants.dart';
import 'package:managerapi/api.dart'; import 'package:manager_api_new/api.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'new_update_response_quizz.dart'; import 'new_update_response_quizz.dart';

View File

@ -3,7 +3,7 @@ import 'package:flutter/material.dart';
import 'package:manager_app/Components/rounded_button.dart'; import 'package:manager_app/Components/rounded_button.dart';
import 'package:manager_app/app_context.dart'; import 'package:manager_app/app_context.dart';
import 'package:manager_app/constants.dart'; import 'package:manager_app/constants.dart';
import 'package:managerapi/api.dart'; import 'package:manager_api_new/api.dart';
import 'dart:convert'; import 'dart:convert';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';

View File

@ -3,7 +3,7 @@ import 'package:flutter/material.dart';
import 'package:manager_app/Screens/Configurations/Section/SubSection/Slider/new_update_image_slider.dart'; import 'package:manager_app/Screens/Configurations/Section/SubSection/Slider/new_update_image_slider.dart';
import 'package:manager_app/app_context.dart'; import 'package:manager_app/app_context.dart';
import 'package:manager_app/constants.dart'; import 'package:manager_app/constants.dart';
import 'package:managerapi/api.dart'; import 'package:manager_api_new/api.dart';
class ListViewCardImage extends StatefulWidget { class ListViewCardImage extends StatefulWidget {
final int index; final int index;

View File

@ -6,7 +6,7 @@ import 'package:manager_app/Components/text_form_input_container.dart';
import 'package:manager_app/Models/managerContext.dart'; import 'package:manager_app/Models/managerContext.dart';
import 'package:manager_app/app_context.dart'; import 'package:manager_app/app_context.dart';
import 'package:manager_app/constants.dart'; import 'package:manager_app/constants.dart';
import 'package:managerapi/api.dart'; import 'package:manager_api_new/api.dart';
Future<ImageDTO> showNewOrUpdateImageSlider(ImageDTO inputImageDTO, AppContext appContext, BuildContext context, bool showTitle, bool showDescription) async { Future<ImageDTO> showNewOrUpdateImageSlider(ImageDTO inputImageDTO, AppContext appContext, BuildContext context, bool showTitle, bool showDescription) async {
ImageDTO imageDTO = new ImageDTO(); ImageDTO imageDTO = new ImageDTO();
@ -55,7 +55,7 @@ Future<ImageDTO> showNewOrUpdateImageSlider(ImageDTO inputImageDTO, AppContext a
color: kPrimaryColor, color: kPrimaryColor,
onChanged: (ResourceDTO resource) { onChanged: (ResourceDTO resource) {
var result = resource; var result = resource;
imageDTO.source_ = result.type == ResourceType.imageUrl ? result.data : appContext.getContext().clientAPI.resourceApi.apiClient.basePath+"/api/Resource/"+ result.id; imageDTO.source_ = result.type == ResourceType.ImageUrl ? result.data : appContext.getContext().clientAPI.resourceApi.apiClient.basePath+"/api/Resource/"+ result.id;
imageDTO.resourceId = result.id; imageDTO.resourceId = result.id;
}, },
isSmall: true isSmall: true

View File

@ -3,7 +3,7 @@ import 'package:manager_app/Screens/Configurations/Section/SubSection/Slider/lis
import 'package:manager_app/Screens/Configurations/Section/SubSection/Slider/new_update_image_slider.dart'; import 'package:manager_app/Screens/Configurations/Section/SubSection/Slider/new_update_image_slider.dart';
import 'package:manager_app/app_context.dart'; import 'package:manager_app/app_context.dart';
import 'package:manager_app/constants.dart'; import 'package:manager_app/constants.dart';
import 'package:managerapi/api.dart'; import 'package:manager_api_new/api.dart';
import 'dart:convert'; import 'dart:convert';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';

View File

@ -1,7 +1,7 @@
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:manager_app/Components/string_input_container.dart'; import 'package:manager_app/Components/string_input_container.dart';
import 'package:managerapi/api.dart'; import 'package:manager_api_new/api.dart';
import 'dart:convert'; import 'dart:convert';
class WebOrVideoConfig extends StatefulWidget { class WebOrVideoConfig extends StatefulWidget {

View File

@ -13,7 +13,7 @@ import 'package:manager_app/Screens/Configurations/Section/SubSection/WebOrVideo
import 'package:manager_app/app_context.dart'; import 'package:manager_app/app_context.dart';
import 'package:manager_app/client.dart'; import 'package:manager_app/client.dart';
import 'package:manager_app/constants.dart'; import 'package:manager_app/constants.dart';
import 'package:managerapi/api.dart'; import 'package:manager_api_new/api.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
@ -100,7 +100,7 @@ class _SectionDetailScreenState extends State<SectionDetailScreen> {
), ),
), ),
Text(sectionDTO != null ? sectionDTO.label : "", style: TextStyle(fontSize: 30, fontWeight: FontWeight.w400)), Text(sectionDTO != null ? sectionDTO.label : "", style: TextStyle(fontSize: 30, fontWeight: FontWeight.w400)),
if(sectionDTO.type == SectionType.article) if(sectionDTO.type == SectionType.Article)
DownloadPDF(sections: [sectionDTO]), DownloadPDF(sections: [sectionDTO]),
], ],
), ),
@ -148,7 +148,7 @@ class _SectionDetailScreenState extends State<SectionDetailScreen> {
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [ children: [
if(sectionDTO.type == SectionType.article) if(sectionDTO.type == SectionType.Article)
Container( Container(
width: size.width *0.1, width: size.width *0.1,
height: 125, height: 125,
@ -183,7 +183,7 @@ class _SectionDetailScreenState extends State<SectionDetailScreen> {
maxLines: 1, maxLines: 1,
isTitle: true, isTitle: true,
), ),
if(sectionDTO.type != SectionType.article) if(sectionDTO.type != SectionType.Article)
MultiStringContainer( MultiStringContainer(
label: "Description affichée:", label: "Description affichée:",
modalLabel: "Description", modalLabel: "Description",
@ -210,7 +210,7 @@ class _SectionDetailScreenState extends State<SectionDetailScreen> {
color: kPrimaryColor, color: kPrimaryColor,
onChanged: (ResourceDTO resource) { onChanged: (ResourceDTO resource) {
sectionDTO.imageId = resource.id; sectionDTO.imageId = resource.id;
sectionDTO.imageSource = resource.type == ResourceType.imageUrl ? resource.data : appContext.getContext().clientAPI.resourceApi.apiClient.basePath+"/api/Resource/"+ resource.id; sectionDTO.imageSource = resource.type == ResourceType.ImageUrl ? resource.data : appContext.getContext().clientAPI.resourceApi.apiClient.basePath+"/api/Resource/"+ resource.id;
}, },
), ),
], ],
@ -329,7 +329,7 @@ class _SectionDetailScreenState extends State<SectionDetailScreen> {
getSpecificData(SectionDTO sectionDTO, AppContext appContext) { getSpecificData(SectionDTO sectionDTO, AppContext appContext) {
switch(sectionDTO.type) { switch(sectionDTO.type) {
case SectionType.map: case SectionType.Map:
return MapConfig( return MapConfig(
initialValue: sectionDTO.data, initialValue: sectionDTO.data,
onChanged: (String data) { onChanged: (String data) {
@ -337,7 +337,7 @@ class _SectionDetailScreenState extends State<SectionDetailScreen> {
//save(false, sectionDTO, appContext); //save(false, sectionDTO, appContext);
}, },
); );
case SectionType.slider: case SectionType.Slider:
return SliderConfig( return SliderConfig(
initialValue: sectionDTO.data, initialValue: sectionDTO.data,
onChanged: (String data) { onChanged: (String data) {
@ -345,16 +345,16 @@ class _SectionDetailScreenState extends State<SectionDetailScreen> {
save(false, sectionDTO, appContext); save(false, sectionDTO, appContext);
}, },
); );
case SectionType.video: case SectionType.Video:
case SectionType.web: case SectionType.Web:
return WebOrVideoConfig( return WebOrVideoConfig(
label: sectionDTO.type == SectionType.video ? "Url de la vidéo:": "Url du site web:", label: sectionDTO.type == SectionType.Video ? "Url de la vidéo:": "Url du site web:",
initialValue: sectionDTO.data, initialValue: sectionDTO.data,
onChanged: (String data) { onChanged: (String data) {
sectionDTO.data = data; sectionDTO.data = data;
}, },
); );
case SectionType.menu: case SectionType.Menu:
return MenuConfig( return MenuConfig(
initialValue: sectionDTO.data, initialValue: sectionDTO.data,
onChanged: (String data) { onChanged: (String data) {
@ -363,7 +363,7 @@ class _SectionDetailScreenState extends State<SectionDetailScreen> {
sectionDTO.data = data; sectionDTO.data = data;
}, },
); );
case SectionType.quizz: case SectionType.Quizz:
return QuizzConfig( return QuizzConfig(
initialValue: sectionDTO.data, initialValue: sectionDTO.data,
onChanged: (String data) { onChanged: (String data) {
@ -372,7 +372,7 @@ class _SectionDetailScreenState extends State<SectionDetailScreen> {
sectionDTO.data = data; sectionDTO.data = data;
}, },
); );
case SectionType.article: case SectionType.Article:
return ArticleConfig( return ArticleConfig(
initialValue: sectionDTO.data, initialValue: sectionDTO.data,
onChanged: (String data) { onChanged: (String data) {

View File

@ -21,7 +21,7 @@ import 'package:manager_app/Screens/Configurations/section_reorderList.dart';
import 'package:manager_app/app_context.dart'; import 'package:manager_app/app_context.dart';
import 'package:manager_app/client.dart'; import 'package:manager_app/client.dart';
import 'package:manager_app/constants.dart'; import 'package:manager_app/constants.dart';
import 'package:managerapi/api.dart'; import 'package:manager_api_new/api.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
import 'dart:html' as html; import 'dart:html' as html;
@ -287,7 +287,7 @@ class _ConfigurationDetailScreenState extends State<ConfigurationDetailScreen> {
color: kPrimaryColor, color: kPrimaryColor,
onChanged: (ResourceDTO resource) { onChanged: (ResourceDTO resource) {
configurationDTO.imageId = resource.id; configurationDTO.imageId = resource.id;
configurationDTO.imageSource = resource.type == ResourceType.imageUrl ? resource.data : appContext.getContext().clientAPI.resourceApi.apiClient.basePath+"/api/Resource/"+ resource.id; configurationDTO.imageSource = resource.type == ResourceType.ImageUrl ? resource.data : appContext.getContext().clientAPI.resourceApi.apiClient.basePath+"/api/Resource/"+ resource.id;
}, },
), ),
]) ])

View File

@ -6,7 +6,7 @@ import 'package:manager_app/Screens/Configurations/configuration_detail_screen.d
import 'package:manager_app/Screens/Configurations/new_configuration_popup.dart'; import 'package:manager_app/Screens/Configurations/new_configuration_popup.dart';
import 'package:manager_app/app_context.dart'; import 'package:manager_app/app_context.dart';
import 'package:manager_app/constants.dart'; import 'package:manager_app/constants.dart';
import 'package:managerapi/api.dart'; import 'package:manager_api_new/api.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';

View File

@ -3,7 +3,7 @@ import 'package:flutter/material.dart';
import 'package:manager_app/Components/fetch_section_icon.dart'; import 'package:manager_app/Components/fetch_section_icon.dart';
import 'package:manager_app/app_context.dart'; import 'package:manager_app/app_context.dart';
import 'package:manager_app/constants.dart'; import 'package:manager_app/constants.dart';
import 'package:managerapi/api.dart'; import 'package:manager_api_new/api.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class ListViewCardSections extends StatefulWidget { class ListViewCardSections extends StatefulWidget {

View File

@ -8,7 +8,7 @@ import 'package:manager_app/Helpers/FileHelper.dart';
import 'package:manager_app/Models/managerContext.dart'; import 'package:manager_app/Models/managerContext.dart';
import 'package:manager_app/app_context.dart'; import 'package:manager_app/app_context.dart';
import 'package:manager_app/constants.dart'; import 'package:manager_app/constants.dart';
import 'package:managerapi/api.dart'; import 'package:manager_api_new/api.dart';
void showNewConfiguration(AppContext appContext, ValueChanged<bool> isImport, BuildContext context, BuildContext mainContext) { void showNewConfiguration(AppContext appContext, ValueChanged<bool> isImport, BuildContext context, BuildContext mainContext) {
ConfigurationDTO configurationDTO = new ConfigurationDTO(); ConfigurationDTO configurationDTO = new ConfigurationDTO();

View File

@ -6,7 +6,7 @@ import 'package:manager_app/Components/string_input_container.dart';
import 'package:manager_app/Models/managerContext.dart'; import 'package:manager_app/Models/managerContext.dart';
import 'package:manager_app/app_context.dart'; import 'package:manager_app/app_context.dart';
import 'package:manager_app/constants.dart'; import 'package:manager_app/constants.dart';
import 'package:managerapi/api.dart'; import 'package:manager_api_new/api.dart';
void showNewSection(String configurationId, AppContext appContext, BuildContext contextBuild, bool isSubSection, Function sendSubSection, bool isMobile) { void showNewSection(String configurationId, AppContext appContext, BuildContext contextBuild, bool isSubSection, Function sendSubSection, bool isMobile) {
SectionDTO sectionDTO = new SectionDTO(); SectionDTO sectionDTO = new SectionDTO();
@ -14,7 +14,7 @@ void showNewSection(String configurationId, AppContext appContext, BuildContext
sectionDTO.isSubSection = isSubSection; sectionDTO.isSubSection = isSubSection;
sectionDTO.parentId = isSubSection ? appContext.getContext().selectedSection.id : null; sectionDTO.parentId = isSubSection ? appContext.getContext().selectedSection.id : null;
Size size = MediaQuery.of(contextBuild).size; Size size = MediaQuery.of(contextBuild).size;
sectionDTO.type = isMobile ? SectionType.article : SectionType.map; sectionDTO.type = isMobile ? SectionType.Article : SectionType.Map;
showDialog( showDialog(
builder: (BuildContext context) => AlertDialog( builder: (BuildContext context) => AlertDialog(

View File

@ -5,7 +5,7 @@ import 'package:manager_app/Screens/Configurations/listView_card_section.dart';
import 'package:manager_app/Screens/Configurations/new_section_popup.dart'; import 'package:manager_app/Screens/Configurations/new_section_popup.dart';
import 'package:manager_app/app_context.dart'; import 'package:manager_app/app_context.dart';
import 'package:manager_app/constants.dart'; import 'package:manager_app/constants.dart';
import 'package:managerapi/api.dart'; import 'package:manager_api_new/api.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class SectionReorderList extends StatefulWidget { class SectionReorderList extends StatefulWidget {

View File

@ -4,7 +4,7 @@ import 'package:manager_app/Components/string_input_container.dart';
import 'package:manager_app/Models/managerContext.dart'; import 'package:manager_app/Models/managerContext.dart';
import 'package:manager_app/app_context.dart'; import 'package:manager_app/app_context.dart';
import 'package:manager_app/constants.dart'; import 'package:manager_app/constants.dart';
import 'package:managerapi/api.dart'; import 'package:manager_api_new/api.dart';
import 'dropDown_configuration.dart'; import 'dropDown_configuration.dart';

View File

@ -4,7 +4,7 @@ import 'package:manager_app/Models/managerContext.dart';
import 'package:manager_app/Screens/Devices/change_device_info_modal.dart'; import 'package:manager_app/Screens/Devices/change_device_info_modal.dart';
import 'package:manager_app/app_context.dart'; import 'package:manager_app/app_context.dart';
import 'package:manager_app/constants.dart'; import 'package:manager_app/constants.dart';
import 'package:managerapi/api.dart'; import 'package:manager_api_new/api.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class DeviceElement extends StatefulWidget { class DeviceElement extends StatefulWidget {

View File

@ -4,7 +4,7 @@ import 'package:manager_app/Models/managerContext.dart';
import 'package:manager_app/Screens/Devices/device_element.dart'; import 'package:manager_app/Screens/Devices/device_element.dart';
import 'package:manager_app/app_context.dart'; import 'package:manager_app/app_context.dart';
import 'package:manager_app/constants.dart'; import 'package:manager_app/constants.dart';
import 'package:managerapi/api.dart'; import 'package:manager_api_new/api.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class DevicesScreen extends StatefulWidget { class DevicesScreen extends StatefulWidget {

View File

@ -1,6 +1,6 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:manager_app/constants.dart'; import 'package:manager_app/constants.dart';
import 'package:managerapi/api.dart'; import 'package:manager_api_new/api.dart';
class DropDownConfig extends StatefulWidget { class DropDownConfig extends StatefulWidget {
final List<ConfigurationDTO> configurations; final List<ConfigurationDTO> configurations;

View File

@ -13,7 +13,7 @@ import 'package:manager_app/Screens/login_screen.dart';
import 'package:manager_app/app_context.dart'; import 'package:manager_app/app_context.dart';
import 'package:manager_app/constants.dart'; import 'package:manager_app/constants.dart';
import 'package:manager_app/main.dart'; import 'package:manager_app/main.dart';
import 'package:managerapi/api.dart'; import 'package:manager_api_new/api.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -139,7 +139,7 @@ class _BodyState extends State<Body> {
Storage localStorage = window.localStorage; Storage localStorage = window.localStorage;
localStorage.clear(); localStorage.clear();
ManagerAppContext managerAppContext = appContext.getContext(); ManagerAppContext managerAppContext = appContext.getContext();
managerAppContext.token = null; managerAppContext.accessToken = null;
appContext.setContext(managerAppContext); appContext.setContext(managerAppContext);
Navigator.pushAndRemoveUntil( Navigator.pushAndRemoveUntil(
@ -197,9 +197,9 @@ class _BodyState extends State<Body> {
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: ResourcesScreen( child: ResourcesScreen(
resourceTypes: [ resourceTypes: [
ResourceType.audio, ResourceType.Audio,
ResourceType.image, ResourceType.Image,
ResourceType.imageUrl ResourceType.ImageUrl
] ]
) )
); );

View File

@ -1,12 +1,12 @@
import 'package:manager_app/Components/audio_player.dart'; import 'package:manager_app/Components/audio_player.dart';
import 'package:manager_app/app_context.dart'; import 'package:manager_app/app_context.dart';
import 'package:manager_app/constants.dart'; import 'package:manager_app/constants.dart';
import 'package:managerapi/api.dart'; import 'package:manager_api_new/api.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
getElementForResource(dynamic resourceDTO, AppContext appContext) { getElementForResource(dynamic resourceDTO, AppContext appContext) {
switch(resourceDTO.type) { switch(resourceDTO.type) {
case ResourceType.image: case ResourceType.Image:
return Image.network( return Image.network(
appContext.getContext().clientAPI.resourceApi.apiClient.basePath+"/api/Resource/"+ resourceDTO.id, appContext.getContext().clientAPI.resourceApi.apiClient.basePath+"/api/Resource/"+ resourceDTO.id,
fit:BoxFit.fill, fit:BoxFit.fill,
@ -27,7 +27,7 @@ getElementForResource(dynamic resourceDTO, AppContext appContext) {
}, },
); );
break; break;
case ResourceType.imageUrl: case ResourceType.ImageUrl:
return Image.network( return Image.network(
resourceDTO.data, resourceDTO.data,
fit:BoxFit.fill, fit:BoxFit.fill,
@ -48,14 +48,14 @@ getElementForResource(dynamic resourceDTO, AppContext appContext) {
}, },
); );
break; break;
case ResourceType.audio: case ResourceType.Audio:
//return AudioPlayerContainer(resourceDTO: resourceDTO, isAuto: true); //return AudioPlayerContainer(resourceDTO: resourceDTO, isAuto: true);
return Text("Fichier audio - aucune visualisation possible"); return Text("Fichier audio - aucune visualisation possible");
break; break;
case ResourceType.video: case ResourceType.Video:
return Text("Vidéo locale - aucune visualisation possible"); return Text("Vidéo locale - aucune visualisation possible");
break; break;
case ResourceType.videoUrl: case ResourceType.VideoUrl:
return Text(resourceDTO.data); return Text(resourceDTO.data);
break; break;
} }

View File

@ -9,7 +9,7 @@ import 'package:manager_app/Components/rounded_button.dart';
import 'package:manager_app/Components/string_input_container.dart'; import 'package:manager_app/Components/string_input_container.dart';
import 'package:manager_app/app_context.dart'; import 'package:manager_app/app_context.dart';
import 'package:manager_app/constants.dart'; import 'package:manager_app/constants.dart';
import 'package:managerapi/api.dart'; import 'package:manager_api_new/api.dart';
dynamic showNewResource(AppContext appContext, BuildContext context) async { dynamic showNewResource(AppContext appContext, BuildContext context) async {
ResourceDTO resourceDetailDTO = new ResourceDTO(); ResourceDTO resourceDetailDTO = new ResourceDTO();

View File

@ -5,7 +5,7 @@ import 'package:manager_app/Components/multi_select_container.dart';
import 'package:manager_app/Components/string_input_container.dart'; import 'package:manager_app/Components/string_input_container.dart';
import 'package:manager_app/app_context.dart'; import 'package:manager_app/app_context.dart';
import 'package:manager_app/constants.dart'; import 'package:manager_app/constants.dart';
import 'package:managerapi/api.dart'; import 'package:manager_api_new/api.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class ResourceBodyGrid extends StatefulWidget { class ResourceBodyGrid extends StatefulWidget {
@ -193,11 +193,11 @@ boxDecoration(dynamic resourceDetailDTO, appContext) {
color: resourceDetailDTO.id == null ? kSuccess : kBackgroundColor, color: resourceDetailDTO.id == null ? kSuccess : kBackgroundColor,
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(30.0), borderRadius: BorderRadius.circular(30.0),
image: resourceDetailDTO.id != null && (resourceDetailDTO.type == ResourceType.image || resourceDetailDTO.type == ResourceType.imageUrl) ? new DecorationImage( image: resourceDetailDTO.id != null && (resourceDetailDTO.type == ResourceType.Image || resourceDetailDTO.type == ResourceType.ImageUrl) ? new DecorationImage(
fit: BoxFit.cover, fit: BoxFit.cover,
colorFilter: new ColorFilter.mode(Colors.black.withOpacity(0.3), BlendMode.dstATop), colorFilter: new ColorFilter.mode(Colors.black.withOpacity(0.3), BlendMode.dstATop),
image: new NetworkImage( image: new NetworkImage(
resourceDetailDTO.type == ResourceType.image ? appContext.getContext().clientAPI.resourceApi.apiClient.basePath+"/api/Resource/"+ resourceDetailDTO.id : resourceDetailDTO.data, resourceDetailDTO.type == ResourceType.Image ? appContext.getContext().clientAPI.resourceApi.apiClient.basePath+"/api/Resource/"+ resourceDetailDTO.id : resourceDetailDTO.data,
), ),
) : null, ) : null,
boxShadow: [ boxShadow: [

View File

@ -9,7 +9,7 @@ import 'package:manager_app/Screens/Resources/resource_body_grid.dart';
import 'package:manager_app/Screens/Resources/show_resource_popup.dart'; import 'package:manager_app/Screens/Resources/show_resource_popup.dart';
import 'package:manager_app/app_context.dart'; import 'package:manager_app/app_context.dart';
import 'package:manager_app/constants.dart'; import 'package:manager_app/constants.dart';
import 'package:managerapi/api.dart'; import 'package:manager_api_new/api.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:http/http.dart' as http; import 'package:http/http.dart' as http;
import 'package:flutter/foundation.dart' show kIsWeb; import 'package:flutter/foundation.dart' show kIsWeb;
@ -51,7 +51,7 @@ class _ResourcesScreenState extends State<ResourcesScreen> {
// tempOutput.add(ResourceDTO(id: null)); // tempOutput.add(ResourceDTO(id: null));
return ResourceBodyGrid( return ResourceBodyGrid(
resources: tempOutput, resources: tempOutput,
resourceTypesIn: widget.isImage ? resource_types.where((rt) => rt.type == ResourceType.image || rt.type == ResourceType.imageUrl).map((rt) => rt.type).toList() : widget.resourceTypes, resourceTypesIn: widget.isImage ? resource_types.where((rt) => rt.type == ResourceType.Image || rt.type == ResourceType.ImageUrl).map((rt) => rt.type).toList() : widget.resourceTypes,
isAddButton: widget.isAddButton, isAddButton: widget.isAddButton,
onSelect: (value) async { onSelect: (value) async {
if (widget.onGetResult == null) { if (widget.onGetResult == null) {
@ -93,16 +93,16 @@ Future<void> getResources(Function onGetResult, bool isImage, AppContext appCont
types = types != null ? types : []; types = types != null ? types : [];
List<ResourceDTO> resources = await (appContext.getContext() as ManagerAppContext).clientAPI.resourceApi.resourceGet(instanceId: (appContext.getContext() as ManagerAppContext).instanceId, types: types); List<ResourceDTO> resources = await (appContext.getContext() as ManagerAppContext).clientAPI.resourceApi.resourceGet(instanceId: (appContext.getContext() as ManagerAppContext).instanceId, types: types);
if (onGetResult != null && isImage) { if (onGetResult != null && isImage) {
resources = resources.where((element) => element.type == ResourceType.image || element.type == ResourceType.imageUrl || element.type == ResourceType.audio).toList(); resources = resources.where((element) => element.type == ResourceType.Image || element.type == ResourceType.ImageUrl || element.type == ResourceType.Audio).toList();
} }
return resources; return resources;
} }
Future<ResourceDTO> create(ResourceDTO resourceDTO, List<File> files, List<PlatformFile> filesWeb, AppContext appContext, context) async { Future<ResourceDTO> create(ResourceDTO resourceDTO, List<File> files, List<PlatformFile> filesWeb, AppContext appContext, context) async {
switch(resourceDTO.type) { switch(resourceDTO.type) {
case ResourceType.audio: case ResourceType.Audio:
case ResourceType.image: case ResourceType.Image:
case ResourceType.video: case ResourceType.Video:
var request = http.MultipartRequest('POST', Uri.parse(appContext.getContext().clientAPI.resourceApi.apiClient.basePath+"/api/Resource/upload")); var request = http.MultipartRequest('POST', Uri.parse(appContext.getContext().clientAPI.resourceApi.apiClient.basePath+"/api/Resource/upload"));
@ -130,7 +130,7 @@ Future<ResourceDTO> create(ResourceDTO resourceDTO, List<File> files, List<Platf
} }
ManagerAppContext managerAppContext = appContext.getContext(); ManagerAppContext managerAppContext = appContext.getContext();
request.headers["authorization"]="Bearer ${managerAppContext.token.accessToken}"; request.headers["authorization"]="Bearer ${managerAppContext.accessToken}";
request.fields['label'] = resourceDTO.label; request.fields['label'] = resourceDTO.label;
request.fields['type'] = resourceDTO.type.toString(); request.fields['type'] = resourceDTO.type.toString();
request.fields['instanceId'] = managerAppContext.instanceId; request.fields['instanceId'] = managerAppContext.instanceId;
@ -145,8 +145,8 @@ Future<ResourceDTO> create(ResourceDTO resourceDTO, List<File> files, List<Platf
showNotification(kPrimaryColor, kWhite, 'Erreur, attention, la taille de la ressource doit être inférieure à 2Mb', context, null); showNotification(kPrimaryColor, kWhite, 'Erreur, attention, la taille de la ressource doit être inférieure à 2Mb', context, null);
} }
break; break;
case ResourceType.imageUrl: case ResourceType.ImageUrl:
case ResourceType.videoUrl: case ResourceType.VideoUrl:
if (resourceDTO.data != null) { if (resourceDTO.data != null) {
// test if Correct url // test if Correct url
bool _validURL = Uri.parse(resourceDTO.data).isAbsolute; bool _validURL = Uri.parse(resourceDTO.data).isAbsolute;

View File

@ -3,7 +3,7 @@ import 'package:manager_app/Components/rounded_button.dart';
import 'package:manager_app/Components/string_input_container.dart'; import 'package:manager_app/Components/string_input_container.dart';
import 'package:manager_app/Screens/Resources/resources_screen.dart'; import 'package:manager_app/Screens/Resources/resources_screen.dart';
import 'package:manager_app/constants.dart'; import 'package:manager_app/constants.dart';
import 'package:managerapi/api.dart'; import 'package:manager_api_new/api.dart';
dynamic showSelectResourceModal (String text, int maxLines, List<ResourceType> resourceTypes, BuildContext mainContext) async { /*Function onSelect,*/ dynamic showSelectResourceModal (String text, int maxLines, List<ResourceType> resourceTypes, BuildContext mainContext) async { /*Function onSelect,*/
Size size = MediaQuery.of(mainContext).size; Size size = MediaQuery.of(mainContext).size;

View File

@ -5,7 +5,7 @@ import 'package:manager_app/Components/rounded_button.dart';
import 'package:manager_app/Models/managerContext.dart'; import 'package:manager_app/Models/managerContext.dart';
import 'package:manager_app/app_context.dart'; import 'package:manager_app/app_context.dart';
import 'package:manager_app/constants.dart'; import 'package:manager_app/constants.dart';
import 'package:managerapi/api.dart'; import 'package:manager_api_new/api.dart';
import 'get_element_for_resource.dart'; import 'get_element_for_resource.dart';

View File

@ -15,7 +15,7 @@ import 'package:manager_app/Screens/Main/main_screen.dart';
import 'package:manager_app/app_context.dart'; import 'package:manager_app/app_context.dart';
import 'package:manager_app/client.dart'; import 'package:manager_app/client.dart';
import 'package:manager_app/constants.dart'; import 'package:manager_app/constants.dart';
import 'package:managerapi/api.dart'; import 'package:manager_api_new/api.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:flutter/foundation.dart' show kIsWeb; import 'package:flutter/foundation.dart' show kIsWeb;
@ -36,9 +36,10 @@ class _LoginScreenState extends State<LoginScreen> {
bool isRememberMe = false; bool isRememberMe = false;
String pageTitle = "MyMuseum"; String pageTitle = "MyMuseum";
String token; String token;
String instanceId;
Storage localStorage = window.localStorage; Storage localStorage = window.localStorage;
void authenticateTRY(dynamic appContext) async { void authenticateTRY(dynamic appContext, bool fromClick) async {
//print("try auth.. "); //print("try auth.. ");
/*this.host = "http://localhost:5000"; /*this.host = "http://localhost:5000";
@ -51,27 +52,36 @@ class _LoginScreenState extends State<LoginScreen> {
// if () {} // Add if token exist and not null + not expired // if () {} // Add if token exist and not null + not expired
try { try {
setState(() { if(fromClick) {
isLoading = true; setState(() {
}); isLoading = true;
});
}
/*print(email); /*print(email);
print(password);*/ print(password);*/
LoginDTO loginDTO = new LoginDTO(email: email, password: password); var accessToken = this.token;
TokenDTO token = await clientAPI.authenticationApi.authenticationAuthenticateWithJson(loginDTO); var instanceId = this.instanceId;
setAccessToken(token.accessToken); if(accessToken == null) {
LoginDTO loginDTO = new LoginDTO(email: email, password: password);
TokenDTO token = await clientAPI.authenticationApi.authenticationAuthenticateWithJson(loginDTO);
accessToken = token.accessToken;
instanceId = token.instanceId;
if(!isRememberMe) { showNotification(kSuccess, kWhite, 'Connexion réussie', context, null);
localStorage.clear();
} else {
if(!localStorage.containsKey("remember")) { if(isRememberMe) {
localStorage.addEntries({"remember": "true"}.entries); if(!localStorage.containsKey("remember")) {
} localStorage.addEntries({"remember": "true"}.entries);
}
if(!localStorage.containsKey("email") && !localStorage.containsKey("token")) { if(!localStorage.containsKey("email") && !localStorage.containsKey("token")) {
localStorage.addEntries({"email": email}.entries); localStorage.addEntries({"email": email}.entries);
localStorage.addEntries({"token": token.accessToken}.entries); localStorage.addEntries({"token": token.accessToken}.entries);
localStorage.addEntries({"instanceId": token.instanceId}.entries);
}
} else {
localStorage.clear();
} }
} }
// Desktop // Desktop
@ -81,8 +91,6 @@ class _LoginScreenState extends State<LoginScreen> {
FileHelper().writeSession(updatedSession); FileHelper().writeSession(updatedSession);
}*/ }*/
showNotification(kSuccess, kWhite, 'Connexion réussie', context, null);
ManagerAppContext managerAppContext = appContext.getContext(); ManagerAppContext managerAppContext = appContext.getContext();
// Set the appContext // Set the appContext
if (managerAppContext == null) { if (managerAppContext == null) {
@ -92,16 +100,19 @@ class _LoginScreenState extends State<LoginScreen> {
// store user info locally // store user info locally
managerAppContext.email = email; managerAppContext.email = email;
managerAppContext.host = host; managerAppContext.host = host;
managerAppContext.instanceId = token.instanceId; managerAppContext.instanceId = instanceId;
managerAppContext.token = token; managerAppContext.accessToken = accessToken;
managerAppContext.clientAPI = clientAPI; managerAppContext.clientAPI = clientAPI;
setAccessToken(accessToken);
//print(managerAppContext); //print(managerAppContext);
appContext.setContext(managerAppContext); appContext.setContext(managerAppContext);
setState(() { if(fromClick) {
isLoading = false; setState(() {
}); isLoading = false;
});
}
//Navigator.pushNamed(context, '/main'); //Navigator.pushNamed(context, '/main');
@ -118,27 +129,33 @@ class _LoginScreenState extends State<LoginScreen> {
return MainScreen(); return MainScreen();
}, },
), ),
(Route<dynamic> route) => false // For pushAndRemoveUntil (Route<dynamic> route) => false // For pushAndRemoveUntil
); );
} }
catch (e) { catch (e) {
//print("error auth"); print("error auth");
//print(e); print(e);
showNotification(Colors.orange, kWhite, 'Un problème est survenu lors de la connexion', context, null); if(fromClick) {
showNotification(Colors.orange, kWhite, 'Un problème est survenu lors de la connexion', context, null);
setState(() { setState(() {
isLoading = false; isLoading = false;
}); });
}
} }
} }
} }
void setAccessToken(String accessToken) { void setAccessToken(String accessToken) {
clientAPI.apiApi.authentications.forEach((key, auth) { //clientAPI.resourceApi.apiClient.addDefaultHeader('authorization', 'Bearer '+accessToken);
clientAPI.apiApi.addDefaultHeader('authorization', 'Bearer '+accessToken);
//clientAPI.resourceApi.addDefaultHeader('Bearer', accessToken);
//clientAPI.apiApi.authentication.applyToParams([], Map.from({'Bearer': accessToken}));
/*clientAPI.apiApi.authentications.forEach((key, auth) {
if (auth is OAuth) { if (auth is OAuth) {
auth.accessToken = accessToken; auth.accessToken = accessToken;
} }
}); });*/
} }
@override @override
@ -155,6 +172,10 @@ class _LoginScreenState extends State<LoginScreen> {
} }
if(localStorage.containsKey("token")) { if(localStorage.containsKey("token")) {
this.token = localStorage.entries.where((element) => element.key == "token").first.value; this.token = localStorage.entries.where((element) => element.key == "token").first.value;
this.password = "AnythingAsWeAlreadyHaveAccessToken";
}
if(localStorage.containsKey("instanceId")) {
this.instanceId = localStorage.entries.where((element) => element.key == "instanceId").first.value;
} }
} }
super.initState(); super.initState();
@ -193,10 +214,11 @@ class _LoginScreenState extends State<LoginScreen> {
initInstance(appContext.getContext()); initInstance(appContext.getContext());
if(mounted && appContext != null && this.token != null) // ==> We need to work with route or something else like pop-up (pop up is nice) to make it works !
/*if(mounted && appContext != null && this.token != null)
{ {
this.authenticateTRY(appContext); this.authenticateTRY(appContext, false);
} }*/
return Scaffold( return Scaffold(
body: Center( body: Center(
@ -306,7 +328,7 @@ class _LoginScreenState extends State<LoginScreen> {
horizontal: 45, horizontal: 45,
press: () { press: () {
TextInput.finishAutofillContext(); TextInput.finishAutofillContext();
authenticateTRY(appContext); authenticateTRY(appContext, true);
}, },
): Container( ): Container(
height: size.height * 0.1, height: size.height * 0.1,

15
lib/api/openApiTest.dart Normal file
View File

@ -0,0 +1,15 @@
import 'package:openapi_generator_annotations/openapi_generator_annotations.dart';
@Openapi(
additionalProperties:
AdditionalProperties(pubName: 'manager_api_new', pubAuthor: 'Fransolet Thomas', useEnumExtension: true),
inputSpecFile: 'lib/api/swagger.yaml',
generatorName: Generator.dart,
alwaysRun: true,
outputDirectory: 'manager_api_new')
class Example extends OpenapiGeneratorConfig {}
/*
RUN
>flutter pub run build_runner build --delete-conflicting-outputs
*/

3540
lib/api/swagger.yaml Normal file

File diff suppressed because it is too large Load Diff

View File

@ -12,13 +12,6 @@ paths:
tags: tags:
- Configuration - Configuration
operationId: Configuration_Get operationId: Configuration_Get
parameters:
- name: instanceId
in: query
schema:
type: string
nullable: true
x-position: 1
responses: responses:
'200': '200':
description: '' description: ''
@ -273,13 +266,6 @@ paths:
tags: tags:
- Device - Device
operationId: Device_Get operationId: Device_Get
parameters:
- name: instanceId
in: query
schema:
type: string
nullable: true
x-position: 1
responses: responses:
'200': '200':
description: '' description: ''
@ -491,201 +477,11 @@ paths:
type: string type: string
security: security:
- bearer: [] - bearer: []
/api/Instance:
get:
tags:
- Instance
operationId: Instance_Get
responses:
'200':
description: ''
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Instance'
'500':
description: ''
content:
application/json:
schema:
type: string
security:
- bearer: []
post:
tags:
- Instance
operationId: Instance_CreateInstance
requestBody:
x-name: newInstance
content:
application/json:
schema:
$ref: '#/components/schemas/Instance'
required: true
x-position: 1
responses:
'200':
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/InstanceDTO'
'400':
description: ''
content:
application/json:
schema:
type: string
'409':
description: ''
content:
application/json:
schema:
type: string
'500':
description: ''
content:
application/json:
schema:
type: string
security:
- bearer: []
put:
tags:
- Instance
operationId: Instance_Updateinstance
requestBody:
x-name: updatedInstance
content:
application/json:
schema:
$ref: '#/components/schemas/Instance'
required: true
x-position: 1
responses:
'200':
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/InstanceDTO'
'400':
description: ''
content:
application/json:
schema:
type: string
'404':
description: ''
content:
application/json:
schema:
type: string
'500':
description: ''
content:
application/json:
schema:
type: string
security:
- bearer: []
/api/Instance/{id}:
get:
tags:
- Instance
operationId: Instance_GetDetail
parameters:
- name: id
in: path
required: true
schema:
type: string
nullable: true
x-position: 1
responses:
'200':
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/InstanceDTO'
'404':
description: ''
content:
application/json:
schema:
type: string
'500':
description: ''
content:
application/json:
schema:
type: string
security:
- bearer: []
delete:
tags:
- Instance
operationId: Instance_DeleteInstance
parameters:
- name: id
in: path
required: true
schema:
type: string
nullable: true
x-position: 1
responses:
'202':
description: ''
content:
application/json:
schema:
type: string
'400':
description: ''
content:
application/json:
schema:
type: string
'404':
description: ''
content:
application/json:
schema:
type: string
'500':
description: ''
content:
application/json:
schema:
type: string
security:
- bearer: []
/api/Resource: /api/Resource:
get: get:
tags: tags:
- Resource - Resource
operationId: Resource_Get operationId: Resource_Get
parameters:
- name: instanceId
in: query
schema:
type: string
nullable: true
x-position: 1
- name: types
in: query
style: form
explode: true
schema:
type: array
nullable: true
items:
$ref: '#/components/schemas/ResourceType'
x-position: 2
responses: responses:
'200': '200':
description: '' description: ''
@ -901,9 +697,6 @@ paths:
type: type:
type: string type: string
nullable: true nullable: true
instanceId:
type: string
nullable: true
responses: responses:
'200': '200':
description: '' description: ''
@ -930,13 +723,6 @@ paths:
tags: tags:
- Section - Section
operationId: Section_Get operationId: Section_Get
parameters:
- name: instanceId
in: query
schema:
type: string
nullable: true
x-position: 1
responses: responses:
'200': '200':
description: '' description: ''
@ -1418,8 +1204,6 @@ paths:
application/json: application/json:
schema: schema:
type: string type: string
security:
- bearer: []
put: put:
tags: tags:
- User - User
@ -1651,9 +1435,6 @@ components:
type: boolean type: boolean
isOffline: isOffline:
type: boolean type: boolean
instanceId:
type: string
nullable: true
TranslationDTO: TranslationDTO:
type: object type: object
additionalProperties: false additionalProperties: false
@ -1725,19 +1506,9 @@ components:
order: order:
type: integer type: integer
format: int32 format: int32
instanceId:
type: string
nullable: true
SectionType: SectionType:
type: integer type: string
description: |- description: ''
0 = Map
1 = Slider
2 = Video
3 = Web
4 = Menu
5 = Quizz
6 = Article
x-enumNames: x-enumNames:
- Map - Map
- Slider - Slider
@ -1747,13 +1518,13 @@ components:
- Quizz - Quizz
- Article - Article
enum: enum:
- 0 - Map
- 1 - Slider
- 2 - Video
- 3 - Web
- 4 - Menu
- 5 - Quizz
- 6 - Article
ResourceDTO: ResourceDTO:
type: object type: object
additionalProperties: false additionalProperties: false
@ -1766,35 +1537,25 @@ components:
label: label:
type: string type: string
nullable: true nullable: true
data:
type: string
nullable: true
dateCreation: dateCreation:
type: string type: string
format: date-time format: date-time
instanceId: data:
type: string type: string
nullable: true nullable: true
ResourceType: ResourceType:
type: integer type: string
description: |- description: ''
0 = Image
1 = Video
2 = ImageUrl
3 = VideoUrl
4 = Audio
x-enumNames: x-enumNames:
- Image - Image
- Video - Video
- ImageUrl - ImageUrl
- VideoUrl - VideoUrl
- Audio
enum: enum:
- 0 - Image
- 1 - Video
- 2 - ImageUrl
- 3 - VideoUrl
- 4
DeviceDTO: DeviceDTO:
type: object type: object
additionalProperties: false additionalProperties: false
@ -1828,9 +1589,6 @@ components:
dateUpdate: dateUpdate:
type: string type: string
format: date-time format: date-time
instanceId:
type: string
nullable: true
DeviceDetailDTO: DeviceDetailDTO:
allOf: allOf:
- $ref: '#/components/schemas/DeviceDTO' - $ref: '#/components/schemas/DeviceDTO'
@ -1849,32 +1607,6 @@ components:
lastBatteryLevel: lastBatteryLevel:
type: string type: string
format: date-time format: date-time
Instance:
type: object
additionalProperties: false
properties:
id:
type: string
nullable: true
name:
type: string
nullable: true
dateCreation:
type: string
format: date-time
InstanceDTO:
type: object
additionalProperties: false
properties:
id:
type: string
nullable: true
name:
type: string
nullable: true
dateCreation:
type: string
format: date-time
MapDTO: MapDTO:
type: object type: object
additionalProperties: false additionalProperties: false
@ -1896,13 +1628,8 @@ components:
type: string type: string
nullable: true nullable: true
MapTypeApp: MapTypeApp:
type: integer type: string
description: |- description: ''
0 = none
1 = normal
2 = satellite
3 = terrain
4 = hybrid
x-enumNames: x-enumNames:
- none - none
- normal - normal
@ -1910,11 +1637,11 @@ components:
- terrain - terrain
- hybrid - hybrid
enum: enum:
- 0 - none
- 1 - normal
- 2 - satellite
- 3 - terrain
- 4 - hybrid
GeoPointDTO: GeoPointDTO:
type: object type: object
additionalProperties: false additionalProperties: false
@ -2107,11 +1834,9 @@ components:
nullable: true nullable: true
isContentTop: isContentTop:
type: boolean type: boolean
audioIds: audioId:
type: array type: string
nullable: true nullable: true
items:
$ref: '#/components/schemas/TranslationDTO'
isReadAudioAuto: isReadAudioAuto:
type: boolean type: boolean
images: images:
@ -2144,9 +1869,6 @@ components:
dateCreation: dateCreation:
type: string type: string
format: date-time format: date-time
instanceId:
type: string
nullable: true
UserDetailDTO: UserDetailDTO:
type: object type: object
additionalProperties: false additionalProperties: false
@ -2185,9 +1907,6 @@ components:
expiration: expiration:
type: string type: string
format: date-time format: date-time
instanceId:
type: string
nullable: true
LoginDTO: LoginDTO:
type: object type: object
additionalProperties: false additionalProperties: false
@ -2215,8 +1934,6 @@ tags:
description: Configuration management description: Configuration management
- name: Device - name: Device
description: Device management description: Device management
- name: Instance
description: Instance management
- name: Resource - name: Resource
description: Resource management description: Resource management
- name: Section - name: Section

View File

@ -1,4 +1,4 @@
import 'package:managerapi/api.dart'; import 'package:manager_api_new/api.dart';
//import 'package:openapi_dart_common/openapi.dart'; //import 'package:openapi_dart_common/openapi.dart';
class Client { class Client {

View File

@ -1,6 +1,6 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:manager_app/Models/resourceTypeModel.dart'; import 'package:manager_app/Models/resourceTypeModel.dart';
import 'package:managerapi/api.dart'; import 'package:manager_api_new/api.dart';
// Colors - TO FILL WIT CORRECT COLOR // Colors - TO FILL WIT CORRECT COLOR
//const kBackgroundColor = Color(0xFFFFFFFF); //const kBackgroundColor = Color(0xFFFFFFFF);
@ -20,9 +20,9 @@ const List<String> section_types = ["Map", "Slider", "Video", "Web", "Menu", "Qu
const List<String> map_types = ["none", "normal", "satellite", "terrain", "hybrid"]; const List<String> map_types = ["none", "normal", "satellite", "terrain", "hybrid"];
const List<String> languages = ["FR", "NL", "EN", "DE", "IT", "ES", "CN", "PL"]; const List<String> languages = ["FR", "NL", "EN", "DE", "IT", "ES", "CN", "PL"];
List<ResourceTypeModel> resource_types = [ List<ResourceTypeModel> resource_types = [
ResourceTypeModel(label: "image", type: ResourceType.image), ResourceTypeModel(label: "image", type: ResourceType.Image),
ResourceTypeModel(label: "image url", type: ResourceType.imageUrl), ResourceTypeModel(label: "image url", type: ResourceType.ImageUrl),
ResourceTypeModel(label: "audio", type: ResourceType.audio) ResourceTypeModel(label: "audio", type: ResourceType.Audio)
]; // "video url" , "video", {"label": "image"}, "image url", "audio" ]; // "video url" , "video", {"label": "image"}, "image url", "audio"
/* /*

View File

@ -1,27 +0,0 @@
# 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

View File

@ -1 +0,0 @@
5.1.0

View File

@ -1,229 +0,0 @@
# managerapi.api.DisplayApi
## Load the API package
```dart
import 'package:managerapi/api.dart';
```
All URIs are relative to *https://localhost:44339*
Method | HTTP request | Description
------------- | ------------- | -------------
[**displayCreate**](DisplayApi.md#displaycreate) | **POST** /api/Display |
[**displayDelete**](DisplayApi.md#displaydelete) | **DELETE** /api/Display/{id} |
[**displayGet**](DisplayApi.md#displayget) | **GET** /api/Display |
[**displayGetDetail**](DisplayApi.md#displaygetdetail) | **GET** /api/Display/{id} |
[**displayUpdate**](DisplayApi.md#displayupdate) | **PUT** /api/Display |
# **displayCreate**
> RessourceDetailDTO displayCreate(displayDTO)
### Example
```dart
import 'package:managerapi/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = DisplayApi();
final displayDTO = DisplayDTO(); // DisplayDTO |
try {
final result = api_instance.displayCreate(displayDTO);
print(result);
} catch (e) {
print('Exception when calling DisplayApi->displayCreate: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**displayDTO** | [**DisplayDTO**](DisplayDTO.md)| |
### Return type
[**RessourceDetailDTO**](RessourceDetailDTO.md)
### Authorization
[bearer](../README.md#bearer)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[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)
# **displayDelete**
> String displayDelete(id)
### Example
```dart
import 'package:managerapi/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = DisplayApi();
final id = id_example; // String |
try {
final result = api_instance.displayDelete(id);
print(result);
} catch (e) {
print('Exception when calling DisplayApi->displayDelete: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **String**| |
### Return type
**String**
### Authorization
[bearer](../README.md#bearer)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[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)
# **displayGet**
> List<DisplayDTO> displayGet()
### Example
```dart
import 'package:managerapi/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = DisplayApi();
try {
final result = api_instance.displayGet();
print(result);
} catch (e) {
print('Exception when calling DisplayApi->displayGet: $e\n');
}
```
### Parameters
This endpoint does not need any parameter.
### Return type
[**List<DisplayDTO>**](DisplayDTO.md)
### Authorization
[bearer](../README.md#bearer)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[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)
# **displayGetDetail**
> DisplayDTO displayGetDetail(id)
### Example
```dart
import 'package:managerapi/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = DisplayApi();
final id = id_example; // String |
try {
final result = api_instance.displayGetDetail(id);
print(result);
} catch (e) {
print('Exception when calling DisplayApi->displayGetDetail: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **String**| |
### Return type
[**DisplayDTO**](DisplayDTO.md)
### Authorization
[bearer](../README.md#bearer)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[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)
# **displayUpdate**
> DisplayDTO displayUpdate(displayDTO)
### Example
```dart
import 'package:managerapi/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = DisplayApi();
final displayDTO = DisplayDTO(); // DisplayDTO |
try {
final result = api_instance.displayUpdate(displayDTO);
print(result);
} catch (e) {
print('Exception when calling DisplayApi->displayUpdate: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**displayDTO** | [**DisplayDTO**](DisplayDTO.md)| |
### Return type
[**DisplayDTO**](DisplayDTO.md)
### Authorization
[bearer](../README.md#bearer)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[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)

View File

@ -1,21 +0,0 @@
# managerapi.model.DisplayDTO
## Load the model package
```dart
import 'package:managerapi/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **String** | | [optional]
**label** | **String** | | [optional]
**sectionIds** | **List<String>** | | [optional] [default to const []]
**primaryColor** | **String** | | [optional]
**secondaryColor** | **String** | | [optional]
**languages** | **List<String>** | | [optional] [default to const []]
**dateCreation** | [**DateTime**](DateTime.md) | | [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)

View File

@ -1,19 +0,0 @@
# managerapi.model.ResourceDetailDTO
## Load the model package
```dart
import 'package:managerapi/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **String** | | [optional]
**type** | [**ResourceType**](ResourceType.md) | | [optional]
**label** | **String** | | [optional]
**dateCreation** | [**DateTime**](DateTime.md) | | [optional]
**data** | **String** | | [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)

View File

@ -1,273 +0,0 @@
# managerapi.api.RessourceApi
## Load the API package
```dart
import 'package:managerapi/api.dart';
```
All URIs are relative to *http://192.168.31.96*
Method | HTTP request | Description
------------- | ------------- | -------------
[**ressourceCreate**](RessourceApi.md#ressourcecreate) | **POST** /api/Ressource |
[**ressourceDelete**](RessourceApi.md#ressourcedelete) | **DELETE** /api/Ressource/{id} |
[**ressourceGet**](RessourceApi.md#ressourceget) | **GET** /api/Ressource |
[**ressourceGetDetail**](RessourceApi.md#ressourcegetdetail) | **GET** /api/Ressource/{id}/detail |
[**ressourceShow**](RessourceApi.md#ressourceshow) | **GET** /api/Ressource/{id} |
[**ressourceUpdate**](RessourceApi.md#ressourceupdate) | **PUT** /api/Ressource |
# **ressourceCreate**
> RessourceDetailDTO ressourceCreate(ressourceDetailDTO)
### Example
```dart
import 'package:managerapi/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = RessourceApi();
final ressourceDetailDTO = RessourceDetailDTO(); // RessourceDetailDTO |
try {
final result = api_instance.ressourceCreate(ressourceDetailDTO);
print(result);
} catch (e) {
print('Exception when calling RessourceApi->ressourceCreate: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ressourceDetailDTO** | [**RessourceDetailDTO**](RessourceDetailDTO.md)| |
### Return type
[**RessourceDetailDTO**](RessourceDetailDTO.md)
### Authorization
[bearer](../README.md#bearer)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[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)
# **ressourceDelete**
> String ressourceDelete(id)
### Example
```dart
import 'package:managerapi/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = RessourceApi();
final id = id_example; // String |
try {
final result = api_instance.ressourceDelete(id);
print(result);
} catch (e) {
print('Exception when calling RessourceApi->ressourceDelete: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **String**| |
### Return type
**String**
### Authorization
[bearer](../README.md#bearer)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[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)
# **ressourceGet**
> List<RessourceDTO> ressourceGet()
### Example
```dart
import 'package:managerapi/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = RessourceApi();
try {
final result = api_instance.ressourceGet();
print(result);
} catch (e) {
print('Exception when calling RessourceApi->ressourceGet: $e\n');
}
```
### Parameters
This endpoint does not need any parameter.
### Return type
[**List<RessourceDTO>**](RessourceDTO.md)
### Authorization
[bearer](../README.md#bearer)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[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)
# **ressourceGetDetail**
> RessourceDetailDTO ressourceGetDetail(id)
### Example
```dart
import 'package:managerapi/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = RessourceApi();
final id = id_example; // String |
try {
final result = api_instance.ressourceGetDetail(id);
print(result);
} catch (e) {
print('Exception when calling RessourceApi->ressourceGetDetail: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **String**| |
### Return type
[**RessourceDetailDTO**](RessourceDetailDTO.md)
### Authorization
[bearer](../README.md#bearer)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[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)
# **ressourceShow**
> MultipartFile ressourceShow(id)
### Example
```dart
import 'package:managerapi/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = RessourceApi();
final id = id_example; // String |
try {
final result = api_instance.ressourceShow(id);
print(result);
} catch (e) {
print('Exception when calling RessourceApi->ressourceShow: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **String**| |
### Return type
[**MultipartFile**](MultipartFile.md)
### Authorization
[bearer](../README.md#bearer)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/octet-stream, application/json
[[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)
# **ressourceUpdate**
> RessourceDetailDTO ressourceUpdate(ressourceDetailDTO)
### Example
```dart
import 'package:managerapi/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = RessourceApi();
final ressourceDetailDTO = RessourceDetailDTO(); // RessourceDetailDTO |
try {
final result = api_instance.ressourceUpdate(ressourceDetailDTO);
print(result);
} catch (e) {
print('Exception when calling RessourceApi->ressourceUpdate: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ressourceDetailDTO** | [**RessourceDetailDTO**](RessourceDetailDTO.md)| |
### Return type
[**RessourceDetailDTO**](RessourceDetailDTO.md)
### Authorization
[bearer](../README.md#bearer)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[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)

View File

@ -1,17 +0,0 @@
# managerapi.model.RessourceDTO
## Load the model package
```dart
import 'package:managerapi/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **String** | | [optional]
**type** | [**RessourceType**](RessourceType.md) | | [optional]
**label** | **String** | | [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)

View File

@ -1,19 +0,0 @@
# managerapi.model.RessourceDetailDTO
## Load the model package
```dart
import 'package:managerapi/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **String** | | [optional]
**type** | [**RessourceType**](RessourceType.md) | | [optional]
**label** | **String** | | [optional]
**dateCreation** | [**DateTime**](DateTime.md) | | [optional]
**data** | **String** | | [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)

View File

@ -1,14 +0,0 @@
# managerapi.model.RessourceType
## Load the model package
```dart
import 'package:managerapi/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -1,191 +0,0 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.0
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class AuthenticationApi {
AuthenticationApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient;
final ApiClient apiClient;
/// Performs an HTTP 'POST /api/Authentication/Token' operation and returns the [Response].
/// Parameters:
///
/// * [String] grantType:
///
/// * [String] username:
///
/// * [String] password:
///
/// * [String] clientId:
///
/// * [String] clientSecret:
Future<Response> authenticationAuthenticateWithFormWithHttpInfo({ String grantType, String username, String password, String clientId, String clientSecret }) async {
// Verify required params are set.
final path = r'/api/Authentication/Token';
Object postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
final contentTypes = <String>['multipart/form-data'];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (grantType != null) {
hasFields = true;
mp.fields[r'grant_type'] = parameterToString(grantType);
}
if (username != null) {
hasFields = true;
mp.fields[r'username'] = parameterToString(username);
}
if (password != null) {
hasFields = true;
mp.fields[r'password'] = parameterToString(password);
}
if (clientId != null) {
hasFields = true;
mp.fields[r'client_id'] = parameterToString(clientId);
}
if (clientSecret != null) {
hasFields = true;
mp.fields[r'client_secret'] = parameterToString(clientSecret);
}
if (hasFields) {
postBody = mp;
}
} else {
if (grantType != null) {
formParams[r'grant_type'] = parameterToString(grantType);
}
if (username != null) {
formParams[r'username'] = parameterToString(username);
}
if (password != null) {
formParams[r'password'] = parameterToString(password);
}
if (clientId != null) {
formParams[r'client_id'] = parameterToString(clientId);
}
if (clientSecret != null) {
formParams[r'client_secret'] = parameterToString(clientSecret);
}
}
return await apiClient.invokeAPI(
path,
'POST',
queryParams,
postBody,
headerParams,
formParams,
nullableContentType,
authNames,
);
}
/// Parameters:
///
/// * [String] grantType:
///
/// * [String] username:
///
/// * [String] password:
///
/// * [String] clientId:
///
/// * [String] clientSecret:
Future<TokenDTO> authenticationAuthenticateWithForm({ String grantType, String username, String password, String clientId, String clientSecret }) async {
final response = await authenticationAuthenticateWithFormWithHttpInfo( grantType: grantType, username: username, password: password, clientId: clientId, clientSecret: clientSecret );
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'TokenDTO') as TokenDTO;
}
return Future<TokenDTO>.value(null);
}
/// Performs an HTTP 'POST /api/Authentication/Authenticate' operation and returns the [Response].
/// Parameters:
///
/// * [LoginDTO] loginDTO (required):
Future<Response> authenticationAuthenticateWithJsonWithHttpInfo(LoginDTO loginDTO) async {
// Verify required params are set.
if (loginDTO == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: loginDTO');
}
final path = r'/api/Authentication/Authenticate';
Object postBody = loginDTO;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
final contentTypes = <String>['application/json'];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
'POST',
queryParams,
postBody,
headerParams,
formParams,
nullableContentType,
authNames,
);
}
/// Parameters:
///
/// * [LoginDTO] loginDTO (required):
Future<TokenDTO> authenticationAuthenticateWithJson(LoginDTO loginDTO) async {
final response = await authenticationAuthenticateWithJsonWithHttpInfo(loginDTO);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'TokenDTO') as TokenDTO;
}
return Future<TokenDTO>.value(null);
}
}

View File

@ -1,464 +0,0 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.0
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class ConfigurationApi {
ConfigurationApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient;
final ApiClient apiClient;
/// Performs an HTTP 'POST /api/Configuration' operation and returns the [Response].
/// Parameters:
///
/// * [ConfigurationDTO] configurationDTO (required):
Future<Response> configurationCreateWithHttpInfo(ConfigurationDTO configurationDTO) async {
// Verify required params are set.
if (configurationDTO == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: configurationDTO');
}
final path = r'/api/Configuration';
Object postBody = configurationDTO;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
final contentTypes = <String>['application/json'];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
'POST',
queryParams,
postBody,
headerParams,
formParams,
nullableContentType,
authNames,
);
}
/// Parameters:
///
/// * [ConfigurationDTO] configurationDTO (required):
Future<ConfigurationDTO> configurationCreate(ConfigurationDTO configurationDTO) async {
final response = await configurationCreateWithHttpInfo(configurationDTO);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'ConfigurationDTO') as ConfigurationDTO;
}
return Future<ConfigurationDTO>.value(null);
}
/// Performs an HTTP 'DELETE /api/Configuration/{id}' operation and returns the [Response].
/// Parameters:
///
/// * [String] id (required):
Future<Response> configurationDeleteWithHttpInfo(String id) async {
// Verify required params are set.
if (id == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: id');
}
final path = r'/api/Configuration/{id}'
.replaceAll('{' + 'id' + '}', id.toString());
Object postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
final contentTypes = <String>[];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
'DELETE',
queryParams,
postBody,
headerParams,
formParams,
nullableContentType,
authNames,
);
}
/// Parameters:
///
/// * [String] id (required):
Future<String> configurationDelete(String id) async {
final response = await configurationDeleteWithHttpInfo(id);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'String') as String;
}
return Future<String>.value(null);
}
/// Performs an HTTP 'GET /api/Configuration/{id}/export' operation and returns the [Response].
/// Parameters:
///
/// * [String] id (required):
Future<Response> configurationExportWithHttpInfo(String id) async {
// Verify required params are set.
if (id == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: id');
}
final path = r'/api/Configuration/{id}/export'
.replaceAll('{' + 'id' + '}', id.toString());
Object postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
final contentTypes = <String>[];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
'GET',
queryParams,
postBody,
headerParams,
formParams,
nullableContentType,
authNames,
);
}
/// Parameters:
///
/// * [String] id (required):
Future<ExportConfigurationDTO> configurationExport(String id) async {
final response = await configurationExportWithHttpInfo(id);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'ExportConfigurationDTO') as ExportConfigurationDTO;
}
return Future<ExportConfigurationDTO>.value(null);
}
/// Performs an HTTP 'GET /api/Configuration' operation and returns the [Response].
/// Parameters:
///
/// * [String] instanceId:
Future<Response> configurationGetWithHttpInfo({ String instanceId }) async {
// Verify required params are set.
final path = r'/api/Configuration';
Object postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
if (instanceId != null) {
queryParams.addAll(_convertParametersForCollectionFormat('', 'instanceId', instanceId));
}
final contentTypes = <String>[];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
'GET',
queryParams,
postBody,
headerParams,
formParams,
nullableContentType,
authNames,
);
}
/// Parameters:
///
/// * [String] instanceId:
Future<List<ConfigurationDTO>> configurationGet({ String instanceId }) async {
final response = await configurationGetWithHttpInfo( instanceId: instanceId );
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) {
return (apiClient.deserialize(_decodeBodyBytes(response), 'List<ConfigurationDTO>') as List)
.cast<ConfigurationDTO>()
.toList(growable: false);
}
return Future<List<ConfigurationDTO>>.value(null);
}
/// Performs an HTTP 'GET /api/Configuration/{id}' operation and returns the [Response].
/// Parameters:
///
/// * [String] id (required):
Future<Response> configurationGetDetailWithHttpInfo(String id) async {
// Verify required params are set.
if (id == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: id');
}
final path = r'/api/Configuration/{id}'
.replaceAll('{' + 'id' + '}', id.toString());
Object postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
final contentTypes = <String>[];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
'GET',
queryParams,
postBody,
headerParams,
formParams,
nullableContentType,
authNames,
);
}
/// Parameters:
///
/// * [String] id (required):
Future<ConfigurationDTO> configurationGetDetail(String id) async {
final response = await configurationGetDetailWithHttpInfo(id);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'ConfigurationDTO') as ConfigurationDTO;
}
return Future<ConfigurationDTO>.value(null);
}
/// Performs an HTTP 'POST /api/Configuration/import' operation and returns the [Response].
/// Parameters:
///
/// * [ExportConfigurationDTO] exportConfigurationDTO (required):
Future<Response> configurationImportWithHttpInfo(ExportConfigurationDTO exportConfigurationDTO) async {
// Verify required params are set.
if (exportConfigurationDTO == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: exportConfigurationDTO');
}
final path = r'/api/Configuration/import';
Object postBody = exportConfigurationDTO;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
final contentTypes = <String>['application/json'];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
'POST',
queryParams,
postBody,
headerParams,
formParams,
nullableContentType,
authNames,
);
}
/// Parameters:
///
/// * [ExportConfigurationDTO] exportConfigurationDTO (required):
Future<String> configurationImport(ExportConfigurationDTO exportConfigurationDTO) async {
final response = await configurationImportWithHttpInfo(exportConfigurationDTO);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'String') as String;
}
return Future<String>.value(null);
}
/// Performs an HTTP 'PUT /api/Configuration' operation and returns the [Response].
/// Parameters:
///
/// * [ConfigurationDTO] configurationDTO (required):
Future<Response> configurationUpdateWithHttpInfo(ConfigurationDTO configurationDTO) async {
// Verify required params are set.
if (configurationDTO == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: configurationDTO');
}
final path = r'/api/Configuration';
Object postBody = configurationDTO;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
final contentTypes = <String>['application/json'];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
'PUT',
queryParams,
postBody,
headerParams,
formParams,
nullableContentType,
authNames,
);
}
/// Parameters:
///
/// * [ConfigurationDTO] configurationDTO (required):
Future<ConfigurationDTO> configurationUpdate(ConfigurationDTO configurationDTO) async {
final response = await configurationUpdateWithHttpInfo(configurationDTO);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'ConfigurationDTO') as ConfigurationDTO;
}
return Future<ConfigurationDTO>.value(null);
}
}

View File

@ -1,400 +0,0 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.0
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class DeviceApi {
DeviceApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient;
final ApiClient apiClient;
/// Performs an HTTP 'POST /api/Device' operation and returns the [Response].
/// Parameters:
///
/// * [DeviceDetailDTO] deviceDetailDTO (required):
Future<Response> deviceCreateWithHttpInfo(DeviceDetailDTO deviceDetailDTO) async {
// Verify required params are set.
if (deviceDetailDTO == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: deviceDetailDTO');
}
final path = r'/api/Device';
Object postBody = deviceDetailDTO;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
final contentTypes = <String>['application/json'];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
'POST',
queryParams,
postBody,
headerParams,
formParams,
nullableContentType,
authNames,
);
}
/// Parameters:
///
/// * [DeviceDetailDTO] deviceDetailDTO (required):
Future<DeviceDetailDTO> deviceCreate(DeviceDetailDTO deviceDetailDTO) async {
final response = await deviceCreateWithHttpInfo(deviceDetailDTO);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'DeviceDetailDTO') as DeviceDetailDTO;
}
return Future<DeviceDetailDTO>.value(null);
}
/// Performs an HTTP 'DELETE /api/Device/{id}' operation and returns the [Response].
/// Parameters:
///
/// * [String] id (required):
Future<Response> deviceDeleteWithHttpInfo(String id) async {
// Verify required params are set.
if (id == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: id');
}
final path = r'/api/Device/{id}'
.replaceAll('{' + 'id' + '}', id.toString());
Object postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
final contentTypes = <String>[];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
'DELETE',
queryParams,
postBody,
headerParams,
formParams,
nullableContentType,
authNames,
);
}
/// Parameters:
///
/// * [String] id (required):
Future<String> deviceDelete(String id) async {
final response = await deviceDeleteWithHttpInfo(id);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'String') as String;
}
return Future<String>.value(null);
}
/// Performs an HTTP 'GET /api/Device' operation and returns the [Response].
/// Parameters:
///
/// * [String] instanceId:
Future<Response> deviceGetWithHttpInfo({ String instanceId }) async {
// Verify required params are set.
final path = r'/api/Device';
Object postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
if (instanceId != null) {
queryParams.addAll(_convertParametersForCollectionFormat('', 'instanceId', instanceId));
}
final contentTypes = <String>[];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
'GET',
queryParams,
postBody,
headerParams,
formParams,
nullableContentType,
authNames,
);
}
/// Parameters:
///
/// * [String] instanceId:
Future<List<DeviceDTO>> deviceGet({ String instanceId }) async {
final response = await deviceGetWithHttpInfo( instanceId: instanceId );
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) {
return (apiClient.deserialize(_decodeBodyBytes(response), 'List<DeviceDTO>') as List)
.cast<DeviceDTO>()
.toList(growable: false);
}
return Future<List<DeviceDTO>>.value(null);
}
/// Performs an HTTP 'GET /api/Device/{id}/detail' operation and returns the [Response].
/// Parameters:
///
/// * [String] id (required):
Future<Response> deviceGetDetailWithHttpInfo(String id) async {
// Verify required params are set.
if (id == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: id');
}
final path = r'/api/Device/{id}/detail'
.replaceAll('{' + 'id' + '}', id.toString());
Object postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
final contentTypes = <String>[];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
'GET',
queryParams,
postBody,
headerParams,
formParams,
nullableContentType,
authNames,
);
}
/// Parameters:
///
/// * [String] id (required):
Future<DeviceDetailDTO> deviceGetDetail(String id) async {
final response = await deviceGetDetailWithHttpInfo(id);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'DeviceDetailDTO') as DeviceDetailDTO;
}
return Future<DeviceDetailDTO>.value(null);
}
/// Performs an HTTP 'PUT /api/Device' operation and returns the [Response].
/// Parameters:
///
/// * [DeviceDetailDTO] deviceDetailDTO (required):
Future<Response> deviceUpdateWithHttpInfo(DeviceDetailDTO deviceDetailDTO) async {
// Verify required params are set.
if (deviceDetailDTO == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: deviceDetailDTO');
}
final path = r'/api/Device';
Object postBody = deviceDetailDTO;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
final contentTypes = <String>['application/json'];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
'PUT',
queryParams,
postBody,
headerParams,
formParams,
nullableContentType,
authNames,
);
}
/// Parameters:
///
/// * [DeviceDetailDTO] deviceDetailDTO (required):
Future<DeviceDetailDTO> deviceUpdate(DeviceDetailDTO deviceDetailDTO) async {
final response = await deviceUpdateWithHttpInfo(deviceDetailDTO);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'DeviceDetailDTO') as DeviceDetailDTO;
}
return Future<DeviceDetailDTO>.value(null);
}
/// Performs an HTTP 'PUT /api/Device/mainInfos' operation and returns the [Response].
/// Parameters:
///
/// * [DeviceDTO] deviceDTO (required):
Future<Response> deviceUpdateMainInfosWithHttpInfo(DeviceDTO deviceDTO) async {
// Verify required params are set.
if (deviceDTO == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: deviceDTO');
}
final path = r'/api/Device/mainInfos';
Object postBody = deviceDTO;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
final contentTypes = <String>['application/json'];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
'PUT',
queryParams,
postBody,
headerParams,
formParams,
nullableContentType,
authNames,
);
}
/// Parameters:
///
/// * [DeviceDTO] deviceDTO (required):
Future<DeviceDTO> deviceUpdateMainInfos(DeviceDTO deviceDTO) async {
final response = await deviceUpdateMainInfosWithHttpInfo(deviceDTO);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'DeviceDTO') as DeviceDTO;
}
return Future<DeviceDTO>.value(null);
}
}

View File

@ -1,325 +0,0 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.0
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class InstanceApi {
InstanceApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient;
final ApiClient apiClient;
/// Performs an HTTP 'POST /api/Instance' operation and returns the [Response].
/// Parameters:
///
/// * [Instance] instance (required):
Future<Response> instanceCreateInstanceWithHttpInfo(Instance instance) async {
// Verify required params are set.
if (instance == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: instance');
}
final path = r'/api/Instance';
Object postBody = instance;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
final contentTypes = <String>['application/json'];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
'POST',
queryParams,
postBody,
headerParams,
formParams,
nullableContentType,
authNames,
);
}
/// Parameters:
///
/// * [Instance] instance (required):
Future<InstanceDTO> instanceCreateInstance(Instance instance) async {
final response = await instanceCreateInstanceWithHttpInfo(instance);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'InstanceDTO') as InstanceDTO;
}
return Future<InstanceDTO>.value(null);
}
/// Performs an HTTP 'DELETE /api/Instance/{id}' operation and returns the [Response].
/// Parameters:
///
/// * [String] id (required):
Future<Response> instanceDeleteInstanceWithHttpInfo(String id) async {
// Verify required params are set.
if (id == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: id');
}
final path = r'/api/Instance/{id}'
.replaceAll('{' + 'id' + '}', id.toString());
Object postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
final contentTypes = <String>[];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
'DELETE',
queryParams,
postBody,
headerParams,
formParams,
nullableContentType,
authNames,
);
}
/// Parameters:
///
/// * [String] id (required):
Future<String> instanceDeleteInstance(String id) async {
final response = await instanceDeleteInstanceWithHttpInfo(id);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'String') as String;
}
return Future<String>.value(null);
}
/// Performs an HTTP 'GET /api/Instance' operation and returns the [Response].
Future<Response> instanceGetWithHttpInfo() async {
final path = r'/api/Instance';
Object postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
final contentTypes = <String>[];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
'GET',
queryParams,
postBody,
headerParams,
formParams,
nullableContentType,
authNames,
);
}
Future<List<Instance>> instanceGet() async {
final response = await instanceGetWithHttpInfo();
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) {
return (apiClient.deserialize(_decodeBodyBytes(response), 'List<Instance>') as List)
.cast<Instance>()
.toList(growable: false);
}
return Future<List<Instance>>.value(null);
}
/// Performs an HTTP 'GET /api/Instance/{id}' operation and returns the [Response].
/// Parameters:
///
/// * [String] id (required):
Future<Response> instanceGetDetailWithHttpInfo(String id) async {
// Verify required params are set.
if (id == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: id');
}
final path = r'/api/Instance/{id}'
.replaceAll('{' + 'id' + '}', id.toString());
Object postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
final contentTypes = <String>[];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
'GET',
queryParams,
postBody,
headerParams,
formParams,
nullableContentType,
authNames,
);
}
/// Parameters:
///
/// * [String] id (required):
Future<InstanceDTO> instanceGetDetail(String id) async {
final response = await instanceGetDetailWithHttpInfo(id);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'InstanceDTO') as InstanceDTO;
}
return Future<InstanceDTO>.value(null);
}
/// Performs an HTTP 'PUT /api/Instance' operation and returns the [Response].
/// Parameters:
///
/// * [Instance] instance (required):
Future<Response> instanceUpdateinstanceWithHttpInfo(Instance instance) async {
// Verify required params are set.
if (instance == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: instance');
}
final path = r'/api/Instance';
Object postBody = instance;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
final contentTypes = <String>['application/json'];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
'PUT',
queryParams,
postBody,
headerParams,
formParams,
nullableContentType,
authNames,
);
}
/// Parameters:
///
/// * [Instance] instance (required):
Future<InstanceDTO> instanceUpdateinstance(Instance instance) async {
final response = await instanceUpdateinstanceWithHttpInfo(instance);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'InstanceDTO') as InstanceDTO;
}
return Future<InstanceDTO>.value(null);
}
}

View File

@ -1,497 +0,0 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.0
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class ResourceApi {
ResourceApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient;
final ApiClient apiClient;
/// Performs an HTTP 'POST /api/Resource' operation and returns the [Response].
/// Parameters:
///
/// * [ResourceDTO] resourceDTO (required):
Future<Response> resourceCreateWithHttpInfo(ResourceDTO resourceDTO) async {
// Verify required params are set.
if (resourceDTO == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: resourceDTO');
}
final path = r'/api/Resource';
Object postBody = resourceDTO;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
final contentTypes = <String>['application/json'];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
'POST',
queryParams,
postBody,
headerParams,
formParams,
nullableContentType,
authNames,
);
}
/// Parameters:
///
/// * [ResourceDTO] resourceDTO (required):
Future<ResourceDTO> resourceCreate(ResourceDTO resourceDTO) async {
final response = await resourceCreateWithHttpInfo(resourceDTO);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'ResourceDTO') as ResourceDTO;
}
return Future<ResourceDTO>.value(null);
}
/// Performs an HTTP 'DELETE /api/Resource/{id}' operation and returns the [Response].
/// Parameters:
///
/// * [String] id (required):
Future<Response> resourceDeleteWithHttpInfo(String id) async {
// Verify required params are set.
if (id == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: id');
}
final path = r'/api/Resource/{id}'
.replaceAll('{' + 'id' + '}', id.toString());
Object postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
final contentTypes = <String>[];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
'DELETE',
queryParams,
postBody,
headerParams,
formParams,
nullableContentType,
authNames,
);
}
/// Parameters:
///
/// * [String] id (required):
Future<String> resourceDelete(String id) async {
final response = await resourceDeleteWithHttpInfo(id);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'String') as String;
}
return Future<String>.value(null);
}
/// Performs an HTTP 'GET /api/Resource' operation and returns the [Response].
/// Parameters:
///
/// * [String] instanceId:
///
/// * [List<ResourceType>] types:
Future<Response> resourceGetWithHttpInfo({ String instanceId, List<ResourceType> types }) async {
// Verify required params are set.
final path = r'/api/Resource';
Object postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
if (instanceId != null) {
queryParams.addAll(_convertParametersForCollectionFormat('', 'instanceId', instanceId));
}
if (types != null) {
queryParams.addAll(_convertParametersForCollectionFormat('multi', 'types', types));
}
final contentTypes = <String>[];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
'GET',
queryParams,
postBody,
headerParams,
formParams,
nullableContentType,
authNames,
);
}
/// Parameters:
///
/// * [String] instanceId:
///
/// * [List<ResourceType>] types:
Future<List<ResourceDTO>> resourceGet({ String instanceId, List<ResourceType> types }) async {
final response = await resourceGetWithHttpInfo( instanceId: instanceId, types: types );
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) {
return (apiClient.deserialize(_decodeBodyBytes(response), 'List<ResourceDTO>') as List)
.cast<ResourceDTO>()
.toList(growable: false);
}
return Future<List<ResourceDTO>>.value(null);
}
/// Performs an HTTP 'GET /api/Resource/{id}/detail' operation and returns the [Response].
/// Parameters:
///
/// * [String] id (required):
Future<Response> resourceGetDetailWithHttpInfo(String id) async {
// Verify required params are set.
if (id == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: id');
}
final path = r'/api/Resource/{id}/detail'
.replaceAll('{' + 'id' + '}', id.toString());
Object postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
final contentTypes = <String>[];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
'GET',
queryParams,
postBody,
headerParams,
formParams,
nullableContentType,
authNames,
);
}
/// Parameters:
///
/// * [String] id (required):
Future<ResourceDTO> resourceGetDetail(String id) async {
final response = await resourceGetDetailWithHttpInfo(id);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'ResourceDTO') as ResourceDTO;
}
return Future<ResourceDTO>.value(null);
}
/// Performs an HTTP 'GET /api/Resource/{id}' operation and returns the [Response].
/// Parameters:
///
/// * [String] id (required):
Future<Response> resourceShowWithHttpInfo(String id) async {
// Verify required params are set.
if (id == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: id');
}
final path = r'/api/Resource/{id}'
.replaceAll('{' + 'id' + '}', id.toString());
Object postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
final contentTypes = <String>[];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
'GET',
queryParams,
postBody,
headerParams,
formParams,
nullableContentType,
authNames,
);
}
/// Parameters:
///
/// * [String] id (required):
Future<MultipartFile> resourceShow(String id) async {
final response = await resourceShowWithHttpInfo(id);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'MultipartFile') as MultipartFile;
}
return Future<MultipartFile>.value(null);
}
/// Performs an HTTP 'PUT /api/Resource' operation and returns the [Response].
/// Parameters:
///
/// * [ResourceDTO] resourceDTO (required):
Future<Response> resourceUpdateWithHttpInfo(ResourceDTO resourceDTO) async {
// Verify required params are set.
if (resourceDTO == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: resourceDTO');
}
final path = r'/api/Resource';
Object postBody = resourceDTO;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
final contentTypes = <String>['application/json'];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
'PUT',
queryParams,
postBody,
headerParams,
formParams,
nullableContentType,
authNames,
);
}
/// Parameters:
///
/// * [ResourceDTO] resourceDTO (required):
Future<ResourceDTO> resourceUpdate(ResourceDTO resourceDTO) async {
final response = await resourceUpdateWithHttpInfo(resourceDTO);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'ResourceDTO') as ResourceDTO;
}
return Future<ResourceDTO>.value(null);
}
/// Performs an HTTP 'POST /api/Resource/upload' operation and returns the [Response].
/// Parameters:
///
/// * [String] label:
///
/// * [String] type:
///
/// * [String] instanceId:
Future<Response> resourceUploadWithHttpInfo({ String label, String type, String instanceId }) async {
// Verify required params are set.
final path = r'/api/Resource/upload';
Object postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
final contentTypes = <String>['multipart/form-data'];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (label != null) {
hasFields = true;
mp.fields[r'label'] = parameterToString(label);
}
if (type != null) {
hasFields = true;
mp.fields[r'type'] = parameterToString(type);
}
if (instanceId != null) {
hasFields = true;
mp.fields[r'instanceId'] = parameterToString(instanceId);
}
if (hasFields) {
postBody = mp;
}
} else {
if (label != null) {
formParams[r'label'] = parameterToString(label);
}
if (type != null) {
formParams[r'type'] = parameterToString(type);
}
if (instanceId != null) {
formParams[r'instanceId'] = parameterToString(instanceId);
}
}
return await apiClient.invokeAPI(
path,
'POST',
queryParams,
postBody,
headerParams,
formParams,
nullableContentType,
authNames,
);
}
/// Parameters:
///
/// * [String] label:
///
/// * [String] type:
///
/// * [String] instanceId:
Future<String> resourceUpload({ String label, String type, String instanceId }) async {
final response = await resourceUploadWithHttpInfo( label: label, type: type, instanceId: instanceId );
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'String') as String;
}
return Future<String>.value(null);
}
}

View File

@ -1,389 +0,0 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.0
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class RessourceApi {
RessourceApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient;
final ApiClient apiClient;
/// Performs an HTTP 'POST /api/Ressource' operation and returns the [Response].
/// Parameters:
///
/// * [RessourceDetailDTO] ressourceDetailDTO (required):
Future<Response> ressourceCreateWithHttpInfo(RessourceDetailDTO ressourceDetailDTO) async {
// Verify required params are set.
if (ressourceDetailDTO == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: ressourceDetailDTO');
}
final path = r'/api/Ressource';
Object postBody = ressourceDetailDTO;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
final contentTypes = <String>['application/json'];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
'POST',
queryParams,
postBody,
headerParams,
formParams,
nullableContentType,
authNames,
);
}
/// Parameters:
///
/// * [RessourceDetailDTO] ressourceDetailDTO (required):
Future<RessourceDetailDTO> ressourceCreate(RessourceDetailDTO ressourceDetailDTO) async {
final response = await ressourceCreateWithHttpInfo(ressourceDetailDTO);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'RessourceDetailDTO') as RessourceDetailDTO;
}
return Future<RessourceDetailDTO>.value(null);
}
/// Performs an HTTP 'DELETE /api/Ressource/{id}' operation and returns the [Response].
/// Parameters:
///
/// * [String] id (required):
Future<Response> ressourceDeleteWithHttpInfo(String id) async {
// Verify required params are set.
if (id == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: id');
}
final path = r'/api/Ressource/{id}'
.replaceAll('{' + 'id' + '}', id.toString());
Object postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
final contentTypes = <String>[];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
'DELETE',
queryParams,
postBody,
headerParams,
formParams,
nullableContentType,
authNames,
);
}
/// Parameters:
///
/// * [String] id (required):
Future<String> ressourceDelete(String id) async {
final response = await ressourceDeleteWithHttpInfo(id);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'String') as String;
}
return Future<String>.value(null);
}
/// Performs an HTTP 'GET /api/Ressource' operation and returns the [Response].
Future<Response> ressourceGetWithHttpInfo() async {
final path = r'/api/Ressource';
Object postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
final contentTypes = <String>[];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
'GET',
queryParams,
postBody,
headerParams,
formParams,
nullableContentType,
authNames,
);
}
Future<List<RessourceDTO>> ressourceGet() async {
final response = await ressourceGetWithHttpInfo();
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) {
return (apiClient.deserialize(_decodeBodyBytes(response), 'List<RessourceDTO>') as List)
.cast<RessourceDTO>()
.toList(growable: false);
}
return Future<List<RessourceDTO>>.value(null);
}
/// Performs an HTTP 'GET /api/Ressource/{id}/detail' operation and returns the [Response].
/// Parameters:
///
/// * [String] id (required):
Future<Response> ressourceGetDetailWithHttpInfo(String id) async {
// Verify required params are set.
if (id == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: id');
}
final path = r'/api/Ressource/{id}/detail'
.replaceAll('{' + 'id' + '}', id.toString());
Object postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
final contentTypes = <String>[];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
'GET',
queryParams,
postBody,
headerParams,
formParams,
nullableContentType,
authNames,
);
}
/// Parameters:
///
/// * [String] id (required):
Future<RessourceDetailDTO> ressourceGetDetail(String id) async {
final response = await ressourceGetDetailWithHttpInfo(id);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'RessourceDetailDTO') as RessourceDetailDTO;
}
return Future<RessourceDetailDTO>.value(null);
}
/// Performs an HTTP 'GET /api/Ressource/{id}' operation and returns the [Response].
/// Parameters:
///
/// * [String] id (required):
Future<Response> ressourceShowWithHttpInfo(String id) async {
// Verify required params are set.
if (id == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: id');
}
final path = r'/api/Ressource/{id}'
.replaceAll('{' + 'id' + '}', id.toString());
Object postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
final contentTypes = <String>[];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
'GET',
queryParams,
postBody,
headerParams,
formParams,
nullableContentType,
authNames,
);
}
/// Parameters:
///
/// * [String] id (required):
Future<MultipartFile> ressourceShow(String id) async {
final response = await ressourceShowWithHttpInfo(id);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'MultipartFile') as MultipartFile;
}
return Future<MultipartFile>.value(null);
}
/// Performs an HTTP 'PUT /api/Ressource' operation and returns the [Response].
/// Parameters:
///
/// * [RessourceDetailDTO] ressourceDetailDTO (required):
Future<Response> ressourceUpdateWithHttpInfo(RessourceDetailDTO ressourceDetailDTO) async {
// Verify required params are set.
if (ressourceDetailDTO == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: ressourceDetailDTO');
}
final path = r'/api/Ressource';
Object postBody = ressourceDetailDTO;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
final contentTypes = <String>['application/json'];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
'PUT',
queryParams,
postBody,
headerParams,
formParams,
nullableContentType,
authNames,
);
}
/// Parameters:
///
/// * [RessourceDetailDTO] ressourceDetailDTO (required):
Future<RessourceDetailDTO> ressourceUpdate(RessourceDetailDTO ressourceDetailDTO) async {
final response = await ressourceUpdateWithHttpInfo(ressourceDetailDTO);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'RessourceDetailDTO') as RessourceDetailDTO;
}
return Future<RessourceDetailDTO>.value(null);
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,325 +0,0 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.0
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class UserApi {
UserApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient;
final ApiClient apiClient;
/// Performs an HTTP 'POST /api/User' operation and returns the [Response].
/// Parameters:
///
/// * [User] user (required):
Future<Response> userCreateUserWithHttpInfo(User user) async {
// Verify required params are set.
if (user == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: user');
}
final path = r'/api/User';
Object postBody = user;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
final contentTypes = <String>['application/json'];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
'POST',
queryParams,
postBody,
headerParams,
formParams,
nullableContentType,
authNames,
);
}
/// Parameters:
///
/// * [User] user (required):
Future<UserDetailDTO> userCreateUser(User user) async {
final response = await userCreateUserWithHttpInfo(user);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'UserDetailDTO') as UserDetailDTO;
}
return Future<UserDetailDTO>.value(null);
}
/// Performs an HTTP 'DELETE /api/User/{id}' operation and returns the [Response].
/// Parameters:
///
/// * [String] id (required):
Future<Response> userDeleteUserWithHttpInfo(String id) async {
// Verify required params are set.
if (id == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: id');
}
final path = r'/api/User/{id}'
.replaceAll('{' + 'id' + '}', id.toString());
Object postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
final contentTypes = <String>[];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
'DELETE',
queryParams,
postBody,
headerParams,
formParams,
nullableContentType,
authNames,
);
}
/// Parameters:
///
/// * [String] id (required):
Future<String> userDeleteUser(String id) async {
final response = await userDeleteUserWithHttpInfo(id);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'String') as String;
}
return Future<String>.value(null);
}
/// Performs an HTTP 'GET /api/User' operation and returns the [Response].
Future<Response> userGetWithHttpInfo() async {
final path = r'/api/User';
Object postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
final contentTypes = <String>[];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
'GET',
queryParams,
postBody,
headerParams,
formParams,
nullableContentType,
authNames,
);
}
Future<List<User>> userGet() async {
final response = await userGetWithHttpInfo();
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) {
return (apiClient.deserialize(_decodeBodyBytes(response), 'List<User>') as List)
.cast<User>()
.toList(growable: false);
}
return Future<List<User>>.value(null);
}
/// Performs an HTTP 'GET /api/User/{id}' operation and returns the [Response].
/// Parameters:
///
/// * [String] id (required):
Future<Response> userGetDetailWithHttpInfo(String id) async {
// Verify required params are set.
if (id == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: id');
}
final path = r'/api/User/{id}'
.replaceAll('{' + 'id' + '}', id.toString());
Object postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
final contentTypes = <String>[];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
'GET',
queryParams,
postBody,
headerParams,
formParams,
nullableContentType,
authNames,
);
}
/// Parameters:
///
/// * [String] id (required):
Future<UserDetailDTO> userGetDetail(String id) async {
final response = await userGetDetailWithHttpInfo(id);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'UserDetailDTO') as UserDetailDTO;
}
return Future<UserDetailDTO>.value(null);
}
/// Performs an HTTP 'PUT /api/User' operation and returns the [Response].
/// Parameters:
///
/// * [User] user (required):
Future<Response> userUpdateUserWithHttpInfo(User user) async {
// Verify required params are set.
if (user == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: user');
}
final path = r'/api/User';
Object postBody = user;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
final contentTypes = <String>['application/json'];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
'PUT',
queryParams,
postBody,
headerParams,
formParams,
nullableContentType,
authNames,
);
}
/// Parameters:
///
/// * [User] user (required):
Future<UserDetailDTO> userUpdateUser(User user) async {
final response = await userUpdateUserWithHttpInfo(user);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'UserDetailDTO') as UserDetailDTO;
}
return Future<UserDetailDTO>.value(null);
}
}

View File

@ -1,80 +0,0 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.0
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class QueryParam {
const QueryParam(this.name, this.value);
final String name;
final String value;
@override
String toString() => '${Uri.encodeQueryComponent(name)}=${Uri.encodeQueryComponent(value)}';
}
// Ported from the Java version.
Iterable<QueryParam> _convertParametersForCollectionFormat(
String collectionFormat,
String name,
dynamic value,
) {
final params = <QueryParam>[];
// preconditions
if (name != null && !name.isEmpty && value != null) {
if (value is List) {
// get the collection format, default: csv
collectionFormat = (collectionFormat == null || collectionFormat.isEmpty)
? 'csv'
: collectionFormat;
if (collectionFormat == 'multi') {
return value.map((v) => QueryParam(name, parameterToString(v)));
}
final delimiter = _delimiters[collectionFormat] ?? ',';
params.add(QueryParam(name, value.map((v) => parameterToString(v)).join(delimiter)));
} else {
params.add(QueryParam(name, parameterToString(value)));
}
}
return params;
}
/// Format the given parameter object into a [String].
String parameterToString(dynamic value) {
if (value == null) {
return '';
}
if (value is DateTime) {
return value.toUtc().toIso8601String();
}
if (value is MapTypeApp) {
return MapTypeAppTypeTransformer().encode(value).toString();
}
if (value is ResourceType) {
return ResourceTypeTypeTransformer().encode(value).toString();
}
if (value is SectionType) {
return SectionTypeTypeTransformer().encode(value).toString();
}
return value.toString();
}
/// Returns the decoded body as UTF-8 if the given headers indicate an 'application/json'
/// content type. Otherwise, returns the decoded body as decoded by dart:http package.
String _decodeBodyBytes(Response response) {
final contentType = response.headers['content-type'];
return contentType != null && contentType.toLowerCase().startsWith('application/json')
? response.bodyBytes == null ? null : utf8.decode(response.bodyBytes)
: response.body;
}

View File

@ -1,35 +0,0 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.0
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class ApiKeyAuth implements Authentication {
ApiKeyAuth(this.location, this.paramName);
final String location;
final String paramName;
String apiKeyPrefix;
String apiKey;
@override
void applyToParams(List<QueryParam> queryParams, Map<String, String> headerParams) {
final value = apiKeyPrefix == null ? apiKey : '$apiKeyPrefix $apiKey';
if (location == 'query' && value != null) {
queryParams.add(QueryParam(paramName, value));
} else if (location == 'header' && value != null) {
headerParams[paramName] = value;
} else if (location == 'cookie' && value != null) {
headerParams.update('Cookie', (String existingCookie) {
return '$existingCookie; $paramName=$value';
}, ifAbsent: () => '$paramName=$value');
}
}
}

View File

@ -1,116 +0,0 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.0
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class ArticleDTO {
/// Returns a new [ArticleDTO] instance.
ArticleDTO({
this.content,
this.qrCode,
this.isContentTop,
this.audioIds,
this.isReadAudioAuto,
this.images,
});
List<TranslationDTO> content;
String qrCode;
bool isContentTop;
List<TranslationDTO> audioIds;
bool isReadAudioAuto;
List<ImageDTO> images;
@override
bool operator ==(Object other) => identical(this, other) || other is ArticleDTO &&
other.content == content &&
other.qrCode == qrCode &&
other.isContentTop == isContentTop &&
other.audioIds == audioIds &&
other.isReadAudioAuto == isReadAudioAuto &&
other.images == images;
@override
int get hashCode =>
(content == null ? 0 : content.hashCode) +
(qrCode == null ? 0 : qrCode.hashCode) +
(isContentTop == null ? 0 : isContentTop.hashCode) +
(audioIds == null ? 0 : audioIds.hashCode) +
(isReadAudioAuto == null ? 0 : isReadAudioAuto.hashCode) +
(images == null ? 0 : images.hashCode);
@override
String toString() => 'ArticleDTO[content=$content, qrCode=$qrCode, isContentTop=$isContentTop, audioIds=$audioIds, isReadAudioAuto=$isReadAudioAuto, images=$images]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (content != null) {
json[r'content'] = content;
}
if (qrCode != null) {
json[r'qrCode'] = qrCode;
}
if (isContentTop != null) {
json[r'isContentTop'] = isContentTop;
}
if (audioIds != null) {
json[r'audioIds'] = audioIds;
}
if (isReadAudioAuto != null) {
json[r'isReadAudioAuto'] = isReadAudioAuto;
}
if (images != null) {
json[r'images'] = images;
}
return json;
}
/// Returns a new [ArticleDTO] instance and imports its values from
/// [json] if it's non-null, null if [json] is null.
static ArticleDTO fromJson(Map<String, dynamic> json) => json == null
? null
: ArticleDTO(
content: TranslationDTO.listFromJson(json[r'content']),
qrCode: json[r'qrCode'],
isContentTop: json[r'isContentTop'],
audioIds: TranslationDTO.listFromJson(json[r'audioIds']),
isReadAudioAuto: json[r'isReadAudioAuto'],
images: ImageDTO.listFromJson(json[r'images']),
);
static List<ArticleDTO> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <ArticleDTO>[]
: json.map((v) => ArticleDTO.fromJson(v)).toList(growable: true == growable);
static Map<String, ArticleDTO> mapFromJson(Map<String, dynamic> json) {
final map = <String, ArticleDTO>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) => map[key] = ArticleDTO.fromJson(v));
}
return map;
}
// maps a json object with a list of ArticleDTO-objects as value to a dart map
static Map<String, List<ArticleDTO>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
final map = <String, List<ArticleDTO>>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) {
map[key] = ArticleDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
});
}
return map;
}
}

View File

@ -1,183 +0,0 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.0
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class ConfigurationDTO {
/// Returns a new [ConfigurationDTO] instance.
ConfigurationDTO({
this.id,
this.label,
this.title,
this.imageId,
this.imageSource,
this.primaryColor,
this.secondaryColor,
this.languages,
this.dateCreation,
this.isMobile,
this.isTablet,
this.isOffline,
this.instanceId,
});
String id;
String label;
List<TranslationDTO> title;
String imageId;
String imageSource;
String primaryColor;
String secondaryColor;
List<String> languages;
DateTime dateCreation;
bool isMobile;
bool isTablet;
bool isOffline;
String instanceId;
@override
bool operator ==(Object other) => identical(this, other) || other is ConfigurationDTO &&
other.id == id &&
other.label == label &&
other.title == title &&
other.imageId == imageId &&
other.imageSource == imageSource &&
other.primaryColor == primaryColor &&
other.secondaryColor == secondaryColor &&
other.languages == languages &&
other.dateCreation == dateCreation &&
other.isMobile == isMobile &&
other.isTablet == isTablet &&
other.isOffline == isOffline &&
other.instanceId == instanceId;
@override
int get hashCode =>
(id == null ? 0 : id.hashCode) +
(label == null ? 0 : label.hashCode) +
(title == null ? 0 : title.hashCode) +
(imageId == null ? 0 : imageId.hashCode) +
(imageSource == null ? 0 : imageSource.hashCode) +
(primaryColor == null ? 0 : primaryColor.hashCode) +
(secondaryColor == null ? 0 : secondaryColor.hashCode) +
(languages == null ? 0 : languages.hashCode) +
(dateCreation == null ? 0 : dateCreation.hashCode) +
(isMobile == null ? 0 : isMobile.hashCode) +
(isTablet == null ? 0 : isTablet.hashCode) +
(isOffline == null ? 0 : isOffline.hashCode) +
(instanceId == null ? 0 : instanceId.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]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (id != null) {
json[r'id'] = id;
}
if (label != null) {
json[r'label'] = label;
}
if (title != null) {
json[r'title'] = title;
}
if (imageId != null) {
json[r'imageId'] = imageId;
}
if (imageSource != null) {
json[r'imageSource'] = imageSource;
}
if (primaryColor != null) {
json[r'primaryColor'] = primaryColor;
}
if (secondaryColor != null) {
json[r'secondaryColor'] = secondaryColor;
}
if (languages != null) {
json[r'languages'] = languages;
}
if (dateCreation != null) {
json[r'dateCreation'] = dateCreation.toUtc().toIso8601String();
}
if (isMobile != null) {
json[r'isMobile'] = isMobile;
}
if (isTablet != null) {
json[r'isTablet'] = isTablet;
}
if (isOffline != null) {
json[r'isOffline'] = isOffline;
}
if (instanceId != null) {
json[r'instanceId'] = instanceId;
}
return json;
}
/// Returns a new [ConfigurationDTO] instance and imports its values from
/// [json] if it's non-null, null if [json] is null.
static ConfigurationDTO fromJson(Map<String, dynamic> json) => json == null
? null
: ConfigurationDTO(
id: json[r'id'],
label: json[r'label'],
title: TranslationDTO.listFromJson(json[r'title']),
imageId: json[r'imageId'],
imageSource: json[r'imageSource'],
primaryColor: json[r'primaryColor'],
secondaryColor: json[r'secondaryColor'],
languages: json[r'languages'] == null
? null
: (json[r'languages'] as List).cast<String>(),
dateCreation: json[r'dateCreation'] == null
? null
: DateTime.parse(json[r'dateCreation']),
isMobile: json[r'isMobile'],
isTablet: json[r'isTablet'],
isOffline: json[r'isOffline'],
instanceId: json[r'instanceId'],
);
static List<ConfigurationDTO> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <ConfigurationDTO>[]
: json.map((v) => ConfigurationDTO.fromJson(v)).toList(growable: true == growable);
static Map<String, ConfigurationDTO> mapFromJson(Map<String, dynamic> json) {
final map = <String, ConfigurationDTO>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) => map[key] = ConfigurationDTO.fromJson(v));
}
return map;
}
// maps a json object with a list of ConfigurationDTO-objects as value to a dart map
static Map<String, List<ConfigurationDTO>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
final map = <String, List<ConfigurationDTO>>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) {
map[key] = ConfigurationDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
});
}
return map;
}
}

View File

@ -1,205 +0,0 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.0
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class DeviceDetailDTO {
/// Returns a new [DeviceDetailDTO] instance.
DeviceDetailDTO({
this.id,
this.identifier,
this.name,
this.ipAddressWLAN,
this.ipAddressETH,
this.configurationId,
this.configuration,
this.connected,
this.dateCreation,
this.dateUpdate,
this.instanceId,
this.connectionLevel,
this.lastConnectionLevel,
this.batteryLevel,
this.lastBatteryLevel,
});
String id;
String identifier;
String name;
String ipAddressWLAN;
String ipAddressETH;
String configurationId;
String configuration;
bool connected;
DateTime dateCreation;
DateTime dateUpdate;
String instanceId;
String connectionLevel;
DateTime lastConnectionLevel;
String batteryLevel;
DateTime lastBatteryLevel;
@override
bool operator ==(Object other) => identical(this, other) || other is DeviceDetailDTO &&
other.id == id &&
other.identifier == identifier &&
other.name == name &&
other.ipAddressWLAN == ipAddressWLAN &&
other.ipAddressETH == ipAddressETH &&
other.configurationId == configurationId &&
other.configuration == configuration &&
other.connected == connected &&
other.dateCreation == dateCreation &&
other.dateUpdate == dateUpdate &&
other.instanceId == instanceId &&
other.connectionLevel == connectionLevel &&
other.lastConnectionLevel == lastConnectionLevel &&
other.batteryLevel == batteryLevel &&
other.lastBatteryLevel == lastBatteryLevel;
@override
int get hashCode =>
(id == null ? 0 : id.hashCode) +
(identifier == null ? 0 : identifier.hashCode) +
(name == null ? 0 : name.hashCode) +
(ipAddressWLAN == null ? 0 : ipAddressWLAN.hashCode) +
(ipAddressETH == null ? 0 : ipAddressETH.hashCode) +
(configurationId == null ? 0 : configurationId.hashCode) +
(configuration == null ? 0 : configuration.hashCode) +
(connected == null ? 0 : connected.hashCode) +
(dateCreation == null ? 0 : dateCreation.hashCode) +
(dateUpdate == null ? 0 : dateUpdate.hashCode) +
(instanceId == null ? 0 : instanceId.hashCode) +
(connectionLevel == null ? 0 : connectionLevel.hashCode) +
(lastConnectionLevel == null ? 0 : lastConnectionLevel.hashCode) +
(batteryLevel == null ? 0 : batteryLevel.hashCode) +
(lastBatteryLevel == null ? 0 : lastBatteryLevel.hashCode);
@override
String toString() => 'DeviceDetailDTO[id=$id, identifier=$identifier, name=$name, ipAddressWLAN=$ipAddressWLAN, ipAddressETH=$ipAddressETH, configurationId=$configurationId, configuration=$configuration, connected=$connected, dateCreation=$dateCreation, dateUpdate=$dateUpdate, instanceId=$instanceId, connectionLevel=$connectionLevel, lastConnectionLevel=$lastConnectionLevel, batteryLevel=$batteryLevel, lastBatteryLevel=$lastBatteryLevel]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (id != null) {
json[r'id'] = id;
}
if (identifier != null) {
json[r'identifier'] = identifier;
}
if (name != null) {
json[r'name'] = name;
}
if (ipAddressWLAN != null) {
json[r'ipAddressWLAN'] = ipAddressWLAN;
}
if (ipAddressETH != null) {
json[r'ipAddressETH'] = ipAddressETH;
}
if (configurationId != null) {
json[r'configurationId'] = configurationId;
}
if (configuration != null) {
json[r'configuration'] = configuration;
}
if (connected != null) {
json[r'connected'] = connected;
}
if (dateCreation != null) {
json[r'dateCreation'] = dateCreation.toUtc().toIso8601String();
}
if (dateUpdate != null) {
json[r'dateUpdate'] = dateUpdate.toUtc().toIso8601String();
}
if (instanceId != null) {
json[r'instanceId'] = instanceId;
}
if (connectionLevel != null) {
json[r'connectionLevel'] = connectionLevel;
}
if (lastConnectionLevel != null) {
json[r'lastConnectionLevel'] = lastConnectionLevel.toUtc().toIso8601String();
}
if (batteryLevel != null) {
json[r'batteryLevel'] = batteryLevel;
}
if (lastBatteryLevel != null) {
json[r'lastBatteryLevel'] = lastBatteryLevel.toUtc().toIso8601String();
}
return json;
}
/// Returns a new [DeviceDetailDTO] instance and imports its values from
/// [json] if it's non-null, null if [json] is null.
static DeviceDetailDTO fromJson(Map<String, dynamic> json) => json == null
? null
: DeviceDetailDTO(
id: json[r'id'],
identifier: json[r'identifier'],
name: json[r'name'],
ipAddressWLAN: json[r'ipAddressWLAN'],
ipAddressETH: json[r'ipAddressETH'],
configurationId: json[r'configurationId'],
configuration: json[r'configuration'],
connected: json[r'connected'],
dateCreation: json[r'dateCreation'] == null
? null
: DateTime.parse(json[r'dateCreation']),
dateUpdate: json[r'dateUpdate'] == null
? null
: DateTime.parse(json[r'dateUpdate']),
instanceId: json[r'instanceId'],
connectionLevel: json[r'connectionLevel'],
lastConnectionLevel: json[r'lastConnectionLevel'] == null
? null
: DateTime.parse(json[r'lastConnectionLevel']),
batteryLevel: json[r'batteryLevel'],
lastBatteryLevel: json[r'lastBatteryLevel'] == null
? null
: DateTime.parse(json[r'lastBatteryLevel']),
);
static List<DeviceDetailDTO> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <DeviceDetailDTO>[]
: json.map((v) => DeviceDetailDTO.fromJson(v)).toList(growable: true == growable);
static Map<String, DeviceDetailDTO> mapFromJson(Map<String, dynamic> json) {
final map = <String, DeviceDetailDTO>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) => map[key] = DeviceDetailDTO.fromJson(v));
}
return map;
}
// maps a json object with a list of DeviceDetailDTO-objects as value to a dart map
static Map<String, List<DeviceDetailDTO>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
final map = <String, List<DeviceDetailDTO>>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) {
map[key] = DeviceDetailDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
});
}
return map;
}
}

View File

@ -1,102 +0,0 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.0
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class DeviceDetailDTOAllOf {
/// Returns a new [DeviceDetailDTOAllOf] instance.
DeviceDetailDTOAllOf({
this.connectionLevel,
this.lastConnectionLevel,
this.batteryLevel,
this.lastBatteryLevel,
});
String connectionLevel;
DateTime lastConnectionLevel;
String batteryLevel;
DateTime lastBatteryLevel;
@override
bool operator ==(Object other) => identical(this, other) || other is DeviceDetailDTOAllOf &&
other.connectionLevel == connectionLevel &&
other.lastConnectionLevel == lastConnectionLevel &&
other.batteryLevel == batteryLevel &&
other.lastBatteryLevel == lastBatteryLevel;
@override
int get hashCode =>
(connectionLevel == null ? 0 : connectionLevel.hashCode) +
(lastConnectionLevel == null ? 0 : lastConnectionLevel.hashCode) +
(batteryLevel == null ? 0 : batteryLevel.hashCode) +
(lastBatteryLevel == null ? 0 : lastBatteryLevel.hashCode);
@override
String toString() => 'DeviceDetailDTOAllOf[connectionLevel=$connectionLevel, lastConnectionLevel=$lastConnectionLevel, batteryLevel=$batteryLevel, lastBatteryLevel=$lastBatteryLevel]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (connectionLevel != null) {
json[r'connectionLevel'] = connectionLevel;
}
if (lastConnectionLevel != null) {
json[r'lastConnectionLevel'] = lastConnectionLevel.toUtc().toIso8601String();
}
if (batteryLevel != null) {
json[r'batteryLevel'] = batteryLevel;
}
if (lastBatteryLevel != null) {
json[r'lastBatteryLevel'] = lastBatteryLevel.toUtc().toIso8601String();
}
return json;
}
/// Returns a new [DeviceDetailDTOAllOf] instance and imports its values from
/// [json] if it's non-null, null if [json] is null.
static DeviceDetailDTOAllOf fromJson(Map<String, dynamic> json) => json == null
? null
: DeviceDetailDTOAllOf(
connectionLevel: json[r'connectionLevel'],
lastConnectionLevel: json[r'lastConnectionLevel'] == null
? null
: DateTime.parse(json[r'lastConnectionLevel']),
batteryLevel: json[r'batteryLevel'],
lastBatteryLevel: json[r'lastBatteryLevel'] == null
? null
: DateTime.parse(json[r'lastBatteryLevel']),
);
static List<DeviceDetailDTOAllOf> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <DeviceDetailDTOAllOf>[]
: json.map((v) => DeviceDetailDTOAllOf.fromJson(v)).toList(growable: true == growable);
static Map<String, DeviceDetailDTOAllOf> mapFromJson(Map<String, dynamic> json) {
final map = <String, DeviceDetailDTOAllOf>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) => map[key] = DeviceDetailDTOAllOf.fromJson(v));
}
return map;
}
// maps a json object with a list of DeviceDetailDTOAllOf-objects as value to a dart map
static Map<String, List<DeviceDetailDTOAllOf>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
final map = <String, List<DeviceDetailDTOAllOf>>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) {
map[key] = DeviceDetailDTOAllOf.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
});
}
return map;
}
}

View File

@ -1,165 +0,0 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.0
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class DeviceDTO {
/// Returns a new [DeviceDTO] instance.
DeviceDTO({
this.id,
this.identifier,
this.name,
this.ipAddressWLAN,
this.ipAddressETH,
this.configurationId,
this.configuration,
this.connected,
this.dateCreation,
this.dateUpdate,
this.instanceId,
});
String id;
String identifier;
String name;
String ipAddressWLAN;
String ipAddressETH;
String configurationId;
String configuration;
bool connected;
DateTime dateCreation;
DateTime dateUpdate;
String instanceId;
@override
bool operator ==(Object other) => identical(this, other) || other is DeviceDTO &&
other.id == id &&
other.identifier == identifier &&
other.name == name &&
other.ipAddressWLAN == ipAddressWLAN &&
other.ipAddressETH == ipAddressETH &&
other.configurationId == configurationId &&
other.configuration == configuration &&
other.connected == connected &&
other.dateCreation == dateCreation &&
other.dateUpdate == dateUpdate &&
other.instanceId == instanceId;
@override
int get hashCode =>
(id == null ? 0 : id.hashCode) +
(identifier == null ? 0 : identifier.hashCode) +
(name == null ? 0 : name.hashCode) +
(ipAddressWLAN == null ? 0 : ipAddressWLAN.hashCode) +
(ipAddressETH == null ? 0 : ipAddressETH.hashCode) +
(configurationId == null ? 0 : configurationId.hashCode) +
(configuration == null ? 0 : configuration.hashCode) +
(connected == null ? 0 : connected.hashCode) +
(dateCreation == null ? 0 : dateCreation.hashCode) +
(dateUpdate == null ? 0 : dateUpdate.hashCode) +
(instanceId == null ? 0 : instanceId.hashCode);
@override
String toString() => 'DeviceDTO[id=$id, identifier=$identifier, name=$name, ipAddressWLAN=$ipAddressWLAN, ipAddressETH=$ipAddressETH, configurationId=$configurationId, configuration=$configuration, connected=$connected, dateCreation=$dateCreation, dateUpdate=$dateUpdate, instanceId=$instanceId]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (id != null) {
json[r'id'] = id;
}
if (identifier != null) {
json[r'identifier'] = identifier;
}
if (name != null) {
json[r'name'] = name;
}
if (ipAddressWLAN != null) {
json[r'ipAddressWLAN'] = ipAddressWLAN;
}
if (ipAddressETH != null) {
json[r'ipAddressETH'] = ipAddressETH;
}
if (configurationId != null) {
json[r'configurationId'] = configurationId;
}
if (configuration != null) {
json[r'configuration'] = configuration;
}
if (connected != null) {
json[r'connected'] = connected;
}
if (dateCreation != null) {
json[r'dateCreation'] = dateCreation.toUtc().toIso8601String();
}
if (dateUpdate != null) {
json[r'dateUpdate'] = dateUpdate.toUtc().toIso8601String();
}
if (instanceId != null) {
json[r'instanceId'] = instanceId;
}
return json;
}
/// Returns a new [DeviceDTO] instance and imports its values from
/// [json] if it's non-null, null if [json] is null.
static DeviceDTO fromJson(Map<String, dynamic> json) => json == null
? null
: DeviceDTO(
id: json[r'id'],
identifier: json[r'identifier'],
name: json[r'name'],
ipAddressWLAN: json[r'ipAddressWLAN'],
ipAddressETH: json[r'ipAddressETH'],
configurationId: json[r'configurationId'],
configuration: json[r'configuration'],
connected: json[r'connected'],
dateCreation: json[r'dateCreation'] == null
? null
: DateTime.parse(json[r'dateCreation']),
dateUpdate: json[r'dateUpdate'] == null
? null
: DateTime.parse(json[r'dateUpdate']),
instanceId: json[r'instanceId'],
);
static List<DeviceDTO> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <DeviceDTO>[]
: json.map((v) => DeviceDTO.fromJson(v)).toList(growable: true == growable);
static Map<String, DeviceDTO> mapFromJson(Map<String, dynamic> json) {
final map = <String, DeviceDTO>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) => map[key] = DeviceDTO.fromJson(v));
}
return map;
}
// maps a json object with a list of DeviceDTO-objects as value to a dart map
static Map<String, List<DeviceDTO>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
final map = <String, List<DeviceDTO>>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) {
map[key] = DeviceDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
});
}
return map;
}
}

View File

@ -1,131 +0,0 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.0
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class DisplayDTO {
/// Returns a new [DisplayDTO] instance.
DisplayDTO({
this.id,
this.label,
this.sectionIds,
this.primaryColor,
this.secondaryColor,
this.languages,
this.dateCreation,
});
String id;
String label;
List<String> sectionIds;
String primaryColor;
String secondaryColor;
List<String> languages;
DateTime dateCreation;
@override
bool operator ==(Object other) => identical(this, other) || other is DisplayDTO &&
other.id == id &&
other.label == label &&
other.sectionIds == sectionIds &&
other.primaryColor == primaryColor &&
other.secondaryColor == secondaryColor &&
other.languages == languages &&
other.dateCreation == dateCreation;
@override
int get hashCode =>
(id == null ? 0 : id.hashCode) +
(label == null ? 0 : label.hashCode) +
(sectionIds == null ? 0 : sectionIds.hashCode) +
(primaryColor == null ? 0 : primaryColor.hashCode) +
(secondaryColor == null ? 0 : secondaryColor.hashCode) +
(languages == null ? 0 : languages.hashCode) +
(dateCreation == null ? 0 : dateCreation.hashCode);
@override
String toString() => 'DisplayDTO[id=$id, label=$label, sectionIds=$sectionIds, primaryColor=$primaryColor, secondaryColor=$secondaryColor, languages=$languages, dateCreation=$dateCreation]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (id != null) {
json[r'id'] = id;
}
if (label != null) {
json[r'label'] = label;
}
if (sectionIds != null) {
json[r'sectionIds'] = sectionIds;
}
if (primaryColor != null) {
json[r'primaryColor'] = primaryColor;
}
if (secondaryColor != null) {
json[r'secondaryColor'] = secondaryColor;
}
if (languages != null) {
json[r'languages'] = languages;
}
if (dateCreation != null) {
json[r'dateCreation'] = dateCreation.toUtc().toIso8601String();
}
return json;
}
/// Returns a new [DisplayDTO] instance and imports its values from
/// [json] if it's non-null, null if [json] is null.
static DisplayDTO fromJson(Map<String, dynamic> json) => json == null
? null
: DisplayDTO(
id: json[r'id'],
label: json[r'label'],
sectionIds: json[r'sectionIds'] == null
? null
: (json[r'sectionIds'] as List).cast<String>(),
primaryColor: json[r'primaryColor'],
secondaryColor: json[r'secondaryColor'],
languages: json[r'languages'] == null
? null
: (json[r'languages'] as List).cast<String>(),
dateCreation: json[r'dateCreation'] == null
? null
: DateTime.parse(json[r'dateCreation']),
);
static List<DisplayDTO> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <DisplayDTO>[]
: json.map((v) => DisplayDTO.fromJson(v)).toList(growable: true == growable);
static Map<String, DisplayDTO> mapFromJson(Map<String, dynamic> json) {
final map = <String, DisplayDTO>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) => map[key] = DisplayDTO.fromJson(v));
}
return map;
}
// maps a json object with a list of DisplayDTO-objects as value to a dart map
static Map<String, List<DisplayDTO>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
final map = <String, List<DisplayDTO>>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) {
map[key] = DisplayDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
});
}
return map;
}
}

View File

@ -1,201 +0,0 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.0
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class ExportConfigurationDTO {
/// Returns a new [ExportConfigurationDTO] instance.
ExportConfigurationDTO({
this.id,
this.label,
this.title,
this.imageId,
this.imageSource,
this.primaryColor,
this.secondaryColor,
this.languages,
this.dateCreation,
this.isMobile,
this.isTablet,
this.isOffline,
this.instanceId,
this.sections,
this.resources,
});
String id;
String label;
List<TranslationDTO> title;
String imageId;
String imageSource;
String primaryColor;
String secondaryColor;
List<String> languages;
DateTime dateCreation;
bool isMobile;
bool isTablet;
bool isOffline;
String instanceId;
List<SectionDTO> sections;
List<ResourceDTO> resources;
@override
bool operator ==(Object other) => identical(this, other) || other is ExportConfigurationDTO &&
other.id == id &&
other.label == label &&
other.title == title &&
other.imageId == imageId &&
other.imageSource == imageSource &&
other.primaryColor == primaryColor &&
other.secondaryColor == secondaryColor &&
other.languages == languages &&
other.dateCreation == dateCreation &&
other.isMobile == isMobile &&
other.isTablet == isTablet &&
other.isOffline == isOffline &&
other.instanceId == instanceId &&
other.sections == sections &&
other.resources == resources;
@override
int get hashCode =>
(id == null ? 0 : id.hashCode) +
(label == null ? 0 : label.hashCode) +
(title == null ? 0 : title.hashCode) +
(imageId == null ? 0 : imageId.hashCode) +
(imageSource == null ? 0 : imageSource.hashCode) +
(primaryColor == null ? 0 : primaryColor.hashCode) +
(secondaryColor == null ? 0 : secondaryColor.hashCode) +
(languages == null ? 0 : languages.hashCode) +
(dateCreation == null ? 0 : dateCreation.hashCode) +
(isMobile == null ? 0 : isMobile.hashCode) +
(isTablet == null ? 0 : isTablet.hashCode) +
(isOffline == null ? 0 : isOffline.hashCode) +
(instanceId == null ? 0 : instanceId.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, sections=$sections, resources=$resources]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (id != null) {
json[r'id'] = id;
}
if (label != null) {
json[r'label'] = label;
}
if (title != null) {
json[r'title'] = title;
}
if (imageId != null) {
json[r'imageId'] = imageId;
}
if (imageSource != null) {
json[r'imageSource'] = imageSource;
}
if (primaryColor != null) {
json[r'primaryColor'] = primaryColor;
}
if (secondaryColor != null) {
json[r'secondaryColor'] = secondaryColor;
}
if (languages != null) {
json[r'languages'] = languages;
}
if (dateCreation != null) {
json[r'dateCreation'] = dateCreation.toUtc().toIso8601String();
}
if (isMobile != null) {
json[r'isMobile'] = isMobile;
}
if (isTablet != null) {
json[r'isTablet'] = isTablet;
}
if (isOffline != null) {
json[r'isOffline'] = isOffline;
}
if (instanceId != null) {
json[r'instanceId'] = instanceId;
}
if (sections != null) {
json[r'sections'] = sections;
}
if (resources != null) {
json[r'resources'] = resources;
}
return json;
}
/// Returns a new [ExportConfigurationDTO] instance and imports its values from
/// [json] if it's non-null, null if [json] is null.
static ExportConfigurationDTO fromJson(Map<String, dynamic> json) => json == null
? null
: ExportConfigurationDTO(
id: json[r'id'],
label: json[r'label'],
title: TranslationDTO.listFromJson(json[r'title']),
imageId: json[r'imageId'],
imageSource: json[r'imageSource'],
primaryColor: json[r'primaryColor'],
secondaryColor: json[r'secondaryColor'],
languages: json[r'languages'] == null
? null
: (json[r'languages'] as List).cast<String>(),
dateCreation: json[r'dateCreation'] == null
? null
: DateTime.parse(json[r'dateCreation']),
isMobile: json[r'isMobile'],
isTablet: json[r'isTablet'],
isOffline: json[r'isOffline'],
instanceId: json[r'instanceId'],
sections: SectionDTO.listFromJson(json[r'sections']),
resources: ResourceDTO.listFromJson(json[r'resources']),
);
static List<ExportConfigurationDTO> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <ExportConfigurationDTO>[]
: json.map((v) => ExportConfigurationDTO.fromJson(v)).toList(growable: true == growable);
static Map<String, ExportConfigurationDTO> mapFromJson(Map<String, dynamic> json) {
final map = <String, ExportConfigurationDTO>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) => map[key] = ExportConfigurationDTO.fromJson(v));
}
return map;
}
// maps a json object with a list of ExportConfigurationDTO-objects as value to a dart map
static Map<String, List<ExportConfigurationDTO>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
final map = <String, List<ExportConfigurationDTO>>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) {
map[key] = ExportConfigurationDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
});
}
return map;
}
}

View File

@ -1,80 +0,0 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.0
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class ExportConfigurationDTOAllOf {
/// Returns a new [ExportConfigurationDTOAllOf] instance.
ExportConfigurationDTOAllOf({
this.sections,
this.resources,
});
List<SectionDTO> sections;
List<ResourceDTO> resources;
@override
bool operator ==(Object other) => identical(this, other) || other is ExportConfigurationDTOAllOf &&
other.sections == sections &&
other.resources == resources;
@override
int get hashCode =>
(sections == null ? 0 : sections.hashCode) +
(resources == null ? 0 : resources.hashCode);
@override
String toString() => 'ExportConfigurationDTOAllOf[sections=$sections, resources=$resources]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (sections != null) {
json[r'sections'] = sections;
}
if (resources != null) {
json[r'resources'] = resources;
}
return json;
}
/// Returns a new [ExportConfigurationDTOAllOf] instance and imports its values from
/// [json] if it's non-null, null if [json] is null.
static ExportConfigurationDTOAllOf fromJson(Map<String, dynamic> json) => json == null
? null
: ExportConfigurationDTOAllOf(
sections: SectionDTO.listFromJson(json[r'sections']),
resources: ResourceDTO.listFromJson(json[r'resources']),
);
static List<ExportConfigurationDTOAllOf> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <ExportConfigurationDTOAllOf>[]
: json.map((v) => ExportConfigurationDTOAllOf.fromJson(v)).toList(growable: true == growable);
static Map<String, ExportConfigurationDTOAllOf> mapFromJson(Map<String, dynamic> json) {
final map = <String, ExportConfigurationDTOAllOf>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) => map[key] = ExportConfigurationDTOAllOf.fromJson(v));
}
return map;
}
// maps a json object with a list of ExportConfigurationDTOAllOf-objects as value to a dart map
static Map<String, List<ExportConfigurationDTOAllOf>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
final map = <String, List<ExportConfigurationDTOAllOf>>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) {
map[key] = ExportConfigurationDTOAllOf.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
});
}
return map;
}
}

View File

@ -1,116 +0,0 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.0
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class GeoPointDTO {
/// Returns a new [GeoPointDTO] instance.
GeoPointDTO({
this.id,
this.title,
this.description,
this.images,
this.latitude,
this.longitude,
});
int id;
List<TranslationDTO> title;
List<TranslationDTO> description;
List<ImageGeoPoint> images;
String latitude;
String longitude;
@override
bool operator ==(Object other) => identical(this, other) || other is GeoPointDTO &&
other.id == id &&
other.title == title &&
other.description == description &&
other.images == images &&
other.latitude == latitude &&
other.longitude == longitude;
@override
int get hashCode =>
(id == null ? 0 : id.hashCode) +
(title == null ? 0 : title.hashCode) +
(description == null ? 0 : description.hashCode) +
(images == null ? 0 : images.hashCode) +
(latitude == null ? 0 : latitude.hashCode) +
(longitude == null ? 0 : longitude.hashCode);
@override
String toString() => 'GeoPointDTO[id=$id, title=$title, description=$description, images=$images, latitude=$latitude, longitude=$longitude]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (id != null) {
json[r'id'] = id;
}
if (title != null) {
json[r'title'] = title;
}
if (description != null) {
json[r'description'] = description;
}
if (images != null) {
json[r'images'] = images;
}
if (latitude != null) {
json[r'latitude'] = latitude;
}
if (longitude != null) {
json[r'longitude'] = longitude;
}
return json;
}
/// Returns a new [GeoPointDTO] instance and imports its values from
/// [json] if it's non-null, null if [json] is null.
static GeoPointDTO fromJson(Map<String, dynamic> json) => json == null
? null
: GeoPointDTO(
id: json[r'id'],
title: TranslationDTO.listFromJson(json[r'title']),
description: TranslationDTO.listFromJson(json[r'description']),
images: ImageGeoPoint.listFromJson(json[r'images']),
latitude: json[r'latitude'],
longitude: json[r'longitude'],
);
static List<GeoPointDTO> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <GeoPointDTO>[]
: json.map((v) => GeoPointDTO.fromJson(v)).toList(growable: true == growable);
static Map<String, GeoPointDTO> mapFromJson(Map<String, dynamic> json) {
final map = <String, GeoPointDTO>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) => map[key] = GeoPointDTO.fromJson(v));
}
return map;
}
// maps a json object with a list of GeoPointDTO-objects as value to a dart map
static Map<String, List<GeoPointDTO>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
final map = <String, List<GeoPointDTO>>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) {
map[key] = GeoPointDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
});
}
return map;
}
}

View File

@ -1,107 +0,0 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.0
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class ImageDTO {
/// Returns a new [ImageDTO] instance.
ImageDTO({
this.title,
this.description,
this.resourceId,
this.source_,
this.order,
});
List<TranslationDTO> title;
List<TranslationDTO> description;
String resourceId;
String source_;
int order;
@override
bool operator ==(Object other) => identical(this, other) || other is ImageDTO &&
other.title == title &&
other.description == description &&
other.resourceId == resourceId &&
other.source_ == source_ &&
other.order == order;
@override
int get hashCode =>
(title == null ? 0 : title.hashCode) +
(description == null ? 0 : description.hashCode) +
(resourceId == null ? 0 : resourceId.hashCode) +
(source_ == null ? 0 : source_.hashCode) +
(order == null ? 0 : order.hashCode);
@override
String toString() => 'ImageDTO[title=$title, description=$description, resourceId=$resourceId, source_=$source_, order=$order]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (title != null) {
json[r'title'] = title;
}
if (description != null) {
json[r'description'] = description;
}
if (resourceId != null) {
json[r'resourceId'] = resourceId;
}
if (source_ != null) {
json[r'source'] = source_;
}
if (order != null) {
json[r'order'] = order;
}
return json;
}
/// Returns a new [ImageDTO] instance and imports its values from
/// [json] if it's non-null, null if [json] is null.
static ImageDTO fromJson(Map<String, dynamic> json) => json == null
? null
: ImageDTO(
title: TranslationDTO.listFromJson(json[r'title']),
description: TranslationDTO.listFromJson(json[r'description']),
resourceId: json[r'resourceId'],
source_: json[r'source'],
order: json[r'order'],
);
static List<ImageDTO> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <ImageDTO>[]
: json.map((v) => ImageDTO.fromJson(v)).toList(growable: true == growable);
static Map<String, ImageDTO> mapFromJson(Map<String, dynamic> json) {
final map = <String, ImageDTO>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) => map[key] = ImageDTO.fromJson(v));
}
return map;
}
// maps a json object with a list of ImageDTO-objects as value to a dart map
static Map<String, List<ImageDTO>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
final map = <String, List<ImageDTO>>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) {
map[key] = ImageDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
});
}
return map;
}
}

View File

@ -1,80 +0,0 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.0
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class ImageGeoPoint {
/// Returns a new [ImageGeoPoint] instance.
ImageGeoPoint({
this.imageResourceId,
this.imageSource,
});
String imageResourceId;
String imageSource;
@override
bool operator ==(Object other) => identical(this, other) || other is ImageGeoPoint &&
other.imageResourceId == imageResourceId &&
other.imageSource == imageSource;
@override
int get hashCode =>
(imageResourceId == null ? 0 : imageResourceId.hashCode) +
(imageSource == null ? 0 : imageSource.hashCode);
@override
String toString() => 'ImageGeoPoint[imageResourceId=$imageResourceId, imageSource=$imageSource]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (imageResourceId != null) {
json[r'imageResourceId'] = imageResourceId;
}
if (imageSource != null) {
json[r'imageSource'] = imageSource;
}
return json;
}
/// Returns a new [ImageGeoPoint] instance and imports its values from
/// [json] if it's non-null, null if [json] is null.
static ImageGeoPoint fromJson(Map<String, dynamic> json) => json == null
? null
: ImageGeoPoint(
imageResourceId: json[r'imageResourceId'],
imageSource: json[r'imageSource'],
);
static List<ImageGeoPoint> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <ImageGeoPoint>[]
: json.map((v) => ImageGeoPoint.fromJson(v)).toList(growable: true == growable);
static Map<String, ImageGeoPoint> mapFromJson(Map<String, dynamic> json) {
final map = <String, ImageGeoPoint>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) => map[key] = ImageGeoPoint.fromJson(v));
}
return map;
}
// maps a json object with a list of ImageGeoPoint-objects as value to a dart map
static Map<String, List<ImageGeoPoint>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
final map = <String, List<ImageGeoPoint>>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) {
map[key] = ImageGeoPoint.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
});
}
return map;
}
}

View File

@ -1,91 +0,0 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.0
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class Instance {
/// Returns a new [Instance] instance.
Instance({
this.id,
this.name,
this.dateCreation,
});
String id;
String name;
DateTime dateCreation;
@override
bool operator ==(Object other) => identical(this, other) || other is Instance &&
other.id == id &&
other.name == name &&
other.dateCreation == dateCreation;
@override
int get hashCode =>
(id == null ? 0 : id.hashCode) +
(name == null ? 0 : name.hashCode) +
(dateCreation == null ? 0 : dateCreation.hashCode);
@override
String toString() => 'Instance[id=$id, name=$name, dateCreation=$dateCreation]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (id != null) {
json[r'id'] = id;
}
if (name != null) {
json[r'name'] = name;
}
if (dateCreation != null) {
json[r'dateCreation'] = dateCreation.toUtc().toIso8601String();
}
return json;
}
/// Returns a new [Instance] instance and imports its values from
/// [json] if it's non-null, null if [json] is null.
static Instance fromJson(Map<String, dynamic> json) => json == null
? null
: Instance(
id: json[r'id'],
name: json[r'name'],
dateCreation: json[r'dateCreation'] == null
? null
: DateTime.parse(json[r'dateCreation']),
);
static List<Instance> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <Instance>[]
: json.map((v) => Instance.fromJson(v)).toList(growable: true == growable);
static Map<String, Instance> mapFromJson(Map<String, dynamic> json) {
final map = <String, Instance>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) => map[key] = Instance.fromJson(v));
}
return map;
}
// maps a json object with a list of Instance-objects as value to a dart map
static Map<String, List<Instance>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
final map = <String, List<Instance>>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) {
map[key] = Instance.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
});
}
return map;
}
}

View File

@ -1,91 +0,0 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.0
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class InstanceDTO {
/// Returns a new [InstanceDTO] instance.
InstanceDTO({
this.id,
this.name,
this.dateCreation,
});
String id;
String name;
DateTime dateCreation;
@override
bool operator ==(Object other) => identical(this, other) || other is InstanceDTO &&
other.id == id &&
other.name == name &&
other.dateCreation == dateCreation;
@override
int get hashCode =>
(id == null ? 0 : id.hashCode) +
(name == null ? 0 : name.hashCode) +
(dateCreation == null ? 0 : dateCreation.hashCode);
@override
String toString() => 'InstanceDTO[id=$id, name=$name, dateCreation=$dateCreation]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (id != null) {
json[r'id'] = id;
}
if (name != null) {
json[r'name'] = name;
}
if (dateCreation != null) {
json[r'dateCreation'] = dateCreation.toUtc().toIso8601String();
}
return json;
}
/// Returns a new [InstanceDTO] instance and imports its values from
/// [json] if it's non-null, null if [json] is null.
static InstanceDTO fromJson(Map<String, dynamic> json) => json == null
? null
: InstanceDTO(
id: json[r'id'],
name: json[r'name'],
dateCreation: json[r'dateCreation'] == null
? null
: DateTime.parse(json[r'dateCreation']),
);
static List<InstanceDTO> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <InstanceDTO>[]
: json.map((v) => InstanceDTO.fromJson(v)).toList(growable: true == growable);
static Map<String, InstanceDTO> mapFromJson(Map<String, dynamic> json) {
final map = <String, InstanceDTO>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) => map[key] = InstanceDTO.fromJson(v));
}
return map;
}
// maps a json object with a list of InstanceDTO-objects as value to a dart map
static Map<String, List<InstanceDTO>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
final map = <String, List<InstanceDTO>>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) {
map[key] = InstanceDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
});
}
return map;
}
}

View File

@ -1,89 +0,0 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.0
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class LevelDTO {
/// Returns a new [LevelDTO] instance.
LevelDTO({
this.label,
this.resourceId,
this.source_,
});
List<TranslationDTO> label;
String resourceId;
String source_;
@override
bool operator ==(Object other) => identical(this, other) || other is LevelDTO &&
other.label == label &&
other.resourceId == resourceId &&
other.source_ == source_;
@override
int get hashCode =>
(label == null ? 0 : label.hashCode) +
(resourceId == null ? 0 : resourceId.hashCode) +
(source_ == null ? 0 : source_.hashCode);
@override
String toString() => 'LevelDTO[label=$label, resourceId=$resourceId, source_=$source_]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (label != null) {
json[r'label'] = label;
}
if (resourceId != null) {
json[r'resourceId'] = resourceId;
}
if (source_ != null) {
json[r'source'] = source_;
}
return json;
}
/// Returns a new [LevelDTO] instance and imports its values from
/// [json] if it's non-null, null if [json] is null.
static LevelDTO fromJson(Map<String, dynamic> json) => json == null
? null
: LevelDTO(
label: TranslationDTO.listFromJson(json[r'label']),
resourceId: json[r'resourceId'],
source_: json[r'source'],
);
static List<LevelDTO> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <LevelDTO>[]
: json.map((v) => LevelDTO.fromJson(v)).toList(growable: true == growable);
static Map<String, LevelDTO> mapFromJson(Map<String, dynamic> json) {
final map = <String, LevelDTO>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) => map[key] = LevelDTO.fromJson(v));
}
return map;
}
// maps a json object with a list of LevelDTO-objects as value to a dart map
static Map<String, List<LevelDTO>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
final map = <String, List<LevelDTO>>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) {
map[key] = LevelDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
});
}
return map;
}
}

View File

@ -1,80 +0,0 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.0
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class LoginDTO {
/// Returns a new [LoginDTO] instance.
LoginDTO({
this.email,
this.password,
});
String email;
String password;
@override
bool operator ==(Object other) => identical(this, other) || other is LoginDTO &&
other.email == email &&
other.password == password;
@override
int get hashCode =>
(email == null ? 0 : email.hashCode) +
(password == null ? 0 : password.hashCode);
@override
String toString() => 'LoginDTO[email=$email, password=$password]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (email != null) {
json[r'email'] = email;
}
if (password != null) {
json[r'password'] = password;
}
return json;
}
/// Returns a new [LoginDTO] instance and imports its values from
/// [json] if it's non-null, null if [json] is null.
static LoginDTO fromJson(Map<String, dynamic> json) => json == null
? null
: LoginDTO(
email: json[r'email'],
password: json[r'password'],
);
static List<LoginDTO> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <LoginDTO>[]
: json.map((v) => LoginDTO.fromJson(v)).toList(growable: true == growable);
static Map<String, LoginDTO> mapFromJson(Map<String, dynamic> json) {
final map = <String, LoginDTO>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) => map[key] = LoginDTO.fromJson(v));
}
return map;
}
// maps a json object with a list of LoginDTO-objects as value to a dart map
static Map<String, List<LoginDTO>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
final map = <String, List<LoginDTO>>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) {
map[key] = LoginDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
});
}
return map;
}
}

View File

@ -1,107 +0,0 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.0
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class MapDTO {
/// Returns a new [MapDTO] instance.
MapDTO({
this.zoom,
this.mapType,
this.points,
this.iconResourceId,
this.iconSource,
});
int zoom;
MapTypeApp mapType;
List<GeoPointDTO> points;
String iconResourceId;
String iconSource;
@override
bool operator ==(Object other) => identical(this, other) || other is MapDTO &&
other.zoom == zoom &&
other.mapType == mapType &&
other.points == points &&
other.iconResourceId == iconResourceId &&
other.iconSource == iconSource;
@override
int get hashCode =>
(zoom == null ? 0 : zoom.hashCode) +
(mapType == null ? 0 : mapType.hashCode) +
(points == null ? 0 : points.hashCode) +
(iconResourceId == null ? 0 : iconResourceId.hashCode) +
(iconSource == null ? 0 : iconSource.hashCode);
@override
String toString() => 'MapDTO[zoom=$zoom, mapType=$mapType, points=$points, iconResourceId=$iconResourceId, iconSource=$iconSource]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (zoom != null) {
json[r'zoom'] = zoom;
}
if (mapType != null) {
json[r'mapType'] = mapType;
}
if (points != null) {
json[r'points'] = points;
}
if (iconResourceId != null) {
json[r'iconResourceId'] = iconResourceId;
}
if (iconSource != null) {
json[r'iconSource'] = iconSource;
}
return json;
}
/// Returns a new [MapDTO] instance and imports its values from
/// [json] if it's non-null, null if [json] is null.
static MapDTO fromJson(Map<String, dynamic> json) => json == null
? null
: MapDTO(
zoom: json[r'zoom'],
mapType: MapTypeApp.fromJson(json[r'mapType']),
points: GeoPointDTO.listFromJson(json[r'points']),
iconResourceId: json[r'iconResourceId'],
iconSource: json[r'iconSource'],
);
static List<MapDTO> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <MapDTO>[]
: json.map((v) => MapDTO.fromJson(v)).toList(growable: true == growable);
static Map<String, MapDTO> mapFromJson(Map<String, dynamic> json) {
final map = <String, MapDTO>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) => map[key] = MapDTO.fromJson(v));
}
return map;
}
// maps a json object with a list of MapDTO-objects as value to a dart map
static Map<String, List<MapDTO>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
final map = <String, List<MapDTO>>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) {
map[key] = MapDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
});
}
return map;
}
}

View File

@ -1,85 +0,0 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.0
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class MapType {
/// Instantiate a new enum with the provided [value].
const MapType._(this.value);
/// The underlying value of this enum member.
final String value;
@override
String toString() => value;
String toJson() => value;
static const none = MapType._(r'none');
static const normal = MapType._(r'normal');
static const satellite = MapType._(r'satellite');
static const terrain = MapType._(r'terrain');
static const hybrid = MapType._(r'hybrid');
/// List of all possible values in this [enum][MapType].
static const values = <MapType>[
none,
normal,
satellite,
terrain,
hybrid,
];
static MapType fromJson(dynamic value) =>
MapTypeTypeTransformer().decode(value);
static List<MapType> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <MapType>[]
: json
.map((value) => MapType.fromJson(value))
.toList(growable: true == growable);
}
/// Transformation class that can [encode] an instance of [MapType] to String,
/// and [decode] dynamic data back to [MapType].
class MapTypeTypeTransformer {
const MapTypeTypeTransformer._();
factory MapTypeTypeTransformer() => _instance ??= MapTypeTypeTransformer._();
String encode(MapType data) => data.value;
/// Decodes a [dynamic value][data] to a MapType.
///
/// 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.
MapType decode(dynamic data, {bool allowNull}) {
switch (data) {
case r'none': return MapType.none;
case r'normal': return MapType.normal;
case r'satellite': return MapType.satellite;
case r'terrain': return MapType.terrain;
case r'hybrid': return MapType.hybrid;
default:
if (allowNull == false) {
throw ArgumentError('Unknown enum value to decode: $data');
}
}
return null;
}
/// Singleton [MapTypeTypeTransformer] instance.
static MapTypeTypeTransformer _instance;
}

View File

@ -1,85 +0,0 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.0
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class MapTypeApp {
/// Instantiate a new enum with the provided [value].
const MapTypeApp._(this.value);
/// The underlying value of this enum member.
final String value;
@override
String toString() => value;
String toJson() => value;
static const none = MapTypeApp._(r'none');
static const normal = MapTypeApp._(r'normal');
static const satellite = MapTypeApp._(r'satellite');
static const terrain = MapTypeApp._(r'terrain');
static const hybrid = MapTypeApp._(r'hybrid');
/// List of all possible values in this [enum][MapTypeApp].
static const values = <MapTypeApp>[
none,
normal,
satellite,
terrain,
hybrid,
];
static MapTypeApp fromJson(dynamic value) =>
MapTypeAppTypeTransformer().decode(value);
static List<MapTypeApp> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <MapTypeApp>[]
: json
.map((value) => MapTypeApp.fromJson(value))
.toList(growable: true == growable);
}
/// Transformation class that can [encode] an instance of [MapTypeApp] to String,
/// and [decode] dynamic data back to [MapTypeApp].
class MapTypeAppTypeTransformer {
const MapTypeAppTypeTransformer._();
factory MapTypeAppTypeTransformer() => _instance ??= MapTypeAppTypeTransformer._();
String encode(MapTypeApp data) => data.value;
/// Decodes a [dynamic value][data] to a MapTypeApp.
///
/// 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.
MapTypeApp decode(dynamic data, {bool allowNull}) {
switch (data) {
case r'none': return MapTypeApp.none;
case r'normal': return MapTypeApp.normal;
case r'satellite': return MapTypeApp.satellite;
case r'terrain': return MapTypeApp.terrain;
case r'hybrid': return MapTypeApp.hybrid;
default:
if (allowNull == false) {
throw ArgumentError('Unknown enum value to decode: $data');
}
}
return null;
}
/// Singleton [MapTypeAppTypeTransformer] instance.
static MapTypeAppTypeTransformer _instance;
}

View File

@ -1,71 +0,0 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.0
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class MenuDTO {
/// Returns a new [MenuDTO] instance.
MenuDTO({
this.sections,
});
List<SectionDTO> sections;
@override
bool operator ==(Object other) => identical(this, other) || other is MenuDTO &&
other.sections == sections;
@override
int get hashCode =>
(sections == null ? 0 : sections.hashCode);
@override
String toString() => 'MenuDTO[sections=$sections]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (sections != null) {
json[r'sections'] = sections;
}
return json;
}
/// Returns a new [MenuDTO] instance and imports its values from
/// [json] if it's non-null, null if [json] is null.
static MenuDTO fromJson(Map<String, dynamic> json) => json == null
? null
: MenuDTO(
sections: SectionDTO.listFromJson(json[r'sections']),
);
static List<MenuDTO> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <MenuDTO>[]
: json.map((v) => MenuDTO.fromJson(v)).toList(growable: true == growable);
static Map<String, MenuDTO> mapFromJson(Map<String, dynamic> json) {
final map = <String, MenuDTO>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) => map[key] = MenuDTO.fromJson(v));
}
return map;
}
// maps a json object with a list of MenuDTO-objects as value to a dart map
static Map<String, List<MenuDTO>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
final map = <String, List<MenuDTO>>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) {
map[key] = MenuDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
});
}
return map;
}
}

View File

@ -1,80 +0,0 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.0
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class PlayerMessageDTO {
/// Returns a new [PlayerMessageDTO] instance.
PlayerMessageDTO({
this.configChanged,
this.isDeleted,
});
bool configChanged;
bool isDeleted;
@override
bool operator ==(Object other) => identical(this, other) || other is PlayerMessageDTO &&
other.configChanged == configChanged &&
other.isDeleted == isDeleted;
@override
int get hashCode =>
(configChanged == null ? 0 : configChanged.hashCode) +
(isDeleted == null ? 0 : isDeleted.hashCode);
@override
String toString() => 'PlayerMessageDTO[configChanged=$configChanged, isDeleted=$isDeleted]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (configChanged != null) {
json[r'configChanged'] = configChanged;
}
if (isDeleted != null) {
json[r'isDeleted'] = isDeleted;
}
return json;
}
/// Returns a new [PlayerMessageDTO] instance and imports its values from
/// [json] if it's non-null, null if [json] is null.
static PlayerMessageDTO fromJson(Map<String, dynamic> json) => json == null
? null
: PlayerMessageDTO(
configChanged: json[r'configChanged'],
isDeleted: json[r'isDeleted'],
);
static List<PlayerMessageDTO> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <PlayerMessageDTO>[]
: json.map((v) => PlayerMessageDTO.fromJson(v)).toList(growable: true == growable);
static Map<String, PlayerMessageDTO> mapFromJson(Map<String, dynamic> json) {
final map = <String, PlayerMessageDTO>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) => map[key] = PlayerMessageDTO.fromJson(v));
}
return map;
}
// maps a json object with a list of PlayerMessageDTO-objects as value to a dart map
static Map<String, List<PlayerMessageDTO>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
final map = <String, List<PlayerMessageDTO>>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) {
map[key] = PlayerMessageDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
});
}
return map;
}
}

View File

@ -1,107 +0,0 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.0
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class QuestionDTO {
/// Returns a new [QuestionDTO] instance.
QuestionDTO({
this.label,
this.responses,
this.resourceId,
this.source_,
this.order,
});
List<TranslationDTO> label;
List<ResponseDTO> responses;
String resourceId;
String source_;
int order;
@override
bool operator ==(Object other) => identical(this, other) || other is QuestionDTO &&
other.label == label &&
other.responses == responses &&
other.resourceId == resourceId &&
other.source_ == source_ &&
other.order == order;
@override
int get hashCode =>
(label == null ? 0 : label.hashCode) +
(responses == null ? 0 : responses.hashCode) +
(resourceId == null ? 0 : resourceId.hashCode) +
(source_ == null ? 0 : source_.hashCode) +
(order == null ? 0 : order.hashCode);
@override
String toString() => 'QuestionDTO[label=$label, responses=$responses, resourceId=$resourceId, source_=$source_, order=$order]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (label != null) {
json[r'label'] = label;
}
if (responses != null) {
json[r'responses'] = responses;
}
if (resourceId != null) {
json[r'resourceId'] = resourceId;
}
if (source_ != null) {
json[r'source'] = source_;
}
if (order != null) {
json[r'order'] = order;
}
return json;
}
/// Returns a new [QuestionDTO] instance and imports its values from
/// [json] if it's non-null, null if [json] is null.
static QuestionDTO fromJson(Map<String, dynamic> json) => json == null
? null
: QuestionDTO(
label: TranslationDTO.listFromJson(json[r'label']),
responses: ResponseDTO.listFromJson(json[r'responses']),
resourceId: json[r'resourceId'],
source_: json[r'source'],
order: json[r'order'],
);
static List<QuestionDTO> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <QuestionDTO>[]
: json.map((v) => QuestionDTO.fromJson(v)).toList(growable: true == growable);
static Map<String, QuestionDTO> mapFromJson(Map<String, dynamic> json) {
final map = <String, QuestionDTO>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) => map[key] = QuestionDTO.fromJson(v));
}
return map;
}
// maps a json object with a list of QuestionDTO-objects as value to a dart map
static Map<String, List<QuestionDTO>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
final map = <String, List<QuestionDTO>>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) {
map[key] = QuestionDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
});
}
return map;
}
}

View File

@ -1,107 +0,0 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.0
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class QuizzDTO {
/// Returns a new [QuizzDTO] instance.
QuizzDTO({
this.questions,
this.badLevel,
this.mediumLevel,
this.goodLevel,
this.greatLevel,
});
List<QuestionDTO> questions;
LevelDTO badLevel;
LevelDTO mediumLevel;
LevelDTO goodLevel;
LevelDTO greatLevel;
@override
bool operator ==(Object other) => identical(this, other) || other is QuizzDTO &&
other.questions == questions &&
other.badLevel == badLevel &&
other.mediumLevel == mediumLevel &&
other.goodLevel == goodLevel &&
other.greatLevel == greatLevel;
@override
int get hashCode =>
(questions == null ? 0 : questions.hashCode) +
(badLevel == null ? 0 : badLevel.hashCode) +
(mediumLevel == null ? 0 : mediumLevel.hashCode) +
(goodLevel == null ? 0 : goodLevel.hashCode) +
(greatLevel == null ? 0 : greatLevel.hashCode);
@override
String toString() => 'QuizzDTO[questions=$questions, badLevel=$badLevel, mediumLevel=$mediumLevel, goodLevel=$goodLevel, greatLevel=$greatLevel]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (questions != null) {
json[r'questions'] = questions;
}
if (badLevel != null) {
json[r'bad_level'] = badLevel;
}
if (mediumLevel != null) {
json[r'medium_level'] = mediumLevel;
}
if (goodLevel != null) {
json[r'good_level'] = goodLevel;
}
if (greatLevel != null) {
json[r'great_level'] = greatLevel;
}
return json;
}
/// Returns a new [QuizzDTO] instance and imports its values from
/// [json] if it's non-null, null if [json] is null.
static QuizzDTO fromJson(Map<String, dynamic> json) => json == null
? null
: QuizzDTO(
questions: QuestionDTO.listFromJson(json[r'questions']),
badLevel: LevelDTO.fromJson(json[r'bad_level']),
mediumLevel: LevelDTO.fromJson(json[r'medium_level']),
goodLevel: LevelDTO.fromJson(json[r'good_level']),
greatLevel: LevelDTO.fromJson(json[r'great_level']),
);
static List<QuizzDTO> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <QuizzDTO>[]
: json.map((v) => QuizzDTO.fromJson(v)).toList(growable: true == growable);
static Map<String, QuizzDTO> mapFromJson(Map<String, dynamic> json) {
final map = <String, QuizzDTO>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) => map[key] = QuizzDTO.fromJson(v));
}
return map;
}
// maps a json object with a list of QuizzDTO-objects as value to a dart map
static Map<String, List<QuizzDTO>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
final map = <String, List<QuizzDTO>>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) {
map[key] = QuizzDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
});
}
return map;
}
}

Some files were not shown because too many files have changed in this diff Show More