Class: Io::Flow::V0::Models::AuthenticationTechnique

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ AuthenticationTechnique

Returns a new instance of AuthenticationTechnique.



10188
10189
10190
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10188

def initialize(value)
  @value = HttpClient::Preconditions.assert_class('value', value, String)
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



10186
10187
10188
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10186

def value
  @value
end

Class Method Details

.ALLObject



10208
10209
10210
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10208

def AuthenticationTechnique.ALL
  @@all ||= [AuthenticationTechnique.anonymous, AuthenticationTechnique.session, AuthenticationTechnique.token, AuthenticationTechnique.partner_token, AuthenticationTechnique.user]
end

.anonymousObject

No authentication necessary.



10213
10214
10215
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10213

def AuthenticationTechnique.anonymous
  @@_anonymous ||= AuthenticationTechnique.new('anonymous')
end

.apply(value) ⇒ Object

Returns the instance of AuthenticationTechnique for this value, creating a new instance for an unknown value



10193
10194
10195
10196
10197
10198
10199
10200
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10193

def AuthenticationTechnique.apply(value)
  if value.instance_of?(AuthenticationTechnique)
    value
  else
    HttpClient::Preconditions.assert_class_or_nil('value', value, String)
    value.nil? ? nil : (from_string(value) || AuthenticationTechnique.new(value))
  end
end

.from_string(value) ⇒ Object

Returns the instance of AuthenticationTechnique for this value, or nil if not found



10203
10204
10205
10206
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10203

def AuthenticationTechnique.from_string(value)
  HttpClient::Preconditions.assert_class('value', value, String)
  AuthenticationTechnique.ALL.find { |v| v.value == value }
end

.partner_tokenObject

A partner token. Partner Tokens can only access anonymous endpoints and the endpoints of the partner api.



10231
10232
10233
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10231

def AuthenticationTechnique.partner_token
  @@_partner_token ||= AuthenticationTechnique.new('partner_token')
end

.sessionObject

A browser has been assigned an identifier by flow to track their use of our service for an organization.



10219
10220
10221
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10219

def AuthenticationTechnique.session
  @@_session ||= AuthenticationTechnique.new('session')
end

.tokenObject

A token. Tokens carry the same permissions as the user who originally created them.



10225
10226
10227
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10225

def AuthenticationTechnique.token
  @@_token ||= AuthenticationTechnique.new('token')
end

.userObject

A user logs into Flow.



10236
10237
10238
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10236

def AuthenticationTechnique.user
  @@_user ||= AuthenticationTechnique.new('user')
end

Instance Method Details

#to_hashObject



10240
10241
10242
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10240

def to_hash
  value
end