PcoPeopleCampus constructor

PcoPeopleCampus(
  1. {String? id,
  2. double? latitude,
  3. double? longitude,
  4. String? description,
  5. String? street,
  6. String? city,
  7. String? state,
  8. String? zip,
  9. String? country,
  10. String? phoneNumber,
  11. String? website,
  12. bool? isTwentyFourHourTime,
  13. int? dateFormat,
  14. bool? isChurchCenterEnabled,
  15. String? contactEmailAddress,
  16. String? timeZone,
  17. bool? isGeolocationSetManually,
  18. String? name,
  19. DateTime? createdAt,
  20. DateTime? updatedAt,
  21. String? avatarUrl,
  22. Map<String, List<PcoResource>>? withRelationships,
  23. List<PcoResource>? withIncluded}
)

Create a new PcoPeopleCampus object using this endpoint: https://api.planningcenteronline.com/people/v2/campuses

NOTES:

  • Creating an instance of a class this way does not save it on the server.
  • Call save() on the object to save it 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: latitude, longitude, description, street, city, state, zip, country, phoneNumber, website, isTwentyFourHourTime, dateFormat, isChurchCenterEnabled, contactEmailAddress, timeZone, isGeolocationSetManually, name
  • FIELDS USED WHEN UPDATING: latitude, longitude, description, street, city, state, zip, country, phoneNumber, website, isTwentyFourHourTime, dateFormat, isChurchCenterEnabled, contactEmailAddress, timeZone, isGeolocationSetManually, name

Implementation

factory PcoPeopleCampus(
    {String? id,
    double? latitude,
    double? longitude,
    String? description,
    String? street,
    String? city,
    String? state,
    String? zip,
    String? country,
    String? phoneNumber,
    String? website,
    bool? isTwentyFourHourTime,
    int? dateFormat,
    bool? isChurchCenterEnabled,
    String? contactEmailAddress,
    String? timeZone,
    bool? isGeolocationSetManually,
    String? name,
    DateTime? createdAt,
    DateTime? updatedAt,
    String? avatarUrl,
    Map<String, List<PcoResource>>? withRelationships,
    List<PcoResource>? withIncluded}) {
  var obj = PcoPeopleCampus.empty();
  obj._id = id;
  obj._apiPathOverride =
      'https://api.planningcenteronline.com/people/v2/campuses';
  if (latitude != null) obj._attributes['latitude'] = latitude;
  if (longitude != null) obj._attributes['longitude'] = longitude;
  if (description != null) obj._attributes['description'] = description;
  if (street != null) obj._attributes['street'] = street;
  if (city != null) obj._attributes['city'] = city;
  if (state != null) obj._attributes['state'] = state;
  if (zip != null) obj._attributes['zip'] = zip;
  if (country != null) obj._attributes['country'] = country;
  if (phoneNumber != null) obj._attributes['phone_number'] = phoneNumber;
  if (website != null) obj._attributes['website'] = website;
  if (isTwentyFourHourTime != null)
    obj._attributes['twenty_four_hour_time'] = isTwentyFourHourTime;
  if (dateFormat != null) obj._attributes['date_format'] = dateFormat;
  if (isChurchCenterEnabled != null)
    obj._attributes['church_center_enabled'] = isChurchCenterEnabled;
  if (contactEmailAddress != null)
    obj._attributes['contact_email_address'] = contactEmailAddress;
  if (timeZone != null) obj._attributes['time_zone'] = timeZone;
  if (isGeolocationSetManually != null)
    obj._attributes['geolocation_set_manually'] = isGeolocationSetManually;
  if (name != null) obj._attributes['name'] = name;
  if (createdAt != null)
    obj._attributes['created_at'] = createdAt.toIso8601String();
  if (updatedAt != null)
    obj._attributes['updated_at'] = updatedAt.toIso8601String();
  if (avatarUrl != null) obj._attributes['avatar_url'] = avatarUrl;

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