Class: Io::Flow::V0::Models::AuthenticationTechnique
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::AuthenticationTechnique
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Class Method Summary collapse
- .ALL ⇒ Object
-
.anonymous ⇒ Object
No authentication necessary.
-
.apply(value) ⇒ Object
Returns the instance of AuthenticationTechnique for this value, creating a new instance for an unknown value.
-
.from_string(value) ⇒ Object
Returns the instance of AuthenticationTechnique for this value, or nil if not found.
-
.partner_token ⇒ Object
A partner token.
-
.session ⇒ Object
A browser has been assigned an identifier by Flow to track their use of our service for an organization.
-
.token ⇒ Object
A token.
-
.user ⇒ Object
A user logs into Flow.
Instance Method Summary collapse
-
#initialize(value) ⇒ AuthenticationTechnique
constructor
A new instance of AuthenticationTechnique.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ AuthenticationTechnique
Returns a new instance of AuthenticationTechnique.
16835 16836 16837 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16835 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
16833 16834 16835 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16833 def value @value end |
Class Method Details
.ALL ⇒ Object
16855 16856 16857 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16855 def AuthenticationTechnique.ALL @@all ||= [AuthenticationTechnique.anonymous, AuthenticationTechnique.session, AuthenticationTechnique.token, AuthenticationTechnique.partner_token, AuthenticationTechnique.user] end |
.anonymous ⇒ Object
No authentication necessary.
16860 16861 16862 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16860 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
16840 16841 16842 16843 16844 16845 16846 16847 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16840 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
16850 16851 16852 16853 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16850 def AuthenticationTechnique.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) AuthenticationTechnique.ALL.find { |v| v.value == value } end |
.partner_token ⇒ Object
A partner token. Partner Tokens can only access anonymous endpoints and the endpoints of the partner api.
16878 16879 16880 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16878 def AuthenticationTechnique.partner_token @@_partner_token ||= AuthenticationTechnique.new('partner_token') end |
.session ⇒ Object
A browser has been assigned an identifier by Flow to track their use of our service for an organization.
16866 16867 16868 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16866 def AuthenticationTechnique.session @@_session ||= AuthenticationTechnique.new('session') end |
.token ⇒ Object
A token. Tokens carry the same permissions as the user who originally created them.
16872 16873 16874 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16872 def AuthenticationTechnique.token @@_token ||= AuthenticationTechnique.new('token') end |
.user ⇒ Object
A user logs into Flow.
16883 16884 16885 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16883 def AuthenticationTechnique.user @@_user ||= AuthenticationTechnique.new('user') end |
Instance Method Details
#to_hash ⇒ Object
16887 16888 16889 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16887 def to_hash value end |