PcoServicesLive class Null safety
This class represents a PCO Services Live Object
- Application: services
- Id: live
- Type: Live
- ApiVersion: 2018-11-01
- Is Deprecated: false
- Is Collection Only: false
- Default Endpoint: https://api.planningcenteronline.com/services/v2/series/1/plans/1/live
- Create Endpoint: NONE
Instantiation
- Create a new instance using the
PcoServicesLive()
constructor - Instantiate from existing
JSON
data using thePcoServicesLive.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-onlyattributes
map. - Additional data is available through the read-only
links
andrelationships
maps. - Available relationships / includes are exposed through typed getters.
Description
Attributes (and permissions)
id
(ro) -> PCO:id
seriesTitle
(ro) -> PCO:series_title
title
(ro) -> PCO:title
dates
(ro) -> PCO:dates
liveChannel
(ro) -> PCO:live_channel
chatRoomChannel
(ro) -> PCO:chat_room_channel
isCanControl
(ro) -> PCO:can_control
isCanTakeControl
(ro) -> PCO:can_take_control
isCanChat
(ro) -> PCO:can_chat
isCanControlVideoFeed
(ro) -> PCO:can_control_video_feed
Edges and Actions
Outbound Edges:
person-live-controller
: https://api.planningcenteronline.com/services/v2/series/1/plans/1/live/1/controlleritemtime-live-current_item_time
: https://api.planningcenteronline.com/services/v2/series/1/plans/1/live/1/current_item_timeitem-live-items
: https://api.planningcenteronline.com/services/v2/series/1/plans/1/live/1/itemsitemtime-live-next_item_time
: https://api.planningcenteronline.com/services/v2/series/1/plans/1/live/1/next_item_timeservicetype-live-service_type
: https://api.planningcenteronline.com/services/v2/series/1/plans/1/live/1/service_typeplan-live-watchable_plans
: https://api.planningcenteronline.com/services/v2/series/1/plans/1/live/1/watchable_plans
Inbound Edges:
Actions:
go_to_next_item
: https://api.planningcenteronline.com/services/v2/series/1/plans/1/live/1/go_to_next_itemgo_to_previous_item
: https://api.planningcenteronline.com/services/v2/series/1/plans/1/live/1/go_to_previous_itemtoggle_control
: https://api.planningcenteronline.com/services/v2/series/1/plans/1/live/1/toggle_control
Raw Data Object Example
{
"type": "Live",
"id": "1",
"attributes": {
"series_title": "string",
"title": "string",
"dates": "string",
"live_channel": "string",
"chat_room_channel": "string",
"can_control": true,
"can_take_control": true,
"can_chat": true,
"can_control_video_feed": true
},
"relationships": {}
}
- Inheritance
-
- Object
- PcoResource
- PcoServicesLive
Constructors
-
PcoServicesLive({String? id, String? seriesTitle, String? title, String? dates, String? liveChannel, String? chatRoomChannel, bool? isCanControl, bool? isCanTakeControl, bool? isCanChat, bool? isCanControlVideoFeed, Map<
String, List< ? withRelationships, List<PcoResource> >PcoResource> ? withIncluded}) -
Create a new PcoServicesLive object. This object cannot be created with the API
factory
- PcoServicesLive.empty()
- Create an empty instance of this class. This is only useful when an endpoint requires related or included data.
-
PcoServicesLive.fromJson(Map<
String, dynamic> data, {List<Map< ? withIncluded})String, dynamic> >
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
-
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
- canCreate → bool
-
read-onlyoverride
- canDestroy → bool
-
read-onlyoverride
- canUpdate → bool
-
read-onlyoverride
- chatRoomChannel → String
-
read-only
-
createAllowed
→ List<
String> -
read-onlyoverride
- createdAt → DateTime
-
read-onlyinherited
- createPathTemplate → String
-
read-onlyoverride
- dates → String
-
read-only
- defaultPathTemplate → String
-
read-onlyoverride
- fetched ↔ bool
-
indicate whether an item is full or partial
read / writeinherited
- 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
-
includedItems
→ List<
PcoServicesItem> -
read-only
- includedServiceType → PcoServicesServiceType?
-
read-only
- isCanChat → bool
-
read-only
- isCanControl → bool
-
read-only
- isCanControlVideoFeed → bool
-
read-only
- isCanTakeControl → bool
-
read-only
-
links
→ ReadOnlyMapView<
String, dynamic> -
contains the links data returned by the api if present
read-onlyinherited
- liveChannel → String
-
read-only
- needsSave → bool
-
read-onlyinherited
- pcoApplication ↔ String
-
latefinalinherited
-
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
- seriesTitle → String
-
read-only
- slug → String
-
read-onlyinherited
- title → String
-
read-only
-
updateAllowed
→ List<
String> -
read-onlyoverride
- updatedAt → DateTime
-
read-onlyinherited
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< ? withIncluded}) → dynamicString, dynamic> > -
Takes a full JSON:API Response Object (the contents of a "data" field)
will clear and update id, apiPath, attributes and
_relationships
inherited -
getController(
{PcoServicesPersonQuery? query}) → Future< PcoCollection< PcoServicesPerson> > -
Will get a collection of PcoServicesPerson objects (expecting many)
using a path like this:
https://api.planningcenteronline.com/services/v2/series/1/plans/1/live/1/controller
-
getCurrentItemTime(
{PcoServicesItemTimeQuery? query}) → Future< PcoCollection< PcoServicesItemTime> > -
Will get a collection of PcoServicesItemTime objects (expecting many)
using a path like this:
https://api.planningcenteronline.com/services/v2/series/1/plans/1/live/1/current_item_time
-
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/series/1/plans/1/live/1/items
-
getNextItemTime(
{PcoServicesItemTimeQuery? query}) → Future< PcoCollection< PcoServicesItemTime> > -
Will get a collection of PcoServicesItemTime objects (expecting many)
using a path like this:
https://api.planningcenteronline.com/services/v2/series/1/plans/1/live/1/next_item_time
-
getServiceType(
{PcoServicesServiceTypeQuery? query}) → Future< PcoCollection< PcoServicesServiceType> > -
Will get a collection of PcoServicesServiceType objects (expecting many)
using a path like this:
https://api.planningcenteronline.com/services/v2/series/1/plans/1/live/1/service_type
-
getWatchablePlans(
{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/series/1/plans/1/live/1/watchable_plans
-
goToNextItem(
Object data) → Future< PlanningCenterApiResponse< PlanningCenterApiData> > -
ACTION:
go_to_next_item
-
goToPreviousItem(
Object data) → Future< PlanningCenterApiResponse< PlanningCenterApiData> > -
ACTION:
go_to_previous_item
-
handleIncludes(
List< Map< included) → voidString, dynamic> > -
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< included = const []]) → Map<String, dynamic> >String, List< PcoResource> > -
inherited
-
includedController<
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.
-
includedCurrentItemTime<
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.
-
includedNextItemTime<
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.
-
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) operationsinherited -
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 -
toggleControl(
Object data) → Future< PlanningCenterApiResponse< PlanningCenterApiData> > -
ACTION:
toggle_control
-
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 ?where
key
=value or ?wheregt|lt
=valueread-only
Static Methods
-
getAllFromServiceTypeAndPlan(
String serviceTypeId, String planId, {String? id, PcoServicesLiveQuery? query, bool includeAllRelated = false, bool includeController = false, bool includeCurrentItemTime = false, bool includeItems = false, bool includeNextItemTime = false, bool includeServiceType = false}) → Future< PcoCollection< PcoServicesLive> > -
Will get a
PcoCollection
containing ALL PcoServicesLive objects (expecting many) using a path like this:/services/v2/service_types/$serviceTypeId/plans/$planId/live
-
getFromServiceTypeAndPlan(
String serviceTypeId, String planId, {String? id, PcoServicesLiveQuery? query, bool getAll = false, bool includeAllRelated = false, bool includeController = false, bool includeCurrentItemTime = false, bool includeItems = false, bool includeNextItemTime = false, bool includeServiceType = false}) → Future< PcoCollection< PcoServicesLive> > -
Will get a
PcoCollection
of PcoServicesLive objects (expecting many) using a path like this:/services/v2/service_types/$serviceTypeId/plans/$planId/live
-
getSingleFromServiceTypeAndPlan(
String serviceTypeId, String planId, String id, {PcoServicesLiveQuery? query, bool includeAllRelated = false, bool includeController = false, bool includeCurrentItemTime = false, bool includeItems = false, bool includeNextItemTime = false, bool includeServiceType = false}) → Future< PcoServicesLive?> -
Will get a single
PcoServicesLive
object using a path like this:/services/v2/service_types/$serviceTypeId/plans/$planId/live/[id]
Constants
- kApiVersion → const String
-
'2018-11-01'
- kCanChat → const String
-
'can_chat'
- kCanControl → const String
-
'can_control'
- kCanControlVideoFeed → const String
-
'can_control_video_feed'
- kCanTakeControl → const String
-
'can_take_control'
- kChatRoomChannel → const String
-
'chat_room_channel'
- kCreatePathTemplate → const String
-
'null'
- kDates → const String
-
'dates'
- kDefaultPathTemplate → const String
-
'https://api.planningcenteronline.com/services/v2/series/1/plans/1/live'
- kId → const String
-
'id'
- kLiveChannel → const String
-
'live_channel'
- kPcoApplication → const String
-
'services'
- kSeriesTitle → const String
-
'series_title'
- kTitle → const String
-
'title'
- kTypeId → const String
-
'live'
- kTypeString → const String
-
'Live'