PcoServicesServiceType class Null safety

This class represents a PCO Services ServiceType Object

Instantiation

  • Create a new instance using the PcoServicesServiceType() constructor
  • Instantiate from existing JSON data using the PcoServicesServiceType.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 Service Type is a container for plans.

Attributes (and permissions)

  • id (ro) -> PCO: id
  • archivedAt (ro) -> PCO: archived_at
  • createdAt (ro) -> PCO: created_at
  • deletedAt (ro) -> PCO: deleted_at
  • name (rw) -> PCO: name
  • sequence (rw) -> PCO: sequence
  • updatedAt (ro) -> PCO: updated_at
  • isAttachmentTypesEnabled (rw) -> PCO: attachment_types_enabled
  • backgroundCheckPermissions (rw) -> PCO: background_check_permissions
  • commentPermissions (rw) -> PCO: comment_permissions
  • customItemTypes (rw) -> PCO: custom_item_types
  • frequency (rw) -> PCO: frequency
  • lastPlanFrom (rw) -> PCO: last_plan_from
  • permissions (ro) -> PCO: permissions
  • standardItemTypes (rw) -> PCO: standard_item_types
  • parentId (wo) -> PCO: parent_id

Edges and Actions

Outbound Edges:

Inbound Edges:

Actions:

Raw Data Object Example

{
  "type": "ServiceType",
  "id": "1",
  "attributes": {
    "archived_at": "2000-01-01T12:00:00Z",
    "created_at": "2000-01-01T12:00:00Z",
    "deleted_at": "2000-01-01T12:00:00Z",
    "name": "string",
    "sequence": 1,
    "updated_at": "2000-01-01T12:00:00Z",
    "attachment_types_enabled": true,
    "background_check_permissions": "string",
    "comment_permissions": "string",
    "custom_item_types": "string",
    "frequency": "string",
    "last_plan_from": "string",
    "permissions": "string",
    "standard_item_types": "string"
  },
  "relationships": {
    "parent": {
      "data": {
        "type": "Folder",
        "id": "1"
      }
    }
  }
}
Inheritance

Constructors

PcoServicesServiceType({String? id, DateTime? archivedAt, DateTime? createdAt, DateTime? deletedAt, String? name, int? sequence, DateTime? updatedAt, bool? isAttachmentTypesEnabled, String? backgroundCheckPermissions, String? commentPermissions, String? customItemTypes, String? frequency, String? lastPlanFrom, String? permissions, String? standardItemTypes, String? parentId, Map<String, List<PcoResource>>? withRelationships, List<PcoResource>? withIncluded})
Create a new PcoServicesServiceType object using this endpoint: https://api.planningcenteronline.com/services/v2/service_types
factory
PcoServicesServiceType.empty()
Create an empty instance of this class. This is only useful when an endpoint requires related or included data.
PcoServicesServiceType.fromJson(Map<String, dynamic> data, {List<Map<String, dynamic>>? withIncluded})

Properties

api PlanningCenter
planning center resources must be tied to an api
read-onlyinherited
apiEndpoint String
read-onlyinherited
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
read-onlyoverride
apiVersion String
child classes can override these getters which will allow methods in this class to see static variables from child classes
read-onlyoverride
archivedAt DateTime
read-only
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
read-onlyinherited
backgroundCheckPermissions String
pass null to remove key from attributes
read / write
canCreate bool
read-onlyoverride
canDestroy bool
read-onlyoverride
canUpdate bool
read-onlyoverride
commentPermissions String
pass null to remove key from attributes
read / write
createAllowed List<String>
read-onlyoverride
createdAt DateTime
read-onlyinherited
createPathTemplate String
read-onlyoverride
customItemTypes String
A array of hashes that maps an item title substring matcher to a color:
read / write
defaultPathTemplate String
read-onlyoverride
deletedAt DateTime
read-only
fetched bool
indicate whether an item is full or partial
read / writeinherited
frequency String
pass null to remove key from attributes
read / write
hashCode int
The hash code for this object.
read-onlyinherited
id String?
read-onlyinherited
included List<PcoResource>
contains included items parsed into objects
read-onlyinherited
includedTimePreferenceOptions List<PcoServicesTimePreferenceOption>
read-only
isAttachmentTypesEnabled bool
pass null to remove key from attributes
read / write
lastPlanFrom String
pass null to remove key from attributes
read / write
contains the links data returned by the api if present
read-onlyinherited
name String
pass null to remove key from attributes
read / write
needsSave bool
read-onlyinherited
parentId String
pass null to remove key from attributes
read / write
pcoApplication String
latefinalinherited
permissions String
read-only
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
read-onlyinherited
resourceType String
all planning center resources must have a type
latefinalinherited
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited
sequence int
pass null to remove key from attributes
read / write
slug String
read-onlyinherited
standardItemTypes String
An array of hashes that maps an item type to a color:
read / write
updateAllowed List<String>
read-onlyoverride
updatedAt DateTime
read-onlyinherited

