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



12110
12111
12112
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12110

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



12108
12109
12110
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12108

def value
  @value
end

Class Method Details

.ALLObject



12130
12131
12132
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12130

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

.anonymousObject

No authentication necessary.



12135
12136
12137
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12135

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



12115
12116
12117
12118
12119
12120
12121
12122
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12115

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



12125
12126
12127
12128
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12125

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.



12153
12154
12155
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12153

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.



12141
12142
12143
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12141

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

.tokenObject

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



12147
12148
12149
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12147

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

.userObject

A user logs into Flow.



12158
12159
12160
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12158

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

Instance Method Details

#to_hashObject



12162
12163
12164
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12162

def to_hash
  value
end