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

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

{"Id":0,"TenantsId":0,"CustomersId":0,"SegmentsId":0,"PublicAccessGuid":"00000000000000000000000000000000"}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"Id":0,"TenantsId":0,"CustomersId":0,"SegmentsId":0,"PublicAccessGuid":"00000000000000000000000000000000"}