Skip to content

Developers

How can we help you?

← Go back

Scheduling right reference

A SchedulingRightReference represents the relationship between a Scheduling and a right-like entity — a Right, a DeniedRight, or a Blackout — that is affecting the scheduling’s rights status.

The relation-type attribute indicates how the associated entity is affecting the scheduling:

  • clearing: the entity grants availability to the scheduling.
  • conflicting: the entity conflicts with the scheduling (e.g. a right that partially overlaps or violates a restriction).
  • denying: the entity denies availability to the scheduling.

This is how a scheduling right reference looks like:

<?xml version="1.0" encoding="UTF-8"?>
<scheduling-right-reference>
  <relation-type>clearing</relation-type>
  <rightable-type>Right</rightable-type>
  <scheduling-status>cleared</scheduling-status>
  <link rel="scheduling" href="https://movida.bebanjo.net/api/schedulings/23816"/>
  <link rel="rightable" href="https://movida.bebanjo.net/api/rights/4"/>
</scheduling-right-reference>
{
  "resource_type": "scheduling_right_reference",
  "relation_type": "clearing",
  "rightable_type": "Right",
  "scheduling_status": "cleared",
  "scheduling_link": "https://movida.bebanjo.net/api/schedulings/23816",
  "rightable_link": "https://movida.bebanjo.net/api/rights/4"
}

Valid attributes

  • relation-type (read-only): how the associated entity is affecting the scheduling. Possible values are:

    • clearing: the entity clears the scheduling, granting availability.
    • conflicting: the entity conflicts with the scheduling.
    • denying: the entity denies availability to the scheduling.
  • rightable-type (read-only): the type of the associated entity. Possible values are Right, DeniedRight, and Blackout.

  • scheduling-status (read-only): the rights status of the scheduling at the time the reference was computed. Possible values are cleared, conflicting, denied, and no_rights.

  • scheduling: the scheduling that is being affected.
  • rightable: the Right, DeniedRight, or Blackout that is affecting the scheduling. The URL will point to the corresponding resource depending on the value of rightable-type.

Get a list of scheduling right references from a scheduling

Each Scheduling exposes a rel="reference_rights" link. Following it returns a list of scheduling right references (each linking to a Right, DeniedRight, or Blackout) that are currently affecting that scheduling’s rights status:

$ curl --digest -u robot_user:password "https://movida.bebanjo.net/api/schedulings/23816/reference_rights"
$ curl --digest -u robot_user:password -H "Accept: application/json" "https://movida.bebanjo.net/api/schedulings/23816/reference_rights"
<?xml version="1.0" encoding="UTF-8"?>
<scheduling-right-references type="array">
  <total-entries>2</total-entries>
  <scheduling-right-reference>
    <relation-type>clearing</relation-type>
    <rightable-type>Right</rightable-type>
    <scheduling-status>cleared</scheduling-status>
    <link rel="scheduling" href="https://movida.bebanjo.net/api/schedulings/23816"/>
    <link rel="rightable" href="https://movida.bebanjo.net/api/rights/4"/>
  </scheduling-right-reference>
  <scheduling-right-reference>
    <relation-type>conflicting</relation-type>
    <rightable-type>Blackout</rightable-type>
    <scheduling-status>conflicting</scheduling-status>
    <link rel="scheduling" href="https://movida.bebanjo.net/api/schedulings/23816"/>
    <link rel="rightable" href="https://movida.bebanjo.net/api/blackouts/7"/>
  </scheduling-right-reference>
</scheduling-right-references>
{
  "total_entries": 2,
  "entries": [
    {
      "resource_type": "scheduling_right_reference",
      "relation_type": "clearing",
      "rightable_type": "Right",
      "scheduling_status": "cleared",
      "scheduling_link": "https://movida.bebanjo.net/api/schedulings/23816",
      "rightable_link": "https://movida.bebanjo.net/api/rights/4"
    },
    {
      "resource_type": "scheduling_right_reference",
      "relation_type": "conflicting",
      "rightable_type": "Blackout",
      "scheduling_status": "conflicting",
      "scheduling_link": "https://movida.bebanjo.net/api/schedulings/23816",
      "rightable_link": "https://movida.bebanjo.net/api/blackouts/7"
    }
  ]
}

Get a list of scheduling right references from a right