Methods

coerceDouble(dynamic a) double
inherited
coerceInt(dynamic a) int
inherited
createPlans(Object data) Future<PlanningCenterApiResponse<PlanningCenterApiData>>
ACTION: create_plans
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
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/attachments
getItemNoteCategories({PcoServicesItemNoteCategoryQuery? query}) Future<PcoCollection<PcoServicesItemNoteCategory>>
Will get a collection of PcoServicesItemNoteCategory objects (expecting many) using a path like this: https://api.planningcenteronline.com/services/v2/service_types/1/item_note_categories
getLayouts({PcoServicesLayoutQuery? query}) Future<PcoCollection<PcoServicesLayout>>
Will get a collection of PcoServicesLayout objects (expecting many) using a path like this: https://api.planningcenteronline.com/services/v2/service_types/1/layouts
getLiveControllers({PcoServicesLiveControllerQuery? query}) Future<PcoCollection<PcoServicesLiveController>>
Will get a collection of PcoServicesLiveController objects (expecting many) using a path like this: https://api.planningcenteronline.com/services/v2/service_types/1/live_controllers
getPlanNoteCategories({PcoServicesPlanNoteCategoryQuery? query}) Future<PcoCollection<PcoServicesPlanNoteCategory>>
Will get a collection of PcoServicesPlanNoteCategory objects (expecting many) using a path like this: https://api.planningcenteronline.com/services/v2/service_types/1/plan_note_categories
getPlans({PcoServicesPlanQuery? query}) Future<PcoCollection<PcoServicesPlan>>
Will get a collection of PcoServicesPlan objects (expecting many) using a path like this: https://api.planningcenteronline.com/services/v2/service_types/1/plans
getPlanTemplates({PcoServicesPlanTemplateQuery? query}) Future<PcoCollection<PcoServicesPlanTemplate>>
Will get a collection of PcoServicesPlanTemplate objects (expecting many) using a path like this: https://api.planningcenteronline.com/services/v2/service_types/1/plan_templates
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/plan_times
getPublicView({PcoServicesPublicViewQuery? query}) Future<PcoCollection<PcoServicesPublicView>>
Will get a collection of PcoServicesPublicView objects (expecting many) using a path like this: https://api.planningcenteronline.com/services/v2/service_types/1/public_view
getTeamPositions({PcoServicesTeamPositionQuery? query}) Future<PcoCollection<PcoServicesTeamPosition>>
Will get a collection of PcoServicesTeamPosition objects (expecting many) using a path like this: https://api.planningcenteronline.com/services/v2/service_types/1/team_positions
getTeams({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/teams
getTimePreferenceOptions({PcoServicesTimePreferenceOptionQuery? query}) Future<PcoCollection<PcoServicesTimePreferenceOption>>
Will get a collection of PcoServicesTimePreferenceOption objects (expecting many) using a path like this: https://api.planningcenteronline.com/services/v2/service_types/1/time_preference_options
getUnscopedPlans({PcoServicesPlanQuery? query}) Future<PcoCollection<PcoServicesPlan>>
Will get a collection of PcoServicesPlan objects (expecting many) using a path like this: https://api.planningcenteronline.com/services/v2/service_types/1/unscoped_plans
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
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent 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
read-only
canOrderBy List<String>
possible orderings with parameter ?order=
read-only
canQuery List<String>
possible queries using parameters like ?wherekey=value or ?wheregt|lt=value
read-only

Static Methods

get({String? id, PcoServicesServiceTypeQuery? query, bool getAll = false, bool includeTimePreferenceOptions = false}) Future<PcoCollection<PcoServicesServiceType>>
Will get a PcoCollection of PcoServicesServiceType objects (expecting many) using a path like this: /services/v2/service_types
getAll({String? id, PcoServicesServiceTypeQuery? query, bool includeTimePreferenceOptions = false}) Future<PcoCollection<PcoServicesServiceType>>
Will get a PcoCollection containing ALL PcoServicesServiceType objects (expecting many) using a path like this: /services/v2/service_types
getAllFromFolder(String folderId, {String? id, PcoServicesServiceTypeQuery? query, bool includeTimePreferenceOptions = false}) Future<PcoCollection<PcoServicesServiceType>>
Will get a PcoCollection containing ALL PcoServicesServiceType objects (expecting many) using a path like this: /services/v2/folders/$folderId/service_types
getFromFolder(String folderId, {String? id, PcoServicesServiceTypeQuery? query, bool getAll = false, bool includeTimePreferenceOptions = false}) Future<PcoCollection<PcoServicesServiceType>>
Will get a PcoCollection of PcoServicesServiceType objects (expecting many) using a path like this: /services/v2/folders/$folderId/service_types
getFromSeriesAndPlanAndLive(String seriesId, String planId, String liveId, {PcoServicesServiceTypeQuery? query, bool getAll = false, bool includeTimePreferenceOptions = false}) Future<PcoCollection<PcoServicesServiceType>>
Will get a PcoCollection of PcoServicesServiceType objects (expecting one) using a path like this: /services/v2/series/$seriesId/plans/$planId/live/$liveId/service_type
getFromTeam(String teamId, {PcoServicesServiceTypeQuery? query, bool getAll = false, bool includeTimePreferenceOptions = false}) Future<PcoCollection<PcoServicesServiceType>>
Will get a PcoCollection of PcoServicesServiceType objects (expecting one) using a path like this: /services/v2/teams/$teamId/service_type
getSingle(String id, {PcoServicesServiceTypeQuery? query, bool includeTimePreferenceOptions = false}) Future<PcoServicesServiceType?>
Will get a single PcoServicesServiceType object using a path like this: /services/v2/service_types/[id]
getSingleFromFolder(String folderId, String id, {PcoServicesServiceTypeQuery? query, bool includeTimePreferenceOptions = false}) Future<PcoServicesServiceType?>
Will get a single PcoServicesServiceType object using a path like this: /services/v2/folders/$folderId/service_types/[id]

Constants

kApiVersion → const String
'2018-11-01'
kArchivedAt → const String
'archived_at'
kAttachmentTypesEnabled → const String
'attachment_types_enabled'
kBackgroundCheckPermissions → const String
'background_check_permissions'
kCommentPermissions → const String
'comment_permissions'
kCreatedAt → const String
'created_at'
kCreatePathTemplate → const String
'https://api.planningcenteronline.com/services/v2/service_types'
kCustomItemTypes → const String
'custom_item_types'
kDefaultPathTemplate → const String
'https://api.planningcenteronline.com/services/v2/service_types'
kDeletedAt → const String
'deleted_at'
kFrequency → const String
'frequency'
kId → const String
'id'
kLastPlanFrom → const String
'last_plan_from'
kName → const String
'name'
kParentId → const String
'parent_id'
kPcoApplication → const String
'services'
kPermissions → const String
'permissions'
kSequence → const String
'sequence'
kStandardItemTypes → const String
'standard_item_types'
kTypeId → const String
'service_type'
kTypeString → const String
'ServiceType'
kUpdatedAt → const String
'updated_at'