Class: WalmartApIs::OauthScopeWalletAuth

Inherits:
Object
  • Object
show all
Defined in:
lib/walmart_ap_is/models/oauth_scope_wallet_auth.rb

Overview

OAuth 2 scopes supported by the API

Constant Summary collapse

OAUTH_SCOPE_WALLET_AUTH =
[
  # Read catalog data
  CATALOGREAD = 'catalog:read'.freeze,

  # Submit and retrieve Data Kiosk analytics queries and documents
  ANALYTICSREAD = 'analytics:read'.freeze,

  # Read feed status
  FEEDSREAD = 'feeds:read'.freeze,

  # Submit feeds
  FEEDSWRITE = 'feeds:write'.freeze,

  # Read WFS fulfillment orders and shipments, Read eligible shipping
  # services
  FULFILLMENTREAD = 'fulfillment:read'.freeze,

  # Create, update, and cancel WFS fulfillment orders, Purchase and cancel
  # shipping labels
  FULFILLMENTWRITE = 'fulfillment:write'.freeze,

  # Read inventory data
  INVENTORYREAD = 'inventory:read'.freeze,

  # Update inventory quantities
  INVENTORYWRITE = 'inventory:write'.freeze,

  # Read access
  READ = 'read'.freeze,

  # Write access
  WRITE = 'write'.freeze,

  # Read listings items, Read listing restrictions for items
  LISTINGSREAD = 'listings:read'.freeze,

  # Create, update, patch, and delete listings items
  LISTINGSWRITE = 'listings:write'.freeze,

  # Read orders
  ORDERSREAD = 'orders:read'.freeze,

  # Acknowledge, ship, cancel orders
  ORDERSWRITE = 'orders:write'.freeze,

  # Read settlement, reconciliation, and payout data
  DISBURSEMENTSREAD = 'disbursements:read'.freeze,

  # Initiate and configure payout operations
  DISBURSEMENTSWRITE = 'disbursements:write'.freeze,

  # Read financial event groups and financial events
  FINANCESREAD = 'finances:read'.freeze,

  # Read seller pricing and competitive pricing data
  PRICINGREAD = 'pricing:read'.freeze,

  # Read product type definitions
  DEFINITIONSREAD = 'definitions:read'.freeze,

  # Read and download seller reports and schedules
  REPORTSREAD = 'reports:read'.freeze,

  # Create and cancel reports and schedules
  REPORTSWRITE = 'reports:write'.freeze,

  # Read seller account and marketplace participation info
  SELLERSREAD = 'sellers:read'.freeze,

  # Read shipping rates, tracking, documents, and access points
  SHIPPINGREAD = 'shipping:read'.freeze,

  # Purchase, cancel, and submit NDR feedback on shipments
  SHIPPINGWRITE = 'shipping:write'.freeze,

  # Create upload destinations for feed and report documents
  UPLOADSWRITE = 'uploads:write'.freeze
].freeze

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = CATALOGREAD) ⇒ Object



94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# File 'lib/walmart_ap_is/models/oauth_scope_wallet_auth.rb', line 94

def self.from_value(value, default_value = CATALOGREAD)
  return default_value if value.nil?

  str = value.to_s.strip

  case str.downcase
  when 'catalogread' then CATALOGREAD
  when 'analyticsread' then ANALYTICSREAD
  when 'feedsread' then FEEDSREAD
  when 'feedswrite' then FEEDSWRITE
  when 'fulfillmentread' then FULFILLMENTREAD
  when 'fulfillmentwrite' then FULFILLMENTWRITE
  when 'inventoryread' then INVENTORYREAD
  when 'inventorywrite' then INVENTORYWRITE
  when 'read' then READ
  when 'write' then WRITE
  when 'listingsread' then LISTINGSREAD
  when 'listingswrite' then LISTINGSWRITE
  when 'ordersread' then ORDERSREAD
  when 'orderswrite' then ORDERSWRITE
  when 'disbursementsread' then DISBURSEMENTSREAD
  when 'disbursementswrite' then DISBURSEMENTSWRITE
  when 'financesread' then FINANCESREAD
  when 'pricingread' then PRICINGREAD
  when 'definitionsread' then DEFINITIONSREAD
  when 'reportsread' then REPORTSREAD
  when 'reportswrite' then REPORTSWRITE
  when 'sellersread' then SELLERSREAD
  when 'shippingread' then SHIPPINGREAD
  when 'shippingwrite' then SHIPPINGWRITE
  when 'uploadswrite' then UPLOADSWRITE
  else
    default_value
  end
end

.validate(value) ⇒ Object



88
89
90
91
92
# File 'lib/walmart_ap_is/models/oauth_scope_wallet_auth.rb', line 88

def self.validate(value)
  return false if value.nil?

  OAUTH_SCOPE_WALLET_AUTH.include?(value)
end