Agentivity API

<back to all web services

GetAirSegmentsPerAccountByVendor

The following routes are available for this service:
GET/AirSegmentsPerAccountByVendor
import 'package:servicestack/servicestack.dart';

// @DataContract(Name="Metadata", Namespace="schemas.agentivity.com/types")
class PagingMetadata implements IConvertible
{
    /**
    * Starting Record
    */
    // @DataMember
    // @ApiMember(DataType="string", Description="Starting Record", Name="Offset", ParameterType="query")
    String? Offset;

    /**
    * Number of records to return (PageSize)
    */
    // @DataMember
    // @ApiMember(DataType="string", Description="Number of records to return (PageSize)", Name="Limit", ParameterType="query")
    String? Limit;

    /**
    * Total Number of Records in a Full Reponse (if no paging)
    */
    // @DataMember
    // @ApiMember(DataType="string", Description="Total Number of Records in a Full Reponse (if no paging)", Name="TotalRecords", ParameterType="query")
    int? TotalRecords;

    /**
    * Total Number of Records in this Reponse (on this page)
    */
    // @DataMember
    // @ApiMember(DataType="string", Description="Total Number of Records in this Reponse (on this page)", Name="ResponseRecords", ParameterType="query")
    int? ResponseRecords;

    PagingMetadata({this.Offset,this.Limit,this.TotalRecords,this.ResponseRecords});
    PagingMetadata.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Offset = json['Offset'];
        Limit = json['Limit'];
        TotalRecords = json['TotalRecords'];
        ResponseRecords = json['ResponseRecords'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Offset': Offset,
        'Limit': Limit,
        'TotalRecords': TotalRecords,
        'ResponseRecords': ResponseRecords
    };

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

// @DataContract(Namespace="schemas.agentivity.com/types")
abstract class CompanyLevelRequestBase extends PagingMetadata implements IMemberUsername, IMemberOwningCompanyCode
{
    /**
    * Comma Delimited List of Owning Company Codes
    */
    // @DataMember
    List<String>? OwningCompanyCode;

    /**
    * UserName in form of an email address
    */
    // @DataMember
    String? UserName;

    CompanyLevelRequestBase({this.OwningCompanyCode,this.UserName});
    CompanyLevelRequestBase.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

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

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

// @DataContract(Name="AirSegmentPerAccountByVendor", Namespace="schemas.agentivity.com/types")
class AirSegmentPerAccountByVendor implements IConvertible
{
    // @DataMember(Order=10)
    String? Account;

    // @DataMember(Order=20)
    int? TotalAirSegments;

    AirSegmentPerAccountByVendor({this.Account,this.TotalAirSegments});
    AirSegmentPerAccountByVendor.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

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

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

// @DataContract(Namespace="schemas.agentivity.com/types")
class Report<TItemResponse,TItem> implements IConvertible
{
    // @DataMember(Order=1, EmitDefaultValue=false)
    TItem? Item;

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

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

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

    getTypeName() => "Report<$TItemResponse,$TItem>";
    TypeContext? context = _ctx;
}

// @DataContract(Name="AirSegmentPerAccountByVendor", Namespace="schemas.agentivity.com/types")
class AirSegmentsPerAccountByVendorResponseReport extends Report<AirSegmentsPerAccountByVendorItemResponse,AirSegmentPerAccountByVendor> implements IConvertible
{
    AirSegmentsPerAccountByVendorResponseReport();
    AirSegmentsPerAccountByVendorResponseReport.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() => "AirSegmentsPerAccountByVendorResponseReport";
    TypeContext? context = _ctx;
}

// @DataContract(Name="CacheMetadata", Namespace="schemas.agentivity.com/types")
class CacheMetadata implements IConvertible
{
    // @DataMember(Order=1)
    DateTime? CachedAt;

    // @DataMember(Order=2)
    DateTime? CacheExpiresAt;

    // @DataMember(Order=0)
    bool? IsFromCache;

    CacheMetadata({this.CachedAt,this.CacheExpiresAt,this.IsFromCache});
    CacheMetadata.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        CachedAt = JsonConverters.fromJson(json['CachedAt'],'DateTime',context!);
        CacheExpiresAt = JsonConverters.fromJson(json['CacheExpiresAt'],'DateTime',context!);
        IsFromCache = json['IsFromCache'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'CachedAt': JsonConverters.toJson(CachedAt,'DateTime',context!),
        'CacheExpiresAt': JsonConverters.toJson(CacheExpiresAt,'DateTime',context!),
        'IsFromCache': IsFromCache
    };

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

// @DataContract(Name="ResponseMetadata", Namespace="schemas.agentivity.com/types")
class ResponseMetadata implements IConvertible
{
    // @DataMember(Order=0)
    bool? Success;

    // @DataMember(Order=1)
    bool? HasCache;

    // @DataMember(Order=2)
    bool? HasPaging;

    // @DataMember(Order=3, EmitDefaultValue=false)
    CacheMetadata? CacheMetadata;

    // @DataMember(Order=4, EmitDefaultValue=false)
    PagingMetadata? PagingMetadata;

    ResponseMetadata({this.Success,this.HasCache,this.HasPaging,this.CacheMetadata,this.PagingMetadata});
    ResponseMetadata.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Success = json['Success'];
        HasCache = json['HasCache'];
        HasPaging = json['HasPaging'];
        CacheMetadata = JsonConverters.fromJson(json['CacheMetadata'],'CacheMetadata',context!);
        PagingMetadata = JsonConverters.fromJson(json['PagingMetadata'],'PagingMetadata',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Success': Success,
        'HasCache': HasCache,
        'HasPaging': HasPaging,
        'CacheMetadata': JsonConverters.toJson(CacheMetadata,'CacheMetadata',context!),
        'PagingMetadata': JsonConverters.toJson(PagingMetadata,'PagingMetadata',context!)
    };

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

// @DataContract(Name="ResponseMetadata", Namespace="schemas.agentivity.com/types")
class AgentivityError implements IConvertible
{
    // @DataMember
    String? ErrorCode;

