projectal.entities.location API documentation

# projectal.entities.location

View Source

    from datetime import datetime

    from projectal.entity import Entity
    from projectal import api

    class Location(Entity):
        """
        Implementation of the [Location](https://projectal.com/docs/latest/#tag/Location) API.
        """
        _path = 'location'
        _name = 'LOCATION'

        @classmethod
        def calendar(cls, uuId, begin=None, until=None):
            """
            Get the location's calendar.
            `uuId`: The location `uuId`
            `begin`: Start date in `yyyy-MM-dd` format
            `until`: End date in `yyyy-MM-dd` format
            """
            if begin:
                begin = datetime.strptime(begin, '%Y-%m-%d').date()
            if until:
                until = datetime.strptime(until, '%Y-%m-%d').date()

            url = '/api/location/{}/calendar?'.format(uuId)
            params = []
            params.append('begin={}'.format(begin)) if begin else None
            params.append('until={}'.format(until)) if until else None
            url += '&'.join(params)

            return api.get(url)

class Location(projectal.entity.Entity):
View Source

    class Location(Entity):
        """
        Implementation of the [Location](https://projectal.com/docs/latest/#tag/Location) API.
        """
        _path = 'location'
        _name = 'LOCATION'

        @classmethod
        def calendar(cls, uuId, begin=None, until=None):
            """
            Get the location's calendar.
            `uuId`: The location `uuId`
            `begin`: Start date in `yyyy-MM-dd` format
            `until`: End date in `yyyy-MM-dd` format
            """
            if begin:
                begin = datetime.strptime(begin, '%Y-%m-%d').date()
            if until:
                until = datetime.strptime(until, '%Y-%m-%d').date()

            url = '/api/location/{}/calendar?'.format(uuId)
            params = []
            params.append('begin={}'.format(begin)) if begin else None
            params.append('until={}'.format(until)) if until else None
            url += '&'.join(params)

            return api.get(url)

Implementation of the Location API.

@classmethod
def calendar(cls, uuId, begin=None, until=None):
View Source

        @classmethod
        def calendar(cls, uuId, begin=None, until=None):
            """
            Get the location's calendar.
            `uuId`: The location `uuId`
            `begin`: Start date in `yyyy-MM-dd` format
            `until`: End date in `yyyy-MM-dd` format
            """
            if begin:
                begin = datetime.strptime(begin, '%Y-%m-%d').date()
            if until:
                until = datetime.strptime(until, '%Y-%m-%d').date()

            url = '/api/location/{}/calendar?'.format(uuId)
            params = []
            params.append('begin={}'.format(begin)) if begin else None
            params.append('until={}'.format(until)) if until else None
            url += '&'.join(params)

            return api.get(url)

Get the location's calendar. `uuId`: The location `uuId` `begin`: Start date in `yyyy-MM-dd` format `until`: End date in `yyyy-MM-dd` format

##### Inherited Members

projectal.entity.Entity
  Entity
  get
  update
  delete
  create
  save
  clone
  history
  list
  match
  match_startswith
  match_endswith
  search
  query
  profile_get
  profile_set
  changes
  set_readonly
builtins.dict
  setdefault
  pop
  popitem
  keys
  items
  values
  fromkeys
  clear
  copy