| Requires any of the roles: | Client, Admin, Partner |
| PUT | /customers/{Id} |
|---|
<?php namespace dtos;
use DateTime;
use Exception;
use DateInterval;
use JsonSerializable;
use ServiceStack\{IReturn,IReturnVoid,IGet,IPost,IPut,IDelete,IPatch,IMeta,IHasSessionId,IHasBearerToken,IHasVersion};
use ServiceStack\{ICrud,ICreateDb,IUpdateDb,IPatchDb,IDeleteDb,ISaveDb,AuditBase,QueryDb,QueryDb2,QueryData,QueryData2,QueryResponse};
use ServiceStack\{ResponseStatus,ResponseError,EmptyResponse,IdResponse,ArrayList,KeyValuePair2,StringResponse,StringsResponse,Tuple2,Tuple3,ByteArray};
use ServiceStack\{JsonConverters,Returns,TypeContext};
class CustomersEditResponse implements JsonSerializable
{
public function __construct(
// @DataMember(Order=1)
/** @var int */
public int $Id=0,
// @DataMember(Order=2)
/** @var int */
public int $TenantsId=0,
// @DataMember(Order=3)
/** @var int|null */
public ?int $UserAuthId=null,
// @DataMember(Order=4)
/** @var int */
public int $SegmentsId=0,
// @DataMember(Order=5)
/** @var int|null */
public ?int $CompaniesId=null,
// @DataMember(Order=6)
/** @var int|null */
public ?int $CurrenciesId=null,
// @DataMember(Order=7)
/** @var string|null */
public ?string $Address=null,
// @DataMember(Order=8)
/** @var int|null */
public ?int $Age=null,
// @DataMember(Order=9)
/** @var string|null */
public ?string $City=null,
// @DataMember(Order=10)
/** @var string|null */
public ?string $ContactNumber=null,
// @DataMember(Order=11)
/** @var string|null */
public ?string $Email=null,
// @DataMember(Order=12)
/** @var string|null */
public ?string $EthnicGroup=null,
// @DataMember(Order=13)
/** @var string|null */
public ?string $FirstName=null,
// @DataMember(Order=14)
/** @var string|null */
public ?string $Gender=null,
// @DataMember(Order=15)
/** @var string|null */
public ?string $HomeLanguage=null,
// @DataMember(Order=16)
/** @var string|null */
public ?string $IdNumber=null,
// @DataMember(Order=17)
/** @var string|null */
public ?string $LastName=null,
// @DataMember(Order=18)
/** @var string|null */
public ?string $PostalCode=null,
// @DataMember(Order=19)
/** @var string|null */
public ?string $Region=null,
// @DataMember(Order=20)
/** @var string|null */
public ?string $Suburb=null,
// @DataMember(Order=21)
/** @var string|null */
public ?string $UniqueIdentifier=null,
// @DataMember(Order=23)
/** @var ResponseStatus|null */
public ?ResponseStatus $ResponseStatus=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Id'])) $this->Id = $o['Id'];
if (isset($o['TenantsId'])) $this->TenantsId = $o['TenantsId'];
if (isset($o['UserAuthId'])) $this->UserAuthId = $o['UserAuthId'];
if (isset($o['SegmentsId'])) $this->SegmentsId = $o['SegmentsId'];
if (isset($o['CompaniesId'])) $this->CompaniesId = $o['CompaniesId'];
if (isset($o['CurrenciesId'])) $this->CurrenciesId = $o['CurrenciesId'];
if (isset($o['Address'])) $this->Address = $o['Address'];
if (isset($o['Age'])) $this->Age = $o['Age'];
if (isset($o['City'])) $this->City = $o['City'];
if (isset($o['ContactNumber'])) $this->ContactNumber = $o['ContactNumber'];
if (isset($o['Email'])) $this->Email = $o['Email'];
if (isset($o['EthnicGroup'])) $this->EthnicGroup = $o['EthnicGroup'];
if (isset($o['FirstName'])) $this->FirstName = $o['FirstName'];
if (isset($o['Gender'])) $this->Gender = $o['Gender'];
if (isset($o['HomeLanguage'])) $this->HomeLanguage = $o['HomeLanguage'];
if (isset($o['IdNumber'])) $this->IdNumber = $o['IdNumber'];
if (isset($o['LastName'])) $this->LastName = $o['LastName'];
if (isset($o['PostalCode'])) $this->PostalCode = $o['PostalCode'];
if (isset($o['Region'])) $this->Region = $o['Region'];
if (isset($o['Suburb'])) $this->Suburb = $o['Suburb'];
if (isset($o['UniqueIdentifier'])) $this->UniqueIdentifier = $o['UniqueIdentifier'];
if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Id)) $o['Id'] = $this->Id;
if (isset($this->TenantsId)) $o['TenantsId'] = $this->TenantsId;
if (isset($this->UserAuthId)) $o['UserAuthId'] = $this->UserAuthId;
if (isset($this->SegmentsId)) $o['SegmentsId'] = $this->SegmentsId;
if (isset($this->CompaniesId)) $o['CompaniesId'] = $this->CompaniesId;
if (isset($this->CurrenciesId)) $o['CurrenciesId'] = $this->CurrenciesId;
if (isset($this->Address)) $o['Address'] = $this->Address;
if (isset($this->Age)) $o['Age'] = $this->Age;
if (isset($this->City)) $o['City'] = $this->City;
if (isset($this->ContactNumber)) $o['ContactNumber'] = $this->ContactNumber;
if (isset($this->Email)) $o['Email'] = $this->Email;
if (isset($this->EthnicGroup)) $o['EthnicGroup'] = $this->EthnicGroup;
if (isset($this->FirstName)) $o['FirstName'] = $this->FirstName;
if (isset($this->Gender)) $o['Gender'] = $this->Gender;
if (isset($this->HomeLanguage)) $o['HomeLanguage'] = $this->HomeLanguage;
if (isset($this->IdNumber)) $o['IdNumber'] = $this->IdNumber;
if (isset($this->LastName)) $o['LastName'] = $this->LastName;
if (isset($this->PostalCode)) $o['PostalCode'] = $this->PostalCode;
if (isset($this->Region)) $o['Region'] = $this->Region;
if (isset($this->Suburb)) $o['Suburb'] = $this->Suburb;
if (isset($this->UniqueIdentifier)) $o['UniqueIdentifier'] = $this->UniqueIdentifier;
if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
return empty($o) ? new class(){} : $o;
}
}
// @DataContract
class CustomersEdit implements JsonSerializable
{
public function __construct(
// @DataMember(Order=1)
// @Validate(Validator="NotNull")
/** @var int */
public int $Id=0,
// @DataMember(Order=2)
// @Validate(Validator="NotNull")
/** @var int */
public int $TenantsId=0,
// @DataMember(Order=3)
/** @var int|null */
public ?int $UserAuthId=null,
// @DataMember(Order=4)
// @Validate(Validator="NotNull")
/** @var int */
public int $SegmentsId=0,
// @DataMember(Order=5)
/** @var int|null */
public ?int $CompaniesId=null,
// @DataMember(Order=6)
/** @var int|null */
public ?int $CurrenciesId=null,
// @DataMember(Order=7)
/** @var string|null */
public ?string $Address=null,
// @DataMember(Order=8)
/** @var int|null */
public ?int $Age=null,
// @DataMember(Order=9)
/** @var string|null */
public ?string $City=null,
// @DataMember(Order=10)
/** @var string|null */
public ?string $ContactNumber=null,
// @DataMember(Order=11)
/** @var string|null */
public ?string $Email=null,
// @DataMember(Order=12)
/** @var string|null */
public ?string $EthnicGroup=null,
// @DataMember(Order=13)
/** @var string|null */
public ?string $FirstName=null,
// @DataMember(Order=14)
/** @var string|null */
public ?string $Gender=null,
// @DataMember(Order=15)
/** @var string|null */
public ?string $HomeLanguage=null,
// @DataMember(Order=16)
/** @var string|null */
public ?string $IdNumber=null,
// @DataMember(Order=17)
/** @var string|null */
public ?string $LastName=null,
// @DataMember(Order=18)
/** @var string|null */
public ?string $PostalCode=null,
// @DataMember(Order=19)
/** @var string|null */
public ?string $Region=null,
// @DataMember(Order=20)
/** @var string|null */
public ?string $Suburb=null,
// @DataMember(Order=21)
/** @var string|null */
public ?string $UniqueIdentifier=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Id'])) $this->Id = $o['Id'];
if (isset($o['TenantsId'])) $this->TenantsId = $o['TenantsId'];
if (isset($o['UserAuthId'])) $this->UserAuthId = $o['UserAuthId'];
if (isset($o['SegmentsId'])) $this->SegmentsId = $o['SegmentsId'];
if (isset($o['CompaniesId'])) $this->CompaniesId = $o['CompaniesId'];
if (isset($o['CurrenciesId'])) $this->CurrenciesId = $o['CurrenciesId'];
if (isset($o['Address'])) $this->Address = $o['Address'];
if (isset($o['Age'])) $this->Age = $o['Age'];
if (isset($o['City'])) $this->City = $o['City'];
if (isset($o['ContactNumber'])) $this->ContactNumber = $o['ContactNumber'];
if (isset($o['Email'])) $this->Email = $o['Email'];
if (isset($o['EthnicGroup'])) $this->EthnicGroup = $o['EthnicGroup'];
if (isset($o['FirstName'])) $this->FirstName = $o['FirstName'];
if (isset($o['Gender'])) $this->Gender = $o['Gender'];
if (isset($o['HomeLanguage'])) $this->HomeLanguage = $o['HomeLanguage'];
if (isset($o['IdNumber'])) $this->IdNumber = $o['IdNumber'];
if (isset($o['LastName'])) $this->LastName = $o['LastName'];
if (isset($o['PostalCode'])) $this->PostalCode = $o['PostalCode'];
if (isset($o['Region'])) $this->Region = $o['Region'];
if (isset($o['Suburb'])) $this->Suburb = $o['Suburb'];
if (isset($o['UniqueIdentifier'])) $this->UniqueIdentifier = $o['UniqueIdentifier'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Id)) $o['Id'] = $this->Id;
if (isset($this->TenantsId)) $o['TenantsId'] = $this->TenantsId;
if (isset($this->UserAuthId)) $o['UserAuthId'] = $this->UserAuthId;
if (isset($this->SegmentsId)) $o['SegmentsId'] = $this->SegmentsId;
if (isset($this->CompaniesId)) $o['CompaniesId'] = $this->CompaniesId;
if (isset($this->CurrenciesId)) $o['CurrenciesId'] = $this->CurrenciesId;
if (isset($this->Address)) $o['Address'] = $this->Address;
if (isset($this->Age)) $o['Age'] = $this->Age;
if (isset($this->City)) $o['City'] = $this->City;
if (isset($this->ContactNumber)) $o['ContactNumber'] = $this->ContactNumber;
if (isset($this->Email)) $o['Email'] = $this->Email;
if (isset($this->EthnicGroup)) $o['EthnicGroup'] = $this->EthnicGroup;
if (isset($this->FirstName)) $o['FirstName'] = $this->FirstName;
if (isset($this->Gender)) $o['Gender'] = $this->Gender;
if (isset($this->HomeLanguage)) $o['HomeLanguage'] = $this->HomeLanguage;
if (isset($this->IdNumber)) $o['IdNumber'] = $this->IdNumber;
if (isset($this->LastName)) $o['LastName'] = $this->LastName;
if (isset($this->PostalCode)) $o['PostalCode'] = $this->PostalCode;
if (isset($this->Region)) $o['Region'] = $this->Region;
if (isset($this->Suburb)) $o['Suburb'] = $this->Suburb;
if (isset($this->UniqueIdentifier)) $o['UniqueIdentifier'] = $this->UniqueIdentifier;
return empty($o) ? new class(){} : $o;
}
}
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.
PUT /customers/{Id} HTTP/1.1
Host: duengageapi.uat.scadsoftware.com
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<CustomersEdit xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/digitaluapi.ServiceModel">
<Id>0</Id>
<TenantsId>0</TenantsId>
<UserAuthId>0</UserAuthId>
<SegmentsId>0</SegmentsId>
<CompaniesId>0</CompaniesId>
<CurrenciesId>0</CurrenciesId>
<Address>String</Address>
<Age>0</Age>
<City>String</City>
<ContactNumber>String</ContactNumber>
<Email>String</Email>
<EthnicGroup>String</EthnicGroup>
<FirstName>String</FirstName>
<Gender>String</Gender>
<HomeLanguage>String</HomeLanguage>
<IdNumber>String</IdNumber>
<LastName>String</LastName>
<PostalCode>String</PostalCode>
<Region>String</Region>
<Suburb>String</Suburb>
<UniqueIdentifier>String</UniqueIdentifier>
</CustomersEdit>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<CustomersEditResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/digitaluapi.ServiceModel">
<Address>String</Address>
<Age>0</Age>
<City>String</City>
<CompaniesId>0</CompaniesId>
<ContactNumber>String</ContactNumber>
<CurrenciesId>0</CurrenciesId>
<Email>String</Email>
<EthnicGroup>String</EthnicGroup>
<FirstName>String</FirstName>
<Gender>String</Gender>
<HomeLanguage>String</HomeLanguage>
<Id>0</Id>
<IdNumber>String</IdNumber>
<LastName>String</LastName>
<PostalCode>String</PostalCode>
<Region>String</Region>
<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>
<SegmentsId>0</SegmentsId>
<Suburb>String</Suburb>
<TenantsId>0</TenantsId>
<UniqueIdentifier>String</UniqueIdentifier>
<UserAuthId>0</UserAuthId>
</CustomersEditResponse>