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, RetrieveParams

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.



109
110
111
# File 'lib/stripe/resources/radar/value_list_item.rb', line 109

def created
  @created
end

#created_byObject (readonly)

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



112
113
114
# File 'lib/stripe/resources/radar/value_list_item.rb', line 112

def created_by
  @created_by
end

#deletedObject (readonly)

Always true for a deleted object



130
131
132
# File 'lib/stripe/resources/radar/value_list_item.rb', line 130

def deleted
  @deleted
end

#idObject (readonly)

Unique identifier for the object.



115
116
117
# File 'lib/stripe/resources/radar/value_list_item.rb', line 115

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.



118
119
120
# File 'lib/stripe/resources/radar/value_list_item.rb', line 118

def livemode
  @livemode
end

#objectObject (readonly)

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



121
122
123
# File 'lib/stripe/resources/radar/value_list_item.rb', line 121

def object
  @object
end

#valueObject (readonly)

The value of the item.



124
125
126
# File 'lib/stripe/resources/radar/value_list_item.rb', line 124

def value
  @value
end

#value_listObject (readonly)

The identifier of the value list this item belongs to.



127
128
129
# File 'lib/stripe/resources/radar/value_list_item.rb', line 127

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.



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

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

.delete(id, params = {}, opts = {}) ⇒ Object

Deletes a ValueListItem object, removing it from its parent value list.



143
144
145
146
147
148
149
150
# File 'lib/stripe/resources/radar/value_list_item.rb', line 143

def self.delete(id, params = {}, opts = {})
  request_stripe_object(
    method: :delete,
    path: format("/v1/radar/value_list_items/%<id>s", { id: CGI.escape(id) }),
    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.



163
164
165
166
167
168
169
170
# File 'lib/stripe/resources/radar/value_list_item.rb', line 163

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.



153
154
155
156
157
158
159
160
# File 'lib/stripe/resources/radar/value_list_item.rb', line 153

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