Fields

Fields are used when defining Resource Schemas and comes with type-specific query builders.

Text

class snow.resource.fields.text.Text(*args, pluck=<Joined.VALUE: 'value'>, is_primary=False, **kwargs)[source]
between(value1, value2)[source]

Example: short_description.between(“q”, “t”)

All records in which the first letter in the Short description field is “q,” “r,” “s,” or “t.”

contains(value)[source]

Example: short_description.contains(“SAP”)

All records in which the characters “SAP” appear anywhere in the value for the Short description field.

ends_with(value)[source]

Example: short_description.ends_with(“outage”)

All records in which the string “outage” appears at the end of the value for the Short description field.

equals(value)[source]

Example: short_description.equals(“Network storage is unavailable”)

All records in which the Short description says nothing else but “Network storage is unavailable.”

greater_or_equals(value)[source]

Example: short_description.greater_or_equals(“s”)

All records in which the string in the Short description field is one of the following:
  • the first letter is any letter between “s” and “z”
  • the exact value is “s”
less_or_equals(value)[source]

Example: short_description.less_or_equals(“s”)

All records in which the string in the Short description field is one of the following:
  • the first letter is any letter between “a” and “s”
  • the exact value is “s”
not_contains(value)[source]

Example: short_description.not_contains(“SAP”)

All records in which the characters “SAP” do not appear anywhere in the value for the Short description field.

not_equals(value)[source]

Example: short_description.not_equals(“Network storage is unavailable”)

All records in which the value for the Short description field says anything but “Network storage is unavailable.”

starts_with(value)[source]

Example: short_description.starts_with(“SAP”)

All records in which the characters “SAP” appear at the beginning of the value for the Short description field.

Numeric

class snow.resource.fields.numeric.Numeric(*args, pluck=<Joined.VALUE: 'value'>, is_primary=False, **kwargs)[source]
between(value1, value2)[source]

Example: impact.between([1, 3])

All records in which the Impact field has one of the following values: 1 - High 2 - Medium 3 - Low

equals(value)[source]

Example: reassignment_count.equals(0)

All records in which the Reassignment count is nothing else but 0.

greater_or_equals(value)[source]

Example: impact.greater_or_equals(2)

All records in which the Impact field has a value of 2 - Medium or 3 - Low.

greater_than(value)[source]

Example: impact.greater_than(2)

All records in which the Impact field has a value of 3 - Low

less_or_equals(value)[source]

Example: impact.less_or_equals(2)

All records in which the Impact field has a value of 1 - High or 2 - Medium.

less_than(value)[source]

Example: impact.less_than(2)

All records in which the Impact field has a value of 1 - High.

not_equals(value)[source]

Example: reassignment_count.not_equals(0)

All records in which the value for the Reassignment count is any number but 0.

Boolean

class snow.resource.fields.boolean.Boolean(*args, pluck=<Joined.VALUE: 'value'>, is_primary=False, **kwargs)[source]
is_falsy()[source]

Example: active.is_falsy()

All records in which the Active field is False, empty, or NULL.

is_true()[source]

Example: active.is_true()

All records in which the Active field is True.

Datetime

class snow.resource.fields.datetime.Datetime(*args, pluck=<Joined.VALUE: 'value'>, is_primary=False, **kwargs)[source]
after(value)[source]

Example: sla_due.after(“2019-12-24 02:03:04”)

All records in which the value for the SLA due field is any date after the given date.

as_of(value)[source]

Example: sla_due.as_of(“2019-12-24 02:03:04”)

All records in which the date value for the SLA due field is one of the following:
  • today
  • any date after today
before(value)[source]

Example: sla_due.before(“2019-12-24 02:03:04”)

All records in which the value for the SLA due field is any date previous to the given date.

between(value1, value2)[source]

Example:

All records in which the value for the SLA due field is between the given dates

not_on(value)[source]

Example: sla_due.not_on(“2019-12-24 02:03:04”)

All records in which the value for the SLA due field is any other but the given date

on(value)[source]

Example: sla_due.on(“2019-12-24 02:03:04”)

All records in which the value for the SLA due field matches the given date

until(value)[source]

Example: sla_due.until(“2019-12-24 02:03:04”)

All records in which the value for the SLA due field is one of the following:
  • any date previous to today
  • today

Choice

class snow.resource.fields.choice.ChoiceBase(*args, pluck=<Joined.VALUE: 'value'>, is_primary=False, **kwargs)[source]
not_oneof(*values)[source]

All records in which the field is not populated by the given values

oneof(*values)[source]

All records in which the field is populated by the given values

class snow.resource.fields.choice.NumericChoice(*args, pluck=<Joined.VALUE: 'value'>, is_primary=False, **kwargs)[source]
class snow.resource.fields.choice.TextChoice(*args, pluck=<Joined.VALUE: 'value'>, is_primary=False, **kwargs)[source]

Email

class snow.resource.fields.email.Email(*args, pluck=<Joined.VALUE: 'value'>, is_primary=False, **kwargs)[source]
changes()[source]

Example: state.changes()

All records in which the State field is updated.

changes_from(value)[source]

Example: state.changes_from(“4^EQ”)

All records in which the State field is updated to another value after previously being Awaiting User Info.

changes_to(value)[source]

Example: state.changes_to(“4^EQ”)

All records in which the State field is updated to Awaiting User Info after previously being any other value.

Reference

class snow.resource.fields.reference.Reference(*args, pluck=<Joined.VALUE: 'value'>, is_primary=False, **kwargs)[source]