Ramanth 46c18ad4dd [R] feat(r) : Alternate PR for serialization fixes along with WithHttpInfo method enhancement (#3099)
* feat(r): fixing serialization and deserialization issues

* feat(r): pet store file generated with serialization fixes

* fix(r): updated the query params with keyname in get request

* fix(r):fix issue with package name and other minor

* fix(r): fixing unit tests

* feat(r): adding api calls WithHttpInfo method

* fix(r): reverting unit test changes

* feat(r): saving changes for reference

* Revert "feat(r): saving changes for reference"

This reverts commit 0d091b5c20f8f7f83e8b3318c1f7ddf5c0a4cced.

* feat(r): minor refactor of method position

* fix(r): fixing bug in withhttpinfo method args passing

* fix(r): generated petstore with fix
2019-06-21 16:38:32 +08:00

3.4 KiB

StoreApi

All URIs are relative to http://petstore.swagger.io/v2

Method HTTP request Description
DeleteOrder DELETE /store/order/{orderId} Delete purchase order by ID
GetInventory GET /store/inventory Returns pet inventories by status
GetOrderById GET /store/order/{orderId} Find purchase order by ID
PlaceOrder POST /store/order Place an order for a pet

DeleteOrder

DeleteOrder(order.id)

Delete purchase order by ID

For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors

Example

library(petstore)

var.order.id <- 'order.id_example' # character | ID of the order that needs to be deleted

#Delete purchase order by ID
api.instance <- StoreApi$new()
api.instance$DeleteOrder(var.order.id)

Parameters

Name Type Description Notes
order.id character ID of the order that needs to be deleted

Return type

void (empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

GetInventory

map(integer) GetInventory()

Returns pet inventories by status

Returns a map of status codes to quantities

Example

library(petstore)


#Returns pet inventories by status
api.instance <- StoreApi$new()
# Configure API key authorization: api_key
api.instance$apiClient$apiKeys['api_key'] <- 'TODO_YOUR_API_KEY';
result <- api.instance$GetInventory()
dput(result)

Parameters

This endpoint does not need any parameter.

Return type

map(integer)

Authorization

api_key

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

GetOrderById

Order GetOrderById(order.id)

Find purchase order by ID

For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions

Example

library(petstore)

var.order.id <- 56 # integer | ID of pet that needs to be fetched

#Find purchase order by ID
api.instance <- StoreApi$new()
result <- api.instance$GetOrderById(var.order.id)
dput(result)

Parameters

Name Type Description Notes
order.id integer ID of pet that needs to be fetched

Return type

Order

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/xml, application/json

PlaceOrder

Order PlaceOrder(body)

Place an order for a pet

Example

library(petstore)

var.body <- Order$new(123, 123, 123, "shipDate_example", "status_example", "complete_example") # Order | order placed for purchasing the pet

#Place an order for a pet
api.instance <- StoreApi$new()
result <- api.instance$PlaceOrder(var.body)
dput(result)

Parameters

Name Type Description Notes
body Order order placed for purchasing the pet

Return type

Order

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/xml, application/json