PcoServicesPlan class

This class represents a PCO Services Plan Object

Instantiation

  • Create a new instance using the PcoServicesPlan() constructor
  • Instantiate from existing JSON data using the PcoServicesPlan.fromJson() constructor.
  • Load an instance from the API using one of the static methods defined on this class.

Usage

  • Fields exposed by the API are readable through getter methods.
  • Fields writable by the API are exposed through setter methods.
  • Original json data is exposed through the read-only attributes map.
  • Additional data is available through the read-only links and relationships maps.
  • Available relationships / includes are exposed through typed getters.

Description

A single plan within a Service Type.

Attributes (and permissions)

  • id (ro) -> PCO: id
  • createdAt (ro) -> PCO: created_at
  • title (rw) -> PCO: title
  • updatedAt (ro) -> PCO: updated_at
  • isPublic (rw) -> PCO: public
  • seriesTitle (rw) -> PCO: series_title
  • planNotesCount (ro) -> PCO: plan_notes_count
  • otherTimeCount (ro) -> PCO: other_time_count
  • rehearsalTimeCount (ro) -> PCO: rehearsal_time_count
  • serviceTimeCount (ro) -> PCO: service_time_count
  • planPeopleCount (ro) -> PCO: plan_people_count
  • neededPositionsCount (ro) -> PCO: needed_positions_count
  • itemsCount (ro) -> PCO: items_count
  • totalLength (ro) -> PCO: total_length
  • isCanViewOrder (ro) -> PCO: can_view_order
  • isMultiDay (ro) -> PCO: multi_day
  • isPrefersOrderView (ro) -> PCO: prefers_order_view
  • isRehearsable (ro) -> PCO: rehearsable
  • filesExpireAt (ro) -> PCO: files_expire_at
  • sortDate (ro) -> PCO: sort_date
  • lastTimeAt (ro) -> PCO: last_time_at
  • permissions (ro) -> PCO: permissions
  • dates (ro) -> PCO: dates
  • shortDates (ro) -> PCO: short_dates
  • planningCenterUrl (ro) -> PCO: planning_center_url
  • isRemindersDisabled (rw) -> PCO: reminders_disabled
  • seriesId (wo) -> PCO: series_id

Edges and Actions

Outbound Edges:

Inbound Edges:

Actions:

Raw Data Object Example

{
  "type": "Plan",
  "id": "1",
  "attributes": {
    "created_at": "2000-01-01T12:00:00Z",
    "title": "string",
    "updated_at": "2000-01-01T12:00:00Z",
    "public": true,
    "series_title": "string",
    "plan_notes_count": 1,
    "other_time_count": 1,
    "rehearsal_time_count": 1,
    "service_time_count": 1,
    "plan_people_count": 1,
    "needed_positions_count": 1,
    "items_count": 1,
    "total_length": 1,
    "can_view_order": true,
    "multi_day": true,
    "prefers_order_view": true,
    "rehearsable": true,
    "files_expire_at": "2000-01-01T12:00:00Z",
    "sort_date": "2000-01-01T12:00:00Z",
    "last_time_at": "2000-01-01T12:00:00Z",
    "permissions": "string",
    "dates": "string",
    "short_dates": "string",
    "planning_center_url": "string",
    "reminders_disabled": true
  },
  "relationships": {
    "service_type": {
      "data": {
        "type": "ServiceType",
        "id": "1"
      }
    },
    "next_plan": {
      "data": {
        "type": "Plan",
        "id": "1"
      }
    },
    "previous_plan": {
      "data": {
        "type": "Plan",
        "id": "1"
      }
    },
    "attachment_types": {
      "data": [
        {
          "type": "AttachmentType",
          "id": "1"
        }
      ]
    },
    "series": {
      "data": {
        "type": "Series",
        "id": "1"
      }
    },
    "created_by": {
      "data": {
        "type": "Person",
        "id": "1"
      }
    },
    "updated_by": {
      "data": {
        "type": "Person",
        "id": "1"
      }
    },
    "linked_publishing_episode": {
      "data": {
        "type": "LinkedPublishingEpisode",
        "id": "1"
      }
    }
  }
}
Inheritance

