FBiHBetting.Aggregator.WebApi

<back to all web services

UpdateBettor

The following routes are available for this service:
POST/bettors/update
<?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 Reference implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $id=null,
        /** @var string|null */
        public ?string $value=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['id'])) $this->id = $o['id'];
        if (isset($o['value'])) $this->value = $o['value'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->id)) $o['id'] = $this->id;
        if (isset($this->value)) $o['value'] = $this->value;
        return empty($o) ? new class(){} : $o;
    }
}

class Address implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $street=null,
        /** @var Reference|null */
        public ?Reference $city=null,
        /** @var string|null */
        public ?string $postalCode=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['street'])) $this->street = $o['street'];
        if (isset($o['city'])) $this->city = JsonConverters::from('Reference', $o['city']);
        if (isset($o['postalCode'])) $this->postalCode = $o['postalCode'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->street)) $o['street'] = $this->street;
        if (isset($this->city)) $o['city'] = JsonConverters::to('Reference', $this->city);
        if (isset($this->postalCode)) $o['postalCode'] = $this->postalCode;
        return empty($o) ? new class(){} : $o;
    }
}

class UpdateBettor implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $id=null,
        /** @var string|null */
        public ?string $fullName=null,
        /** @var DateTime */
        public DateTime $dateOfBirth=new DateTime(),
        /** @var Address|null */
        public ?Address $bettorAddress=null,
        /** @var string|null */
        public ?string $email=null,
        /** @var string|null */
        public ?string $phoneNumber=null,
        /** @var string|null */
        public ?string $username=null,
        /** @var string|null */
        public ?string $bankTransactionAccountNumber=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['id'])) $this->id = $o['id'];
        if (isset($o['fullName'])) $this->fullName = $o['fullName'];
        if (isset($o['dateOfBirth'])) $this->dateOfBirth = JsonConverters::from('DateTime', $o['dateOfBirth']);
        if (isset($o['bettorAddress'])) $this->bettorAddress = JsonConverters::from('Address', $o['bettorAddress']);
        if (isset($o['email'])) $this->email = $o['email'];
        if (isset($o['phoneNumber'])) $this->phoneNumber = $o['phoneNumber'];
        if (isset($o['username'])) $this->username = $o['username'];
        if (isset($o['bankTransactionAccountNumber'])) $this->bankTransactionAccountNumber = $o['bankTransactionAccountNumber'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->id)) $o['id'] = $this->id;
        if (isset($this->fullName)) $o['fullName'] = $this->fullName;
        if (isset($this->dateOfBirth)) $o['dateOfBirth'] = JsonConverters::to('DateTime', $this->dateOfBirth);
        if (isset($this->bettorAddress)) $o['bettorAddress'] = JsonConverters::to('Address', $this->bettorAddress);
        if (isset($this->email)) $o['email'] = $this->email;
        if (isset($this->phoneNumber)) $o['phoneNumber'] = $this->phoneNumber;
        if (isset($this->username)) $o['username'] = $this->username;
        if (isset($this->bankTransactionAccountNumber)) $o['bankTransactionAccountNumber'] = $this->bankTransactionAccountNumber;
        return empty($o) ? new class(){} : $o;
    }
}

PHP UpdateBettor 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.

POST /bettors/update HTTP/1.1 
Host: fbihtaapi.bettor.webhop.biz 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<UpdateBettor xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/FBiHBetting.Aggregator.WebApi.ServiceModel">
  <BankTransactionAccountNumber>String</BankTransactionAccountNumber>
  <BettorAddress>
    <City>
      <Id>String</Id>
      <Value>String</Value>
    </City>
    <PostalCode>String</PostalCode>
    <Street>String</Street>
  </BettorAddress>
  <DateOfBirth>0001-01-01T00:00:00</DateOfBirth>
  <Email>String</Email>
  <FullName>String</FullName>
  <Id>String</Id>
  <PhoneNumber>String</PhoneNumber>
  <Username>String</Username>
</UpdateBettor>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<ResponseStatus xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.servicestack.net/types">
  <ErrorCode>String</ErrorCode>
  <Message>String</Message>
  <StackTrace>String</StackTrace>
  <Errors>
    <ResponseError>
      <ErrorCode>String</ErrorCode>
      <FieldName>String</FieldName>
      <Message>String</Message>
      <Meta xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <d4p1:KeyValueOfstringstring>
          <d4p1:Key>String</d4p1:Key>
          <d4p1:Value>String</d4p1:Value>
        </d4p1:KeyValueOfstringstring>
      </Meta>
    </ResponseError>
  </Errors>
  <Meta xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:KeyValueOfstringstring>
      <d2p1:Key>String</d2p1:Key>
      <d2p1:Value>String</d2p1:Value>
    </d2p1:KeyValueOfstringstring>
  </Meta>
</ResponseStatus>