Class: Stripe::Terminal::Location

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

Overview

A Location represents a grouping of readers.

Related guide: [Fleet management](stripe.com/docs/terminal/fleet/locations)

Defined Under Namespace

Classes: Address, AddressKana, AddressKanji

Constant Summary collapse

OBJECT_NAME =
"terminal.location"

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

#addressObject (readonly)

Attribute for field address



93
94
95
# File 'lib/stripe/resources/terminal/location.rb', line 93

def address
  @address
end

#address_kanaObject (readonly)

Attribute for field address_kana



95
96
97
# File 'lib/stripe/resources/terminal/location.rb', line 95

def address_kana
  @address_kana
end

#address_kanjiObject (readonly)

Attribute for field address_kanji



97
98
99
# File 'lib/stripe/resources/terminal/location.rb', line 97

def address_kanji
  @address_kanji
end

#configuration_overridesObject (readonly)

The ID of a configuration that will be used to customize all readers in this location.



99
100
101
# File 'lib/stripe/resources/terminal/location.rb', line 99

def configuration_overrides
  @configuration_overrides
end

#deletedObject (readonly)

Always true for a deleted object



117
118
119
# File 'lib/stripe/resources/terminal/location.rb', line 117

def deleted
  @deleted
end

#display_nameObject (readonly)

The display name of the location.



101
102
103
# File 'lib/stripe/resources/terminal/location.rb', line 101

def display_name
  @display_name
end

#display_name_kanaObject (readonly)

The Kana variation of the display name of the location.



103
104
105
# File 'lib/stripe/resources/terminal/location.rb', line 103

def display_name_kana
  @display_name_kana
end

#display_name_kanjiObject (readonly)

The Kanji variation of the display name of the location.



105
106
107
# File 'lib/stripe/resources/terminal/location.rb', line 105

def display_name_kanji
  @display_name_kanji
end

#idObject (readonly)

Unique identifier for the object.



107
108
109
# File 'lib/stripe/resources/terminal/location.rb', line 107

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.



109
110
111
# File 'lib/stripe/resources/terminal/location.rb', line 109

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.



111
112
113
# File 'lib/stripe/resources/terminal/location.rb', line 111

def 
  
end

#objectObject (readonly)

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



113
114
115
# File 'lib/stripe/resources/terminal/location.rb', line 113

def object
  @object
end

#phoneObject (readonly)

The phone number of the location.



115
116
117
# File 'lib/stripe/resources/terminal/location.rb', line 115

def phone
  @phone
end

Class Method Details

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

Creates a new Location object. For further details, including which address fields are required in each country, see the [Manage locations](docs.stripe.com/docs/terminal/fleet/locations) guide.



121
122
123
124
125
126
127
128
# File 'lib/stripe/resources/terminal/location.rb', line 121

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

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

Deletes a Location object.



131
132
133
134
135
136
137
138
# File 'lib/stripe/resources/terminal/location.rb', line 131

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

.field_remappingsObject



178
179
180
# File 'lib/stripe/resources/terminal/location.rb', line 178

def self.field_remappings
  @field_remappings = {}
end

.inner_class_typesObject



170
171
172
173
174
175
176
# File 'lib/stripe/resources/terminal/location.rb', line 170

def self.inner_class_types
  @inner_class_types = {
    address: Address,
    address_kana: AddressKana,
    address_kanji: AddressKanji,
  }
end

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

Returns a list of Location objects.



151
152
153
154
155
156
157
158
# File 'lib/stripe/resources/terminal/location.rb', line 151

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

.object_nameObject



16
17
18
# File 'lib/stripe/resources/terminal/location.rb', line 16

def self.object_name
  "terminal.location"
end

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

Updates a Location object by setting the values of the parameters passed. Any parameters not provided will be left unchanged.



161
162
163
164
165
166
167
168
# File 'lib/stripe/resources/terminal/location.rb', line 161

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

Instance Method Details

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

Deletes a Location object.



141
142
143
144
145
146
147
148
# File 'lib/stripe/resources/terminal/location.rb', line 141

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