Class: Io::Flow::V0::Models::FlowAddonRole

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) ⇒ FlowAddonRole

Returns a new instance of FlowAddonRole.



15222
15223
15224
15225
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15222

def initialize(value)
  super(:name => FlowRole::Types::FLOW_ADDON_ROLE, :discriminator => 'flow_addon_role')
  @value = HttpClient::Preconditions.assert_class('value', value, String)
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



15220
15221
15222
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15220

def value
  @value
end

Class Method Details

.ALLObject



15243
15244
15245
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15243

def FlowAddonRole.ALL
  @@all ||= [FlowAddonRole.consumer_data_viewer, FlowAddonRole.membership_manager]
end

.apply(value) ⇒ Object

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



15228
15229
15230
15231
15232
15233
15234
15235
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15228

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

.consumer_data_viewerObject

Can view consumer’s private data



15248
15249
15250
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15248

def FlowAddonRole.consumer_data_viewer
  @@_consumer_data_viewer ||= FlowAddonRole.new('consumer_data_viewer')
end

.from_string(value) ⇒ Object

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



15238
15239
15240
15241
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15238

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

.membership_managerObject

Can invite new users to the org.



15253
15254
15255
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15253

def FlowAddonRole.membership_manager
  @@_membership_manager ||= FlowAddonRole.new('membership_manager')
end

Instance Method Details

#subtype_to_hashObject



15257
15258
15259
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15257

def subtype_to_hash
  value
end