SupplierConnect Gateway API

<back to all web services

CancelScheduleRequest

Creates or Reschedules a SupplierConnect schedule. This will return the id of the schedule request created and the communication id of the notification sent.

Requires Authentication
The following routes are available for this service:
POST/api/schedules/{RequestId}/cancel
<?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 ScheduleResponse implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $ReferenceId='',
        /** @var string */
        public string $CommunicationId='',
        /** @var bool|null */
        public ?bool $Success=null,
        /** @var string|null */
        public ?string $Message=null,
        /** @var string|null */
        public ?string $Payload=null
    ) {
    }

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

// @DataContract
class ObjectReference implements JsonSerializable
{
    public function __construct(
        // @DataMember(Name="RmsTableContextId")
        /** @var string */
        public string $RmsTableContextId='',

        // @DataMember(Name="AlternateKey")
        /** @var string|null */
        public ?string $AlternateKey=null,

        // @DataMember(Name="DataSourceInstanceId")
        /** @var string */
        public string $DataSourceInstanceId=''
    ) {
    }

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

// @DataContract
class ContactInfo implements JsonSerializable
{
    public function __construct(
        // @DataMember(Name="Id")
        /** @var string */
        public string $Id='',

        // @DataMember(Name="Name")
        /** @var string|null */
        public ?string $Name=null,

        // @DataMember(Name="Email")
        /** @var string|null */
        public ?string $Email=null,

        // @DataMember(Name="Phone")
        /** @var string|null */
        public ?string $Phone=null,

        // @DataMember(Name="ContactReference")
        /** @var ObjectReference|null */
        public ?ObjectReference $ContactReference=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Id'])) $this->Id = $o['Id'];
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['Email'])) $this->Email = $o['Email'];
        if (isset($o['Phone'])) $this->Phone = $o['Phone'];
        if (isset($o['ContactReference'])) $this->ContactReference = JsonConverters::from('ObjectReference', $o['ContactReference']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Id)) $o['Id'] = $this->Id;
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->Email)) $o['Email'] = $this->Email;
        if (isset($this->Phone)) $o['Phone'] = $this->Phone;
        if (isset($this->ContactReference)) $o['ContactReference'] = JsonConverters::to('ObjectReference', $this->ContactReference);
        return empty($o) ? new class(){} : $o;
    }
}

// @DataContract
class ProjectInfo implements JsonSerializable
{
    public function __construct(
        // @DataMember(Name="Id")
        /** @var string */
        public string $Id='',

        // @DataMember(Name="Name")
        /** @var string|null */
        public ?string $Name=null,

        // @DataMember(Name="Reference")
        /** @var string|null */
        public ?string $Reference=null,

        // @DataMember(Name="Description")
        /** @var string|null */
        public ?string $Description=null,

        // @DataMember(Name="Address")
        /** @var string|null */
        public ?string $Address=null,

        // @DataMember(Name="HouseType")
        /** @var string|null */
        public ?string $HouseType=null,

        // @DataMember(Name="Elevation")
        /** @var string|null */
        public ?string $Elevation=null,

        // @DataMember(Name="CustomerName")
        /** @var string|null */
        public ?string $CustomerName=null,

        // @DataMember(Name="Supervisor")
        /** @var ContactInfo|null */
        public ?ContactInfo $Supervisor=null,

        // @DataMember(Name="ProjectReference")
        /** @var ObjectReference|null */
        public ?ObjectReference $ProjectReference=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Id'])) $this->Id = $o['Id'];
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['Reference'])) $this->Reference = $o['Reference'];
        if (isset($o['Description'])) $this->Description = $o['Description'];
        if (isset($o['Address'])) $this->Address = $o['Address'];
        if (isset($o['HouseType'])) $this->HouseType = $o['HouseType'];
        if (isset($o['Elevation'])) $this->Elevation = $o['Elevation'];
        if (isset($o['CustomerName'])) $this->CustomerName = $o['CustomerName'];
        if (isset($o['Supervisor'])) $this->Supervisor = JsonConverters::from('ContactInfo', $o['Supervisor']);
        if (isset($o['ProjectReference'])) $this->ProjectReference = JsonConverters::from('ObjectReference', $o['ProjectReference']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Id)) $o['Id'] = $this->Id;
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->Reference)) $o['Reference'] = $this->Reference;
        if (isset($this->Description)) $o['Description'] = $this->Description;
        if (isset($this->Address)) $o['Address'] = $this->Address;
        if (isset($this->HouseType)) $o['HouseType'] = $this->HouseType;
        if (isset($this->Elevation)) $o['Elevation'] = $this->Elevation;
        if (isset($this->CustomerName)) $o['CustomerName'] = $this->CustomerName;
        if (isset($this->Supervisor)) $o['Supervisor'] = JsonConverters::to('ContactInfo', $this->Supervisor);
        if (isset($this->ProjectReference)) $o['ProjectReference'] = JsonConverters::to('ObjectReference', $this->ProjectReference);
        return empty($o) ? new class(){} : $o;
    }
}

