Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 39 additions & 26 deletions lib/square/inventory/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ def initialize(client:)
# @return [Square::Types::GetInventoryAdjustmentResponse]
def deprecated_get_adjustment(request_options: {}, **params)
_request = Square::Internal::JSON::Request.new(
base_url: request_options[:base_url] || Square::Environment::PRODUCTION,
base_url: request_options[:base_url],
method: "GET",
path: "v2/inventory/adjustment/#{params[:adjustment_id]}"
path: "v2/inventory/adjustment/#{params[:adjustment_id]}",
request_options: request_options
)
begin
_response = @client.send(_request)
Expand All @@ -38,9 +39,10 @@ def deprecated_get_adjustment(request_options: {}, **params)
# @return [Square::Types::GetInventoryAdjustmentResponse]
def get_adjustment(request_options: {}, **params)
_request = Square::Internal::JSON::Request.new(
base_url: request_options[:base_url] || Square::Environment::PRODUCTION,
base_url: request_options[:base_url],
method: "GET",
path: "v2/inventory/adjustments/#{params[:adjustment_id]}"
path: "v2/inventory/adjustments/#{params[:adjustment_id]}",
request_options: request_options
)
begin
_response = @client.send(_request)
Expand All @@ -62,10 +64,11 @@ def get_adjustment(request_options: {}, **params)
# @return [Square::Types::BatchChangeInventoryResponse]
def deprecated_batch_change(request_options: {}, **params)
_request = Square::Internal::JSON::Request.new(
base_url: request_options[:base_url] || Square::Environment::PRODUCTION,
base_url: request_options[:base_url],
method: "POST",
path: "v2/inventory/batch-change",
body: Square::Types::BatchChangeInventoryRequest.new(params).to_h
body: Square::Types::BatchChangeInventoryRequest.new(params).to_h,
request_options: request_options
)
begin
_response = @client.send(_request)
Expand All @@ -87,10 +90,11 @@ def deprecated_batch_change(request_options: {}, **params)
# @return [Square::Types::BatchGetInventoryChangesResponse]
def deprecated_batch_get_changes(request_options: {}, **params)
_request = Square::Internal::JSON::Request.new(
base_url: request_options[:base_url] || Square::Environment::PRODUCTION,
base_url: request_options[:base_url],
method: "POST",
path: "v2/inventory/batch-retrieve-changes",
body: Square::Types::BatchRetrieveInventoryChangesRequest.new(params).to_h
body: Square::Types::BatchRetrieveInventoryChangesRequest.new(params).to_h,
request_options: request_options
)
begin
_response = @client.send(_request)
Expand All @@ -112,10 +116,11 @@ def deprecated_batch_get_changes(request_options: {}, **params)
# @return [Square::Types::BatchGetInventoryCountsResponse]
def deprecated_batch_get_counts(request_options: {}, **params)
_request = Square::Internal::JSON::Request.new(
base_url: request_options[:base_url] || Square::Environment::PRODUCTION,
base_url: request_options[:base_url],
method: "POST",
path: "v2/inventory/batch-retrieve-counts",
body: Square::Types::BatchGetInventoryCountsRequest.new(params).to_h
body: Square::Types::BatchGetInventoryCountsRequest.new(params).to_h,
request_options: request_options
)
begin
_response = @client.send(_request)
Expand All @@ -140,10 +145,11 @@ def deprecated_batch_get_counts(request_options: {}, **params)
# @return [Square::Types::BatchChangeInventoryResponse]
def batch_create_changes(request_options: {}, **params)
_request = Square::Internal::JSON::Request.new(
base_url: request_options[:base_url] || Square::Environment::PRODUCTION,
base_url: request_options[:base_url],
method: "POST",
path: "v2/inventory/changes/batch-create",
body: Square::Types::BatchChangeInventoryRequest.new(params).to_h
body: Square::Types::BatchChangeInventoryRequest.new(params).to_h,
request_options: request_options
)
begin
_response = @client.send(_request)
Expand Down Expand Up @@ -177,10 +183,11 @@ def batch_get_changes(request_options: {}, **params)
) do |next_cursor|
params[:cursor] = next_cursor
_request = Square::Internal::JSON::Request.new(
base_url: request_options[:base_url] || Square::Environment::PRODUCTION,
base_url: request_options[:base_url],
method: "POST",
path: "v2/inventory/changes/batch-retrieve",
body: Square::Types::BatchRetrieveInventoryChangesRequest.new(params).to_h
body: Square::Types::BatchRetrieveInventoryChangesRequest.new(params).to_h,
request_options: request_options
)
begin
_response = @client.send(_request)
Expand Down Expand Up @@ -218,10 +225,11 @@ def batch_get_counts(request_options: {}, **params)
) do |next_cursor|
params[:cursor] = next_cursor
_request = Square::Internal::JSON::Request.new(
base_url: request_options[:base_url] || Square::Environment::PRODUCTION,
base_url: request_options[:base_url],
method: "POST",
path: "v2/inventory/counts/batch-retrieve",
body: Square::Types::BatchGetInventoryCountsRequest.new(params).to_h
body: Square::Types::BatchGetInventoryCountsRequest.new(params).to_h,
request_options: request_options
)
begin
_response = @client.send(_request)
Expand All @@ -244,9 +252,10 @@ def batch_get_counts(request_options: {}, **params)
# @return [Square::Types::GetInventoryPhysicalCountResponse]
def deprecated_get_physical_count(request_options: {}, **params)
_request = Square::Internal::JSON::Request.new(
base_url: request_options[:base_url] || Square::Environment::PRODUCTION,
base_url: request_options[:base_url],
method: "GET",
path: "v2/inventory/physical-count/#{params[:physical_count_id]}"
path: "v2/inventory/physical-count/#{params[:physical_count_id]}",
request_options: request_options
)
begin
_response = @client.send(_request)
Expand All @@ -268,9 +277,10 @@ def deprecated_get_physical_count(request_options: {}, **params)
# @return [Square::Types::GetInventoryPhysicalCountResponse]
def get_physical_count(request_options: {}, **params)
_request = Square::Internal::JSON::Request.new(
base_url: request_options[:base_url] || Square::Environment::PRODUCTION,
base_url: request_options[:base_url],
method: "GET",
path: "v2/inventory/physical-counts/#{params[:physical_count_id]}"
path: "v2/inventory/physical-counts/#{params[:physical_count_id]}",
request_options: request_options
)
begin
_response = @client.send(_request)
Expand All @@ -292,9 +302,10 @@ def get_physical_count(request_options: {}, **params)
# @return [Square::Types::GetInventoryTransferResponse]
def get_transfer(request_options: {}, **params)
_request = Square::Internal::JSON::Request.new(
base_url: request_options[:base_url] || Square::Environment::PRODUCTION,
base_url: request_options[:base_url],
method: "GET",
path: "v2/inventory/transfers/#{params[:transfer_id]}"
path: "v2/inventory/transfers/#{params[:transfer_id]}",
request_options: request_options
)
begin
_response = @client.send(_request)
Expand Down Expand Up @@ -329,10 +340,11 @@ def get(request_options: {}, **params)
) do |next_cursor|
_query[:cursor] = next_cursor
_request = Square::Internal::JSON::Request.new(
base_url: request_options[:base_url] || Square::Environment::PRODUCTION,
base_url: request_options[:base_url],
method: "GET",
path: "v2/inventory/#{params[:catalog_object_id]}",
query: _query
query: _query,
request_options: request_options
)
begin
_response = @client.send(_request)
Expand Down Expand Up @@ -377,10 +389,11 @@ def changes(request_options: {}, **params)
) do |next_cursor|
_query[:cursor] = next_cursor
_request = Square::Internal::JSON::Request.new(
base_url: request_options[:base_url] || Square::Environment::PRODUCTION,
base_url: request_options[:base_url],
method: "GET",
path: "v2/inventory/#{params[:catalog_object_id]}/changes",
query: _query
query: _query,
request_options: request_options
)
begin
_response = @client.send(_request)
Expand Down
40 changes: 24 additions & 16 deletions lib/square/transfer_orders/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,11 @@ def initialize(client:)
# @return [Square::Types::CreateTransferOrderResponse]
def create(request_options: {}, **params)
_request = Square::Internal::JSON::Request.new(
base_url: request_options[:base_url] || Square::Environment::PRODUCTION,
base_url: request_options[:base_url],
method: "POST",
path: "v2/transfer-orders",
body: params
body: params,
request_options: request_options
)
begin
_response = @client.send(_request)
Expand Down Expand Up @@ -68,10 +69,11 @@ def search(request_options: {}, **params)
) do |next_cursor|
params[:cursor] = next_cursor
_request = Square::Internal::JSON::Request.new(
base_url: request_options[:base_url] || Square::Environment::PRODUCTION,
base_url: request_options[:base_url],
method: "POST",
path: "v2/transfer-orders/search",
body: params
body: params,
request_options: request_options
)
begin
_response = @client.send(_request)
Expand Down Expand Up @@ -99,9 +101,10 @@ def search(request_options: {}, **params)
# @return [Square::Types::RetrieveTransferOrderResponse]
def get(request_options: {}, **params)
_request = Square::Internal::JSON::Request.new(
base_url: request_options[:base_url] || Square::Environment::PRODUCTION,
base_url: request_options[:base_url],
method: "GET",
path: "v2/transfer-orders/#{params[:transfer_order_id]}"
path: "v2/transfer-orders/#{params[:transfer_order_id]}",
request_options: request_options
)
begin
_response = @client.send(_request)
Expand All @@ -127,10 +130,11 @@ def update(request_options: {}, **params)
_path_param_names = ["transfer_order_id"]

