Class: Stripe::Radar::ValueListItem
- Inherits:
-
APIResource
- Object
- StripeObject
- APIResource
- Stripe::Radar::ValueListItem
- Extended by:
- APIOperations::Create, APIOperations::List
- Includes:
- APIOperations::Delete
- Defined in:
- lib/stripe/resources/radar/value_list_item.rb
Overview
Value list items allow you to add specific values to a given Radar value list, which can then be used in rules.
Related guide: [Managing list items](stripe.com/docs/radar/lists#managing-list-items)
Defined Under Namespace
Classes: CreateParams, DeleteParams, ListParams
Constant Summary collapse
- OBJECT_NAME =
"radar.value_list_item"
Constants inherited from StripeObject
StripeObject::RESERVED_FIELD_NAMES
Instance Attribute Summary collapse
-
#created ⇒ Object
readonly
Time at which the object was created.
-
#created_by ⇒ Object
readonly
The name or email address of the user who added this item to the value list.
-
#deleted ⇒ Object
readonly
Always true for a deleted object.
-
#id ⇒ Object
readonly
Unique identifier for the object.
-
#livemode ⇒ Object
readonly
Has the value ‘true` if the object exists in live mode or the value `false` if the object exists in test mode.
-
#object ⇒ Object
readonly
String representing the object’s type.
-
#value ⇒ Object
readonly
The value of the item.
-
#value_list ⇒ Object
readonly
The identifier of the value list this item belongs to.
Attributes inherited from APIResource
Attributes inherited from StripeObject
Class Method Summary collapse
-
.create(params = {}, opts = {}) ⇒ Object
Creates a new ValueListItem object, which is added to the specified parent value list.
-
.delete(item, params = {}, opts = {}) ⇒ Object
Deletes a ValueListItem object, removing it from its parent value list.
-
.list(params = {}, opts = {}) ⇒ Object
Returns a list of ValueListItem objects.
- .object_name ⇒ Object
Instance Method Summary collapse
-
#delete(params = {}, opts = {}) ⇒ Object
Deletes a ValueListItem object, removing it from its parent value list.
Methods included from APIOperations::Create
Methods included from APIOperations::List
Methods included from APIOperations::Delete
Methods inherited from APIResource
class_name, custom_method, #refresh, #request_stripe_object, resource_url, #resource_url, retrieve, save_nested_resource
Methods included from APIOperations::Request
Methods inherited from StripeObject
#==, #[], #[]=, additive_object_param, additive_object_param?, #as_json, construct_from, #deleted?, #dirty!, #each, #eql?, #hash, #initialize, #inspect, #keys, #marshal_dump, #marshal_load, protected_fields, #serialize_params, #to_hash, #to_json, #to_s, #update_attributes, #values
Constructor Details
This class inherits a constructor from Stripe::StripeObject
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Stripe::StripeObject
Instance Attribute Details
#created ⇒ Object (readonly)
Time at which the object was created. Measured in seconds since the Unix epoch.
89 90 91 |
# File 'lib/stripe/resources/radar/value_list_item.rb', line 89 def created @created end |
#created_by ⇒ Object (readonly)
The name or email address of the user who added this item to the value list.
91 92 93 |
# File 'lib/stripe/resources/radar/value_list_item.rb', line 91 def created_by @created_by end |
#deleted ⇒ Object (readonly)
Always true for a deleted object
103 104 105 |
# File 'lib/stripe/resources/radar/value_list_item.rb', line 103 def deleted @deleted end |
#id ⇒ Object (readonly)
Unique identifier for the object.
93 94 95 |
# File 'lib/stripe/resources/radar/value_list_item.rb', line 93 def id @id end |
#livemode ⇒ Object (readonly)
Has the value ‘true` if the object exists in live mode or the value `false` if the object exists in test mode.
95 96 97 |
# File 'lib/stripe/resources/radar/value_list_item.rb', line 95 def livemode @livemode end |
#object ⇒ Object (readonly)
String representing the object’s type. Objects of the same type share the same value.
97 98 99 |
# File 'lib/stripe/resources/radar/value_list_item.rb', line 97 def object @object end |
#value ⇒ Object (readonly)
The value of the item.
99 100 101 |
# File 'lib/stripe/resources/radar/value_list_item.rb', line 99 def value @value end |
#value_list ⇒ Object (readonly)
The identifier of the value list this item belongs to.
101 102 103 |
# File 'lib/stripe/resources/radar/value_list_item.rb', line 101 def value_list @value_list end |
Class Method Details
.create(params = {}, opts = {}) ⇒ Object
Creates a new ValueListItem object, which is added to the specified parent value list.
106 107 108 109 110 111 112 113 |
# File 'lib/stripe/resources/radar/value_list_item.rb', line 106 def self.create(params = {}, opts = {}) request_stripe_object( method: :post, path: "/v1/radar/value_list_items", params: params, opts: opts ) end |
.delete(item, params = {}, opts = {}) ⇒ Object
Deletes a ValueListItem object, removing it from its parent value list.
116 117 118 119 120 121 122 123 |
# File 'lib/stripe/resources/radar/value_list_item.rb', line 116 def self.delete(item, params = {}, opts = {}) request_stripe_object( method: :delete, path: format("/v1/radar/value_list_items/%<item>s", { item: CGI.escape(item) }), params: params, opts: opts ) end |
.list(params = {}, opts = {}) ⇒ Object
Returns a list of ValueListItem objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first.
136 137 138 139 140 141 142 143 |
# File 'lib/stripe/resources/radar/value_list_item.rb', line 136 def self.list(params = {}, opts = {}) request_stripe_object( method: :get, path: "/v1/radar/value_list_items", params: params, opts: opts ) end |
.object_name ⇒ Object
15 16 17 |
# File 'lib/stripe/resources/radar/value_list_item.rb', line 15 def self.object_name "radar.value_list_item" end |
Instance Method Details
#delete(params = {}, opts = {}) ⇒ Object
Deletes a ValueListItem object, removing it from its parent value list.
126 127 128 129 130 131 132 133 |
# File 'lib/stripe/resources/radar/value_list_item.rb', line 126 def delete(params = {}, opts = {}) request_stripe_object( method: :delete, path: format("/v1/radar/value_list_items/%<item>s", { item: CGI.escape(self["id"]) }), params: params, opts: opts ) end |