Unico3.Link.API

<back to all web services

RiferimentoImpianto

Assistenza
The following routes are available for this service:
PUT/assistenza/impianti/riferimenti
PUT,GET/assistenza/impianti/riferimenti/id/{Id}
PUT,GET/assistenza/impianti/riferimenti/codiceexport/{CodiceExport}
import 'package:servicestack/servicestack.dart';

abstract class FK
{
    int? Id;

    FK({this.Id});
    FK.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Id = json['Id'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Id': Id
    };

    getTypeName() => "FK";
    TypeContext? context = _ctx;
}

class FK_Impianto extends FK implements IUniqueCodiceNumerico, IUniqueCodiceExport, IConvertible
{
    int? Codice;
    String? CodiceExport;

    FK_Impianto({this.Codice,this.CodiceExport});
    FK_Impianto.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        Codice = json['Codice'];
        CodiceExport = json['CodiceExport'];
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'Codice': Codice,
        'CodiceExport': CodiceExport
    });

    getTypeName() => "FK_Impianto";
    TypeContext? context = _ctx;
}

class FK_Anagrafica extends FK implements IUniqueCodiceNumerico, IUniqueCodiceExport, IConvertible
{
    int? Codice;
    String? CodiceExport;

    FK_Anagrafica({this.Codice,this.CodiceExport});
    FK_Anagrafica.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        Codice = json['Codice'];
        CodiceExport = json['CodiceExport'];
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'Codice': Codice,
        'CodiceExport': CodiceExport
    });

    getTypeName() => "FK_Anagrafica";
    TypeContext? context = _ctx;
}

enum RuoloRiferimentoImpianto
{
    Cliente,
    Amministratore,
    Installatore,
    Proprietario,
    TerzoResponsabile,
    Progettista,
    Referente,
    Occupante,
    Conduttore,
}

class OptionalNullableDateTime extends Optional<DateTime> implements IConvertible
{
    OptionalNullableDateTime();
    OptionalNullableDateTime.fromJson(Map<String, dynamic> json) : super.fromJson(json);
    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson();
    getTypeName() => "OptionalNullableDateTime";
    TypeContext? context = _ctx;
}

class RiferimentoImpianto implements IConvertible
{
    int? Id;
    String? CodiceExport;
    FK_Impianto? Impianto;
    FK_Anagrafica? Anagrafica;
    RuoloRiferimentoImpianto? Ruolo;
    String? Note;
    OptionalNullableDateTime? DataInizioIncarico;

    RiferimentoImpianto({this.Id,this.CodiceExport,this.Impianto,this.Anagrafica,this.Ruolo,this.Note,this.DataInizioIncarico});
    RiferimentoImpianto.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Id = json['Id'];
        CodiceExport = json['CodiceExport'];
        Impianto = JsonConverters.fromJson(json['Impianto'],'FK_Impianto',context!);
        Anagrafica = JsonConverters.fromJson(json['Anagrafica'],'FK_Anagrafica',context!);
        Ruolo = JsonConverters.fromJson(json['Ruolo'],'RuoloRiferimentoImpianto',context!);
        Note = json['Note'];
        DataInizioIncarico = JsonConverters.fromJson(json['DataInizioIncarico'],'OptionalNullableDateTime',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Id': Id,
        'CodiceExport': CodiceExport,
        'Impianto': JsonConverters.toJson(Impianto,'FK_Impianto',context!),
        'Anagrafica': JsonConverters.toJson(Anagrafica,'FK_Anagrafica',context!),
        'Ruolo': JsonConverters.toJson(Ruolo,'RuoloRiferimentoImpianto',context!),
        'Note': Note,
        'DataInizioIncarico': JsonConverters.toJson(DataInizioIncarico,'OptionalNullableDateTime',context!)
    };

    getTypeName() => "RiferimentoImpianto";
    TypeContext? context = _ctx;
}

class Optional<T> implements IConvertible
{
    String? Value;

    Optional({this.Value});
    Optional.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Value = JsonConverters.fromJson(json['Value'],'Nullable<${runtimeGenericTypeDefs(this,[0]).join(",")}>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Value': JsonConverters.toJson(Value,'String',context!)
    };

    getTypeName() => "Optional<$T>";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'link.dc8.unico3.cloud', types: <String, TypeInfo> {
    'FK': TypeInfo(TypeOf.AbstractClass),
    'FK_Impianto': TypeInfo(TypeOf.Class, create:() => FK_Impianto()),
    'FK_Anagrafica': TypeInfo(TypeOf.Class, create:() => FK_Anagrafica()),
    'RuoloRiferimentoImpianto': TypeInfo(TypeOf.Enum, enumValues:RuoloRiferimentoImpianto.values),
    'OptionalNullableDateTime': TypeInfo(TypeOf.Class, create:() => OptionalNullableDateTime()),
    'RiferimentoImpianto': TypeInfo(TypeOf.Class, create:() => RiferimentoImpianto()),
    'Optional<T>': TypeInfo(TypeOf.GenericDef,create:() => Optional()),
});

Dart RiferimentoImpianto DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

PUT /assistenza/impianti/riferimenti HTTP/1.1 
Host: unico3.link.api 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"Id":0,"CodiceExport":"String","Impianto":{"Codice":0,"CodiceExport":"String","Id":0},"Anagrafica":{"Codice":0,"CodiceExport":"String","Id":0},"Ruolo":"0","Note":"String","DataInizioIncarico":{"Value":"0001-01-01T00:00:00.0000000"}}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"Id":0,"CodiceExport":"String","Impianto":{"Codice":0,"CodiceExport":"String","Id":0},"Anagrafica":{"Codice":0,"CodiceExport":"String","Id":0},"Ruolo":"0","Note":"String","DataInizioIncarico":{"Value":"0001-01-01T00:00:00.0000000"}}