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)

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

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

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



88
89
90
# File 'lib/stripe/resources/radar/value_list_item.rb', line 88

def created
  @created
end

#created_byObject (readonly)

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



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

def created_by
  @created_by
end

#deletedObject (readonly)

Always true for a deleted object



102
103
104
# File 'lib/stripe/resources/radar/value_list_item.rb', line 102

def deleted
  @deleted
end

#idObject (readonly)

Unique identifier for the object.



92
93
94
# File 'lib/stripe/resources/radar/value_list_item.rb', line 92

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.



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

def livemode
  @livemode
end

#objectObject (readonly)

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



96
97
98
# File 'lib/stripe/resources/radar/value_list_item.rb', line 96

def object
  @object
end

#valueObject (readonly)

The value of the item.



98
99
100
# File 'lib/stripe/resources/radar/value_list_item.rb', line 98

def value
  @value
end

#value_listObject (readonly)

The identifier of the value list this item belongs to.



100
101
102
# File 'lib/stripe/resources/radar/value_list_item.rb', line 100

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.



105
106
107
108
109
110
111
112
# File 'lib/stripe/resources/radar/value_list_item.rb', line 105

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.



115
116
117
118
119
120
121
122
# File 'lib/stripe/resources/radar/value_list_item.rb', line 115

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.



135
136
137
138
139
140
141
142
# File 'lib/stripe/resources/radar/value_list_item.rb', line 135

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.



125
126
127
128
129
130
131
132
# File 'lib/stripe/resources/radar/value_list_item.rb', line 125

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