Class: Io::Flow::V0::Models::FlowUserRole

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

Instance Attribute Summary collapse

Attributes inherited from FlowRole

#__discriminator__

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from FlowRole

from_json, #to_hash

Constructor Details

#initialize(value) ⇒ FlowUserRole

Returns a new instance of FlowUserRole.



12897
12898
12899
12900
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12897

def initialize(value)
  super(:name => FlowRole::Types::FLOW_USER_ROLE, :__discriminator__ => 'flow_user_role')
  @value = HttpClient::Preconditions.assert_class('value', value, String)
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



12895
12896
12897
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12895

def value
  @value
end

Class Method Details

.ALLObject



12918
12919
12920
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12918

def FlowUserRole.ALL
  @@all ||= [FlowUserRole.organization_admin, FlowUserRole.organization_merchant, FlowUserRole.organization_operations]
end

.apply(value) ⇒ Object

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



12903
12904
12905
12906
12907
12908
12909
12910
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12903

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

.from_string(value) ⇒ Object

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



12913
12914
12915
12916
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12913

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

.organization_adminObject

Can fully administrate a merchant organization.



12923
12924
12925
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12923

def FlowUserRole.organization_admin
  @@_organization_admin ||= FlowUserRole.new('organization_admin')
end

.organization_merchantObject

Can access merchant functions such as analytics, billing, experiences.



12928
12929
12930
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12928

def FlowUserRole.organization_merchant
  @@_organization_merchant ||= FlowUserRole.new('organization_merchant')
end

.organization_operationsObject

Can access customer service functions and retreive relevant data.



12933
12934
12935
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12933

def FlowUserRole.organization_operations
  @@_organization_operations ||= FlowUserRole.new('organization_operations')
end

Instance Method Details

#subtype_to_hashObject



12937
12938
12939
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12937

def subtype_to_hash
  value
end