PcoServicesBlockoutDate constructor

PcoServicesBlockoutDate({
  1. String? id,
  2. String? groupIdentifier,
  3. String? reason,
  4. String? timeZone,
  5. bool? isShare,
  6. DateTime? startsAt,
  7. DateTime? endsAt,
  8. DateTime? endsAtUtc,
  9. DateTime? startsAtUtc,
  10. Map<String, List<PcoResource>>? withRelationships,
  11. List<PcoResource>? withIncluded,
})

Create a new PcoServicesBlockoutDate 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 the id 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: none
  • FIELDS USED WHEN UPDATING: none

Implementation

factory PcoServicesBlockoutDate(
    {String? id,
    String? groupIdentifier,
    String? reason,
    String? timeZone,
    bool? isShare,
    DateTime? startsAt,
    DateTime? endsAt,
    DateTime? endsAtUtc,
    DateTime? startsAtUtc,
    Map<String, List<PcoResource>>? withRelationships,
    List<PcoResource>? withIncluded}) {
  var obj = PcoServicesBlockoutDate.empty();
  obj._id = id;
  if (groupIdentifier != null)
    obj._attributes['group_identifier'] = groupIdentifier;
  if (reason != null) obj._attributes['reason'] = reason;
  if (timeZone != null) obj._attributes['time_zone'] = timeZone;
  if (isShare != null) obj._attributes['share'] = isShare;
  if (startsAt != null)
    obj._attributes['starts_at'] = startsAt.toIso8601String();
  if (endsAt != null) obj._attributes['ends_at'] = endsAt.toIso8601String();
  if (endsAtUtc != null)
    obj._attributes['ends_at_utc'] = endsAtUtc.toIso8601String();
  if (startsAtUtc != null)
    obj._attributes['starts_at_utc'] = startsAtUtc.toIso8601String();

  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;
}