text: /// =========================================================================
  /// AUTO-GENERATED FILE CREATED ON 2022-03-08T16:42:06.334822
  /// THIS FILE WAS AUTOMATICALLY GENERATED, MODIFICATIONS WILL BE OVERWRITTEN.
  /// =========================================================================
  
  
  
  import { PcoResource, PlanningCenterApiQuery, PcoCollection } from '../../pco.js'
  
  /// This class represents a PCO Groups Tag Object
  /// 
  /// - Application:        groups
  /// - Id:                 tag
  /// - Type:               Tag
  /// - ApiVersion:         2018-08-01
  /// - Is Deprecated:      false
  /// - Is Collection Only: false
  /// - Default Endpoint:   https://api.planningcenteronline.com/groups/v2/tags
  /// 
  /// Description:
  /// 
  /// 
  /// Example:
  /// ```json
  /// {
  ///   "type": "Tag",
  ///   "id": "1",
  ///   "attributes": {
  ///     "name": "string",
  ///     "position": 1
  ///   },
  ///   "relationships": {
  ///     "tag_group": {
  ///       "data": {
  ///         "type": "TagGroup",
  ///         "id": "1"
  ///       }
  ///     }
  ///   }
  /// }
  /// ```
  /// 
  /// Possible includes with parameter ?include=a,b
  /// NONE
  ///
  /// Possible queries using parameters like ?where[key]=value or ?where[key][gt|lt]=value
  /// - `id`: (URLParameter), query on a specific id, example: ?where[id]=primary_key
  /// - `name`: (URLParameter), query on a specific name, example: ?where[name]=string
  /// 
  /// Possible orderings with parameter ?order=
  /// - `name`: (URLParameter), prefix with a hyphen (-name) to reverse the order
  /// - `position`: (URLParameter), prefix with a hyphen (-position) to reverse the order
  ///
  /// All Outbound Edges:
  /// - `group-tag-groups`: https://api.planningcenteronline.com/groups/v2/tags/1/groups
  /// 
  /// All Inbound Edges:
  /// - `tag-group-tags`: https://api.planningcenteronline.com/groups/v2/groups/1/tags
  /// - `tag-taggroup-tags`: https://api.planningcenteronline.com/groups/v2/tag_groups/1/tags
  /// 
  /// All Actions:
  /// NONE
  ///
  export class PcoGroupsTag extends PcoResource {
    static kPcoApplication = 'groups';
    static kTypeString = 'Tag';
    static kTypeId = 'tag';
    static kApiVersion = '2018-08-01';
    static kShortestEdgeId = '';
    static kShortestEdgePathTemplate = 'https://api.planningcenteronline.com/groups/v2/tags';
    static kDefaultPathTemplate = 'https://api.planningcenteronline.com/groups/v2/tags';
  
    /// possible includes with parameter ?include=a,b
    /// 
    static get canInclude() { return [] }
  
    /// possible queries using parameters like ?where[key]=value or ?where[key][gt|lt]=value
    /// - `id`: (URLParameter), query on a specific id, example: ?where[id]=primary_key
    /// - `name`: (URLParameter), query on a specific name, example: ?where[name]=string
    static get canQuery() { return ['id','name'] }
  
    /// possible orderings with parameter ?order=
    /// - `name`: (URLParameter), prefix with a hyphen (-name) to reverse the order
    /// - `position`: (URLParameter), prefix with a hyphen (-position) to reverse the order
    static get canOrderBy() { return ['name','position'] }
  
    // By using overridden getters, the parent class can call the getter and will get the results from the
    // child class. This lets the parent access the static variables of the child class.
  
    // overrides parent method
    get shortestEdgePath() { return PcoGroupsTag.kShortestEdgePathTemplate; }
  
    // overrides parent method
    get defaultPathTemplate() { return PcoGroupsTag.kDefaultPathTemplate; }
  
    // overrides parent method
    get apiVersion() { return PcoGroupsTag.kApiVersion; }
  
    _apiPathOverride;
  
    // overrides parent method
    get apiPath() { return this.links['self'] ?? _apiPathOverride ?? super.apiPath; }
  
    // field mapping constants
    static get kId() { return 'id' }
    static get kName() { return 'name' }
    static get kPosition() { return 'position' }
  
  
    // getters and setters
    // @override
    get createAllowed() { return []; }
  
    // @override
    get updateAllowed() { return []; }
  
    // @override
    get canCreate() { return false; }
  
    // @override
    get canUpdate() { return false; }
  
    // @override
    get canDestroy() { return false; }
  
    // getters for object attributes
  
    get name() { return attributes[this.constructor.kName] ?? ''; }
    get position() { return attributes[this.constructor.kPosition] ?? 0; }
    
  
    // setters for object attributes
  
    
  
    // additional setters and getters for assignable values
  
    
  
  
  
    // Class Constructors
    // PcoGroupsTag._() : super(kPcoApplication, kTypeString);
    static createFromJson({ data, withIncludes = [] }) {
      let obj = new PcoGroupsTag({});
  
      // inherited methods
      obj.fromJson(data);
      obj.handleIncludes(withIncludes);
      return obj;
    };
  
  
  
    // ---------------------------------
    // Inbound Edges
    // ---------------------------------
  
  
  
    /// -- JAVASCRIPT --
    /// Will get a [PcoCollection] of [PcoGroupsTag] objects (expecting many)
    /// using a path like this: `/groups/v2/groups/${groupId}/tags`
    static getFromGroup(groupId, {id,  query, allIncludes = false}) {
      query = query ?? new PlanningCenterApiQuery({});
      if (allIncludes) query.include = PcoGroupsTag.canInclude;
      let apiVersion = this.kApiVersion; // reading static member from static member uses 'this'
      let url = `/groups/v2/groups/${groupId}/tags`;
      if (id != null) url += `/${id}`;
      return PcoCollection.fromApiCall(url, {query, apiVersion});
    }
  
  
    /// -- JAVASCRIPT --
    /// Will get a [PcoCollection] of [PcoGroupsTag] objects (expecting many)
    /// using a path like this: `/groups/v2/tag_groups/${tagGroupId}/tags`
    static getFromTagGroup(tagGroupId, {id,  query, allIncludes = false}) {
      query = query ?? new PlanningCenterApiQuery({});
      if (allIncludes) query.include = PcoGroupsTag.canInclude;
      let apiVersion = this.kApiVersion; // reading static member from static member uses 'this'
      let url = `/groups/v2/tag_groups/${tagGroupId}/tags`;
      if (id != null) url += `/${id}`;
      return PcoCollection.fromApiCall(url, {query, apiVersion});
    }
  
  
    // --------------------------------
    // Outbound Edges
    // --------------------------------
    // Instance functions to traverse outbound edges
  
    /// -- JAVASCRIPT --
    /// Will get a [PcoCollection] of [PcoGroupsGroup] objects (expecting many)
    /// using a path like this: `https://api.planningcenteronline.com/groups/v2/tags/1/groups`
    /// [query] should be an object mathching the [PlannningCenterApiQuery] class
    getGroups({query, allIncludes = false}) {
      query = query ?? new PlanningCenterApiQuery({});
      if (allIncludes) query.include = PcoGroupsGroup.canInclude;
      let url = `${apiEndpoint}/groups`;
      let apiVersion = this.apiVersion;
      return PcoCollection.fromApiCall(url, {query, apiVersion});
    }
  
  
    // --------------------------------
    // Actions
    // --------------------------------
    // Instance functions to run actions from this item
  
  
  
  }
  