-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAccessChannelUpdateSimulateAction.js
86 lines (86 loc) · 5.75 KB
/
AccessChannelUpdateSimulateAction.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.validateAccessChannelUpdateSimulateAction = exports.AccessChannelUpdateSimulateActionOrSubClassJoiSchema = exports.AccessChannelUpdateSimulateActionJoiSchema = void 0;
// This file was generated
const Joi = require("joi");
const oaValidationError_1 = require("../oaValidationError");
const oa = require("../oa");
const schema = require("../schema");
/**
* test:AccessChannelUpdateSimulateAction - Validation schema (w/ JOI)
*
* [NOTICE: This class is part of the Open Booking API Test Interface, and MUST NOT be used in production.]
*
* This type is derived from https://schema.org/Action, which means that any of this type's properties within schema.org may also be used.
*/
exports.AccessChannelUpdateSimulateActionJoiSchema = Joi.object({
'@type': Joi.string().valid('AccessChannelUpdateSimulateAction').required(),
'@context': Joi.alternatives().try([Joi.string(), Joi.array().items(Joi.string())]),
identifier: Joi.alternatives().try(Joi.lazy(() => schema.PropertyValueOrSubClassJoiSchema), Joi.string(), Joi.string().uri()),
name: Joi.string(),
description: Joi.string(),
'@id': Joi.string().uri(),
object: Joi.alternatives().try(Joi.lazy(() => oa.OrderOrSubClassJoiSchema), Joi.lazy(() => oa.Event_OrSubClassJoiSchema)),
result: Joi.alternatives().try(Joi.lazy(() => schema.ThingOrSubClassJoiSchema), Joi.string().uri()),
participant: Joi.alternatives().try(Joi.lazy(() => schema.PersonOrSubClassJoiSchema), Joi.lazy(() => schema.OrganizationOrSubClassJoiSchema), Joi.string().uri()),
error: Joi.alternatives().try(Joi.lazy(() => schema.ThingOrSubClassJoiSchema), Joi.string().uri()),
location: Joi.alternatives().try(Joi.lazy(() => schema.PostalAddressOrSubClassJoiSchema), Joi.string(), Joi.lazy(() => schema.PlaceOrSubClassJoiSchema), Joi.lazy(() => schema.VirtualLocationOrSubClassJoiSchema), Joi.string().uri()),
endTime: Joi.alternatives().try(Joi.string().isoDate(), Joi.string()),
agent: Joi.alternatives().try(Joi.lazy(() => schema.OrganizationOrSubClassJoiSchema), Joi.lazy(() => schema.PersonOrSubClassJoiSchema), Joi.string().uri()),
target: Joi.alternatives().try(Joi.lazy(() => schema.EntryPointOrSubClassJoiSchema), Joi.string().uri()),
actionStatus: Joi.alternatives().try(Joi.lazy(() => schema.ActionStatusTypeOrSubClassJoiSchema), Joi.string().uri()),
instrument: Joi.alternatives().try(Joi.lazy(() => schema.ThingOrSubClassJoiSchema), Joi.string().uri()),
startTime: Joi.alternatives().try(Joi.string(), Joi.string().isoDate()),
mainEntityOfPage: Joi.alternatives().try(Joi.string().uri(), Joi.lazy(() => schema.CreativeWorkOrSubClassJoiSchema)),
additionalType: Joi.string().uri(),
url: Joi.string().uri(),
alternateName: Joi.string(),
sameAs: Joi.string().uri(),
potentialAction: Joi.alternatives().try(Joi.lazy(() => schema.ActionOrSubClassJoiSchema), Joi.string().uri()),
subjectOf: Joi.alternatives().try(Joi.lazy(() => schema.Event_OrSubClassJoiSchema), Joi.lazy(() => schema.CreativeWorkOrSubClassJoiSchema), Joi.string().uri()),
disambiguatingDescription: Joi.string(),
image: Joi.alternatives().try(Joi.lazy(() => schema.ImageObjectOrSubClassJoiSchema), Joi.string().uri()),
});
/**
* test:AccessChannelUpdateSimulateAction - Validation schema (w/ JOI)
*
* [NOTICE: This class is part of the Open Booking API Test Interface, and MUST NOT be used in production.]
*
* This type is derived from https://schema.org/Action, which means that any of this type's properties within schema.org may also be used.
*
* This differs from AccessChannelUpdateSimulateActionJoiSchema because it also allows for objects that have the type of a model that
* sub-classes this model. e.g. `Event.OrSubClassJoiSchema` allows `Event`s as well as `ScheduledSession`s,
* `SessionSeries`, etc.
*/
exports.AccessChannelUpdateSimulateActionOrSubClassJoiSchema = Joi.alternatives().try([
exports.AccessChannelUpdateSimulateActionJoiSchema,
]);
/**
* Runtime validator for test:AccessChannelUpdateSimulateAction.
*
* If some data has a structure which matches a test:AccessChannelUpdateSimulateAction, it will be returned with the correct type.
* Otherwise, this function returns an OAValidationError with details about why the data does not match.
*
* Use this to e.g. check a JSON object received in an HTTP request. Example usage (for an express request handler):
*
* ```ts
* const maybeAccessChannelUpdateSimulateAction = validateAccessChannelUpdateSimulateAction(req.body); // `req.body` will have type `any` or `unknown`
* if (maybeAccessChannelUpdateSimulateAction instanceof OaValidationError) {
* // From this point on, `maybeAccessChannelUpdateSimulateAction` will have type `OaValidationError`
* const error = maybeAccessChannelUpdateSimulateAction;
* // Do something with the error. Maybe ignore it? Or log it? Or throw? Up to you.
* }
* // From this point on, `maybeAccessChannelUpdateSimulateAction` will have type `AccessChannelUpdateSimulateAction`
* const accessChannelUpdateSimulateAction = maybeAccessChannelUpdateSimulateAction;
* ```
*/
function validateAccessChannelUpdateSimulateAction(maybeAccessChannelUpdateSimulateAction) {
const { value, error } = exports.AccessChannelUpdateSimulateActionJoiSchema.validate(maybeAccessChannelUpdateSimulateAction);
if (error) {
return new oaValidationError_1.OaValidationError('AccessChannelUpdateSimulateAction', maybeAccessChannelUpdateSimulateAction, error);
}
/* Joi does not implement TS Type Guards, so TS does not implicitly know that this has now been validated
to have the right type. Therefore, we just cast it to the right type. */
return value;
}
exports.validateAccessChannelUpdateSimulateAction = validateAccessChannelUpdateSimulateAction;