    // @DataMember
    String? Message;

    // @DataMember
    String? StatusCode;

    // @DataMember
    String? VerboseMessage;

    AgentivityError({this.ErrorCode,this.Message,this.StatusCode,this.VerboseMessage});
    AgentivityError.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        ErrorCode = json['ErrorCode'];
        Message = json['Message'];
        StatusCode = json['StatusCode'];
        VerboseMessage = json['VerboseMessage'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'ErrorCode': ErrorCode,
        'Message': Message,
        'StatusCode': StatusCode,
        'VerboseMessage': VerboseMessage
    };

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

// @DataContract(Name="AgentivityResponse", Namespace="schemas.agentivity.com/types")
class ItemResponse<TItem,TReport> implements IConvertible
{
    // @DataMember(Order=1)
    ResponseMetadata? ResponseMetadata;

    // @DataMember(Order=2, EmitDefaultValue=false)
    TReport? ResponseReport;

    // @DataMember(Order=3, EmitDefaultValue=false)
    AgentivityError? ResponseError;

    ItemResponse({this.ResponseMetadata,this.ResponseReport,this.ResponseError});
    ItemResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        ResponseMetadata = JsonConverters.fromJson(json['ResponseMetadata'],'ResponseMetadata',context!);
        ResponseReport = JsonConverters.fromJson(json['ResponseReport'],'TReport',context!);
        ResponseError = JsonConverters.fromJson(json['ResponseError'],'AgentivityError',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'ResponseMetadata': JsonConverters.toJson(ResponseMetadata,'ResponseMetadata',context!),
        'ResponseReport': JsonConverters.toJson(ResponseReport,'TReport',context!),
        'ResponseError': JsonConverters.toJson(ResponseError,'AgentivityError',context!)
    };

    getTypeName() => "ItemResponse<$TItem,$TReport>";
    TypeContext? context = _ctx;
}

// @DataContract(Name="AgentivityResponse", Namespace="schemas.agentivity.com/types")
class AirSegmentsPerAccountByVendorItemResponse extends ItemResponse<AirSegmentPerAccountByVendor,AirSegmentsPerAccountByVendorResponseReport> implements IConvertible
{
    AirSegmentsPerAccountByVendorItemResponse();
    AirSegmentsPerAccountByVendorItemResponse.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() => "AirSegmentsPerAccountByVendorItemResponse";
    TypeContext? context = _ctx;
}

// @DataContract(Namespace="schemas.agentivity.com/types")
class GetAirSegmentsPerAccountByVendor extends CompanyLevelRequestBase implements IConvertible
{
    /**
    * Date in format YYYYMMDD
    */
    // @DataMember
    String? DateStart;

    /**
    * Date in format YYYYMMDD
    */
    // @DataMember
    String? DateEnd;

    /**
    * Vendor code
    */
    // @DataMember
    String? VendorCode;

    GetAirSegmentsPerAccountByVendor({this.DateStart,this.DateEnd,this.VendorCode});
    GetAirSegmentsPerAccountByVendor.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'DateStart': DateStart,
        'DateEnd': DateEnd,
        'VendorCode': VendorCode
    });

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

TypeContext _ctx = TypeContext(library: 'api.agentivity.com', types: <String, TypeInfo> {
    'PagingMetadata': TypeInfo(TypeOf.Class, create:() => PagingMetadata()),
    'CompanyLevelRequestBase': TypeInfo(TypeOf.AbstractClass),
    'AirSegmentPerAccountByVendor': TypeInfo(TypeOf.Class, create:() => AirSegmentPerAccountByVendor()),
    'Report<TItemResponse,TItem>': TypeInfo(TypeOf.GenericDef,create:() => Report()),
    'AirSegmentsPerAccountByVendorResponseReport': TypeInfo(TypeOf.Class, create:() => AirSegmentsPerAccountByVendorResponseReport()),
    'CacheMetadata': TypeInfo(TypeOf.Class, create:() => CacheMetadata()),
    'ResponseMetadata': TypeInfo(TypeOf.Class, create:() => ResponseMetadata()),
    'AgentivityError': TypeInfo(TypeOf.Class, create:() => AgentivityError()),
    'ItemResponse<TItem,TReport>': TypeInfo(TypeOf.GenericDef,create:() => ItemResponse()),
    'AirSegmentsPerAccountByVendorItemResponse': TypeInfo(TypeOf.Class, create:() => AirSegmentsPerAccountByVendorItemResponse()),
    'GetAirSegmentsPerAccountByVendor': TypeInfo(TypeOf.Class, create:() => GetAirSegmentsPerAccountByVendor()),
});

Dart GetAirSegmentsPerAccountByVendor 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.

GET /AirSegmentsPerAccountByVendor HTTP/1.1 
Host: api.agentivity.com 
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"ResponseMetadata":{"Success":false,"HasCache":false,"HasPaging":false,"CacheMetadata":{"IsFromCache":false,"CachedAt":"\/Date(-62135596800000-0000)\/","CacheExpiresAt":"\/Date(-62135596800000-0000)\/"},"PagingMetadata":{"Offset":"String","Limit":"String","TotalRecords":0,"ResponseRecords":0}},"ResponseReport":{"Item":{"Account":"String","TotalAirSegments":0}},"ResponseError":{"ErrorCode":"String","Message":"String","StatusCode":"String","VerboseMessage":"String"}}