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.
-
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.
-
Boolean¶
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
-
Choice¶
-
class
snow.resource.fields.choice.ChoiceBase(*args, pluck=<Joined.VALUE: 'value'>, is_primary=False, **kwargs)[source]¶