Class: Stripe::Radar::ValueList

Inherits:
APIResource show all
Extended by:
APIOperations::Create, APIOperations::List
Includes:
APIOperations::Delete, APIOperations::Save
Defined in:
lib/stripe/resources/radar/value_list.rb

Overview

Value lists allow you to group values together which can then be referenced in rules.

Related guide: [Default Stripe lists](stripe.com/docs/radar/lists#managing-list-items)

Constant Summary collapse

OBJECT_NAME =
"radar.value_list"

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::Save

included, #save

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

#aliasObject (readonly)

The name of the value list for use in rules.



21
22
23
# File 'lib/stripe/resources/radar/value_list.rb', line 21

def alias
  @alias
end

#createdObject (readonly)

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



23
24
25
# File 'lib/stripe/resources/radar/value_list.rb', line 23

def created
  @created
end

#created_byObject (readonly)

The name or email address of the user who created this value list.



25
26
27
# File 'lib/stripe/resources/radar/value_list.rb', line 25

def created_by
  @created_by
end

#deletedObject (readonly)

Always true for a deleted object



41
42
43
# File 'lib/stripe/resources/radar/value_list.rb', line 41

def deleted
  @deleted
end

#idObject (readonly)

Unique identifier for the object.



27
28
29
# File 'lib/stripe/resources/radar/value_list.rb', line 27

def id
  @id
end

#item_typeObject (readonly)

The type of items in the value list. One of ‘card_fingerprint`, `card_bin`, `email`, `ip_address`, `country`, `string`, `case_sensitive_string`, `customer_id`, `sepa_debit_fingerprint`, or `us_bank_account_fingerprint`.



29
30
31
# File 'lib/stripe/resources/radar/value_list.rb', line 29

def item_type
  @item_type
end

#list_itemsObject (readonly)

List of items contained within this value list.



31
32
33
# File 'lib/stripe/resources/radar/value_list.rb', line 31

def list_items
  @list_items
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.



33
34
35
# File 'lib/stripe/resources/radar/value_list.rb', line 33

def livemode
  @livemode
end

#metadataObject (readonly)

Set of [key-value pairs](stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.



35
36
37
# File 'lib/stripe/resources/radar/value_list.rb', line 35

def 
  
end

#nameObject (readonly)

The name of the value list.



37
38
39
# File 'lib/stripe/resources/radar/value_list.rb', line 37

def name
  @name
end

#objectObject (readonly)

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



39
40
41
# File 'lib/stripe/resources/radar/value_list.rb', line 39

def object
  @object
end

Class Method Details

.create(params = {}, opts = {}) ⇒ Object

Creates a new ValueList object, which can then be referenced in rules.



44
45
46
47
48
49
50
51
# File 'lib/stripe/resources/radar/value_list.rb', line 44

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

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

Deletes a ValueList object, also deleting any items contained within the value list. To be deleted, a value list must not be referenced in any rules.



54
55
56
57
58
59
60
61
# File 'lib/stripe/resources/radar/value_list.rb', line 54

def self.delete(value_list, params = {}, opts = {})
  request_stripe_object(
    method: :delete,
    path: format("/v1/radar/value_lists/%<value_list>s", { value_list: CGI.escape(value_list) }),
    params: params,
    opts: opts
  )
end

.field_remappingsObject



97
98
99
# File 'lib/stripe/resources/radar/value_list.rb', line 97

def self.field_remappings
  @field_remappings = {}
end

.inner_class_typesObject



93
94
95
# File 'lib/stripe/resources/radar/value_list.rb', line 93

def self.inner_class_types
  @inner_class_types = {}
end

.list(params = {}, opts = {}) ⇒ Object

Returns a list of ValueList objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first.



74
75
76
77
78
79
80
81
# File 'lib/stripe/resources/radar/value_list.rb', line 74

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

.object_nameObject



16
17
18
# File 'lib/stripe/resources/radar/value_list.rb', line 16

def self.object_name
  "radar.value_list"
end

.update(value_list, params = {}, opts = {}) ⇒ Object

Updates a ValueList object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Note that item_type is immutable.



84
85
86
87
88
89
90
91
# File 'lib/stripe/resources/radar/value_list.rb', line 84

def self.update(value_list, params = {}, opts = {})
  request_stripe_object(
    method: :post,
    path: format("/v1/radar/value_lists/%<value_list>s", { value_list: CGI.escape(value_list) }),
    params: params,
    opts: opts
  )
end

Instance Method Details

#delete(params = {}, opts = {}) ⇒ Object

Deletes a ValueList object, also deleting any items contained within the value list. To be deleted, a value list must not be referenced in any rules.



64
65
66
67
68
69
70
71
# File 'lib/stripe/resources/radar/value_list.rb', line 64

def delete(params = {}, opts = {})
  request_stripe_object(
    method: :delete,
    path: format("/v1/radar/value_lists/%<value_list>s", { value_list: CGI.escape(self["id"]) }),
    params: params,
    opts: opts
  )
end