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.



15287
15288
15289
15290
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15287

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.



15285
15286
15287
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15285

def value
  @value
end

Class Method Details

.ALLObject



15308
15309
15310
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15308

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



15293
15294
15295
15296
15297
15298
15299
15300
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15293

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



15313
15314
15315
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15313

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



15303
15304
15305
15306
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15303

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.



15318
15319
15320
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15318

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

Instance Method Details

#subtype_to_hashObject



15322
15323
15324
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15322

def subtype_to_hash
  value
end