Required role: | SystemAdministrator |
PATCH | /accounts/{accountId} |
---|
import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';
abstract class EntityInfo
{
/**
* The ID of the object
*/
// @ApiMember(Description="The ID of the object")
String? id;
/**
* The date the object was created
*/
// @ApiMember(Description="The date the object was created")
String? dateCreated;
/**
* The date the object was last modified
*/
// @ApiMember(Description="The date the object was last modified")
String? dateLastModified;
/**
* The user that created this object
*/
// @ApiMember(Description="The user that created this object")
String? createdBy;
/**
* The user that last modified this object
*/
// @ApiMember(Description="The user that last modified this object")
String? lastModifiedBy;
EntityInfo({this.id,this.dateCreated,this.dateLastModified,this.createdBy,this.lastModifiedBy});
EntityInfo.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
id = json['id'];
dateCreated = json['dateCreated'];
dateLastModified = json['dateLastModified'];
createdBy = json['createdBy'];
lastModifiedBy = json['lastModifiedBy'];
return this;
}
Map<String, dynamic> toJson() => {
'id': id,
'dateCreated': dateCreated,
'dateLastModified': dateLastModified,
'createdBy': createdBy,
'lastModifiedBy': lastModifiedBy
};
getTypeName() => "EntityInfo";
TypeContext? context = _ctx;
}
class BillingItem implements IConvertible
{
double? baseCost;
double? rawUnitMultiplier;
double? unitCost;
int? allowance;
BillingItem({this.baseCost,this.rawUnitMultiplier,this.unitCost,this.allowance});
BillingItem.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
baseCost = JsonConverters.toDouble(json['baseCost']);
rawUnitMultiplier = JsonConverters.toDouble(json['rawUnitMultiplier']);
unitCost = JsonConverters.toDouble(json['unitCost']);
allowance = json['allowance'];
return this;
}
Map<String, dynamic> toJson() => {
'baseCost': baseCost,
'rawUnitMultiplier': rawUnitMultiplier,
'unitCost': unitCost,
'allowance': allowance
};
getTypeName() => "BillingItem";
TypeContext? context = _ctx;
}
class BillingSettings implements IConvertible
{
BillingItem? base;
BillingItem? localNumbers;
BillingItem? tollFreeNumbers;
BillingItem? inboundVoiceCalls;
BillingItem? outboundVoiceCalls;
BillingItem? inboundFaxes;
BillingItem? outboundFaxes;
BillingItem? inboundSmsMessages;
BillingItem? outboundSmsMessages;
BillingItem? aiInsights;
BillingItem? aiLiveMinutes;
BillingSettings({this.base,this.localNumbers,this.tollFreeNumbers,this.inboundVoiceCalls,this.outboundVoiceCalls,this.inboundFaxes,this.outboundFaxes,this.inboundSmsMessages,this.outboundSmsMessages,this.aiInsights,this.aiLiveMinutes});
BillingSettings.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
base = JsonConverters.fromJson(json['base'],'BillingItem',context!);
localNumbers = JsonConverters.fromJson(json['localNumbers'],'BillingItem',context!);
tollFreeNumbers = JsonConverters.fromJson(json['tollFreeNumbers'],'BillingItem',context!);
inboundVoiceCalls = JsonConverters.fromJson(json['inboundVoiceCalls'],'BillingItem',context!);
outboundVoiceCalls = JsonConverters.fromJson(json['outboundVoiceCalls'],'BillingItem',context!);
inboundFaxes = JsonConverters.fromJson(json['inboundFaxes'],'BillingItem',context!);
outboundFaxes = JsonConverters.fromJson(json['outboundFaxes'],'BillingItem',context!);
inboundSmsMessages = JsonConverters.fromJson(json['inboundSmsMessages'],'BillingItem',context!);
outboundSmsMessages = JsonConverters.fromJson(json['outboundSmsMessages'],'BillingItem',context!);
aiInsights = JsonConverters.fromJson(json['aiInsights'],'BillingItem',context!);
aiLiveMinutes = JsonConverters.fromJson(json['aiLiveMinutes'],'BillingItem',context!);
return this;
}
Map<String, dynamic> toJson() => {
'base': JsonConverters.toJson(base,'BillingItem',context!),
'localNumbers': JsonConverters.toJson(localNumbers,'BillingItem',context!),
'tollFreeNumbers': JsonConverters.toJson(tollFreeNumbers,'BillingItem',context!),
'inboundVoiceCalls': JsonConverters.toJson(inboundVoiceCalls,'BillingItem',context!),
'outboundVoiceCalls': JsonConverters.toJson(outboundVoiceCalls,'BillingItem',context!),
'inboundFaxes': JsonConverters.toJson(inboundFaxes,'BillingItem',context!),
'outboundFaxes': JsonConverters.toJson(outboundFaxes,'BillingItem',context!),
'inboundSmsMessages': JsonConverters.toJson(inboundSmsMessages,'BillingItem',context!),
'outboundSmsMessages': JsonConverters.toJson(outboundSmsMessages,'BillingItem',context!),
'aiInsights': JsonConverters.toJson(aiInsights,'BillingItem',context!),
'aiLiveMinutes': JsonConverters.toJson(aiLiveMinutes,'BillingItem',context!)
};
getTypeName() => "BillingSettings";
TypeContext? context = _ctx;
}
class AccountInfo extends EntityInfo implements IConvertible
{
/**
* The name of this account
*/
// @ApiMember(Description="The name of this account")
String? name;
/**
* The ID of this account's parent
*/
// @ApiMember(Description="The ID of this account's parent")
String? parentAccountId;
/**
* The twilio account SID
*/
// @ApiMember(Description="The twilio account SID")
String? twilioAccountSid;
/**
* The ancestors of this account. Useful for breadcrumbs
*/
// @ApiMember(Description="The ancestors of this account. Useful for breadcrumbs")
List<String>? ancestorIds;
/**
* The max number of phone numbers this account can have
*/
// @ApiMember(Description="The max number of phone numbers this account can have")
int? maxPhoneNumbers;
/**
* This account is BYOA
*/
// @ApiMember(Description="This account is BYOA")
bool? isBYOA;
/**
* TrustHub Profile Sid
*/
// @ApiMember(Description="TrustHub Profile Sid")
String? trustHubProfileSid;
/**
* The ID of the logo file
*/
// @ApiMember(Description="The ID of the logo file")
String? logoId;
/**
* The URI of the logo file
*/
// @ApiMember(Description="The URI of the logo file")
String? logoUri;
/**
* The billing settings for this account
*/
// @ApiMember(Description="The billing settings for this account")
BillingSettings? billingSettings;
AccountInfo({this.name,this.parentAccountId,this.twilioAccountSid,this.ancestorIds,this.maxPhoneNumbers,this.isBYOA,this.trustHubProfileSid,this.logoId,this.logoUri,this.billingSettings});
AccountInfo.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
name = json['name'];
parentAccountId = json['parentAccountId'];
twilioAccountSid = json['twilioAccountSid'];
ancestorIds = JsonConverters.fromJson(json['ancestorIds'],'List<String>',context!);
maxPhoneNumbers = json['maxPhoneNumbers'];
isBYOA = json['isBYOA'];
trustHubProfileSid = json['trustHubProfileSid'];
logoId = json['logoId'];
logoUri = json['logoUri'];
billingSettings = JsonConverters.fromJson(json['billingSettings'],'BillingSettings',context!);
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'name': name,
'parentAccountId': parentAccountId,
'twilioAccountSid': twilioAccountSid,
'ancestorIds': JsonConverters.toJson(ancestorIds,'List<String>',context!),
'maxPhoneNumbers': maxPhoneNumbers,
'isBYOA': isBYOA,
'trustHubProfileSid': trustHubProfileSid,
'logoId': logoId,
'logoUri': logoUri,
'billingSettings': JsonConverters.toJson(billingSettings,'BillingSettings',context!)
});
getTypeName() => "AccountInfo";
TypeContext? context = _ctx;
}
/**
* Update the specified account details
*/
// @Api(Description="Update the specified account details")
class PatchAccount implements IPatch, IConvertible
{
/**
* The ID of the account you want to update
*/
// @ApiMember(Description="The ID of the account you want to update")
String? accountId;
/**
* The new name for the account
*/
// @ApiMember(Description="The new name for the account")
String? name;
/**
* The max number of phone numbers this account can have
*/
// @ApiMember(Description="The max number of phone numbers this account can have")
int? maxPhoneNumbers;
/**
* The ID of the file to use for a logo on the dashboard
*/
// @ApiMember(Description="The ID of the file to use for a logo on the dashboard")
String? logoId;
/**
* Updated billing settings for this account
*/
// @ApiMember(Description="Updated billing settings for this account")
BillingSettings? billingSettings;
PatchAccount({this.accountId,this.name,this.maxPhoneNumbers,this.logoId,this.billingSettings});
PatchAccount.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
accountId = json['accountId'];
name = json['name'];
maxPhoneNumbers = json['maxPhoneNumbers'];
logoId = json['logoId'];
billingSettings = JsonConverters.fromJson(json['billingSettings'],'BillingSettings',context!);
return this;
}
Map<String, dynamic> toJson() => {
'accountId': accountId,
'name': name,
'maxPhoneNumbers': maxPhoneNumbers,
'logoId': logoId,
'billingSettings': JsonConverters.toJson(billingSettings,'BillingSettings',context!)
};
getTypeName() => "PatchAccount";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'team.evovoice.io', types: <String, TypeInfo> {
'EntityInfo': TypeInfo(TypeOf.AbstractClass),
'BillingItem': TypeInfo(TypeOf.Class, create:() => BillingItem()),
'BillingSettings': TypeInfo(TypeOf.Class, create:() => BillingSettings()),
'AccountInfo': TypeInfo(TypeOf.Class, create:() => AccountInfo()),
'PatchAccount': TypeInfo(TypeOf.Class, create:() => PatchAccount()),
});
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
PATCH /accounts/{accountId} HTTP/1.1
Host: team.evovoice.io
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<PatchAccount xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Voice.Api.Accounts">
<AccountId>String</AccountId>
<BillingSettings>
<AIInsights>
<Allowance>0</Allowance>
<BaseCost>0</BaseCost>
<RawUnitMultiplier>0</RawUnitMultiplier>
<UnitCost>0</UnitCost>
</AIInsights>
<AILiveMinutes>
<Allowance>0</Allowance>
<BaseCost>0</BaseCost>
<RawUnitMultiplier>0</RawUnitMultiplier>
<UnitCost>0</UnitCost>
</AILiveMinutes>
<Base>
<Allowance>0</Allowance>
<BaseCost>0</BaseCost>
<RawUnitMultiplier>0</RawUnitMultiplier>
<UnitCost>0</UnitCost>
</Base>
<InboundFaxes>
<Allowance>0</Allowance>
<BaseCost>0</BaseCost>
<RawUnitMultiplier>0</RawUnitMultiplier>
<UnitCost>0</UnitCost>
</InboundFaxes>
<InboundSmsMessages>
<Allowance>0</Allowance>
<BaseCost>0</BaseCost>
<RawUnitMultiplier>0</RawUnitMultiplier>
<UnitCost>0</UnitCost>
</InboundSmsMessages>
<InboundVoiceCalls>
<Allowance>0</Allowance>
<BaseCost>0</BaseCost>
<RawUnitMultiplier>0</RawUnitMultiplier>
<UnitCost>0</UnitCost>
</InboundVoiceCalls>
<LocalNumbers>
<Allowance>0</Allowance>
<BaseCost>0</BaseCost>
<RawUnitMultiplier>0</RawUnitMultiplier>
<UnitCost>0</UnitCost>
</LocalNumbers>
<OutboundFaxes>
<Allowance>0</Allowance>
<BaseCost>0</BaseCost>
<RawUnitMultiplier>0</RawUnitMultiplier>
<UnitCost>0</UnitCost>
</OutboundFaxes>
<OutboundSmsMessages>
<Allowance>0</Allowance>
<BaseCost>0</BaseCost>
<RawUnitMultiplier>0</RawUnitMultiplier>
<UnitCost>0</UnitCost>
</OutboundSmsMessages>
<OutboundVoiceCalls>
<Allowance>0</Allowance>
<BaseCost>0</BaseCost>
<RawUnitMultiplier>0</RawUnitMultiplier>
<UnitCost>0</UnitCost>
</OutboundVoiceCalls>
<TollFreeNumbers>
<Allowance>0</Allowance>
<BaseCost>0</BaseCost>
<RawUnitMultiplier>0</RawUnitMultiplier>
<UnitCost>0</UnitCost>
</TollFreeNumbers>
</BillingSettings>
<LogoId>String</LogoId>
<MaxPhoneNumbers>0</MaxPhoneNumbers>
<Name>String</Name>
</PatchAccount>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <AccountInfo xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Voice.Api.Accounts"> <CreatedBy xmlns="http://schemas.datacontract.org/2004/07/Voice.Api">String</CreatedBy> <DateCreated xmlns="http://schemas.datacontract.org/2004/07/Voice.Api">String</DateCreated> <DateLastModified xmlns="http://schemas.datacontract.org/2004/07/Voice.Api">String</DateLastModified> <Id xmlns="http://schemas.datacontract.org/2004/07/Voice.Api">String</Id> <LastModifiedBy xmlns="http://schemas.datacontract.org/2004/07/Voice.Api">String</LastModifiedBy> <AncestorIds xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d2p1:string>String</d2p1:string> </AncestorIds> <BillingSettings> <AIInsights> <Allowance>0</Allowance> <BaseCost>0</BaseCost> <RawUnitMultiplier>0</RawUnitMultiplier> <UnitCost>0</UnitCost> </AIInsights> <AILiveMinutes> <Allowance>0</Allowance> <BaseCost>0</BaseCost> <RawUnitMultiplier>0</RawUnitMultiplier> <UnitCost>0</UnitCost> </AILiveMinutes> <Base> <Allowance>0</Allowance> <BaseCost>0</BaseCost> <RawUnitMultiplier>0</RawUnitMultiplier> <UnitCost>0</UnitCost> </Base> <InboundFaxes> <Allowance>0</Allowance> <BaseCost>0</BaseCost> <RawUnitMultiplier>0</RawUnitMultiplier> <UnitCost>0</UnitCost> </InboundFaxes> <InboundSmsMessages> <Allowance>0</Allowance> <BaseCost>0</BaseCost> <RawUnitMultiplier>0</RawUnitMultiplier> <UnitCost>0</UnitCost> </InboundSmsMessages> <InboundVoiceCalls> <Allowance>0</Allowance> <BaseCost>0</BaseCost> <RawUnitMultiplier>0</RawUnitMultiplier> <UnitCost>0</UnitCost> </InboundVoiceCalls> <LocalNumbers> <Allowance>0</Allowance> <BaseCost>0</BaseCost> <RawUnitMultiplier>0</RawUnitMultiplier> <UnitCost>0</UnitCost> </LocalNumbers> <OutboundFaxes> <Allowance>0</Allowance> <BaseCost>0</BaseCost> <RawUnitMultiplier>0</RawUnitMultiplier> <UnitCost>0</UnitCost> </OutboundFaxes> <OutboundSmsMessages> <Allowance>0</Allowance> <BaseCost>0</BaseCost> <RawUnitMultiplier>0</RawUnitMultiplier> <UnitCost>0</UnitCost> </OutboundSmsMessages> <OutboundVoiceCalls> <Allowance>0</Allowance> <BaseCost>0</BaseCost> <RawUnitMultiplier>0</RawUnitMultiplier> <UnitCost>0</UnitCost> </OutboundVoiceCalls> <TollFreeNumbers> <Allowance>0</Allowance> <BaseCost>0</BaseCost> <RawUnitMultiplier>0</RawUnitMultiplier> <UnitCost>0</UnitCost> </TollFreeNumbers> </BillingSettings> <IsBYOA>false</IsBYOA> <LogoId>String</LogoId> <LogoUri>String</LogoUri> <MaxPhoneNumbers>0</MaxPhoneNumbers> <Name>String</Name> <ParentAccountId>String</ParentAccountId> <TrustHubProfileSid>String</TrustHubProfileSid> <TwilioAccountSid>String</TwilioAccountSid> </AccountInfo>