digitaluapi

<back to all web services

CustomersSegmentsAutoQueryEdit

The following routes are available for this service:
PUT/auto/customerssegments/{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 CustomersSegments implements JsonSerializable
{
    public function __construct(
        // @DataMember(Order=1)
        // @Required()
        /** @var int */
        public int $Id=0,

        // @DataMember(Order=2)
        // @Required()
        // @References("typeof(digitaluapi.ServiceModel.Types.Tenants)")
        /** @var int */
        public int $TenantsId=0,

        // @DataMember(Order=3)
        // @Required()
        // @References("typeof(digitaluapi.ServiceModel.Types.Customers)")
        /** @var int */
        public int $CustomersId=0,

        // @DataMember(Order=4)
        // @Required()
        // @References("typeof(digitaluapi.ServiceModel.Types.Segments)")
        /** @var int */
        public int $SegmentsId=0,

        // @DataMember(Order=5)
        // @Required()
        /** @var string */
        public string $PublicAccessGuid=''
    ) {
    }

    /** @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['CustomersId'])) $this->CustomersId = $o['CustomersId'];
        if (isset($o['SegmentsId'])) $this->SegmentsId = $o['SegmentsId'];
        if (isset($o['PublicAccessGuid'])) $this->PublicAccessGuid = $o['PublicAccessGuid'];
    }
    
    /** @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->CustomersId)) $o['CustomersId'] = $this->CustomersId;
        if (isset($this->SegmentsId)) $o['SegmentsId'] = $this->SegmentsId;
        if (isset($this->PublicAccessGuid)) $o['PublicAccessGuid'] = $this->PublicAccessGuid;
        return empty($o) ? new class(){} : $o;
    }
}

/**
 * @template IUpdateDb of CustomersSegments
 */
class CustomersSegmentsAutoQueryEdit extends CustomersSegments implements IUpdateDb, JsonSerializable
{
    /**
     * @param int $Id
     * @param int $TenantsId
     * @param int $CustomersId
     * @param int $SegmentsId
     * @param string $PublicAccessGuid
     */
    public function __construct(
        int $Id=0,
        int $TenantsId=0,
        int $CustomersId=0,
        int $SegmentsId=0,
        string $PublicAccessGuid=''
    ) {
        parent::__construct($Id,$TenantsId,$CustomersId,$SegmentsId,$PublicAccessGuid);
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        return empty($o) ? new class(){} : $o;
    }
}

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

PUT /auto/customerssegments/{Id} HTTP/1.1 
Host: duengageapi.uat.scadsoftware.com 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<CustomersSegmentsAutoQueryEdit xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/digitaluapi.ServiceModel">
  <CustomersId xmlns="http://schemas.datacontract.org/2004/07/digitaluapi.ServiceModel.Types">0</CustomersId>
  <Id xmlns="http://schemas.datacontract.org/2004/07/digitaluapi.ServiceModel.Types">0</Id>
  <PublicAccessGuid xmlns="http://schemas.datacontract.org/2004/07/digitaluapi.ServiceModel.Types">00000000-0000-0000-0000-000000000000</PublicAccessGuid>
  <SegmentsId xmlns="http://schemas.datacontract.org/2004/07/digitaluapi.ServiceModel.Types">0</SegmentsId>
  <TenantsId xmlns="http://schemas.datacontract.org/2004/07/digitaluapi.ServiceModel.Types">0</TenantsId>
</CustomersSegmentsAutoQueryEdit>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<CustomersSegments xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/digitaluapi.ServiceModel.Types">
  <CustomersId>0</CustomersId>
  <Id>0</Id>
  <PublicAccessGuid>00000000-0000-0000-0000-000000000000</PublicAccessGuid>
  <SegmentsId>0</SegmentsId>
  <TenantsId>0</TenantsId>
</CustomersSegments>