// @DataContract
class PurchaseOrderInfo implements JsonSerializable
{
    public function __construct(
        // @DataMember(Name="Id")
        /** @var string */
        public string $Id='',

        // @DataMember(Name="Reference")
        /** @var string|null */
        public ?string $Reference=null,

        // @DataMember(Name="Description")
        /** @var string|null */
        public ?string $Description=null,

        // @DataMember(Name="PurchaseOrderReference")
        /** @var ObjectReference|null */
        public ?ObjectReference $PurchaseOrderReference=null
    ) {
    }

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

// @DataContract
class ActivityReference implements JsonSerializable
{
    public function __construct(
        /** @description Name/details of the activity */
        // @DataMember(Name="name")
        // @ApiMember(Description="Name/details of the activity", IsRequired=true, Name="Name")
        /** @var string */
        public string $name='',

        // @DataMember(Name="notes")
        /** @var string|null */
        public ?string $notes=null
    ) {
    }

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

// @DataContract
class ScheduleParams implements JsonSerializable
{
    public function __construct(
        // @DataMember(Name="Name")
        /** @var string|null */
        public ?string $Name=null,

        // @DataMember(Name="Value")
        /** @var string|null */
        public ?string $Value=null
    ) {
    }

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

enum AttachmentType : string
{
    case Url = 'Url';
    case FileStream = 'FileStream';
}

class EmailAttachment implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $FileName=null,
        /** @var string|null */
        public ?string $ContentType=null,
        /** @var string|null */
        public ?string $Path=null,
        /** @var string|null */
        public ?string $Url=null,
        /** @var int */
        public int $Length=0,
        /** @var ByteArray|null */
        public ?ByteArray $FileStream=null,
        /** @var string|null */
        public ?string $StreamContent=null,
        /** @var AttachmentType|null */
        public ?AttachmentType $AttachmentType=null,
        /** @var bool|null */
        public ?bool $ProcessedAndUploadedAsBlob=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['FileName'])) $this->FileName = $o['FileName'];
        if (isset($o['ContentType'])) $this->ContentType = $o['ContentType'];
        if (isset($o['Path'])) $this->Path = $o['Path'];
        if (isset($o['Url'])) $this->Url = $o['Url'];
        if (isset($o['Length'])) $this->Length = $o['Length'];
        if (isset($o['FileStream'])) $this->FileStream = JsonConverters::from('ByteArray', $o['FileStream']);
        if (isset($o['StreamContent'])) $this->StreamContent = $o['StreamContent'];
        if (isset($o['AttachmentType'])) $this->AttachmentType = JsonConverters::from('AttachmentType', $o['AttachmentType']);
        if (isset($o['ProcessedAndUploadedAsBlob'])) $this->ProcessedAndUploadedAsBlob = $o['ProcessedAndUploadedAsBlob'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->FileName)) $o['FileName'] = $this->FileName;
        if (isset($this->ContentType)) $o['ContentType'] = $this->ContentType;
        if (isset($this->Path)) $o['Path'] = $this->Path;
        if (isset($this->Url)) $o['Url'] = $this->Url;
        if (isset($this->Length)) $o['Length'] = $this->Length;
        if (isset($this->FileStream)) $o['FileStream'] = JsonConverters::to('ByteArray', $this->FileStream);
        if (isset($this->StreamContent)) $o['StreamContent'] = $this->StreamContent;
        if (isset($this->AttachmentType)) $o['AttachmentType'] = JsonConverters::to('AttachmentType', $this->AttachmentType);
        if (isset($this->ProcessedAndUploadedAsBlob)) $o['ProcessedAndUploadedAsBlob'] = $this->ProcessedAndUploadedAsBlob;
        return empty($o) ? new class(){} : $o;
    }
}

