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](docs.stripe.com/radar/lists#managing-list-items)

Defined Under Namespace

Classes: Redaction

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?, field_encodings, #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.



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

def created
  @created
end

#created_byObject (readonly)

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



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

def created_by
  @created_by
end

#deletedObject (readonly)

Always true for a deleted object



36
37
38
# File 'lib/stripe/resources/radar/value_list_item.rb', line 36

def deleted
  @deleted
end

#idObject (readonly)

Unique identifier for the object.



38
39
40
# File 'lib/stripe/resources/radar/value_list_item.rb', line 38

def id
  @id
end

#livemodeObject (readonly)

If the object exists in live mode, the value is ‘true`. If the object exists in test mode, the value is `false`.



40
41
42
# File 'lib/stripe/resources/radar/value_list_item.rb', line 40

def livemode
  @livemode
end

#objectObject (readonly)

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



42
43
44
# File 'lib/stripe/resources/radar/value_list_item.rb', line 42

def object
  @object
end

#redactionObject (readonly)

Redaction status of this item. If not null, this item is associated to a redaction job.



44
45
46
# File 'lib/stripe/resources/radar/value_list_item.rb', line 44

def redaction
  @redaction
end

#valueObject (readonly)

The value of the item.



46
47
48
# File 'lib/stripe/resources/radar/value_list_item.rb', line 46

def value
  @value
end

#value_listObject (readonly)

The identifier of the value list this item belongs to.



48
49
50
# File 'lib/stripe/resources/radar/value_list_item.rb', line 48

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.



51
52
53
54
55
56
57
58
# File 'lib/stripe/resources/radar/value_list_item.rb', line 51

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.



61
62
63
64
65
66
67
68
# File 'lib/stripe/resources/radar/value_list_item.rb', line 61

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



94
95
96
# File 'lib/stripe/resources/radar/value_list_item.rb', line 94

def self.field_remappings
  @field_remappings = {}
end

.inner_class_typesObject



90
91
92
# File 'lib/stripe/resources/radar/value_list_item.rb', line 90

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



81
82
83
84
85
86
87
88
# File 'lib/stripe/resources/radar/value_list_item.rb', line 81

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.



71
72
73
74
75
76
77
78
# File 'lib/stripe/resources/radar/value_list_item.rb', line 71

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