class ShopifyAPI::InventoryLevel

Attributes

available[R]
inventory_item_id[R]
location_id[R]
updated_at[R]

Public Class Methods

all( inventory_item_ids: nil, location_ids: nil, limit: nil, updated_at_min: nil, session: ShopifyAPI::Context.active_session, **kwargs ) click to toggle source
# File lib/shopify_api/rest/resources/2022_04/inventory_level.rb, line 80
def all(
  inventory_item_ids: nil,
  location_ids: nil,
  limit: nil,
  updated_at_min: nil,
  session: ShopifyAPI::Context.active_session,
  **kwargs
)
  response = base_find(
    session: session,
    ids: {},
    params: {inventory_item_ids: inventory_item_ids, location_ids: location_ids, limit: limit, updated_at_min: updated_at_min}.merge(kwargs).compact,
  )

  T.cast(response, T::Array[InventoryLevel])
end
delete( inventory_item_id: nil, location_id: nil, session: ShopifyAPI::Context.active_session ) click to toggle source
# File lib/shopify_api/rest/resources/2022_04/inventory_level.rb, line 56
def delete(
  inventory_item_id: nil,
  location_id: nil,
  session: ShopifyAPI::Context.active_session
)
  request(
    http_method: :delete,
    operation: :delete,
    session: session,
    ids: {},
    params: {inventory_item_id: inventory_item_id, location_id: location_id},
  )
end
new(session: ShopifyAPI::Context.active_session, from_hash: nil) click to toggle source
Calls superclass method ShopifyAPI::Rest::Base::new
# File lib/shopify_api/rest/resources/2022_04/inventory_level.rb, line 19
def initialize(session: ShopifyAPI::Context.active_session, from_hash: nil)

  @available = T.let(nil, T.nilable(Integer))
  @inventory_item_id = T.let(nil, T.nilable(Integer))
  @location_id = T.let(nil, T.nilable(Integer))
  @updated_at = T.let(nil, T.nilable(String))

  super(session: session, from_hash: from_hash)
end

Public Instance Methods

adjust( inventory_item_id: nil, location_id: nil, available_adjustment: nil, body: nil, **kwargs ) click to toggle source
# File lib/shopify_api/rest/resources/2022_04/inventory_level.rb, line 108
def adjust(
  inventory_item_id: nil,
  location_id: nil,
  available_adjustment: nil,
  body: nil,
  **kwargs
)
  self.class.request(
    http_method: :post,
    operation: :adjust,
    session: @session,
    ids: {},
    params: {inventory_item_id: inventory_item_id, location_id: location_id, available_adjustment: available_adjustment}.merge(kwargs).compact,
    body: body,
    entity: self,
  )
end
connect( inventory_item_id: nil, location_id: nil, relocate_if_necessary: nil, body: nil, **kwargs ) click to toggle source
# File lib/shopify_api/rest/resources/2022_04/inventory_level.rb, line 135
def connect(
  inventory_item_id: nil,
  location_id: nil,
  relocate_if_necessary: nil,
  body: nil,
  **kwargs
)
  self.class.request(
    http_method: :post,
    operation: :connect,
    session: @session,
    ids: {},
    params: {inventory_item_id: inventory_item_id, location_id: location_id, relocate_if_necessary: relocate_if_necessary}.merge(kwargs).compact,
    body: body,
    entity: self,
  )
end
set( inventory_item_id: nil, location_id: nil, available: nil, disconnect_if_necessary: nil, body: nil, **kwargs ) click to toggle source
# File lib/shopify_api/rest/resources/2022_04/inventory_level.rb, line 163
def set(
  inventory_item_id: nil,
  location_id: nil,
  available: nil,
  disconnect_if_necessary: nil,
  body: nil,
  **kwargs
)
  self.class.request(
    http_method: :post,
    operation: :set,
    session: @session,
    ids: {},
    params: {inventory_item_id: inventory_item_id, location_id: location_id, available: available, disconnect_if_necessary: disconnect_if_necessary}.merge(kwargs).compact,
    body: body,
    entity: self,
  )
end