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.



10196
10197
10198
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10196

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



10194
10195
10196
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10194

def value
  @value
end

Class Method Details

.ALLObject



10216
10217
10218
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10216

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

.anonymousObject

No authentication necessary.



10221
10222
10223
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10221

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



10201
10202
10203
10204
10205
10206
10207
10208
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10201

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



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

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

.sessionObject

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



10227
10228
10229
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10227

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

.tokenObject

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



10233
10234
10235
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10233

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

.userObject

A user logs into Flow.



10238
10239
10240
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10238

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

Instance Method Details

#to_hashObject



10242
10243
10244
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10242

def to_hash
  value
end