diff --git a/lib/square/inventory/client.rb b/lib/square/inventory/client.rb index 20578340..0e9dbfdf 100644 --- a/lib/square/inventory/client.rb +++ b/lib/square/inventory/client.rb @@ -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) @@ -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) @@ -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) @@ -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) @@ -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) @@ -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) @@ -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) @@ -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) @@ -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) @@ -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) @@ -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) @@ -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) @@ -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) diff --git a/lib/square/transfer_orders/client.rb b/lib/square/transfer_orders/client.rb index 8a52efd5..0334147a 100644 --- a/lib/square/transfer_orders/client.rb +++ b/lib/square/transfer_orders/client.rb @@ -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) @@ -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) @@ -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) @@ -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) @@ -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) @@ -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) @@ -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) @@ -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)