regis

<back to all web services

InstitutionRelationshipsUpdateRequest

Requires Authentication
Required role:REGISUserRole
The following routes are available for this service:
POST/Academic/Institution/{institution_id}/UpdateRelationships
<?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 InstitutionRelationshipRequest implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $related_institution_id=0,
        /** @var string|null */
        public ?string $relationship_type=null,
        /** @var string|null */
        public ?string $notes=null
    ) {
    }

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

class InstitutionRelationshipsUpdateRequest implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $institution_id=0,
        /** @var array<InstitutionRelationshipRequest>|null */
        public ?array $related_institutions=null,
        /** @var string|null */
        public ?string $authorizing_uuid=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['institution_id'])) $this->institution_id = $o['institution_id'];
        if (isset($o['related_institutions'])) $this->related_institutions = JsonConverters::fromArray('InstitutionRelationshipRequest', $o['related_institutions']);
        if (isset($o['authorizing_uuid'])) $this->authorizing_uuid = $o['authorizing_uuid'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->institution_id)) $o['institution_id'] = $this->institution_id;
        if (isset($this->related_institutions)) $o['related_institutions'] = JsonConverters::toArray('InstitutionRelationshipRequest', $this->related_institutions);
        if (isset($this->authorizing_uuid)) $o['authorizing_uuid'] = $this->authorizing_uuid;
        return empty($o) ? new class(){} : $o;
    }
}

PHP InstitutionRelationshipsUpdateRequest 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 /Academic/Institution/{institution_id}/UpdateRelationships HTTP/1.1 
Host: data.regent-college.edu 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	institution_id: 0,
	related_institutions: 
	[
		{
			related_institution_id: 0,
			relationship_type: String,
			notes: String
		}
	],
	authorizing_uuid: String
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	errorCode: String,
	message: String,
	stackTrace: String,
	errors: 
	[
		{
			errorCode: String,
			fieldName: String,
			message: String,
			meta: 
			{
				String: String
			}
		}
	],
	meta: 
	{
		String: String
	}
}