_request = Square::Internal::JSON::Request.new(
base_url: request_options[:base_url] || Square::Environment::PRODUCTION,
base_url: request_options[:base_url],
method: "PUT",
path: "v2/transfer-orders/#{params[:transfer_order_id]}",
body: params.except(*_path_param_names)
body: params.except(*_path_param_names),
request_options: request_options
)
begin
_response = @client.send(_request)
Expand Down Expand Up @@ -160,10 +164,11 @@ def delete(request_options: {}, **params)
params = params.except(*_query_param_names)

_request = Square::Internal::JSON::Request.new(
base_url: request_options[:base_url] || Square::Environment::PRODUCTION,
base_url: request_options[:base_url],
method: "DELETE",
path: "v2/transfer-orders/#{params[:transfer_order_id]}",
query: _query
query: _query,
request_options: request_options
)
begin
_response = @client.send(_request)
Expand Down Expand Up @@ -195,10 +200,11 @@ def cancel(request_options: {}, **params)
_path_param_names = ["transfer_order_id"]

_request = Square::Internal::JSON::Request.new(
base_url: request_options[:base_url] || Square::Environment::PRODUCTION,
base_url: request_options[:base_url],
method: "POST",
path: "v2/transfer-orders/#{params[:transfer_order_id]}/cancel",
body: params.except(*_path_param_names)
body: params.except(*_path_param_names),
request_options: request_options
)
begin
_response = @client.send(_request)
Expand Down Expand Up @@ -236,10 +242,11 @@ def receive(request_options: {}, **params)
_path_param_names = ["transfer_order_id"]

_request = Square::Internal::JSON::Request.new(
base_url: request_options[:base_url] || Square::Environment::PRODUCTION,
base_url: request_options[:base_url],
method: "POST",
path: "v2/transfer-orders/#{params[:transfer_order_id]}/receive",
body: params.except(*_path_param_names)
body: params.except(*_path_param_names),
request_options: request_options
)
begin
_response = @client.send(_request)
Expand Down Expand Up @@ -269,10 +276,11 @@ def start(request_options: {}, **params)
_path_param_names = ["transfer_order_id"]

_request = Square::Internal::JSON::Request.new(
base_url: request_options[:base_url] || Square::Environment::PRODUCTION,
base_url: request_options[:base_url],
method: "POST",
path: "v2/transfer-orders/#{params[:transfer_order_id]}/start",
body: params.except(*_path_param_names)
body: params.except(*_path_param_names),
request_options: request_options
)
begin
_response = @client.send(_request)
Expand Down
Loading