@@ -32,11 +32,13 @@ api_instance <- PetApi$new()
3232# Configure OAuth2 access token for authorization: petstore_auth
3333api_instance $ api_client $ access_token <- ' TODO_YOUR_ACCESS_TOKEN' ;
3434result <- tryCatch(
35+ # to save the result into a file, simply add the optional `data_file` parameter, e.g.
36+ # api_instance$AddPet(var_pet, data_file = "result.txt"),
3537 api_instance $ AddPet(var_pet ),
3638 ApiException = function (ex ) ex
3739 )
3840# In case of error, print the error object
39- if (! is.null(result $ ApiException )) {
41+ if (! is.null(result $ ApiException )) {
4042 cat(result $ ApiException $ toString())
4143} else {
4244 # deserialized response object
@@ -74,7 +76,7 @@ Name | Type | Description | Notes
7476| ** 405** | Invalid input | - |
7577
7678# ** DeletePet**
77- > DeletePet(pet_id, api_key= var.api_key)
79+ > DeletePet(pet_id, api_key = var.api_key)
7880
7981Deletes a pet
8082
@@ -92,11 +94,11 @@ api_instance <- PetApi$new()
9294# Configure OAuth2 access token for authorization: petstore_auth
9395api_instance $ api_client $ access_token <- ' TODO_YOUR_ACCESS_TOKEN' ;
9496result <- tryCatch(
95- api_instance $ DeletePet(var_pet_id , api_key = var_api_key ),
97+ api_instance $ DeletePet(var_pet_id , api_key = var_api_key ),
9698 ApiException = function (ex ) ex
9799 )
98100# In case of error, print the error object
99- if (! is.null(result $ ApiException )) {
101+ if (! is.null(result $ ApiException )) {
100102 cat(result $ ApiException $ toString())
101103} else {
102104 # response headers
@@ -149,11 +151,13 @@ api_instance <- PetApi$new()
149151# Configure OAuth2 access token for authorization: petstore_auth
150152api_instance $ api_client $ access_token <- ' TODO_YOUR_ACCESS_TOKEN' ;
151153result <- tryCatch(
154+ # to save the result into a file, simply add the optional `data_file` parameter, e.g.
155+ # api_instance$FindPetsByStatus(var_status, data_file = "result.txt"),
152156 api_instance $ FindPetsByStatus(var_status ),
153157 ApiException = function (ex ) ex
154158 )
155159# In case of error, print the error object
156- if (! is.null(result $ ApiException )) {
160+ if (! is.null(result $ ApiException )) {
157161 cat(result $ ApiException $ toString())
158162} else {
159163 # deserialized response object
@@ -208,11 +212,13 @@ api_instance <- PetApi$new()
208212# Configure OAuth2 access token for authorization: petstore_auth
209213api_instance $ api_client $ access_token <- ' TODO_YOUR_ACCESS_TOKEN' ;
210214result <- tryCatch(
215+ # to save the result into a file, simply add the optional `data_file` parameter, e.g.
216+ # api_instance$FindPetsByTags(var_tags, data_file = "result.txt"),
211217 api_instance $ FindPetsByTags(var_tags ),
212218 ApiException = function (ex ) ex
213219 )
214220# In case of error, print the error object
215- if (! is.null(result $ ApiException )) {
221+ if (! is.null(result $ ApiException )) {
216222 cat(result $ ApiException $ toString())
217223} else {
218224 # deserialized response object
@@ -267,11 +273,13 @@ api_instance <- PetApi$new()
267273# Configure API key authorization: api_key
268274api_instance $ api_client $ api_keys [' api_key' ] <- ' TODO_YOUR_API_KEY' ;
269275result <- tryCatch(
276+ # to save the result into a file, simply add the optional `data_file` parameter, e.g.
277+ # api_instance$GetPetById(var_pet_id, data_file = "result.txt"),
270278 api_instance $ GetPetById(var_pet_id ),
271279 ApiException = function (ex ) ex
272280 )
273281# In case of error, print the error object
274- if (! is.null(result $ ApiException )) {
282+ if (! is.null(result $ ApiException )) {
275283 cat(result $ ApiException $ toString())
276284} else {
277285 # deserialized response object
@@ -327,11 +335,13 @@ api_instance <- PetApi$new()
327335# Configure OAuth2 access token for authorization: petstore_auth
328336api_instance $ api_client $ access_token <- ' TODO_YOUR_ACCESS_TOKEN' ;
329337result <- tryCatch(
338+ # to save the result into a file, simply add the optional `data_file` parameter, e.g.
339+ # api_instance$UpdatePet(var_pet, data_file = "result.txt"),
330340 api_instance $ UpdatePet(var_pet ),
331341 ApiException = function (ex ) ex
332342 )
333343# In case of error, print the error object
334- if (! is.null(result $ ApiException )) {
344+ if (! is.null(result $ ApiException )) {
335345 cat(result $ ApiException $ toString())
336346} else {
337347 # deserialized response object
@@ -371,7 +381,7 @@ Name | Type | Description | Notes
371381| ** 405** | Validation exception | - |
372382
373383# ** UpdatePetWithForm**
374- > UpdatePetWithForm(pet_id, name= var.name, status= var.status)
384+ > UpdatePetWithForm(pet_id, name = var.name, status = var.status)
375385
376386Updates a pet in the store with form data
377387
@@ -390,11 +400,11 @@ api_instance <- PetApi$new()
390400# Configure OAuth2 access token for authorization: petstore_auth
391401api_instance $ api_client $ access_token <- ' TODO_YOUR_ACCESS_TOKEN' ;
392402result <- tryCatch(
393- api_instance $ UpdatePetWithForm(var_pet_id , name = var_name , status = var_status ),
403+ api_instance $ UpdatePetWithForm(var_pet_id , name = var_name , status = var_status ),
394404 ApiException = function (ex ) ex
395405 )
396406# In case of error, print the error object
397- if (! is.null(result $ ApiException )) {
407+ if (! is.null(result $ ApiException )) {
398408 cat(result $ ApiException $ toString())
399409} else {
400410 # response headers
@@ -431,7 +441,7 @@ void (empty response body)
431441| ** 405** | Invalid input | - |
432442
433443# ** UploadFile**
434- > ModelApiResponse UploadFile(pet_id, additional_metadata= var.additional_metadata, file= var.file)
444+ > ModelApiResponse UploadFile(pet_id, additional_metadata = var.additional_metadata, file = var.file)
435445
436446uploads an image
437447
@@ -450,11 +460,13 @@ api_instance <- PetApi$new()
450460# Configure OAuth2 access token for authorization: petstore_auth
451461api_instance $ api_client $ access_token <- ' TODO_YOUR_ACCESS_TOKEN' ;
452462result <- tryCatch(
453- api_instance $ UploadFile(var_pet_id , additional_metadata = var_additional_metadata , file = var_file ),
463+ # to save the result into a file, simply add the optional `data_file` parameter, e.g.
464+ # api_instance$UploadFile(var_pet_id, additional_metadata = var_additional_metadata, file = var_file, data_file = "result.txt"),
465+ api_instance $ UploadFile(var_pet_id , additional_metadata = var_additional_metadata , file = var_file ),
454466 ApiException = function (ex ) ex
455467 )
456468# In case of error, print the error object
457- if (! is.null(result $ ApiException )) {
469+ if (! is.null(result $ ApiException )) {
458470 cat(result $ ApiException $ toString())
459471} else {
460472 # deserialized response object
0 commit comments