PUT | /mailchimp/member/company/sync | Sync Mailchimp members |
---|
<?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};
// @ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)
class SyncCompanyMembers implements JsonSerializable
{
public function __construct(
/** @description Should we delete emails that do not exist in BokaMera. */
// @ApiMember(Description="Should we delete emails that do not exist in BokaMera.")
/** @var bool|null */
public ?bool $DeleteNonExisting=null,
/** @description Determines if it is a test user */
// @ApiMember(Description="Determines if it is a test user")
/** @var bool|null */
public ?bool $Test=null,
/** @description Determines if it sync was executed manually by click in superAdmin */
// @ApiMember(Description="Determines if it sync was executed manually by click in superAdmin")
/** @var bool|null */
public ?bool $Manual=null,
/** @description The company id of member of which members you want to sync. */
// @ApiMember(Description="The company id of member of which members you want to sync.")
/** @var string|null */
public ?string $MemberCompanyId=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['DeleteNonExisting'])) $this->DeleteNonExisting = $o['DeleteNonExisting'];
if (isset($o['Test'])) $this->Test = $o['Test'];
if (isset($o['Manual'])) $this->Manual = $o['Manual'];
if (isset($o['MemberCompanyId'])) $this->MemberCompanyId = $o['MemberCompanyId'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->DeleteNonExisting)) $o['DeleteNonExisting'] = $this->DeleteNonExisting;
if (isset($this->Test)) $o['Test'] = $this->Test;
if (isset($this->Manual)) $o['Manual'] = $this->Manual;
if (isset($this->MemberCompanyId)) $o['MemberCompanyId'] = $this->MemberCompanyId;
return empty($o) ? new class(){} : $o;
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
PUT /mailchimp/member/company/sync HTTP/1.1
Host: testapi.bokamera.se
Accept: text/csv
Content-Type: text/csv
Content-Length: length
{"DeleteNonExisting":false,"Test":false,"Manual":false,"MemberCompanyId":"00000000-0000-0000-0000-000000000000"}