Constructors

PcoServicesPlan({required String serviceTypeId, String? id, DateTime? createdAt, String? title, DateTime? updatedAt, bool? isPublic, String? seriesTitle, int? planNotesCount, int? otherTimeCount, int? rehearsalTimeCount, int? serviceTimeCount, int? planPeopleCount, int? neededPositionsCount, int? itemsCount, int? totalLength, bool? isCanViewOrder, bool? isMultiDay, bool? isPrefersOrderView, bool? isRehearsable, DateTime? filesExpireAt, DateTime? sortDate, DateTime? lastTimeAt, String? permissions, String? dates, String? shortDates, String? planningCenterUrl, bool? isRemindersDisabled, String? seriesId, Map<String, List<PcoResource>>? withRelationships, List<PcoResource>? withIncluded})
Create a new PcoServicesPlan object using this endpoint: https://api.planningcenteronline.com/services/v2/service_types/$serviceTypeId/plans
factory
PcoServicesPlan.empty()
Create an empty instance of this class. This is only useful when an endpoint requires related or included data.
PcoServicesPlan.fromJson(Map<String, dynamic> data, {List<Map<String, dynamic>>? withIncluded})

Properties

api PlanningCenter
planning center resources must be tied to an api
no setterinherited
apiEndpoint String
no setterinherited
apiPath String
PcoResources include their own path as a link object but this might be null if we haven't created/fetched the object yet Child classes should redefine this getter to allow for manual path overrides
no setteroverride
apiVersion String
child classes can override these getters which will allow methods in this class to see static variables from child classes
no setteroverride
attributes ReadOnlyMapView<String, dynamic>
contains the underlying attributes returned by the api and allows a user to access arbitrary data in the attributes by actual api name
no setterinherited
canCreate bool
no setteroverride
canDestroy bool
no setteroverride
canUpdate bool
no setteroverride
createAllowed List<String>
no setteroverride
createdAt DateTime
no setterinherited
createPathTemplate String
no setteroverride
dates String
no setter
defaultPathTemplate String
no setteroverride
fetched bool
indicate whether an item is full or partial
getter/setter pairinherited
filesExpireAt DateTime
no setter
hashCode int
The hash code for this object.
no setterinherited
id String?
no setterinherited
included List<PcoResource>
contains included items parsed into objects
no setterinherited
includedContributors List<PcoServicesContributor>
no setter
includedPlanTimes List<PcoServicesPlanTime>
no setter
includedSeries List<PcoServicesSeries>
no setter
isCanViewOrder bool
no setter
isMultiDay bool
no setter
isPrefersOrderView bool
no setter
isPublic bool
True if Public Access has been enabled.
getter/setter pair
isRehearsable bool
no setter
isRemindersDisabled bool
pass null to remove key from attributes
getter/setter pair
itemsCount int
no setter
lastTimeAt DateTime
no setter
contains the links data returned by the api if present
no setterinherited
neededPositionsCount int
no setter
needsSave bool
no setterinherited
otherTimeCount int
no setter
pcoApplication String
latefinalinherited
permissions String
no setter
planningCenterUrl String
no setter
planNotesCount int
no setter
planPeopleCount int
no setter
rehearsalTimeCount int
no setter
relationships ReadOnlyMapView<String, List<PcoResource>>
contains relationships parsed into objects even though the api sends relationship objects as Maps or Lists we always put them into lists for consistency
no setterinherited
resourceType String
all planning center resources must have a type
latefinalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
seriesId String
pass null to remove key from attributes
getter/setter pair
seriesTitle String
pass null to remove key from attributes
getter/setter pair
serviceTimeCount int
no setter
shortDates String
no setter
slug String
no setterinherited
sortDate DateTime
no setter
title String
pass null to remove key from attributes
getter/setter pair
totalLength int
no setter
updateAllowed List<String>
no setteroverride
updatedAt DateTime
no setterinherited

