Class: Stripe::V2::Iam::ApiKey

Inherits:
APIResource show all
Defined in:
lib/stripe/resources/v2/iam/api_key.rb

Overview

An API key.

Defined Under Namespace

Classes: ManagedBy, PublishableKey, SecretKey

Constant Summary collapse

OBJECT_NAME =
"v2.iam.api_key"

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

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

#createdObject (readonly)

Timestamp when the API key was created.



87
88
89
# File 'lib/stripe/resources/v2/iam/api_key.rb', line 87

def created
  @created
end

#expires_atObject (readonly)

Timestamp when the API key expires.



89
90
91
# File 'lib/stripe/resources/v2/iam/api_key.rb', line 89

def expires_at
  @expires_at
end

#idObject (readonly)

Unique identifier of the API key.



91
92
93
# File 'lib/stripe/resources/v2/iam/api_key.rb', line 91

def id
  @id
end

#ip_allowlistObject (readonly)

List of IP addresses allowed to use this API key. Addresses use IPv4 protocol, and may be a CIDR range (e.g., [100.10.38.255, 100.10.38.0/24]).



93
94
95
# File 'lib/stripe/resources/v2/iam/api_key.rb', line 93

def ip_allowlist
  @ip_allowlist
end

#last_usedObject (readonly)

Timestamp when the API key was last used.



95
96
97
# File 'lib/stripe/resources/v2/iam/api_key.rb', line 95

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



109
110
111
# File 'lib/stripe/resources/v2/iam/api_key.rb', line 109

def livemode
  @livemode
end

#managed_byObject (readonly)

Account that manages this API key (for keys managed by platforms).



97
98
99
# File 'lib/stripe/resources/v2/iam/api_key.rb', line 97

def managed_by
  @managed_by
end

#nameObject (readonly)

Name of the API key.



99
100
101
# File 'lib/stripe/resources/v2/iam/api_key.rb', line 99

def name
  @name
end

#noteObject (readonly)

Note or description for the API key.



101
102
103
# File 'lib/stripe/resources/v2/iam/api_key.rb', line 101

def note
  @note
end

#objectObject (readonly)

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



103
104
105
# File 'lib/stripe/resources/v2/iam/api_key.rb', line 103

def object
  @object
end

#publishable_keyObject (readonly)

Token set for a publishable key.



111
112
113
# File 'lib/stripe/resources/v2/iam/api_key.rb', line 111

def publishable_key
  @publishable_key
end

#secret_keyObject (readonly)

Token set for a secret key.



113
114
115
# File 'lib/stripe/resources/v2/iam/api_key.rb', line 113

def secret_key
  @secret_key
end

#statusObject (readonly)

Current status of the API key (e.g., active, expired).



105
106
107
# File 'lib/stripe/resources/v2/iam/api_key.rb', line 105

def status
  @status
end

#typeObject (readonly)

Type of the API key.



107
108
109
# File 'lib/stripe/resources/v2/iam/api_key.rb', line 107

def type
  @type
end

Class Method Details

.field_remappingsObject



123
124
125
# File 'lib/stripe/resources/v2/iam/api_key.rb', line 123

def self.field_remappings
  @field_remappings = {}
end

.inner_class_typesObject



115
116
117
118
119
120
121
# File 'lib/stripe/resources/v2/iam/api_key.rb', line 115

def self.inner_class_types
  @inner_class_types = {
    managed_by: ManagedBy,
    publishable_key: PublishableKey,
    secret_key: SecretKey,
  }
end

.object_nameObject



10
11
12
# File 'lib/stripe/resources/v2/iam/api_key.rb', line 10

def self.object_name
  "v2.iam.api_key"
end