PcoCalendarResource constructor
PcoCalendarResource({})
Create a new PcoCalendarResource object. This object cannot be created with the API
NOTES:
- Creating an instance of a class this way does not save it on the server.
- This object cannot be saved directly to the server.
- Only set the
id
field if you know what you are doing. Save operations will overwrite data when theid
is set. - Dummy data can be supplied for a required parameter, but if so,
.save()
should not be called on the object - FIELDS USED WHEN CREATING:
homeLocation
,name
,quantity
- FIELDS USED WHEN UPDATING:
homeLocation
,name
,quantity
Implementation
factory PcoCalendarResource(
{String? id,
DateTime? createdAt,
String? kind,
String? name,
String? serialNumber,
DateTime? updatedAt,
String? description,
DateTime? expiresAt,
String? homeLocation,
String? image,
int? quantity,
String? pathName,
Map<String, List<PcoResource>>? withRelationships,
List<PcoResource>? withIncluded}) {
var obj = PcoCalendarResource.empty();
obj._id = id;
if (createdAt != null)
obj._attributes['created_at'] = createdAt.toIso8601String();
if (kind != null) obj._attributes['kind'] = kind;
if (name != null) obj._attributes['name'] = name;
if (serialNumber != null) obj._attributes['serial_number'] = serialNumber;
if (updatedAt != null)
obj._attributes['updated_at'] = updatedAt.toIso8601String();
if (description != null) obj._attributes['description'] = description;
if (expiresAt != null)
obj._attributes['expires_at'] = expiresAt.toIso8601String();
if (homeLocation != null) obj._attributes['home_location'] = homeLocation;
if (image != null) obj._attributes['image'] = image;
if (quantity != null) obj._attributes['quantity'] = quantity;
if (pathName != null) obj._attributes['path_name'] = pathName;
if (withRelationships != null) {
for (var r in withRelationships.entries) {
obj._relationships[r.key] = r.value;
}
obj._hasManualRelationships = true;
}
if (withIncluded != null) {
obj._included.addAll(withIncluded);
obj._hasManualIncluded = true;
}
return obj;
}