Required role: | REGISUserRole |
POST | /DynamicsCRM/Education/Upsert/{regent_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 CRMEducationUpsertRequest implements JsonSerializable
{
public function __construct(
/** @var int */
public int $regent_id=0,
/** @var int|null */
public ?int $import_id=null,
/** @var int|null */
public ?int $institution_regent_id=null,
/** @var string|null */
public ?string $application_guid=null,
/** @var string|null */
public ?string $degree_status=null,
/** @var string|null */
public ?string $degree_type=null,
/** @var string|null */
public ?string $unofficial_institution_name=null,
/** @var string|null */
public ?string $unofficial_degree_name=null,
/** @var string|null */
public ?string $degree_name=null,
/** @var string|null */
public ?string $degree_code=null,
/** @var string|null */
public ?string $description=null,
/** @var string|null */
public ?string $major=null,
/** @var string|null */
public ?string $second_major=null,
/** @var float|null */
public ?float $cumulative_gpa=null,
/** @var bool|null */
public ?bool $is_final=null,
/** @var bool|null */
public ?bool $is_regis_external_degree=null,
/** @var int|null */
public ?int $start_year=null,
/** @var int|null */
public ?int $end_year=null,
/** @var int|null */
public ?int $month_graduated=null,
/** @var int|null */
public ?int $year_graduated=null,
/** @var DateTime|null */
public ?DateTime $added_date=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['regent_id'])) $this->regent_id = $o['regent_id'];
if (isset($o['import_id'])) $this->import_id = $o['import_id'];
if (isset($o['institution_regent_id'])) $this->institution_regent_id = $o['institution_regent_id'];
if (isset($o['application_guid'])) $this->application_guid = $o['application_guid'];
if (isset($o['degree_status'])) $this->degree_status = $o['degree_status'];
if (isset($o['degree_type'])) $this->degree_type = $o['degree_type'];
if (isset($o['unofficial_institution_name'])) $this->unofficial_institution_name = $o['unofficial_institution_name'];
if (isset($o['unofficial_degree_name'])) $this->unofficial_degree_name = $o['unofficial_degree_name'];
if (isset($o['degree_name'])) $this->degree_name = $o['degree_name'];
if (isset($o['degree_code'])) $this->degree_code = $o['degree_code'];
if (isset($o['description'])) $this->description = $o['description'];
if (isset($o['major'])) $this->major = $o['major'];
if (isset($o['second_major'])) $this->second_major = $o['second_major'];
if (isset($o['cumulative_gpa'])) $this->cumulative_gpa = $o['cumulative_gpa'];
if (isset($o['is_final'])) $this->is_final = $o['is_final'];
if (isset($o['is_regis_external_degree'])) $this->is_regis_external_degree = $o['is_regis_external_degree'];
if (isset($o['start_year'])) $this->start_year = $o['start_year'];
if (isset($o['end_year'])) $this->end_year = $o['end_year'];
if (isset($o['month_graduated'])) $this->month_graduated = $o['month_graduated'];
if (isset($o['year_graduated'])) $this->year_graduated = $o['year_graduated'];
if (isset($o['added_date'])) $this->added_date = JsonConverters::from('DateTime', $o['added_date']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->regent_id)) $o['regent_id'] = $this->regent_id;
if (isset($this->import_id)) $o['import_id'] = $this->import_id;
if (isset($this->institution_regent_id)) $o['institution_regent_id'] = $this->institution_regent_id;
if (isset($this->application_guid)) $o['application_guid'] = $this->application_guid;
if (isset($this->degree_status)) $o['degree_status'] = $this->degree_status;
if (isset($this->degree_type)) $o['degree_type'] = $this->degree_type;
if (isset($this->unofficial_institution_name)) $o['unofficial_institution_name'] = $this->unofficial_institution_name;
if (isset($this->unofficial_degree_name)) $o['unofficial_degree_name'] = $this->unofficial_degree_name;
if (isset($this->degree_name)) $o['degree_name'] = $this->degree_name;
if (isset($this->degree_code)) $o['degree_code'] = $this->degree_code;
if (isset($this->description)) $o['description'] = $this->description;
if (isset($this->major)) $o['major'] = $this->major;
if (isset($this->second_major)) $o['second_major'] = $this->second_major;
if (isset($this->cumulative_gpa)) $o['cumulative_gpa'] = $this->cumulative_gpa;
if (isset($this->is_final)) $o['is_final'] = $this->is_final;
if (isset($this->is_regis_external_degree)) $o['is_regis_external_degree'] = $this->is_regis_external_degree;
if (isset($this->start_year)) $o['start_year'] = $this->start_year;
if (isset($this->end_year)) $o['end_year'] = $this->end_year;
if (isset($this->month_graduated)) $o['month_graduated'] = $this->month_graduated;
if (isset($this->year_graduated)) $o['year_graduated'] = $this->year_graduated;
if (isset($this->added_date)) $o['added_date'] = JsonConverters::to('DateTime', $this->added_date);
return empty($o) ? new class(){} : $o;
}
}
PHP CRMEducationUpsertRequest 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
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /DynamicsCRM/Education/Upsert/{regent_id} HTTP/1.1
Host: data.regent-college.edu
Accept: application/json
Content-Type: application/json
Content-Length: length
{"regent_id":0,"import_id":0,"institution_regent_id":0,"application_guid":"String","degree_status":"String","degree_type":"String","unofficial_institution_name":"String","unofficial_degree_name":"String","degree_name":"String","degree_code":"String","description":"String","major":"String","second_major":"String","cumulative_gpa":0,"is_final":false,"is_regis_external_degree":false,"start_year":0,"end_year":0,"month_graduated":0,"year_graduated":0,"added_date":"0001-01-01T00:00:00.0000000"}
HTTP/1.1 200 OK Content-Type: application/json Content-Length: length {"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}