Class: Stripe::Radar::ValueListItem

Inherits:
APIResource show all
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)

Constant Summary collapse

OBJECT_NAME =
"radar.value_list_item"

Constants inherited from StripeObject

StripeObject::RESERVED_FIELD_NAMES

Instance Attribute Summary collapse

Attributes inherited from APIResource

#save_with_parent

Attributes inherited from StripeObject

#last_response

Class Method Summary collapse

Instance Method Summary collapse

Methods included from APIOperations::Create

create

Methods included from APIOperations::List

list

Methods included from APIOperations::Delete

included

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

included

Methods inherited from StripeObject

#==, #[], #[]=, #_get_inner_class_type, 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

#createdObject (readonly)

Time at which the object was created. Measured in seconds since the Unix epoch.



20
21
22
# File 'lib/stripe/resources/radar/value_list_item.rb', line 20

def created
  @created
end

#created_byObject (readonly)

The name or email address of the user who added this item to the value list.



22
23
24
# File 'lib/stripe/resources/radar/value_list_item.rb', line 22

def created_by
  @created_by
end

#deletedObject (readonly)

Always true for a deleted object



34
35
36
# File 'lib/stripe/resources/radar/value_list_item.rb', line 34

def deleted
  @deleted
end

#idObject (readonly)

Unique identifier for the object.



24
25
26
# File 'lib/stripe/resources/radar/value_list_item.rb', line 24

def id
  @id
end

#livemodeObject (readonly)

Has the value ‘true` if the object exists in live mode or the value `false` if the object exists in test mode.



26
27
28
# File 'lib/stripe/resources/radar/value_list_item.rb', line 26

def livemode
  @livemode
end

#objectObject (readonly)

String representing the object’s type. Objects of the same type share the same value.



28
29
30
# File 'lib/stripe/resources/radar/value_list_item.rb', line 28

def object
  @object
end

#valueObject (readonly)

The value of the item.



30
31
32
# File 'lib/stripe/resources/radar/value_list_item.rb', line 30

def value
  @value
end

#value_listObject (readonly)

The identifier of the value list this item belongs to.



32
33
34
# File 'lib/stripe/resources/radar/value_list_item.rb', line 32

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.



37
38
39
40
41
42
43
44
# File 'lib/stripe/resources/radar/value_list_item.rb', line 37

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.



47
48
49
50
51
52
53
54
# File 'lib/stripe/resources/radar/value_list_item.rb', line 47

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

.field_remappingsObject



80
81
82
# File 'lib/stripe/resources/radar/value_list_item.rb', line 80

def self.field_remappings
  @field_remappings = {}
end

.inner_class_typesObject



76
77
78
# File 'lib/stripe/resources/radar/value_list_item.rb', line 76

def self.inner_class_types
  @inner_class_types = {}
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.



67
68
69
70
71
72
73
74
# File 'lib/stripe/resources/radar/value_list_item.rb', line 67

def self.list(params = {}, opts = {})
  request_stripe_object(
    method: :get,
    path: "/v1/radar/value_list_items",
    params: params,
    opts: opts
  )
end

.object_nameObject



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.



57
58
59
60
61
62
63
64
# File 'lib/stripe/resources/radar/value_list_item.rb', line 57

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