Methods

coerceDouble(dynamic a) double
inherited
coerceInt(dynamic a) int
inherited
delete() Future<PlanningCenterApiResponse<PlanningCenterApiData>>
inherited
filteredAttributes(List<String> allowedKeys) Map<String, dynamic>
inherited
fromJson(Map<String, dynamic> data, {List<Map<String, dynamic>>? withIncluded}) → dynamic
Takes a full JSON:API Response Object (the contents of a "data" field) will clear and update id, apiPath, attributes and _relationships
inherited
getAllAttachments({PcoServicesAttachmentQuery? query}) Future<PcoCollection<PcoServicesAttachment>>
Will get a collection of PcoServicesAttachment objects (expecting many) using a path like this: https://api.planningcenteronline.com/services/v2/service_types/1/plans/1/all_attachments
getAttachments({PcoServicesAttachmentQuery? query}) Future<PcoCollection<PcoServicesAttachment>>
Will get a collection of PcoServicesAttachment objects (expecting many) using a path like this: https://api.planningcenteronline.com/services/v2/service_types/1/plans/1/attachments
getContributors({PcoServicesContributorQuery? query}) Future<PcoCollection<PcoServicesContributor>>
Will get a collection of PcoServicesContributor objects (expecting many) using a path like this: https://api.planningcenteronline.com/services/v2/service_types/1/plans/1/contributors
getItems({PcoServicesItemQuery? query}) Future<PcoCollection<PcoServicesItem>>
Will get a collection of PcoServicesItem objects (expecting many) using a path like this: https://api.planningcenteronline.com/services/v2/service_types/1/plans/1/items
getLive({PcoServicesLiveQuery? query}) Future<PcoCollection<PcoServicesLive>>
Will get a collection of PcoServicesLive objects (expecting many) using a path like this: https://api.planningcenteronline.com/services/v2/service_types/1/plans/1/live
getMySchedules({PcoServicesScheduleQuery? query}) Future<PcoCollection<PcoServicesSchedule>>
Will get a collection of PcoServicesSchedule objects (expecting many) using a path like this: https://api.planningcenteronline.com/services/v2/service_types/1/plans/1/my_schedules
getNeededPositions({PcoServicesNeededPositionQuery? query}) Future<PcoCollection<PcoServicesNeededPosition>>
Will get a collection of PcoServicesNeededPosition objects (expecting many) using a path like this: https://api.planningcenteronline.com/services/v2/service_types/1/plans/1/needed_positions
getNextPlan({PcoServicesPlanQuery? query}) Future<PcoCollection<PcoServicesPlan>>
Will get a collection of PcoServicesPlan objects (expecting one) using a path like this: https://api.planningcenteronline.com/services/v2/service_types/1/plans/1/next_plan
getNotes({PcoServicesPlanNoteQuery? query}) Future<PcoCollection<PcoServicesPlanNote>>
Will get a collection of PcoServicesPlanNote objects (expecting many) using a path like this: https://api.planningcenteronline.com/services/v2/service_types/1/plans/1/notes
getPlanTimes({PcoServicesPlanTimeQuery? query}) Future<PcoCollection<PcoServicesPlanTime>>
Will get a collection of PcoServicesPlanTime objects (expecting many) using a path like this: https://api.planningcenteronline.com/services/v2/service_types/1/plans/1/plan_times
getPreviousPlan({PcoServicesPlanQuery? query}) Future<PcoCollection<PcoServicesPlan>>
Will get a collection of PcoServicesPlan objects (expecting one) using a path like this: https://api.planningcenteronline.com/services/v2/service_types/1/plans/1/previous_plan
getSeries({PcoServicesSeriesQuery? query}) Future<PcoCollection<PcoServicesSeries>>
Will get a collection of PcoServicesSeries objects (expecting one) using a path like this: https://api.planningcenteronline.com/services/v2/service_types/1/plans/1/series
getSignupTeams({PcoServicesTeamQuery? query}) Future<PcoCollection<PcoServicesTeam>>
Will get a collection of PcoServicesTeam objects (expecting many) using a path like this: https://api.planningcenteronline.com/services/v2/service_types/1/plans/1/signup_teams
getTeamMembers({PcoServicesPlanPersonQuery? query}) Future<PcoCollection<PcoServicesPlanPerson>>
Will get a collection of PcoServicesPlanPerson objects (expecting many) using a path like this: https://api.planningcenteronline.com/services/v2/service_types/1/plans/1/team_members
handleIncludes(List<Map<String, dynamic>> included) → void
This function populates the relationships with typed resource objects based on the data in the included map of the json.
inherited
handleItem(Map<String, dynamic> data) PcoResource?
inherited
handleRelationships(Map<String, dynamic> items, [List<Map<String, dynamic>> included = const []]) Map<String, List<PcoResource>>
inherited
importTemplate(Object data) Future<PlanningCenterApiResponse<PlanningCenterApiData>>
ACTION: import_template
includedMySchedules<T extends PcoResource>() List<T>
The code generator could not automatically determine the resource type of this relationship. For type safe code, you should specify it in the type argument when calling.
itemReorder(Object data) Future<PlanningCenterApiResponse<PlanningCenterApiData>>
ACTION: item_reorder
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
save({Map<String, PcoResource>? withRelated, List<PcoResource>? withIncluded}) Future<PlanningCenterApiResponse<PlanningCenterApiData>>
Many Planning Center endpoints allow or require additional relationships and/or included items to be sent with a create/update operation. Since these cannot always be determined by the automatic code generation, they may be included as arguments to the save operation.
inherited
toCreateResource() Map<String, dynamic>
create the attributes Map for this object without the id field using only the attributes allowed in create (post) operations
inherited
toDataMap({Map<String, PcoResource>? withRelated, List<PcoResource>? withIncluded}) Map<String, dynamic>
create a json-api Map for this object automatically selecting create or update based on the existence of the id field. Will result in something like this:
inherited
toIdResource() Map<String, dynamic>
returns the simplest representation of this resource with only the type and the id:
inherited
toJson({dynamic includeAttributes = true, dynamic includeRelationships = false}) Map<String, dynamic>
Some api requests only want the type and id of an object. In those cases, set includeAttributes to false or call toIdResource instead.
inherited
toString() String
A string representation of this object.
inherited
toUpdateResource() Map<String, dynamic>
create the attributes Map for this object using only the attributes allowed in update (patch) operations
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

