github.com/stripe/stripe-go/v76@v76.25.0/radar_valuelist.go (about) 1 // 2 // 3 // File generated from our OpenAPI spec 4 // 5 // 6 7 package stripe 8 9 // The type of items in the value list. One of `card_fingerprint`, `us_bank_account_fingerprint`, `sepa_debit_fingerprint`, `card_bin`, `email`, `ip_address`, `country`, `string`, `case_sensitive_string`, or `customer_id`. 10 type RadarValueListItemType string 11 12 // List of values that RadarValueListItemType can take 13 const ( 14 RadarValueListItemTypeCardBin RadarValueListItemType = "card_bin" 15 RadarValueListItemTypeCardFingerprint RadarValueListItemType = "card_fingerprint" 16 RadarValueListItemTypeCaseSensitiveString RadarValueListItemType = "case_sensitive_string" 17 RadarValueListItemTypeCountry RadarValueListItemType = "country" 18 RadarValueListItemTypeCustomerID RadarValueListItemType = "customer_id" 19 RadarValueListItemTypeEmail RadarValueListItemType = "email" 20 RadarValueListItemTypeIPAddress RadarValueListItemType = "ip_address" 21 RadarValueListItemTypeSEPADebitFingerprint RadarValueListItemType = "sepa_debit_fingerprint" 22 RadarValueListItemTypeString RadarValueListItemType = "string" 23 RadarValueListItemTypeUSBankAccountFingerprint RadarValueListItemType = "us_bank_account_fingerprint" 24 ) 25 26 // 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. 27 type RadarValueListParams struct { 28 Params `form:"*"` 29 // The name of the value list for use in rules. 30 Alias *string `form:"alias"` 31 // Specifies which fields in the response should be expanded. 32 Expand []*string `form:"expand"` 33 // Type of the items in the value list. One of `card_fingerprint`, `us_bank_account_fingerprint`, `sepa_debit_fingerprint`, `card_bin`, `email`, `ip_address`, `country`, `string`, `case_sensitive_string`, or `customer_id`. Use `string` if the item type is unknown or mixed. 34 ItemType *string `form:"item_type"` 35 // Set of [key-value pairs](https://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. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. 36 Metadata map[string]string `form:"metadata"` 37 // The human-readable name of the value list. 38 Name *string `form:"name"` 39 } 40 41 // AddExpand appends a new field to expand. 42 func (p *RadarValueListParams) AddExpand(f string) { 43 p.Expand = append(p.Expand, &f) 44 } 45 46 // AddMetadata adds a new key-value pair to the Metadata. 47 func (p *RadarValueListParams) AddMetadata(key string, value string) { 48 if p.Metadata == nil { 49 p.Metadata = make(map[string]string) 50 } 51 52 p.Metadata[key] = value 53 } 54 55 // Returns a list of ValueList objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. 56 type RadarValueListListParams struct { 57 ListParams `form:"*"` 58 // The alias used to reference the value list when writing rules. 59 Alias *string `form:"alias"` 60 // A value contained within a value list - returns all value lists containing this value. 61 Contains *string `form:"contains"` 62 // Only return value lists that were created during the given date interval. 63 Created *int64 `form:"created"` 64 // Only return value lists that were created during the given date interval. 65 CreatedRange *RangeQueryParams `form:"created"` 66 // Specifies which fields in the response should be expanded. 67 Expand []*string `form:"expand"` 68 } 69 70 // AddExpand appends a new field to expand. 71 func (p *RadarValueListListParams) AddExpand(f string) { 72 p.Expand = append(p.Expand, &f) 73 } 74 75 // Value lists allow you to group values together which can then be referenced in rules. 76 // 77 // Related guide: [Default Stripe lists](https://stripe.com/docs/radar/lists#managing-list-items) 78 type RadarValueList struct { 79 APIResource 80 // The name of the value list for use in rules. 81 Alias string `json:"alias"` 82 // Time at which the object was created. Measured in seconds since the Unix epoch. 83 Created int64 `json:"created"` 84 // The name or email address of the user who created this value list. 85 CreatedBy string `json:"created_by"` 86 Deleted bool `json:"deleted"` 87 // Unique identifier for the object. 88 ID string `json:"id"` 89 // The type of items in the value list. One of `card_fingerprint`, `us_bank_account_fingerprint`, `sepa_debit_fingerprint`, `card_bin`, `email`, `ip_address`, `country`, `string`, `case_sensitive_string`, or `customer_id`. 90 ItemType RadarValueListItemType `json:"item_type"` 91 // List of items contained within this value list. 92 ListItems *RadarValueListItemList `json:"list_items"` 93 // Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. 94 Livemode bool `json:"livemode"` 95 // Set of [key-value pairs](https://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. 96 Metadata map[string]string `json:"metadata"` 97 // The name of the value list. 98 Name string `json:"name"` 99 // String representing the object's type. Objects of the same type share the same value. 100 Object string `json:"object"` 101 } 102 103 // RadarValueListList is a list of ValueLists as retrieved from a list endpoint. 104 type RadarValueListList struct { 105 APIResource 106 ListMeta 107 Data []*RadarValueList `json:"data"` 108 }