Each Right exposes a rel="scheduling_right_references" link. Following it returns all the schedulings that this right is currently affecting:

$ curl --digest -u robot_user:password "https://movida.bebanjo.net/api/rights/4/scheduling_right_references"
$ curl --digest -u robot_user:password -H "Accept: application/json" "https://movida.bebanjo.net/api/rights/4/scheduling_right_references"
<?xml version="1.0" encoding="UTF-8"?>
<scheduling-right-references type="array">
  <total-entries>1</total-entries>
  <scheduling-right-reference>
    <relation-type>clearing</relation-type>
    <rightable-type>Right</rightable-type>
    <scheduling-status>cleared</scheduling-status>
    <link rel="scheduling" href="https://movida.bebanjo.net/api/schedulings/23816"/>
    <link rel="rightable" href="https://movida.bebanjo.net/api/rights/4"/>
  </scheduling-right-reference>
</scheduling-right-references>
{
  "total_entries": 1,
  "entries": [
    {
      "resource_type": "scheduling_right_reference",
      "relation_type": "clearing",
      "rightable_type": "Right",
      "scheduling_status": "cleared",
      "scheduling_link": "https://movida.bebanjo.net/api/schedulings/23816",
      "rightable_link": "https://movida.bebanjo.net/api/rights/4"
    }
  ]
}

Get a list of scheduling right references from a denied right

Each DeniedRight exposes a rel="scheduling_right_references" link. Following it returns all the schedulings that this denied right is currently affecting:

$ curl --digest -u robot_user:password "https://movida.bebanjo.net/api/denied_rights/6/scheduling_right_references"
$ curl --digest -u robot_user:password -H "Accept: application/json" "https://movida.bebanjo.net/api/denied_rights/6/scheduling_right_references"
<?xml version="1.0" encoding="UTF-8"?>
<scheduling-right-references type="array">
  <total-entries>1</total-entries>
  <scheduling-right-reference>
    <relation-type>denying</relation-type>
    <rightable-type>DeniedRight</rightable-type>
    <scheduling-status>denied</scheduling-status>
    <link rel="scheduling" href="https://movida.bebanjo.net/api/schedulings/23816"/>
    <link rel="rightable" href="https://movida.bebanjo.net/api/denied_rights/6"/>
  </scheduling-right-reference>
</scheduling-right-references>
{
  "total_entries": 1,
  "entries": [
    {
      "resource_type": "scheduling_right_reference",
      "relation_type": "denying",
      "rightable_type": "DeniedRight",
      "scheduling_status": "denied",
      "scheduling_link": "https://movida.bebanjo.net/api/schedulings/23816",
      "rightable_link": "https://movida.bebanjo.net/api/denied_rights/6"
    }
  ]
}

Get a list of scheduling right references from a blackout

Each Blackout exposes a rel="scheduling_right_references" link. Following it returns all the schedulings that this blackout is currently affecting:

$ curl --digest -u robot_user:password "https://movida.bebanjo.net/api/blackouts/7/scheduling_right_references"
$ curl --digest -u robot_user:password -H "Accept: application/json" "https://movida.bebanjo.net/api/blackouts/7/scheduling_right_references"
<?xml version="1.0" encoding="UTF-8"?>
<scheduling-right-references type="array">
  <total-entries>1</total-entries>
  <scheduling-right-reference>
    <relation-type>conflicting</relation-type>
    <rightable-type>Blackout</rightable-type>
    <scheduling-status>conflicting</scheduling-status>
    <link rel="scheduling" href="https://movida.bebanjo.net/api/schedulings/23816"/>
    <link rel="rightable" href="https://movida.bebanjo.net/api/blackouts/7"/>
  </scheduling-right-reference>
</scheduling-right-references>
{
  "total_entries": 1,
  "entries": [
    {
      "resource_type": "scheduling_right_reference",
      "relation_type": "conflicting",
      "rightable_type": "Blackout",
      "scheduling_status": "conflicting",
      "scheduling_link": "https://movida.bebanjo.net/api/schedulings/23816",
      "rightable_link": "https://movida.bebanjo.net/api/blackouts/7"
    }
  ]
}

Note: Scheduling right references are read-only. They are automatically created and maintained by Mediagenix On-Demand as rights, denied rights, and blackouts are evaluated against each scheduling.