/** @description Creates or Reschedules a SupplierConnect schedule. This will return the id of the schedule request created and the communication id of the notification sent. */
// @Api(Description="Creates or Reschedules a SupplierConnect schedule. This will return the id of the schedule request created and the communication id of the notification sent.")
// @DataContract
class CancelScheduleRequest implements JsonSerializable
{
    public function __construct(
        /** @description Id of the schedule request to be recreated */
        // @DataMember(Name="RequestId")
        // @ApiMember(Description="Id of the schedule request to be recreated", IsRequired=true, Name="RequestId")
        /** @var string */
        public string $RequestId='',

        /** @description Date/Time of the activity */
        // @DataMember(Name="ScheduleDateTime")
        // @ApiMember(Description="Date/Time of the activity", IsRequired=true, Name="ScheduleDateTime")
        // @Required()
        /** @var DateTime */
        public DateTime $ScheduleDateTime=new DateTime(),

        // @DataMember(Name="Requester")
        /** @var ContactInfo|null */
        public ?ContactInfo $Requester=null,

        // @DataMember(Name="Supplier")
        /** @var ContactInfo|null */
        public ?ContactInfo $Supplier=null,

        // @DataMember(Name="Project")
        /** @var ProjectInfo|null */
        public ?ProjectInfo $Project=null,

        // @DataMember(Name="PurchaseOrder")
        /** @var PurchaseOrderInfo|null */
        public ?PurchaseOrderInfo $PurchaseOrder=null,

        // @DataMember(Name="Activity")
        /** @var ActivityReference|null */
        public ?ActivityReference $Activity=null,

        // @DataMember(Name="Params")
        /** @var array<ScheduleParams>|null */
        public ?array $Params=null,

        // @DataMember(Name="Attachments")
        /** @var array<EmailAttachment>|null */
        public ?array $Attachments=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['RequestId'])) $this->RequestId = $o['RequestId'];
        if (isset($o['ScheduleDateTime'])) $this->ScheduleDateTime = JsonConverters::from('DateTime', $o['ScheduleDateTime']);
        if (isset($o['Requester'])) $this->Requester = JsonConverters::from('ContactInfo', $o['Requester']);
        if (isset($o['Supplier'])) $this->Supplier = JsonConverters::from('ContactInfo', $o['Supplier']);
        if (isset($o['Project'])) $this->Project = JsonConverters::from('ProjectInfo', $o['Project']);
        if (isset($o['PurchaseOrder'])) $this->PurchaseOrder = JsonConverters::from('PurchaseOrderInfo', $o['PurchaseOrder']);
        if (isset($o['Activity'])) $this->Activity = JsonConverters::from('ActivityReference', $o['Activity']);
        if (isset($o['Params'])) $this->Params = JsonConverters::fromArray('ScheduleParams', $o['Params']);
        if (isset($o['Attachments'])) $this->Attachments = JsonConverters::fromArray('EmailAttachment', $o['Attachments']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->RequestId)) $o['RequestId'] = $this->RequestId;
        if (isset($this->ScheduleDateTime)) $o['ScheduleDateTime'] = JsonConverters::to('DateTime', $this->ScheduleDateTime);
        if (isset($this->Requester)) $o['Requester'] = JsonConverters::to('ContactInfo', $this->Requester);
        if (isset($this->Supplier)) $o['Supplier'] = JsonConverters::to('ContactInfo', $this->Supplier);
        if (isset($this->Project)) $o['Project'] = JsonConverters::to('ProjectInfo', $this->Project);
        if (isset($this->PurchaseOrder)) $o['PurchaseOrder'] = JsonConverters::to('PurchaseOrderInfo', $this->PurchaseOrder);
        if (isset($this->Activity)) $o['Activity'] = JsonConverters::to('ActivityReference', $this->Activity);
        if (isset($this->Params)) $o['Params'] = JsonConverters::toArray('ScheduleParams', $this->Params);
        if (isset($this->Attachments)) $o['Attachments'] = JsonConverters::toArray('EmailAttachment', $this->Attachments);
        return empty($o) ? new class(){} : $o;
    }
}

PHP CancelScheduleRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv

HTTP + JSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /api/schedules/{RequestId}/cancel HTTP/1.1 
Host: production-eros-gateway-api-supplierconnect.azurewebsites.net 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	ScheduleDateTime: 0001-01-01,
	Requester: 
	{
		Name: String,
		Email: String,
		Phone: String,
		ContactReference: 
		{
			AlternateKey: String
		}
	},
	Supplier: 
	{
		Name: String,
		Email: String,
		Phone: String,
		ContactReference: 
		{
			AlternateKey: String
		}
	},
	Project: 
	{
		Name: String,
		Reference: String,
		Description: String,
		Address: String,
		HouseType: String,
		Elevation: String,
		CustomerName: String,
		Supervisor: 
		{
			Name: String,
			Email: String,
			Phone: String,
			ContactReference: 
			{
				AlternateKey: String
			}
		},
		ProjectReference: 
		{
			AlternateKey: String
		}
	},
	PurchaseOrder: 
	{
		Reference: String,
		Description: String,
		PurchaseOrderReference: 
		{
			AlternateKey: String
		}
	},
	Activity: 
	{
		name: String,
		notes: String
	},
	Params: 
	[
		{
			Name: String,
			Value: String
		}
	],
	Attachments: 
	[
		{
			FileName: String,
			ContentType: String,
			Path: String,
			Url: String,
			Length: 0,
			StreamContent: String,
			AttachmentType: Url,
			ProcessedAndUploadedAsBlob: False
		}
	]
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	Success: False,
	Message: String,
	Payload: String
}