canInclude List<String>
possible includes with parameter ?include=a,b
no setter
canOrderBy List<String>
possible orderings with parameter ?order=
no setter
canQuery List<String>
possible queries using parameters like ?wherekey=value or ?wheregt|lt=value
no setter

Static Methods

getAllFromSeries(String seriesId, {String? id, PcoServicesPlanQuery? query, bool includeAllRelated = false, bool includeContributors = false, bool includeMySchedules = false, bool includePlanTimes = false, bool includeSeries = false}) Future<PcoCollection<PcoServicesPlan>>
Will get a PcoCollection containing ALL PcoServicesPlan objects (expecting many) using a path like this: /services/v2/series/$seriesId/plans
getAllFromServiceType(String serviceTypeId, {String? id, PcoServicesPlanQuery? query, bool includeAllRelated = false, bool includeContributors = false, bool includeMySchedules = false, bool includePlanTimes = false, bool includeSeries = false}) Future<PcoCollection<PcoServicesPlan>>
Will get a PcoCollection containing ALL PcoServicesPlan objects (expecting many) using a path like this: /services/v2/service_types/$serviceTypeId/plans
getFromPersonAndPlanPerson(String personId, String planPersonId, {PcoServicesPlanQuery? query, bool getAll = false, bool includeAllRelated = false, bool includeContributors = false, bool includeMySchedules = false, bool includePlanTimes = false, bool includeSeries = false}) Future<PcoCollection<PcoServicesPlan>>
Will get a PcoCollection of PcoServicesPlan objects (expecting one) using a path like this: /services/v2/people/$personId/plan_people/$planPersonId/plan
getFromSeries(String seriesId, {String? id, PcoServicesPlanQuery? query, bool getAll = false, bool includeAllRelated = false, bool includeContributors = false, bool includeMySchedules = false, bool includePlanTimes = false, bool includeSeries = false}) Future<PcoCollection<PcoServicesPlan>>
Will get a PcoCollection of PcoServicesPlan objects (expecting many) using a path like this: /services/v2/series/$seriesId/plans
getFromServiceType(String serviceTypeId, {String? id, PcoServicesPlanQuery? query, bool getAll = false, bool includeAllRelated = false, bool includeContributors = false, bool includeMySchedules = false, bool includePlanTimes = false, bool includeSeries = false}) Future<PcoCollection<PcoServicesPlan>>
Will get a PcoCollection of PcoServicesPlan objects (expecting many) using a path like this: /services/v2/service_types/$serviceTypeId/plans
getNextPlanFromServiceTypeAndPlan(String serviceTypeId, String planId, {PcoServicesPlanQuery? query, bool getAll = false, bool includeAllRelated = false, bool includeContributors = false, bool includeMySchedules = false, bool includePlanTimes = false, bool includeSeries = false}) Future<PcoCollection<PcoServicesPlan>>
Will get a PcoCollection of PcoServicesPlan objects (expecting one) using a path like this: /services/v2/service_types/$serviceTypeId/plans/$planId/next_plan
getPreviousPlanFromServiceTypeAndPlan(String serviceTypeId, String planId, {PcoServicesPlanQuery? query, bool getAll = false, bool includeAllRelated = false, bool includeContributors = false, bool includeMySchedules = false, bool includePlanTimes = false, bool includeSeries = false}) Future<PcoCollection<PcoServicesPlan>>
Will get a PcoCollection of PcoServicesPlan objects (expecting one) using a path like this: /services/v2/service_types/$serviceTypeId/plans/$planId/previous_plan
getSingleFromSeries(String seriesId, String id, {PcoServicesPlanQuery? query, bool includeAllRelated = false, bool includeContributors = false, bool includeMySchedules = false, bool includePlanTimes = false, bool includeSeries = false}) Future<PcoServicesPlan?>
Will get a single PcoServicesPlan object using a path like this: /services/v2/series/$seriesId/plans/[id]
getSingleFromServiceType(String serviceTypeId, String id, {PcoServicesPlanQuery? query, bool includeAllRelated = false, bool includeContributors = false, bool includeMySchedules = false, bool includePlanTimes = false, bool includeSeries = false}) Future<PcoServicesPlan?>
Will get a single PcoServicesPlan object using a path like this: /services/v2/service_types/$serviceTypeId/plans/[id]
getUnscopedPlansFromServiceType(String serviceTypeId, {PcoServicesPlanQuery? query, bool getAll = false, bool includeAllRelated = false, bool includeContributors = false, bool includeMySchedules = false, bool includePlanTimes = false, bool includeSeries = false}) Future<PcoCollection<PcoServicesPlan>>
Will get a PcoCollection of PcoServicesPlan objects (expecting one) using a path like this: /services/v2/service_types/$serviceTypeId/unscoped_plans
getWatchablePlansFromSeriesAndPlanAndLive(String seriesId, String planId, String liveId, {PcoServicesPlanQuery? query, bool getAll = false, bool includeAllRelated = false, bool includeContributors = false, bool includeMySchedules = false, bool includePlanTimes = false, bool includeSeries = false}) Future<PcoCollection<PcoServicesPlan>>
Will get a PcoCollection of PcoServicesPlan objects (expecting one) using a path like this: /services/v2/series/$seriesId/plans/$planId/live/$liveId/watchable_plans