Trendsic Platform Service

<back to all web services

GiftCardSurveyRequest

Requires Authentication
Requires any of the roles:Agent, Administrator
The following routes are available for this service:
GET/v1/Survey/GiftCard/{UID}
import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';

class SurveyQuestion implements IConvertible
{
    int? QuestionId;
    String? QuestionType;
    String? HTML;
    String? DependsOn;

    SurveyQuestion({this.QuestionId,this.QuestionType,this.HTML,this.DependsOn});
    SurveyQuestion.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        QuestionId = json['QuestionId'];
        QuestionType = json['QuestionType'];
        HTML = json['HTML'];
        DependsOn = json['DependsOn'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'QuestionId': QuestionId,
        'QuestionType': QuestionType,
        'HTML': HTML,
        'DependsOn': DependsOn
    };

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

class Survey implements IConvertible
{
    int? SurveyId;
    int? ContactId;
    List<SurveyQuestion>? Questions = [];

    Survey({this.SurveyId,this.ContactId,this.Questions});
    Survey.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        SurveyId = json['SurveyId'];
        ContactId = json['ContactId'];
        Questions = JsonConverters.fromJson(json['Questions'],'List<SurveyQuestion>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'SurveyId': SurveyId,
        'ContactId': ContactId,
        'Questions': JsonConverters.toJson(Questions,'List<SurveyQuestion>',context!)
    };

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

class GiftCardSurvey extends Survey implements IConvertible
{
    int? GiftCardId;
    List<String>? GiftCards = [];

    GiftCardSurvey({this.GiftCardId,this.GiftCards});
    GiftCardSurvey.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        GiftCardId = json['GiftCardId'];
        GiftCards = JsonConverters.fromJson(json['GiftCards'],'List<String>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'GiftCardId': GiftCardId,
        'GiftCards': JsonConverters.toJson(GiftCards,'List<String>',context!)
    });

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

class GiftCardSurveyResponse implements IConvertible
{
    GiftCardSurvey? Survey;
    ResponseStatus? ResponseStatus;

    GiftCardSurveyResponse({this.Survey,this.ResponseStatus});
    GiftCardSurveyResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Survey = JsonConverters.fromJson(json['Survey'],'GiftCardSurvey',context!);
        ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
        return this;
    }

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

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

class GiftCardSurveyRequest implements IConvertible
{
    String? UID;

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

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

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

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

TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
    'SurveyQuestion': TypeInfo(TypeOf.Class, create:() => SurveyQuestion()),
    'Survey': TypeInfo(TypeOf.Class, create:() => Survey()),
    'List<SurveyQuestion>': TypeInfo(TypeOf.Class, create:() => <SurveyQuestion>[]),
    'GiftCardSurvey': TypeInfo(TypeOf.Class, create:() => GiftCardSurvey()),
    'GiftCardSurveyResponse': TypeInfo(TypeOf.Class, create:() => GiftCardSurveyResponse()),
    'GiftCardSurveyRequest': TypeInfo(TypeOf.Class, create:() => GiftCardSurveyRequest()),
});

Dart GiftCardSurveyRequest DTOs

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

HTTP + XML

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

GET /v1/Survey/GiftCard/{UID} HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<GiftCardSurveyResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <ResponseStatus xmlns:d2p1="http://schemas.servicestack.net/types">
    <d2p1:ErrorCode>String</d2p1:ErrorCode>
    <d2p1:Message>String</d2p1:Message>
    <d2p1:StackTrace>String</d2p1:StackTrace>
    <d2p1:Errors>
      <d2p1:ResponseError>
        <d2p1:ErrorCode>String</d2p1:ErrorCode>
        <d2p1:FieldName>String</d2p1:FieldName>
        <d2p1:Message>String</d2p1:Message>
        <d2p1:Meta xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
          <d5p1:KeyValueOfstringstring>
            <d5p1:Key>String</d5p1:Key>
            <d5p1:Value>String</d5p1:Value>
          </d5p1:KeyValueOfstringstring>
        </d2p1:Meta>
      </d2p1:ResponseError>
    </d2p1:Errors>
    <d2p1:Meta xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:KeyValueOfstringstring>
        <d3p1:Key>String</d3p1:Key>
        <d3p1:Value>String</d3p1:Value>
      </d3p1:KeyValueOfstringstring>
    </d2p1:Meta>
  </ResponseStatus>
  <Survey>
    <ContactId>0</ContactId>
    <Questions>
      <SurveyQuestion>
        <DependsOn>String</DependsOn>
        <HTML>String</HTML>
        <QuestionId>0</QuestionId>
        <QuestionType>String</QuestionType>
      </SurveyQuestion>
    </Questions>
    <SurveyId>0</SurveyId>
    <GiftCardId>0</GiftCardId>
    <GiftCards xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:string>String</d3p1:string>
    </GiftCards>
  </Survey>
</GiftCardSurveyResponse>