forked from loafle/openapi-generator-original
[R] Add generateWrapper option (#13198)
* add generateWrapper option * fix bug, add tests * update doc
This commit is contained in:
14
bin/configs/r-httr2-wrapper-client.yaml
Normal file
14
bin/configs/r-httr2-wrapper-client.yaml
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
generatorName: r
|
||||||
|
outputDir: samples/client/petstore/R-httr2-wrapper
|
||||||
|
inputSpec: modules/openapi-generator/src/test/resources/3_0/r/petstore.yaml
|
||||||
|
templateDir: modules/openapi-generator/src/main/resources/r
|
||||||
|
httpUserAgent: PetstoreAgent
|
||||||
|
library: httr2
|
||||||
|
additionalProperties:
|
||||||
|
packageName: petstore
|
||||||
|
exceptionPackage: rlang
|
||||||
|
useRlangExceptionHandling: true
|
||||||
|
returnExceptionOnFailure: true
|
||||||
|
errorObjectType: "ModelApiResponse"
|
||||||
|
operationIdNaming: snake_case
|
||||||
|
generateWrapper: true
|
||||||
@@ -20,6 +20,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
|||||||
| ------ | ----------- | ------ | ------- |
|
| ------ | ----------- | ------ | ------- |
|
||||||
|errorObjectType|Error object type.| |null|
|
|errorObjectType|Error object type.| |null|
|
||||||
|exceptionPackage|Specify the exception handling package|<dl><dt>**default**</dt><dd>Use stop() for raising exceptions.</dd><dt>**rlang**</dt><dd>Use rlang package for exceptions.</dd></dl>|default|
|
|exceptionPackage|Specify the exception handling package|<dl><dt>**default**</dt><dd>Use stop() for raising exceptions.</dd><dt>**rlang**</dt><dd>Use rlang package for exceptions.</dd></dl>|default|
|
||||||
|
|generateWrapper|Generate a wrapper class (single point of access) for the R client. This option only works with `httr2` library.| |false|
|
||||||
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true|
|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true|
|
||||||
|library|HTTP library template (sub-template) to use|<dl><dt>**httr2**</dt><dd>httr2 (https://httr2.r-lib.org/)</dd><dt>**httr**</dt><dd>httr (https://cran.r-project.org/web/packages/httr/index.html)</dd></dl>|httr|
|
|library|HTTP library template (sub-template) to use|<dl><dt>**httr2**</dt><dd>httr2 (https://httr2.r-lib.org/)</dd><dt>**httr**</dt><dd>httr (https://cran.r-project.org/web/packages/httr/index.html)</dd></dl>|httr|
|
||||||
|operationIdNaming|Naming convention for operationId (function name in the API)|<dl><dt>**PascalCase**</dt><dd>Pascal case (default)</dd><dt>**snake_case**</dt><dd>Snake case</dd><dt>**camelCase**</dt><dd>Camel case</dd></dl>|null|
|
|operationIdNaming|Naming convention for operationId (function name in the API)|<dl><dt>**PascalCase**</dt><dd>Pascal case (default)</dd><dt>**snake_case**</dt><dd>Snake case</dd><dt>**camelCase**</dt><dd>Camel case</dd></dl>|null|
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ public class RClientCodegen extends DefaultCodegen implements CodegenConfig {
|
|||||||
public static final String EXCEPTION_PACKAGE = "exceptionPackage";
|
public static final String EXCEPTION_PACKAGE = "exceptionPackage";
|
||||||
public static final String USE_DEFAULT_EXCEPTION = "useDefaultExceptionHandling";
|
public static final String USE_DEFAULT_EXCEPTION = "useDefaultExceptionHandling";
|
||||||
public static final String USE_RLANG_EXCEPTION = "useRlangExceptionHandling";
|
public static final String USE_RLANG_EXCEPTION = "useRlangExceptionHandling";
|
||||||
|
public static final String GENERATE_WRAPPER = "generateWrapper";
|
||||||
public static final String DEFAULT = "default";
|
public static final String DEFAULT = "default";
|
||||||
public static final String RLANG = "rlang";
|
public static final String RLANG = "rlang";
|
||||||
public static final String HTTR = "httr";
|
public static final String HTTR = "httr";
|
||||||
@@ -74,6 +75,7 @@ public class RClientCodegen extends DefaultCodegen implements CodegenConfig {
|
|||||||
protected boolean useRlangExceptionHandling = false;
|
protected boolean useRlangExceptionHandling = false;
|
||||||
protected String errorObjectType;
|
protected String errorObjectType;
|
||||||
protected String operationIdNaming;
|
protected String operationIdNaming;
|
||||||
|
protected boolean generateWrapper;
|
||||||
|
|
||||||
private Map<String, String> schemaKeyToModelNameCache = new HashMap<>();
|
private Map<String, String> schemaKeyToModelNameCache = new HashMap<>();
|
||||||
|
|
||||||
@@ -211,6 +213,8 @@ public class RClientCodegen extends DefaultCodegen implements CodegenConfig {
|
|||||||
libraryOption.setDefault(HTTR);
|
libraryOption.setDefault(HTTR);
|
||||||
cliOptions.add(libraryOption);
|
cliOptions.add(libraryOption);
|
||||||
setLibrary(HTTR);
|
setLibrary(HTTR);
|
||||||
|
|
||||||
|
cliOptions.add(CliOption.newBoolean(GENERATE_WRAPPER, "Generate a wrapper class (single point of access) for the R client. This option only works with `httr2` library."));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -254,6 +258,13 @@ public class RClientCodegen extends DefaultCodegen implements CodegenConfig {
|
|||||||
}
|
}
|
||||||
additionalProperties.put(CodegenConstants.ERROR_OBJECT_TYPE, errorObjectType);
|
additionalProperties.put(CodegenConstants.ERROR_OBJECT_TYPE, errorObjectType);
|
||||||
|
|
||||||
|
if (additionalProperties.containsKey(GENERATE_WRAPPER)) {
|
||||||
|
this.setGenerateWrapper(Boolean.parseBoolean(
|
||||||
|
additionalProperties.get(GENERATE_WRAPPER).toString()));
|
||||||
|
} else {
|
||||||
|
this.setGenerateWrapper(false);
|
||||||
|
}
|
||||||
|
|
||||||
additionalProperties.put(CodegenConstants.PACKAGE_NAME, packageName);
|
additionalProperties.put(CodegenConstants.PACKAGE_NAME, packageName);
|
||||||
additionalProperties.put(CodegenConstants.PACKAGE_VERSION, packageVersion);
|
additionalProperties.put(CodegenConstants.PACKAGE_VERSION, packageVersion);
|
||||||
additionalProperties.put(CodegenConstants.EXCEPTION_ON_FAILURE, returnExceptionOnFailure);
|
additionalProperties.put(CodegenConstants.EXCEPTION_ON_FAILURE, returnExceptionOnFailure);
|
||||||
@@ -292,6 +303,9 @@ public class RClientCodegen extends DefaultCodegen implements CodegenConfig {
|
|||||||
// for httr2
|
// for httr2
|
||||||
setLibrary(HTTR2);
|
setLibrary(HTTR2);
|
||||||
additionalProperties.put("isHttr2", Boolean.TRUE);
|
additionalProperties.put("isHttr2", Boolean.TRUE);
|
||||||
|
if (generateWrapper) { // generateWrapper option only supports in httr2 library
|
||||||
|
supportingFiles.add(new SupportingFile("api_wrapper.mustache", "R", packageName.toLowerCase(Locale.ROOT) + "_api.R"));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
throw new IllegalArgumentException("Invalid HTTP library " + getLibrary() + ". Only httr, httr2 are supported.");
|
throw new IllegalArgumentException("Invalid HTTP library " + getLibrary() + ". Only httr, httr2 are supported.");
|
||||||
}
|
}
|
||||||
@@ -592,6 +606,10 @@ public class RClientCodegen extends DefaultCodegen implements CodegenConfig {
|
|||||||
this.errorObjectType = errorObjectType;
|
this.errorObjectType = errorObjectType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setGenerateWrapper(final boolean generateWrapper) {
|
||||||
|
this.generateWrapper = generateWrapper;
|
||||||
|
}
|
||||||
|
|
||||||
public void setOperationIdNaming(final String operationIdNaming) {
|
public void setOperationIdNaming(final String operationIdNaming) {
|
||||||
if (!("PascalCase".equals(operationIdNaming) || "camelCase".equals(operationIdNaming) ||
|
if (!("PascalCase".equals(operationIdNaming) || "camelCase".equals(operationIdNaming) ||
|
||||||
"snake_case".equals(operationIdNaming))) {
|
"snake_case".equals(operationIdNaming))) {
|
||||||
|
|||||||
@@ -12,6 +12,11 @@ import(httr2)
|
|||||||
import(base64enc)
|
import(base64enc)
|
||||||
import(stringr)
|
import(stringr)
|
||||||
|
|
||||||
|
{{#generateWrapper}}
|
||||||
|
# Wrapper
|
||||||
|
export({{#lambda.lowercase}}{{{packageName}}}{{/lambda.lowercase}}_api)
|
||||||
|
{{/generateWrapper}}
|
||||||
|
|
||||||
# Core
|
# Core
|
||||||
export(ApiClient)
|
export(ApiClient)
|
||||||
export(ApiResponse)
|
export(ApiResponse)
|
||||||
|
|||||||
@@ -28,7 +28,12 @@ var_{{{paramName}}} <- {{{vendorExtensions.x-r-example}}} # {{{dataType}}} | {{{
|
|||||||
{{#summary}}
|
{{#summary}}
|
||||||
#{{{.}}}
|
#{{{.}}}
|
||||||
{{/summary}}
|
{{/summary}}
|
||||||
|
{{#generateWrapper}}
|
||||||
|
api_instance <- {{#lambda.lowercase}}{{{packageName}}}{{/lambda.lowercase}}_api$new()
|
||||||
|
{{/generateWrapper}}
|
||||||
|
{{^generateWrapper}}
|
||||||
api_instance <- {{{classname}}}$new()
|
api_instance <- {{{classname}}}$new()
|
||||||
|
{{/generateWrapper}}
|
||||||
{{#hasAuthMethods}}
|
{{#hasAuthMethods}}
|
||||||
{{#authMethods}}
|
{{#authMethods}}
|
||||||
{{#isBasic}}
|
{{#isBasic}}
|
||||||
@@ -63,7 +68,7 @@ result <- tryCatch(
|
|||||||
# api_instance${{{operationId}}}({{#requiredParams}}var_{{{paramName}}}{{^-last}}, {{/-last}}{{/requiredParams}}{{#optionalParams}}{{#-first}}{{#requiredParams.0}}, {{/requiredParams.0}}{{/-first}}{{{paramName}}} = var_{{{paramName}}}{{^-last}}, {{/-last}}{{/optionalParams}}{{#allParams}}{{#-first}}, {{/-first}}{{/allParams}}stream_callback = function(x){ print(length(x)) }),
|
# api_instance${{{operationId}}}({{#requiredParams}}var_{{{paramName}}}{{^-last}}, {{/-last}}{{/requiredParams}}{{#optionalParams}}{{#-first}}{{#requiredParams.0}}, {{/requiredParams.0}}{{/-first}}{{{paramName}}} = var_{{{paramName}}}{{^-last}}, {{/-last}}{{/optionalParams}}{{#allParams}}{{#-first}}, {{/-first}}{{/allParams}}stream_callback = function(x){ print(length(x)) }),
|
||||||
{{/vendorExtensions.x-streaming}}
|
{{/vendorExtensions.x-streaming}}
|
||||||
{{/returnType}}
|
{{/returnType}}
|
||||||
api_instance${{{operationId}}}({{#requiredParams}}var_{{{paramName}}}{{^-last}}, {{/-last}}{{/requiredParams}}{{#optionalParams}}{{#-first}}{{#requiredParams.0}}, {{/requiredParams.0}}{{/-first}}{{{paramName}}} = var_{{{paramName}}}{{^-last}}, {{/-last}}{{/optionalParams}}),
|
api_instance{{#generateWrapper}}${{#lambda.snakecase}}{{{classname}}}{{/lambda.snakecase}}{{/generateWrapper}}${{{operationId}}}({{#requiredParams}}var_{{{paramName}}}{{^-last}}, {{/-last}}{{/requiredParams}}{{#optionalParams}}{{#-first}}{{#requiredParams.0}}, {{/requiredParams.0}}{{/-first}}{{{paramName}}} = var_{{{paramName}}}{{^-last}}, {{/-last}}{{/optionalParams}}),
|
||||||
ApiException = function(ex) ex
|
ApiException = function(ex) ex
|
||||||
)
|
)
|
||||||
# In case of error, print the error object
|
# In case of error, print the error object
|
||||||
@@ -95,7 +100,7 @@ if (!is.null(result$ApiException)) {
|
|||||||
# this endpoint supports data streaming via a callback function using the optional `stream_callback` parameter, e.g.
|
# this endpoint supports data streaming via a callback function using the optional `stream_callback` parameter, e.g.
|
||||||
# api_instance${{{operationId}}}({{#requiredParams}}var_{{{paramName}}}{{^-last}}, {{/-last}}{{/requiredParams}}{{#optionalParams}}{{#-first}}{{#requiredParams.0}}, {{/requiredParams.0}}{{/-first}}{{{paramName}}} = var_{{{paramName}}}{{^-last}}, {{/-last}}{{/optionalParams}}{{#allParams}}{{#-first}}, {{/-first}}{{/allParams}}stream_callback = function(x){ print(length(x)) })
|
# api_instance${{{operationId}}}({{#requiredParams}}var_{{{paramName}}}{{^-last}}, {{/-last}}{{/requiredParams}}{{#optionalParams}}{{#-first}}{{#requiredParams.0}}, {{/requiredParams.0}}{{/-first}}{{{paramName}}} = var_{{{paramName}}}{{^-last}}, {{/-last}}{{/optionalParams}}{{#allParams}}{{#-first}}, {{/-first}}{{/allParams}}stream_callback = function(x){ print(length(x)) })
|
||||||
{{/vendorExtensions.x-streaming}}
|
{{/vendorExtensions.x-streaming}}
|
||||||
{{#returnType}}result <- {{/returnType}}api_instance${{{operationId}}}({{#requiredParams}}var_{{{paramName}}}{{^-last}}, {{/-last}}{{/requiredParams}}{{#optionalParams}}{{#-first}}{{#requiredParams.0}}, {{/requiredParams.0}}{{/-first}}{{{paramName}}} = var_{{{paramName}}}{{^-last}}, {{/-last}}{{/optionalParams}})
|
{{#returnType}}result <- {{/returnType}}api_instance{{#generateWrapper}}${{#lambda.snakecase}}{{{classname}}}{{/lambda.snakecase}}{{/generateWrapper}}${{{operationId}}}({{#requiredParams}}var_{{{paramName}}}{{^-last}}, {{/-last}}{{/requiredParams}}{{#optionalParams}}{{#-first}}{{#requiredParams.0}}, {{/requiredParams.0}}{{/-first}}{{{paramName}}} = var_{{{paramName}}}{{^-last}}, {{/-last}}{{/optionalParams}})
|
||||||
{{#returnType}}
|
{{#returnType}}
|
||||||
dput(result)
|
dput(result)
|
||||||
{{/returnType}}
|
{{/returnType}}
|
||||||
|
|||||||
73
modules/openapi-generator/src/main/resources/r/libraries/httr2/api_wrapper.mustache
vendored
Normal file
73
modules/openapi-generator/src/main/resources/r/libraries/httr2/api_wrapper.mustache
vendored
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
{{>partial_header}}
|
||||||
|
#' {{{packageName}}} API Class
|
||||||
|
#'
|
||||||
|
#' A single point of access to the {{{packageName}}} API.
|
||||||
|
#'
|
||||||
|
#' NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
#' Ref: https://openapi-generator.tech
|
||||||
|
#' Do not edit the class manually.
|
||||||
|
#'
|
||||||
|
#' @docType class
|
||||||
|
#' @title ApiClient
|
||||||
|
#' @description ApiClient Class
|
||||||
|
#' @format An \code{R6Class} generator object
|
||||||
|
#' @field api_client API client
|
||||||
|
{{#apiInfo}}
|
||||||
|
{{#apis}}
|
||||||
|
{{#operations}}
|
||||||
|
{{#operation}}
|
||||||
|
{{#-first}}
|
||||||
|
#' @field {{#lambda.snakecase}}{{classname}}{{/lambda.snakecase}} an instance of {{classname}}
|
||||||
|
{{/-first}}
|
||||||
|
{{/operation}}
|
||||||
|
{{/operations}}
|
||||||
|
{{/apis}}
|
||||||
|
{{/apiInfo}}
|
||||||
|
{{#useRlangExceptionHandling}}
|
||||||
|
#' @importFrom rlang abort
|
||||||
|
{{/useRlangExceptionHandling}}
|
||||||
|
#' @export
|
||||||
|
{{#lambda.lowercase}}{{{packageName}}}{{/lambda.lowercase}}_api <- R6::R6Class(
|
||||||
|
"{{#lambda.lowercase}}{{{packageName}}}{{/lambda.lowercase}}_api",
|
||||||
|
public = list(
|
||||||
|
api_client = NULL,
|
||||||
|
{{#apiInfo}}
|
||||||
|
{{#apis}}
|
||||||
|
{{#operations}}
|
||||||
|
{{#operation}}
|
||||||
|
{{#-first}}
|
||||||
|
{{#lambda.snakecase}}{{classname}}{{/lambda.snakecase}} = NULL,
|
||||||
|
{{/-first}}
|
||||||
|
{{/operation}}
|
||||||
|
{{/operations}}
|
||||||
|
{{/apis}}
|
||||||
|
{{/apiInfo}}
|
||||||
|
#' Initialize a new {{{packageName}}} API Class.
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Initialize a new {{{packageName}}} API Class.
|
||||||
|
#'
|
||||||
|
#' @param api_client An instance of API client (optional).
|
||||||
|
#' @export
|
||||||
|
initialize = function(api_client) {
|
||||||
|
if (missing(api_client)) {
|
||||||
|
self$api_client <- ApiClient$new()
|
||||||
|
} else {
|
||||||
|
self$api_client <- api_client
|
||||||
|
}
|
||||||
|
|
||||||
|
{{#apiInfo}}
|
||||||
|
{{#apis}}
|
||||||
|
{{#operations}}
|
||||||
|
{{#operation}}
|
||||||
|
{{#-first}}
|
||||||
|
self${{#lambda.snakecase}}{{classname}}{{/lambda.snakecase}} <- {{{classname}}}$new(self$api_client)
|
||||||
|
|
||||||
|
{{/-first}}
|
||||||
|
{{/operation}}
|
||||||
|
{{/operations}}
|
||||||
|
{{/apis}}
|
||||||
|
{{/apiInfo}}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
@@ -13,4 +13,4 @@
|
|||||||
#' Contact: {{{.}}}
|
#' Contact: {{{.}}}
|
||||||
{{/infoEmail}}
|
{{/infoEmail}}
|
||||||
#' Generated by: https://openapi-generator.tech
|
#' Generated by: https://openapi-generator.tech
|
||||||
#'
|
#'
|
||||||
20
samples/client/petstore/R-httr2-wrapper/.Rbuildignore
Normal file
20
samples/client/petstore/R-httr2-wrapper/.Rbuildignore
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
^.*\.Rproj$ # Designates the directory as an RStudio Project
|
||||||
|
^\.Rproj\.user$ # Used by RStudio for temporary files
|
||||||
|
^README\.Rmd$ # An Rmd file used to generate README.md
|
||||||
|
^LICENSE\.md$ # Full text of the license
|
||||||
|
^cran-comments\.md$ # Comments for CRAN submission
|
||||||
|
^data-raw$ # Code used to create data included in the package
|
||||||
|
^pkgdown$ # Resources used for the package website
|
||||||
|
^_pkgdown\.yml$ # Configuration info for the package website
|
||||||
|
^\.github$ # Contributing guidelines, CoC, issue templates, etc.
|
||||||
|
^\.Rhistory$
|
||||||
|
^\.gitignore$
|
||||||
|
^\.openapi-generator-ignore$
|
||||||
|
^\.travis\.yml$
|
||||||
|
^\.lintr$
|
||||||
|
^\.github$
|
||||||
|
^\.openapi-generator$
|
||||||
|
^docs$
|
||||||
|
^git_push\.sh$
|
||||||
|
^petstore\.Rcheck$
|
||||||
|
^\.\.Rcheck$
|
||||||
33
samples/client/petstore/R-httr2-wrapper/.github/workflows/r-client.yaml
vendored
Normal file
33
samples/client/petstore/R-httr2-wrapper/.github/workflows/r-client.yaml
vendored
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
# This file is automatically generated by openapi-generator (https://openapi-generator.tech)
|
||||||
|
#
|
||||||
|
# Based on https://github.com/r-lib/actions/tree/v2/examples
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main, master]
|
||||||
|
pull_request:
|
||||||
|
branches: [main, master]
|
||||||
|
|
||||||
|
name: R-CMD-check
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
R-CMD-check:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
R_KEEP_PKG_SOURCE: yes
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- uses: r-lib/actions/setup-r@v2
|
||||||
|
with:
|
||||||
|
use-public-rspm: true
|
||||||
|
- uses: r-lib/actions/setup-r-dependencies@v2
|
||||||
|
with:
|
||||||
|
extra-packages: any::rcmdcheck, any::roxygen2, any::lintr, local::.
|
||||||
|
needs: check, roxygen2, lint
|
||||||
|
- name: Lint
|
||||||
|
run: lintr::lint_package()
|
||||||
|
shell: Rscript {0}
|
||||||
|
- name: Roxygenize
|
||||||
|
run: |
|
||||||
|
roxygen2::roxygenize('.', roclets = c('rd', 'collate', 'namespace'))
|
||||||
|
shell: Rscript {0}
|
||||||
|
- uses: r-lib/actions/check-r-package@v2
|
||||||
35
samples/client/petstore/R-httr2-wrapper/.gitignore
vendored
Normal file
35
samples/client/petstore/R-httr2-wrapper/.gitignore
vendored
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
# ref: https://github.com/github/gitignore/blob/master/R.gitignore
|
||||||
|
|
||||||
|
# History files
|
||||||
|
.Rhistory
|
||||||
|
.Rapp.history
|
||||||
|
|
||||||
|
# Session Data files
|
||||||
|
.RData
|
||||||
|
|
||||||
|
# Example code in package build process
|
||||||
|
*-Ex.R
|
||||||
|
|
||||||
|
# Output files from R CMD build
|
||||||
|
/*.tar.gz
|
||||||
|
|
||||||
|
# Output files from R CMD check
|
||||||
|
/*.Rcheck/
|
||||||
|
|
||||||
|
# RStudio files
|
||||||
|
.Rproj.user/
|
||||||
|
|
||||||
|
# produced vignettes
|
||||||
|
vignettes/*.html
|
||||||
|
vignettes/*.pdf
|
||||||
|
|
||||||
|
# OAuth2 token, see https://github.com/hadley/httr/releases/tag/v0.3
|
||||||
|
.httr-oauth
|
||||||
|
|
||||||
|
# knitr and R markdown default cache directories
|
||||||
|
/*_cache/
|
||||||
|
/cache/
|
||||||
|
|
||||||
|
# Temporary files created by R markdown
|
||||||
|
*.utf8.md
|
||||||
|
*.knit.md
|
||||||
7
samples/client/petstore/R-httr2-wrapper/.lintr
Normal file
7
samples/client/petstore/R-httr2-wrapper/.lintr
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
linters: linters_with_defaults(
|
||||||
|
line_length_linter(160),
|
||||||
|
object_name_linter = NULL,
|
||||||
|
cyclocomp_linter = NULL
|
||||||
|
)
|
||||||
|
exclusions: list(
|
||||||
|
)
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
# Swagger Codegen Ignore
|
||||||
|
# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen
|
||||||
|
|
||||||
|
# Use this file to prevent files from being overwritten by the generator.
|
||||||
|
# The patterns follow closely to .gitignore or .dockerignore.
|
||||||
|
|
||||||
|
# As an example, the C# client generator defines ApiClient.cs.
|
||||||
|
# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line:
|
||||||
|
#ApiClient.cs
|
||||||
|
|
||||||
|
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
|
||||||
|
#foo/*/qux
|
||||||
|
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
|
||||||
|
|
||||||
|
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
|
||||||
|
#foo/**/qux
|
||||||
|
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
|
||||||
|
|
||||||
|
# You can also negate patterns with an exclamation (!).
|
||||||
|
# For example, you can ignore all files in a docs folder with the file extension .md:
|
||||||
|
#docs/*.md
|
||||||
|
# Then explicitly reverse the ignore rule for a single file:
|
||||||
|
#!docs/README.md
|
||||||
@@ -0,0 +1,60 @@
|
|||||||
|
.Rbuildignore
|
||||||
|
.github/workflows/r-client.yaml
|
||||||
|
.gitignore
|
||||||
|
.lintr
|
||||||
|
.travis.yml
|
||||||
|
DESCRIPTION
|
||||||
|
NAMESPACE
|
||||||
|
R/allof_tag_api_response.R
|
||||||
|
R/animal.R
|
||||||
|
R/any_of_pig.R
|
||||||
|
R/api_client.R
|
||||||
|
R/api_exception.R
|
||||||
|
R/api_response.R
|
||||||
|
R/basque_pig.R
|
||||||
|
R/cat.R
|
||||||
|
R/cat_all_of.R
|
||||||
|
R/category.R
|
||||||
|
R/danish_pig.R
|
||||||
|
R/dog.R
|
||||||
|
R/dog_all_of.R
|
||||||
|
R/fake_api.R
|
||||||
|
R/model_api_response.R
|
||||||
|
R/nested_one_of.R
|
||||||
|
R/order.R
|
||||||
|
R/pet.R
|
||||||
|
R/pet_api.R
|
||||||
|
R/petstore_api.R
|
||||||
|
R/pig.R
|
||||||
|
R/special.R
|
||||||
|
R/store_api.R
|
||||||
|
R/tag.R
|
||||||
|
R/update_pet_request.R
|
||||||
|
R/user.R
|
||||||
|
R/user_api.R
|
||||||
|
README.md
|
||||||
|
docs/AllofTagApiResponse.md
|
||||||
|
docs/Animal.md
|
||||||
|
docs/AnyOfPig.md
|
||||||
|
docs/BasquePig.md
|
||||||
|
docs/Cat.md
|
||||||
|
docs/CatAllOf.md
|
||||||
|
docs/Category.md
|
||||||
|
docs/DanishPig.md
|
||||||
|
docs/Dog.md
|
||||||
|
docs/DogAllOf.md
|
||||||
|
docs/FakeApi.md
|
||||||
|
docs/ModelApiResponse.md
|
||||||
|
docs/NestedOneOf.md
|
||||||
|
docs/Order.md
|
||||||
|
docs/Pet.md
|
||||||
|
docs/PetApi.md
|
||||||
|
docs/Pig.md
|
||||||
|
docs/Special.md
|
||||||
|
docs/StoreApi.md
|
||||||
|
docs/Tag.md
|
||||||
|
docs/UpdatePetRequest.md
|
||||||
|
docs/User.md
|
||||||
|
docs/UserApi.md
|
||||||
|
git_push.sh
|
||||||
|
tests/testthat.R
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
6.1.0-SNAPSHOT
|
||||||
18
samples/client/petstore/R-httr2-wrapper/.travis.yml
Normal file
18
samples/client/petstore/R-httr2-wrapper/.travis.yml
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
# ref: https://docs.travis-ci.com/user/languages/r/
|
||||||
|
language: r
|
||||||
|
cache:
|
||||||
|
directories:
|
||||||
|
- /home/travis/R/Library
|
||||||
|
r_packages:
|
||||||
|
- jsonlite
|
||||||
|
- httr
|
||||||
|
- testthat
|
||||||
|
# uncomment below to install deps with devtools
|
||||||
|
#install:
|
||||||
|
#- R -e 'devtools::install_deps(dep = T)'
|
||||||
|
script:
|
||||||
|
- R CMD build .
|
||||||
|
- R CMD check *tar.gz
|
||||||
|
- R CMD INSTALL *tar.gz
|
||||||
|
after_failure:
|
||||||
|
- cat ${TRAVIS_BUILD_DIR}/namsor.Rcheck/tests/testthat.Rout.fail
|
||||||
15
samples/client/petstore/R-httr2-wrapper/DESCRIPTION
Normal file
15
samples/client/petstore/R-httr2-wrapper/DESCRIPTION
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
Package: petstore
|
||||||
|
Title: R Package Client for OpenAPI Petstore
|
||||||
|
Version: 1.0.0
|
||||||
|
Author: person("OpenAPI Generator community", email = "team@openapitools.org", role = c("aut", "cre"))
|
||||||
|
Maintainer: OpenAPI Generator community <team@openapitools.org>
|
||||||
|
Description: This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||||
|
URL: https://github.com/GIT_USER_ID/GIT_REPO_ID
|
||||||
|
BugReports: https://github.com/GIT_USER_ID/GIT_REPO_ID/issues
|
||||||
|
Depends: R (>= 3.3)
|
||||||
|
Encoding: UTF-8
|
||||||
|
License: Apache License 2.0
|
||||||
|
LazyData: true
|
||||||
|
Suggests: testthat
|
||||||
|
Imports: jsonlite, httr2, R6, base64enc, stringr
|
||||||
|
RoxygenNote: 7.2.0
|
||||||
43
samples/client/petstore/R-httr2-wrapper/NAMESPACE
Normal file
43
samples/client/petstore/R-httr2-wrapper/NAMESPACE
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
# Generated by openapi-generator: https://openapi-generator.tech
|
||||||
|
# Do not edit by hand
|
||||||
|
|
||||||
|
import(R6)
|
||||||
|
import(jsonlite)
|
||||||
|
import(httr2)
|
||||||
|
import(base64enc)
|
||||||
|
import(stringr)
|
||||||
|
|
||||||
|
# Wrapper
|
||||||
|
export(petstore_api)
|
||||||
|
|
||||||
|
# Core
|
||||||
|
export(ApiClient)
|
||||||
|
export(ApiResponse)
|
||||||
|
export(ApiException)
|
||||||
|
|
||||||
|
# Models
|
||||||
|
export(AllofTagApiResponse)
|
||||||
|
export(Animal)
|
||||||
|
export(AnyOfPig)
|
||||||
|
export(BasquePig)
|
||||||
|
export(Cat)
|
||||||
|
export(CatAllOf)
|
||||||
|
export(Category)
|
||||||
|
export(DanishPig)
|
||||||
|
export(Dog)
|
||||||
|
export(DogAllOf)
|
||||||
|
export(ModelApiResponse)
|
||||||
|
export(NestedOneOf)
|
||||||
|
export(Order)
|
||||||
|
export(Pet)
|
||||||
|
export(Pig)
|
||||||
|
export(Special)
|
||||||
|
export(Tag)
|
||||||
|
export(UpdatePetRequest)
|
||||||
|
export(User)
|
||||||
|
|
||||||
|
# APIs
|
||||||
|
export(FakeApi)
|
||||||
|
export(PetApi)
|
||||||
|
export(StoreApi)
|
||||||
|
export(UserApi)
|
||||||
18
samples/client/petstore/R-httr2-wrapper/R.Rproj
Normal file
18
samples/client/petstore/R-httr2-wrapper/R.Rproj
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
Version: 1.0
|
||||||
|
|
||||||
|
RestoreWorkspace: Default
|
||||||
|
SaveWorkspace: Default
|
||||||
|
AlwaysSaveHistory: Default
|
||||||
|
|
||||||
|
EnableCodeIndexing: Yes
|
||||||
|
UseSpacesForTab: Yes
|
||||||
|
NumSpacesForTab: 2
|
||||||
|
Encoding: UTF-8
|
||||||
|
|
||||||
|
RnwWeave: Sweave
|
||||||
|
LaTeX: pdfLaTeX
|
||||||
|
|
||||||
|
BuildType: Package
|
||||||
|
PackageUseDevtools: Yes
|
||||||
|
PackageInstallArgs: --no-multiarch --with-keep.source
|
||||||
|
PackageRoxygenize: rd,collate,namespace
|
||||||
@@ -0,0 +1,236 @@
|
|||||||
|
#' OpenAPI Petstore
|
||||||
|
#'
|
||||||
|
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||||
|
#'
|
||||||
|
#' The version of the OpenAPI document: 1.0.0
|
||||||
|
#' Generated by: https://openapi-generator.tech
|
||||||
|
#'
|
||||||
|
#' @docType class
|
||||||
|
#' @title AllofTagApiResponse
|
||||||
|
#' @description AllofTagApiResponse Class
|
||||||
|
#' @format An \code{R6Class} generator object
|
||||||
|
#' @field id integer [optional]
|
||||||
|
#' @field name character [optional]
|
||||||
|
#' @field code integer [optional]
|
||||||
|
#' @field type character [optional]
|
||||||
|
#' @field message character [optional]
|
||||||
|
#' @importFrom R6 R6Class
|
||||||
|
#' @importFrom jsonlite fromJSON toJSON
|
||||||
|
#' @export
|
||||||
|
AllofTagApiResponse <- R6::R6Class(
|
||||||
|
"AllofTagApiResponse",
|
||||||
|
public = list(
|
||||||
|
`id` = NULL,
|
||||||
|
`name` = NULL,
|
||||||
|
`code` = NULL,
|
||||||
|
`type` = NULL,
|
||||||
|
`message` = NULL,
|
||||||
|
#' Initialize a new AllofTagApiResponse class.
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Initialize a new AllofTagApiResponse class.
|
||||||
|
#'
|
||||||
|
#' @param id id
|
||||||
|
#' @param name name
|
||||||
|
#' @param code code
|
||||||
|
#' @param type type
|
||||||
|
#' @param message message
|
||||||
|
#' @param ... Other optional arguments.
|
||||||
|
#' @export
|
||||||
|
initialize = function(
|
||||||
|
`id` = NULL, `name` = NULL, `code` = NULL, `type` = NULL, `message` = NULL, ...
|
||||||
|
) {
|
||||||
|
if (!is.null(`id`)) {
|
||||||
|
stopifnot(is.numeric(`id`), length(`id`) == 1)
|
||||||
|
self$`id` <- `id`
|
||||||
|
}
|
||||||
|
if (!is.null(`name`)) {
|
||||||
|
stopifnot(is.character(`name`), length(`name`) == 1)
|
||||||
|
self$`name` <- `name`
|
||||||
|
}
|
||||||
|
if (!is.null(`code`)) {
|
||||||
|
stopifnot(is.numeric(`code`), length(`code`) == 1)
|
||||||
|
self$`code` <- `code`
|
||||||
|
}
|
||||||
|
if (!is.null(`type`)) {
|
||||||
|
stopifnot(is.character(`type`), length(`type`) == 1)
|
||||||
|
self$`type` <- `type`
|
||||||
|
}
|
||||||
|
if (!is.null(`message`)) {
|
||||||
|
stopifnot(is.character(`message`), length(`message`) == 1)
|
||||||
|
self$`message` <- `message`
|
||||||
|
}
|
||||||
|
},
|
||||||
|
#' To JSON string
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' To JSON String
|
||||||
|
#'
|
||||||
|
#' @return AllofTagApiResponse in JSON format
|
||||||
|
#' @export
|
||||||
|
toJSON = function() {
|
||||||
|
AllofTagApiResponseObject <- list()
|
||||||
|
if (!is.null(self$`id`)) {
|
||||||
|
AllofTagApiResponseObject[["id"]] <-
|
||||||
|
self$`id`
|
||||||
|
}
|
||||||
|
if (!is.null(self$`name`)) {
|
||||||
|
AllofTagApiResponseObject[["name"]] <-
|
||||||
|
self$`name`
|
||||||
|
}
|
||||||
|
if (!is.null(self$`code`)) {
|
||||||
|
AllofTagApiResponseObject[["code"]] <-
|
||||||
|
self$`code`
|
||||||
|
}
|
||||||
|
if (!is.null(self$`type`)) {
|
||||||
|
AllofTagApiResponseObject[["type"]] <-
|
||||||
|
self$`type`
|
||||||
|
}
|
||||||
|
if (!is.null(self$`message`)) {
|
||||||
|
AllofTagApiResponseObject[["message"]] <-
|
||||||
|
self$`message`
|
||||||
|
}
|
||||||
|
|
||||||
|
AllofTagApiResponseObject
|
||||||
|
},
|
||||||
|
#' Deserialize JSON string into an instance of AllofTagApiResponse
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Deserialize JSON string into an instance of AllofTagApiResponse
|
||||||
|
#'
|
||||||
|
#' @param input_json the JSON input
|
||||||
|
#' @return the instance of AllofTagApiResponse
|
||||||
|
#' @export
|
||||||
|
fromJSON = function(input_json) {
|
||||||
|
this_object <- jsonlite::fromJSON(input_json)
|
||||||
|
if (!is.null(this_object$`id`)) {
|
||||||
|
self$`id` <- this_object$`id`
|
||||||
|
}
|
||||||
|
if (!is.null(this_object$`name`)) {
|
||||||
|
self$`name` <- this_object$`name`
|
||||||
|
}
|
||||||
|
if (!is.null(this_object$`code`)) {
|
||||||
|
self$`code` <- this_object$`code`
|
||||||
|
}
|
||||||
|
if (!is.null(this_object$`type`)) {
|
||||||
|
self$`type` <- this_object$`type`
|
||||||
|
}
|
||||||
|
if (!is.null(this_object$`message`)) {
|
||||||
|
self$`message` <- this_object$`message`
|
||||||
|
}
|
||||||
|
self
|
||||||
|
},
|
||||||
|
#' To JSON string
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' To JSON String
|
||||||
|
#'
|
||||||
|
#' @return AllofTagApiResponse in JSON format
|
||||||
|
#' @export
|
||||||
|
toJSONString = function() {
|
||||||
|
jsoncontent <- c(
|
||||||
|
if (!is.null(self$`id`)) {
|
||||||
|
sprintf(
|
||||||
|
'"id":
|
||||||
|
%d
|
||||||
|
',
|
||||||
|
self$`id`
|
||||||
|
)
|
||||||
|
},
|
||||||
|
if (!is.null(self$`name`)) {
|
||||||
|
sprintf(
|
||||||
|
'"name":
|
||||||
|
"%s"
|
||||||
|
',
|
||||||
|
self$`name`
|
||||||
|
)
|
||||||
|
},
|
||||||
|
if (!is.null(self$`code`)) {
|
||||||
|
sprintf(
|
||||||
|
'"code":
|
||||||
|
%d
|
||||||
|
',
|
||||||
|
self$`code`
|
||||||
|
)
|
||||||
|
},
|
||||||
|
if (!is.null(self$`type`)) {
|
||||||
|
sprintf(
|
||||||
|
'"type":
|
||||||
|
"%s"
|
||||||
|
',
|
||||||
|
self$`type`
|
||||||
|
)
|
||||||
|
},
|
||||||
|
if (!is.null(self$`message`)) {
|
||||||
|
sprintf(
|
||||||
|
'"message":
|
||||||
|
"%s"
|
||||||
|
',
|
||||||
|
self$`message`
|
||||||
|
)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
jsoncontent <- paste(jsoncontent, collapse = ",")
|
||||||
|
as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
|
||||||
|
},
|
||||||
|
#' Deserialize JSON string into an instance of AllofTagApiResponse
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Deserialize JSON string into an instance of AllofTagApiResponse
|
||||||
|
#'
|
||||||
|
#' @param input_json the JSON input
|
||||||
|
#' @return the instance of AllofTagApiResponse
|
||||||
|
#' @export
|
||||||
|
fromJSONString = function(input_json) {
|
||||||
|
this_object <- jsonlite::fromJSON(input_json)
|
||||||
|
self$`id` <- this_object$`id`
|
||||||
|
self$`name` <- this_object$`name`
|
||||||
|
self$`code` <- this_object$`code`
|
||||||
|
self$`type` <- this_object$`type`
|
||||||
|
self$`message` <- this_object$`message`
|
||||||
|
self
|
||||||
|
},
|
||||||
|
#' Validate JSON input with respect to AllofTagApiResponse
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Validate JSON input with respect to AllofTagApiResponse and throw an exception if invalid
|
||||||
|
#'
|
||||||
|
#' @param input the JSON input
|
||||||
|
#' @export
|
||||||
|
validateJSON = function(input) {
|
||||||
|
input_json <- jsonlite::fromJSON(input)
|
||||||
|
},
|
||||||
|
#' To string (JSON format)
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' To string (JSON format)
|
||||||
|
#'
|
||||||
|
#' @return String representation of AllofTagApiResponse
|
||||||
|
#' @export
|
||||||
|
toString = function() {
|
||||||
|
self$toJSONString()
|
||||||
|
},
|
||||||
|
#' Return true if the values in all fields are valid.
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Return true if the values in all fields are valid.
|
||||||
|
#'
|
||||||
|
#' @return true if the values in all fields are valid.
|
||||||
|
#' @export
|
||||||
|
isValid = function() {
|
||||||
|
TRUE
|
||||||
|
},
|
||||||
|
#' Return a list of invalid fields (if any).
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Return a list of invalid fields (if any).
|
||||||
|
#'
|
||||||
|
#' @return A list of invalid fields (if any).
|
||||||
|
#' @export
|
||||||
|
getInvalidFields = function() {
|
||||||
|
invalid_fields <- list()
|
||||||
|
invalid_fields
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
183
samples/client/petstore/R-httr2-wrapper/R/animal.R
Normal file
183
samples/client/petstore/R-httr2-wrapper/R/animal.R
Normal file
@@ -0,0 +1,183 @@
|
|||||||
|
#' OpenAPI Petstore
|
||||||
|
#'
|
||||||
|
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||||
|
#'
|
||||||
|
#' The version of the OpenAPI document: 1.0.0
|
||||||
|
#' Generated by: https://openapi-generator.tech
|
||||||
|
#'
|
||||||
|
#' @docType class
|
||||||
|
#' @title Animal
|
||||||
|
#' @description Animal Class
|
||||||
|
#' @format An \code{R6Class} generator object
|
||||||
|
#' @field className character
|
||||||
|
#' @field color character [optional]
|
||||||
|
#' @importFrom R6 R6Class
|
||||||
|
#' @importFrom jsonlite fromJSON toJSON
|
||||||
|
#' @export
|
||||||
|
Animal <- R6::R6Class(
|
||||||
|
"Animal",
|
||||||
|
public = list(
|
||||||
|
`className` = NULL,
|
||||||
|
`color` = NULL,
|
||||||
|
#' Initialize a new Animal class.
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Initialize a new Animal class.
|
||||||
|
#'
|
||||||
|
#' @param className className
|
||||||
|
#' @param color color. Default to "red".
|
||||||
|
#' @param ... Other optional arguments.
|
||||||
|
#' @export
|
||||||
|
initialize = function(
|
||||||
|
`className`, `color` = "red", ...
|
||||||
|
) {
|
||||||
|
if (!missing(`className`)) {
|
||||||
|
stopifnot(is.character(`className`), length(`className`) == 1)
|
||||||
|
self$`className` <- `className`
|
||||||
|
}
|
||||||
|
if (!is.null(`color`)) {
|
||||||
|
stopifnot(is.character(`color`), length(`color`) == 1)
|
||||||
|
self$`color` <- `color`
|
||||||
|
}
|
||||||
|
},
|
||||||
|
#' To JSON string
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' To JSON String
|
||||||
|
#'
|
||||||
|
#' @return Animal in JSON format
|
||||||
|
#' @export
|
||||||
|
toJSON = function() {
|
||||||
|
AnimalObject <- list()
|
||||||
|
if (!is.null(self$`className`)) {
|
||||||
|
AnimalObject[["className"]] <-
|
||||||
|
self$`className`
|
||||||
|
}
|
||||||
|
if (!is.null(self$`color`)) {
|
||||||
|
AnimalObject[["color"]] <-
|
||||||
|
self$`color`
|
||||||
|
}
|
||||||
|
|
||||||
|
AnimalObject
|
||||||
|
},
|
||||||
|
#' Deserialize JSON string into an instance of Animal
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Deserialize JSON string into an instance of Animal
|
||||||
|
#'
|
||||||
|
#' @param input_json the JSON input
|
||||||
|
#' @return the instance of Animal
|
||||||
|
#' @export
|
||||||
|
fromJSON = function(input_json) {
|
||||||
|
this_object <- jsonlite::fromJSON(input_json)
|
||||||
|
if (!is.null(this_object$`className`)) {
|
||||||
|
self$`className` <- this_object$`className`
|
||||||
|
}
|
||||||
|
if (!is.null(this_object$`color`)) {
|
||||||
|
self$`color` <- this_object$`color`
|
||||||
|
}
|
||||||
|
self
|
||||||
|
},
|
||||||
|
#' To JSON string
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' To JSON String
|
||||||
|
#'
|
||||||
|
#' @return Animal in JSON format
|
||||||
|
#' @export
|
||||||
|
toJSONString = function() {
|
||||||
|
jsoncontent <- c(
|
||||||
|
if (!is.null(self$`className`)) {
|
||||||
|
sprintf(
|
||||||
|
'"className":
|
||||||
|
"%s"
|
||||||
|
',
|
||||||
|
self$`className`
|
||||||
|
)
|
||||||
|
},
|
||||||
|
if (!is.null(self$`color`)) {
|
||||||
|
sprintf(
|
||||||
|
'"color":
|
||||||
|
"%s"
|
||||||
|
',
|
||||||
|
self$`color`
|
||||||
|
)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
jsoncontent <- paste(jsoncontent, collapse = ",")
|
||||||
|
as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
|
||||||
|
},
|
||||||
|
#' Deserialize JSON string into an instance of Animal
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Deserialize JSON string into an instance of Animal
|
||||||
|
#'
|
||||||
|
#' @param input_json the JSON input
|
||||||
|
#' @return the instance of Animal
|
||||||
|
#' @export
|
||||||
|
fromJSONString = function(input_json) {
|
||||||
|
this_object <- jsonlite::fromJSON(input_json)
|
||||||
|
self$`className` <- this_object$`className`
|
||||||
|
self$`color` <- this_object$`color`
|
||||||
|
self
|
||||||
|
},
|
||||||
|
#' Validate JSON input with respect to Animal
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Validate JSON input with respect to Animal and throw an exception if invalid
|
||||||
|
#'
|
||||||
|
#' @param input the JSON input
|
||||||
|
#' @export
|
||||||
|
validateJSON = function(input) {
|
||||||
|
input_json <- jsonlite::fromJSON(input)
|
||||||
|
# check the required field `className`
|
||||||
|
if (!is.null(input_json$`className`)) {
|
||||||
|
stopifnot(is.character(input_json$`className`), length(input_json$`className`) == 1)
|
||||||
|
} else {
|
||||||
|
stop(paste("The JSON input `", input, "` is invalid for Animal: the required field `className` is missing."))
|
||||||
|
}
|
||||||
|
},
|
||||||
|
#' To string (JSON format)
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' To string (JSON format)
|
||||||
|
#'
|
||||||
|
#' @return String representation of Animal
|
||||||
|
#' @export
|
||||||
|
toString = function() {
|
||||||
|
self$toJSONString()
|
||||||
|
},
|
||||||
|
#' Return true if the values in all fields are valid.
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Return true if the values in all fields are valid.
|
||||||
|
#'
|
||||||
|
#' @return true if the values in all fields are valid.
|
||||||
|
#' @export
|
||||||
|
isValid = function() {
|
||||||
|
# check if the required `className` is null
|
||||||
|
if (is.null(self$`className`)) {
|
||||||
|
return(FALSE)
|
||||||
|
}
|
||||||
|
|
||||||
|
TRUE
|
||||||
|
},
|
||||||
|
#' Return a list of invalid fields (if any).
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Return a list of invalid fields (if any).
|
||||||
|
#'
|
||||||
|
#' @return A list of invalid fields (if any).
|
||||||
|
#' @export
|
||||||
|
getInvalidFields = function() {
|
||||||
|
invalid_fields <- list()
|
||||||
|
# check if the required `className` is null
|
||||||
|
if (is.null(self$`className`)) {
|
||||||
|
invalid_fields["className"] = "Non-nullable required field `className` cannot be null."
|
||||||
|
}
|
||||||
|
|
||||||
|
invalid_fields
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
156
samples/client/petstore/R-httr2-wrapper/R/any_of_pig.R
Normal file
156
samples/client/petstore/R-httr2-wrapper/R/any_of_pig.R
Normal file
@@ -0,0 +1,156 @@
|
|||||||
|
#' OpenAPI Petstore
|
||||||
|
#'
|
||||||
|
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||||
|
#'
|
||||||
|
#' The version of the OpenAPI document: 1.0.0
|
||||||
|
#' Generated by: https://openapi-generator.tech
|
||||||
|
#'
|
||||||
|
#' @docType class
|
||||||
|
#' @title AnyOfPig
|
||||||
|
#'
|
||||||
|
#' @description AnyOfPig Class
|
||||||
|
#'
|
||||||
|
#' @format An \code{R6Class} generator object
|
||||||
|
#'
|
||||||
|
#' @importFrom R6 R6Class
|
||||||
|
#' @importFrom jsonlite fromJSON toJSON
|
||||||
|
#' @export
|
||||||
|
AnyOfPig <- R6::R6Class(
|
||||||
|
"AnyOfPig",
|
||||||
|
public = list(
|
||||||
|
#' @field actual_instance the object stored in this instance.
|
||||||
|
actual_instance = NULL,
|
||||||
|
#' @field actual_type the type of the object stored in this instance.
|
||||||
|
actual_type = NULL,
|
||||||
|
#' @field any_of a list of object types defined in the anyOf schema.
|
||||||
|
any_of = list("BasquePig", "DanishPig"),
|
||||||
|
#' Initialize a new AnyOfPig.
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Initialize a new AnyOfPig.
|
||||||
|
#'
|
||||||
|
#' @param instance an instance of the object defined in the anyOf schemas: "BasquePig", "DanishPig"
|
||||||
|
#' @export
|
||||||
|
initialize = function(instance = NULL) {
|
||||||
|
if (is.null(instance)) {
|
||||||
|
# do nothing
|
||||||
|
} else if (get(class(instance)[[1]], pos = -1)$classname == "BasquePig") {
|
||||||
|
self$actual_instance <- instance
|
||||||
|
self$actual_type <- "BasquePig"
|
||||||
|
} else if (get(class(instance)[[1]], pos = -1)$classname == "DanishPig") {
|
||||||
|
self$actual_instance <- instance
|
||||||
|
self$actual_type <- "DanishPig"
|
||||||
|
} else {
|
||||||
|
stop(paste("Failed to initialize AnyOfPig with anyOf schemas BasquePig, DanishPig. Provided class name: ",
|
||||||
|
get(class(instance)[[1]], pos = -1)$classname))
|
||||||
|
}
|
||||||
|
},
|
||||||
|
#' Deserialize JSON string into an instance of AnyOfPig.
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Deserialize JSON string into an instance of AnyOfPig.
|
||||||
|
#'
|
||||||
|
#' @param input The input JSON.
|
||||||
|
#' @return An instance of AnyOfPig.
|
||||||
|
#' @export
|
||||||
|
fromJSON = function(input) {
|
||||||
|
error_messages <- list()
|
||||||
|
|
||||||
|
BasquePig_result <- tryCatch({
|
||||||
|
BasquePig$public_methods$validateJSON(input)
|
||||||
|
BasquePig_instance <- BasquePig$new()
|
||||||
|
self$actual_instance <- BasquePig_instance$fromJSON(input)
|
||||||
|
self$actual_type <- "BasquePig"
|
||||||
|
return(self)
|
||||||
|
},
|
||||||
|
error = function(err) err
|
||||||
|
)
|
||||||
|
|
||||||
|
if (!is.null(BasquePig_result["error"])) {
|
||||||
|
error_messages <- append(error_messages, BasquePig_result["message"])
|
||||||
|
}
|
||||||
|
|
||||||
|
DanishPig_result <- tryCatch({
|
||||||
|
DanishPig$public_methods$validateJSON(input)
|
||||||
|
DanishPig_instance <- DanishPig$new()
|
||||||
|
self$actual_instance <- DanishPig_instance$fromJSON(input)
|
||||||
|
self$actual_type <- "DanishPig"
|
||||||
|
return(self)
|
||||||
|
},
|
||||||
|
error = function(err) err
|
||||||
|
)
|
||||||
|
|
||||||
|
if (!is.null(DanishPig_result["error"])) {
|
||||||
|
error_messages <- append(error_messages, DanishPig_result["message"])
|
||||||
|
}
|
||||||
|
|
||||||
|
# no match
|
||||||
|
stop(paste("No match found when deserializing the payload into AnyOfPig with anyOf schemas BasquePig, DanishPig. Details: ",
|
||||||
|
paste(error_messages, collapse = ", ")))
|
||||||
|
},
|
||||||
|
#' Serialize AnyOfPig to JSON string.
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Serialize AnyOfPig to JSON string.
|
||||||
|
#'
|
||||||
|
#' @return JSON string representation of the AnyOfPig.
|
||||||
|
#' @export
|
||||||
|
toJSONString = function() {
|
||||||
|
if (!is.null(self$actual_instance)) {
|
||||||
|
as.character(jsonlite::minify((self$actual_instance$toJSONString())))
|
||||||
|
} else {
|
||||||
|
NULL
|
||||||
|
}
|
||||||
|
},
|
||||||
|
#' Serialize AnyOfPig to JSON.
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Serialize AnyOfPig to JSON.
|
||||||
|
#'
|
||||||
|
#' @return JSON representation of the AnyOfPig.
|
||||||
|
#' @export
|
||||||
|
toJSON = function() {
|
||||||
|
if (!is.null(self$actual_instance)) {
|
||||||
|
self$actual_instance$toJSON()
|
||||||
|
} else {
|
||||||
|
NULL
|
||||||
|
}
|
||||||
|
},
|
||||||
|
#' Validate the input JSON with respect to AnyOfPig.
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Validate the input JSON with respect to AnyOfPig and
|
||||||
|
#' throw exception if invalid.
|
||||||
|
#'
|
||||||
|
#' @param input The input JSON.
|
||||||
|
#' @export
|
||||||
|
validateJSON = function(input) {
|
||||||
|
# backup current values
|
||||||
|
actual_instance_bak <- self$actual_instance
|
||||||
|
actual_type_bak <- self$actual_type
|
||||||
|
|
||||||
|
# if it's not valid, an error will be thrown
|
||||||
|
self$fromJSON(input)
|
||||||
|
|
||||||
|
# no error thrown, restore old values
|
||||||
|
self$actual_instance <- actual_instance_bak
|
||||||
|
self$actual_type <- actual_type_bak
|
||||||
|
},
|
||||||
|
#' Returns the string representation of the instance.
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Returns the string representation of the instance.
|
||||||
|
#'
|
||||||
|
#' @return The string representation of the instance.
|
||||||
|
#' @export
|
||||||
|
toString = function() {
|
||||||
|
jsoncontent <- c(
|
||||||
|
sprintf('"actual_instance": %s', if (is.null(self$actual_instance)) NULL else self$actual_instance$toJSONString()),
|
||||||
|
sprintf('"actual_type": "%s"', self$actual_type),
|
||||||
|
sprintf('"any_of": "%s"', paste(unlist(self$any_of), collapse = ", "))
|
||||||
|
)
|
||||||
|
jsoncontent <- paste(jsoncontent, collapse = ",")
|
||||||
|
as.character(jsonlite::prettify(paste("{", jsoncontent, "}", sep = "")))
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
410
samples/client/petstore/R-httr2-wrapper/R/api_client.R
Normal file
410
samples/client/petstore/R-httr2-wrapper/R/api_client.R
Normal file
@@ -0,0 +1,410 @@
|
|||||||
|
#' OpenAPI Petstore
|
||||||
|
#'
|
||||||
|
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||||
|
#'
|
||||||
|
#' The version of the OpenAPI document: 1.0.0
|
||||||
|
#' Generated by: https://openapi-generator.tech
|
||||||
|
#'
|
||||||
|
#' ApiClient Class
|
||||||
|
#'
|
||||||
|
#' Generic API client for OpenAPI client library builds.
|
||||||
|
#' OpenAPI generic API client. This client handles the client-
|
||||||
|
#' server communication, and is invariant across implementations. Specifics of
|
||||||
|
#' the methods and models for each application are generated from the OpenAPI Generator
|
||||||
|
#' templates.
|
||||||
|
#'
|
||||||
|
#' NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
#' Ref: https://openapi-generator.tech
|
||||||
|
#' Do not edit the class manually.
|
||||||
|
#'
|
||||||
|
#' @docType class
|
||||||
|
#' @title ApiClient
|
||||||
|
#' @description ApiClient Class
|
||||||
|
#' @format An \code{R6Class} generator object
|
||||||
|
#' @field base_path Base url
|
||||||
|
#' @field user_agent Default user agent
|
||||||
|
#' @field default_headers Default headers
|
||||||
|
#' @field username Username for HTTP basic authentication
|
||||||
|
#' @field password Password for HTTP basic authentication
|
||||||
|
#' @field api_keys API keys
|
||||||
|
#' @field access_token Access token
|
||||||
|
#' @field oauth_client_id OAuth client ID
|
||||||
|
#' @field oauth_secret OAuth secret
|
||||||
|
#' @field oauth_refresh_token OAuth refresh token
|
||||||
|
#' @field oauth_flow_type OAuth flow type
|
||||||
|
#' @field oauth_authorization_url Authoriziation URL
|
||||||
|
#' @field oauth_token_url Token URL
|
||||||
|
#' @field oauth_pkce Boolean flag to enable PKCE
|
||||||
|
#' @field oauth_scopes OAuth scopes
|
||||||
|
#' @field bearer_token Bearer token
|
||||||
|
#' @field timeout Default timeout in seconds
|
||||||
|
#' @field retry_status_codes vector of status codes to retry
|
||||||
|
#' @field max_retry_attempts maximum number of retries for the status codes
|
||||||
|
#' @importFrom rlang abort
|
||||||
|
#' @export
|
||||||
|
ApiClient <- R6::R6Class(
|
||||||
|
"ApiClient",
|
||||||
|
public = list(
|
||||||
|
# base path of all requests
|
||||||
|
base_path = "http://petstore.swagger.io/v2",
|
||||||
|
# user agent in the HTTP request
|
||||||
|
user_agent = "PetstoreAgent",
|
||||||
|
# default headers in the HTTP request
|
||||||
|
default_headers = NULL,
|
||||||
|
# username (HTTP basic authentication)
|
||||||
|
username = NULL,
|
||||||
|
# password (HTTP basic authentication)
|
||||||
|
password = NULL,
|
||||||
|
# API keys
|
||||||
|
api_keys = NULL,
|
||||||
|
# Access token
|
||||||
|
access_token = NULL,
|
||||||
|
# OAuth2 client ID
|
||||||
|
oauth_client_id = NULL,
|
||||||
|
# OAuth2 secret
|
||||||
|
oauth_secret = NULL,
|
||||||
|
# OAuth2 refresh token
|
||||||
|
oauth_refresh_token = NULL,
|
||||||
|
# OAuth2
|
||||||
|
# Flow type
|
||||||
|
oauth_flow_type = "implicit",
|
||||||
|
# Authoriziation URL
|
||||||
|
oauth_authorization_url = "http://petstore.swagger.io/api/oauth/dialog",
|
||||||
|
# Token URL
|
||||||
|
oauth_token_url = "",
|
||||||
|
# Enable PKCE?
|
||||||
|
oauth_pkce = TRUE,
|
||||||
|
# OAuth scopes
|
||||||
|
oauth_scopes = NULL,
|
||||||
|
# Bearer token
|
||||||
|
bearer_token = NULL,
|
||||||
|
# Time Out (seconds)
|
||||||
|
timeout = NULL,
|
||||||
|
# Vector of status codes to retry
|
||||||
|
retry_status_codes = NULL,
|
||||||
|
# Maximum number of retry attempts for the retry status codes
|
||||||
|
max_retry_attempts = NULL,
|
||||||
|
#' Initialize a new ApiClient.
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Initialize a new ApiClient.
|
||||||
|
#'
|
||||||
|
#' @param base_path Base path.
|
||||||
|
#' @param user_agent User agent.
|
||||||
|
#' @param default_headers Default headers.
|
||||||
|
#' @param username User name.
|
||||||
|
#' @param password Password.
|
||||||
|
#' @param api_keys API keys.
|
||||||
|
#' @param access_token Access token.
|
||||||
|
#' @param bearer_token Bearer token.
|
||||||
|
#' @param timeout Timeout.
|
||||||
|
#' @param retry_status_codes Status codes for retry.
|
||||||
|
#' @param max_retry_attempts Maxmium number of retry.
|
||||||
|
#' @export
|
||||||
|
initialize = function(base_path = NULL, user_agent = NULL,
|
||||||
|
default_headers = NULL,
|
||||||
|
username = NULL, password = NULL, api_keys = NULL,
|
||||||
|
access_token = NULL, bearer_token = NULL, timeout = NULL,
|
||||||
|
retry_status_codes = NULL, max_retry_attempts = NULL) {
|
||||||
|
if (!is.null(base_path)) {
|
||||||
|
self$base_path <- base_path
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!is.null(default_headers)) {
|
||||||
|
self$default_headers <- default_headers
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!is.null(username)) {
|
||||||
|
self$username <- username
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!is.null(password)) {
|
||||||
|
self$password <- password
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!is.null(access_token)) {
|
||||||
|
self$access_token <- access_token
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!is.null(bearer_token)) {
|
||||||
|
self$bearer_token <- bearer_token
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!is.null(api_keys)) {
|
||||||
|
self$api_keys <- api_keys
|
||||||
|
} else {
|
||||||
|
self$api_keys <- list()
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!is.null(user_agent)) {
|
||||||
|
self$`user_agent` <- user_agent
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!is.null(timeout)) {
|
||||||
|
self$timeout <- timeout
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!is.null(retry_status_codes)) {
|
||||||
|
self$retry_status_codes <- retry_status_codes
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!is.null(max_retry_attempts)) {
|
||||||
|
self$max_retry_attempts <- max_retry_attempts
|
||||||
|
}
|
||||||
|
},
|
||||||
|
#' Prepare to make an API call with the retry logic.
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Prepare to make an API call with the retry logic.
|
||||||
|
#'
|
||||||
|
#' @param url URL.
|
||||||
|
#' @param method HTTP method.
|
||||||
|
#' @param query_params The query parameters.
|
||||||
|
#' @param header_params The header parameters.
|
||||||
|
#' @param form_params The form parameters.
|
||||||
|
#' @param file_params The form parameters to upload files.
|
||||||
|
#' @param accepts The HTTP accpet headers.
|
||||||
|
#' @param content_types The HTTP content-type headers.
|
||||||
|
#' @param body The HTTP request body.
|
||||||
|
#' @param is_oauth True if the endpoints required OAuth authentication.
|
||||||
|
#' @param oauth_scopes OAuth scopes.
|
||||||
|
#' @param stream_callback Callback function to process the data stream.
|
||||||
|
#' @param ... Other optional arguments.
|
||||||
|
#' @return HTTP response
|
||||||
|
#' @export
|
||||||
|
CallApi = function(url, method, query_params, header_params, form_params,
|
||||||
|
file_params, accepts, content_types, body,
|
||||||
|
is_oauth = FALSE, oauth_scopes = NULL, stream_callback = NULL, ...) {
|
||||||
|
|
||||||
|
# set the URL
|
||||||
|
req <- request(url)
|
||||||
|
|
||||||
|
resp <- self$Execute(req, method, query_params, header_params, form_params,
|
||||||
|
file_params, accepts, content_types, body, is_oauth = is_oauth,
|
||||||
|
oauth_scopes = oauth_scopes, stream_callback = stream_callback, ...)
|
||||||
|
},
|
||||||
|
#' Make an API call
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Make an API call
|
||||||
|
#'
|
||||||
|
#' @param req httr2 request.
|
||||||
|
#' @param method HTTP method.
|
||||||
|
#' @param query_params The query parameters.
|
||||||
|
#' @param header_params The header parameters.
|
||||||
|
#' @param form_params The form parameters.
|
||||||
|
#' @param file_params The form parameters for uploading files.
|
||||||
|
#' @param accepts The HTTP accpet headers.
|
||||||
|
#' @param content_types The HTTP content-type headers.
|
||||||
|
#' @param body The HTTP request body.
|
||||||
|
#' @param is_oauth True if the endpoints required OAuth authentication.
|
||||||
|
#' @param oauth_scopes OAuth scopes.
|
||||||
|
#' @param stream_callback Callback function to process data stream.
|
||||||
|
#' @param ... Other optional arguments.
|
||||||
|
#' @return HTTP response
|
||||||
|
#' @export
|
||||||
|
Execute = function(req, method, query_params, header_params, form_params,
|
||||||
|
file_params, accepts, content_types, body,
|
||||||
|
is_oauth = FALSE, oauth_scopes = NULL, stream_callback = NULL, ...) {
|
||||||
|
|
||||||
|
## add headers
|
||||||
|
req <- req %>% req_headers(!!!header_params)
|
||||||
|
|
||||||
|
## add default headers
|
||||||
|
req <- req %>% req_headers(!!!self$default_headers)
|
||||||
|
|
||||||
|
# set HTTP accept header
|
||||||
|
accept <- self$select_header(accepts)
|
||||||
|
if (!is.null(accept)) {
|
||||||
|
req <- req %>% req_headers("Accept" = accept)
|
||||||
|
}
|
||||||
|
|
||||||
|
# set HTTP content-type header
|
||||||
|
content_type <- self$select_header(content_types)
|
||||||
|
if (!is.null(content_type)) {
|
||||||
|
req <- req %>% req_headers("Content-Type" = content_type)
|
||||||
|
}
|
||||||
|
|
||||||
|
## add query parameters
|
||||||
|
req <- req %>% req_url_query(!!!query_params)
|
||||||
|
|
||||||
|
# has file upload?
|
||||||
|
if (!is.null(file_params) && length(file_params) != 0) {
|
||||||
|
req <- req %>% req_body_multipart(!!!file_params)
|
||||||
|
|
||||||
|
# add form parameters via req_body_multipart
|
||||||
|
if (!is.null(form_params) && length(form_params) != 0) {
|
||||||
|
req <- req %>% req_body_multipart(!!!form_params)
|
||||||
|
}
|
||||||
|
} else { # no file upload
|
||||||
|
# add form parameters via req_body_form
|
||||||
|
if (!is.null(form_params) && length(form_params) != 0) {
|
||||||
|
req <- req %>% req_body_form(!!!form_params)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# add body parameters
|
||||||
|
if (!is.null(body)) {
|
||||||
|
req <- req %>% req_body_raw(body)
|
||||||
|
}
|
||||||
|
|
||||||
|
# set timeout
|
||||||
|
if (!is.null(self$timeout)) {
|
||||||
|
req <- req %>% req_timeout(self$timeout)
|
||||||
|
}
|
||||||
|
|
||||||
|
# set retry
|
||||||
|
if (!is.null(self$max_retry_attempts)) {
|
||||||
|
req <- req %>% retry_max_tries(self$timeout)
|
||||||
|
req <- req %>% retry_max_seconds(self$timeout)
|
||||||
|
}
|
||||||
|
|
||||||
|
# set user agent
|
||||||
|
if (!is.null(self$user_agent)) {
|
||||||
|
req <- req %>% req_user_agent(self$user_agent)
|
||||||
|
}
|
||||||
|
|
||||||
|
# set HTTP verb
|
||||||
|
req <- req %>% req_method(method)
|
||||||
|
|
||||||
|
# use oauth authentication if the endpoint requires it
|
||||||
|
if (is_oauth && !is.null(self$oauth_client_id) && !is.null(self$oauth_secret)) {
|
||||||
|
client <- oauth_client(
|
||||||
|
id = self$oauth_client_id,
|
||||||
|
secret = obfuscated(self$oauth_secret),
|
||||||
|
token_url = self$oauth_token_url,
|
||||||
|
name = "petstore-oauth"
|
||||||
|
)
|
||||||
|
|
||||||
|
req_oauth_scopes <- NULL
|
||||||
|
if (!is.null(self$oauth_scopes)) {
|
||||||
|
# use oauth scopes provided by the user
|
||||||
|
req_oauth_scopes <- self$oauth_scopes
|
||||||
|
} else {
|
||||||
|
# use oauth scopes defined in openapi spec
|
||||||
|
req_oauth_scopes <- oauth_scopes
|
||||||
|
}
|
||||||
|
|
||||||
|
req <- req %>% req_oauth_auth_code(client, scope = req_oauth_scopes,
|
||||||
|
pkce = self$oauth_pkce,
|
||||||
|
auth_url = self$oauth_authoriziation_url)
|
||||||
|
}
|
||||||
|
|
||||||
|
# stream data
|
||||||
|
if (typeof(stream_callback) == "closure") {
|
||||||
|
req %>% req_stream(stream_callback)
|
||||||
|
} else {
|
||||||
|
# perform the HTTP request
|
||||||
|
resp <- req %>%
|
||||||
|
req_error(is_error = function(resp) FALSE) %>%
|
||||||
|
req_perform()
|
||||||
|
|
||||||
|
# return ApiResponse
|
||||||
|
api_response <- ApiResponse$new()
|
||||||
|
api_response$status_code <- resp %>% resp_status()
|
||||||
|
api_response$status_code_desc <- resp %>% resp_status_desc()
|
||||||
|
api_response$response <- resp %>% resp_body_string()
|
||||||
|
api_response$headers <- resp %>% resp_headers()
|
||||||
|
|
||||||
|
api_response
|
||||||
|
}
|
||||||
|
},
|
||||||
|
#' Deserialize the content of API response to the given type.
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Deserialize the content of API response to the given type.
|
||||||
|
#'
|
||||||
|
#' @param raw_response Raw response.
|
||||||
|
#' @param return_type R return type.
|
||||||
|
#' @param pkg_env Package environment.
|
||||||
|
#' @return Deserialized object.
|
||||||
|
#' @export
|
||||||
|
deserialize = function(raw_response, return_type, pkg_env) {
|
||||||
|
resp_obj <- jsonlite::fromJSON(raw_response)
|
||||||
|
self$deserializeObj(resp_obj, return_type, pkg_env)
|
||||||
|
},
|
||||||
|
#' Deserialize the response from jsonlite object based on the given type.
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Deserialize the response from jsonlite object based on the given type.
|
||||||
|
#' by handling complex and nested types by iterating recursively
|
||||||
|
#' Example return_types will be like "array[integer]", "map(Pet)", "array[map(Tag)]", etc.
|
||||||
|
#'
|
||||||
|
#' @param obj Response object.
|
||||||
|
#' @param return_type R return type.
|
||||||
|
#' @param pkg_env Package environment.
|
||||||
|
#' @return Deserialized object.
|
||||||
|
#' @export
|
||||||
|
deserializeObj = function(obj, return_type, pkg_env) {
|
||||||
|
return_obj <- NULL
|
||||||
|
primitive_types <- c("character", "numeric", "integer", "logical", "complex")
|
||||||
|
|
||||||
|
# To handle the "map" type
|
||||||
|
if (startsWith(return_type, "map(")) {
|
||||||
|
inner_return_type <- regmatches(return_type,
|
||||||
|
regexec(pattern = "map\\((.*)\\)", return_type))[[1]][2]
|
||||||
|
return_obj <- lapply(names(obj), function(name) {
|
||||||
|
self$deserializeObj(obj[[name]], inner_return_type, pkg_env)
|
||||||
|
})
|
||||||
|
names(return_obj) <- names(obj)
|
||||||
|
} else if (startsWith(return_type, "array[")) {
|
||||||
|
# To handle the "array" type
|
||||||
|
inner_return_type <- regmatches(return_type,
|
||||||
|
regexec(pattern = "array\\[(.*)\\]", return_type))[[1]][2]
|
||||||
|
if (c(inner_return_type) %in% primitive_types) {
|
||||||
|
return_obj <- vector("list", length = length(obj))
|
||||||
|
if (length(obj) > 0) {
|
||||||
|
for (row in 1:length(obj)) {
|
||||||
|
return_obj[[row]] <- self$deserializeObj(obj[row], inner_return_type, pkg_env)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (!is.null(nrow(obj))) {
|
||||||
|
return_obj <- vector("list", length = nrow(obj))
|
||||||
|
if (nrow(obj) > 0) {
|
||||||
|
for (row in 1:nrow(obj)) {
|
||||||
|
return_obj[[row]] <- self$deserializeObj(obj[row, , drop = FALSE],
|
||||||
|
inner_return_type, pkg_env)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (exists(return_type, pkg_env) && !(c(return_type) %in% primitive_types)) {
|
||||||
|
# To handle model objects which are not array or map containers. Ex:"Pet"
|
||||||
|
return_type <- get(return_type, envir = as.environment(pkg_env))
|
||||||
|
return_obj <- return_type$new()
|
||||||
|
return_obj$fromJSON(
|
||||||
|
jsonlite::toJSON(obj, digits = NA, auto_unbox = TRUE)
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
# To handle primitive type
|
||||||
|
return_obj <- obj
|
||||||
|
}
|
||||||
|
return_obj
|
||||||
|
},
|
||||||
|
#' Return a propery header (for accept or content-type).
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Return a propery header (for accept or content-type). If JSON-related MIME is found,
|
||||||
|
#' return it. Otherwise, return the first one, if any.
|
||||||
|
#'
|
||||||
|
#' @param headers A list of headers
|
||||||
|
#' @return A header (e.g. 'application/json')
|
||||||
|
#' @export
|
||||||
|
select_header = function(headers) {
|
||||||
|
if (length(headers) == 0) {
|
||||||
|
return(invisible(NULL))
|
||||||
|
} else {
|
||||||
|
for (header in headers) {
|
||||||
|
if (str_detect(header, "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$")) {
|
||||||
|
# return JSON-related MIME
|
||||||
|
return(header)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# not json mime type, simply return the first one
|
||||||
|
return(headers[1])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
82
samples/client/petstore/R-httr2-wrapper/R/api_exception.R
Normal file
82
samples/client/petstore/R-httr2-wrapper/R/api_exception.R
Normal file
@@ -0,0 +1,82 @@
|
|||||||
|
#' OpenAPI Petstore
|
||||||
|
#'
|
||||||
|
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||||
|
#'
|
||||||
|
#' The version of the OpenAPI document: 1.0.0
|
||||||
|
#' Generated by: https://openapi-generator.tech
|
||||||
|
#'
|
||||||
|
#' @docType class
|
||||||
|
#' @title ApiException
|
||||||
|
#' @description ApiException Class
|
||||||
|
#' @format An \code{R6Class} generator object
|
||||||
|
#' @field status Status of the ApiException
|
||||||
|
#' @field reason Reason of the ApiException
|
||||||
|
#' @field body Body of the http response
|
||||||
|
#' @field headers Headers of the http response
|
||||||
|
#' @field error_object error object type
|
||||||
|
#' @export
|
||||||
|
ApiException <- R6::R6Class(
|
||||||
|
"ApiException",
|
||||||
|
public = list(
|
||||||
|
status = NULL,
|
||||||
|
reason = NULL,
|
||||||
|
body = NULL,
|
||||||
|
headers = NULL,
|
||||||
|
error_object = NULL,
|
||||||
|
#' Initialize a new ApiException class.
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Initialize a new ApiExceptino class.
|
||||||
|
#'
|
||||||
|
#' @param status HTTP status.
|
||||||
|
#' @param reason Reason of the ApiException.
|
||||||
|
#' @param http_response HTTP response object.
|
||||||
|
#' @export
|
||||||
|
initialize = function(status = NULL, reason = NULL, http_response = NULL) {
|
||||||
|
if (!is.null(http_response)) {
|
||||||
|
self$status <- http_response$status_code
|
||||||
|
errorMsg <- http_response$response
|
||||||
|
if (is.null(errorMsg) || errorMsg == "") {
|
||||||
|
errorMsg <- "Api exception encountered. No details given."
|
||||||
|
}
|
||||||
|
self$body <- errorMsg
|
||||||
|
self$headers <- http_response$headers
|
||||||
|
self$reason <- http_response$http_status_desc
|
||||||
|
self$error_object <- ModelApiResponse$new()$fromJSONString(http_response$response)
|
||||||
|
} else {
|
||||||
|
self$status <- status
|
||||||
|
self$reason <- reason
|
||||||
|
self$body <- NULL
|
||||||
|
self$headers <- NULL
|
||||||
|
self$error_object <- NULL
|
||||||
|
}
|
||||||
|
},
|
||||||
|
#' Returns the string format of ApiException.
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Returns the string format of ApiException.
|
||||||
|
#'
|
||||||
|
#' @return the string format of ApiException.
|
||||||
|
#' @export
|
||||||
|
toString = function() {
|
||||||
|
errorMsg <- ""
|
||||||
|
errorMsg <- paste("status : ", self$status, "\n", sep = "")
|
||||||
|
errorMsg <- paste(errorMsg, "Reason : ", self$reason, "\n", sep = "")
|
||||||
|
if (!is.null(self$headers)) {
|
||||||
|
errorMsg <- paste(errorMsg, "Headers : ", "\n", sep = "")
|
||||||
|
for (name in names(self$headers)) {
|
||||||
|
errorMsg <- paste(errorMsg, name, " : ", self$headers[[name]], "\n", sep = " ")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!is.null(self$body)) {
|
||||||
|
errorMsg <- paste(errorMsg, "Body : ", "\n", sep = "")
|
||||||
|
errorMsg <- paste(errorMsg, self$body, "\n")
|
||||||
|
}
|
||||||
|
if (!is.null(self$error_object)) {
|
||||||
|
errorMsg <- paste(errorMsg, "Error object : ", "\n", sep = "")
|
||||||
|
errorMsg <- paste(errorMsg, self$error_object$toJSONString(), "\n")
|
||||||
|
}
|
||||||
|
errorMsg
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
49
samples/client/petstore/R-httr2-wrapper/R/api_response.R
Normal file
49
samples/client/petstore/R-httr2-wrapper/R/api_response.R
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
#' OpenAPI Petstore
|
||||||
|
#'
|
||||||
|
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||||
|
#'
|
||||||
|
#' The version of the OpenAPI document: 1.0.0
|
||||||
|
#' Generated by: https://openapi-generator.tech
|
||||||
|
#'
|
||||||
|
#' @docType class
|
||||||
|
#' @title ApiResponse
|
||||||
|
#' @description ApiResponse Class
|
||||||
|
#' @format An \code{R6Class} generator object
|
||||||
|
#' @field content The deserialized response body.
|
||||||
|
#' @field response The raw response from the endpoint.
|
||||||
|
#' @field status_code The HTTP response status code.
|
||||||
|
#' @field status_code_desc The brief descriptoin of the HTTP response status code.
|
||||||
|
#' @field headers The HTTP response headers.
|
||||||
|
#' @export
|
||||||
|
ApiResponse <- R6::R6Class(
|
||||||
|
"ApiResponse",
|
||||||
|
public = list(
|
||||||
|
content = NULL,
|
||||||
|
response = NULL,
|
||||||
|
status_code = NULL,
|
||||||
|
status_code_desc = NULL,
|
||||||
|
headers = NULL,
|
||||||
|
#' Initialize a new ApiResponse class.
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Initialize a new ApiResponse class.
|
||||||
|
#'
|
||||||
|
#' @param content The deserialized response body.
|
||||||
|
#' @param response The raw response from the endpoint.
|
||||||
|
#' @param status_code The HTTP response status code.
|
||||||
|
#' @param status_code_desc The brief description of the HTTP response status code.
|
||||||
|
#' @param headers The HTTP response headers.
|
||||||
|
#' @export
|
||||||
|
initialize = function(content = NULL,
|
||||||
|
response = NULL,
|
||||||
|
status_code = NULL,
|
||||||
|
status_code_desc = NULL,
|
||||||
|
headers = NULL) {
|
||||||
|
self$content <- content
|
||||||
|
self$response <- response
|
||||||
|
self$status_code <- status_code
|
||||||
|
self$status_code_desc <- status_code_desc
|
||||||
|
self$headers <- headers
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
199
samples/client/petstore/R-httr2-wrapper/R/basque_pig.R
Normal file
199
samples/client/petstore/R-httr2-wrapper/R/basque_pig.R
Normal file
@@ -0,0 +1,199 @@
|
|||||||
|
#' OpenAPI Petstore
|
||||||
|
#'
|
||||||
|
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||||
|
#'
|
||||||
|
#' The version of the OpenAPI document: 1.0.0
|
||||||
|
#' Generated by: https://openapi-generator.tech
|
||||||
|
#'
|
||||||
|
#' @docType class
|
||||||
|
#' @title BasquePig
|
||||||
|
#' @description BasquePig Class
|
||||||
|
#' @format An \code{R6Class} generator object
|
||||||
|
#' @field className character
|
||||||
|
#' @field color character
|
||||||
|
#' @importFrom R6 R6Class
|
||||||
|
#' @importFrom jsonlite fromJSON toJSON
|
||||||
|
#' @export
|
||||||
|
BasquePig <- R6::R6Class(
|
||||||
|
"BasquePig",
|
||||||
|
public = list(
|
||||||
|
`className` = NULL,
|
||||||
|
`color` = NULL,
|
||||||
|
#' Initialize a new BasquePig class.
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Initialize a new BasquePig class.
|
||||||
|
#'
|
||||||
|
#' @param className className
|
||||||
|
#' @param color color
|
||||||
|
#' @param ... Other optional arguments.
|
||||||
|
#' @export
|
||||||
|
initialize = function(
|
||||||
|
`className`, `color`, ...
|
||||||
|
) {
|
||||||
|
if (!missing(`className`)) {
|
||||||
|
stopifnot(is.character(`className`), length(`className`) == 1)
|
||||||
|
self$`className` <- `className`
|
||||||
|
}
|
||||||
|
if (!missing(`color`)) {
|
||||||
|
stopifnot(is.character(`color`), length(`color`) == 1)
|
||||||
|
self$`color` <- `color`
|
||||||
|
}
|
||||||
|
},
|
||||||
|
#' To JSON string
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' To JSON String
|
||||||
|
#'
|
||||||
|
#' @return BasquePig in JSON format
|
||||||
|
#' @export
|
||||||
|
toJSON = function() {
|
||||||
|
BasquePigObject <- list()
|
||||||
|
if (!is.null(self$`className`)) {
|
||||||
|
BasquePigObject[["className"]] <-
|
||||||
|
self$`className`
|
||||||
|
}
|
||||||
|
if (!is.null(self$`color`)) {
|
||||||
|
BasquePigObject[["color"]] <-
|
||||||
|
self$`color`
|
||||||
|
}
|
||||||
|
|
||||||
|
BasquePigObject
|
||||||
|
},
|
||||||
|
#' Deserialize JSON string into an instance of BasquePig
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Deserialize JSON string into an instance of BasquePig
|
||||||
|
#'
|
||||||
|
#' @param input_json the JSON input
|
||||||
|
#' @return the instance of BasquePig
|
||||||
|
#' @export
|
||||||
|
fromJSON = function(input_json) {
|
||||||
|
this_object <- jsonlite::fromJSON(input_json)
|
||||||
|
if (!is.null(this_object$`className`)) {
|
||||||
|
self$`className` <- this_object$`className`
|
||||||
|
}
|
||||||
|
if (!is.null(this_object$`color`)) {
|
||||||
|
self$`color` <- this_object$`color`
|
||||||
|
}
|
||||||
|
self
|
||||||
|
},
|
||||||
|
#' To JSON string
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' To JSON String
|
||||||
|
#'
|
||||||
|
#' @return BasquePig in JSON format
|
||||||
|
#' @export
|
||||||
|
toJSONString = function() {
|
||||||
|
jsoncontent <- c(
|
||||||
|
if (!is.null(self$`className`)) {
|
||||||
|
sprintf(
|
||||||
|
'"className":
|
||||||
|
"%s"
|
||||||
|
',
|
||||||
|
self$`className`
|
||||||
|
)
|
||||||
|
},
|
||||||
|
if (!is.null(self$`color`)) {
|
||||||
|
sprintf(
|
||||||
|
'"color":
|
||||||
|
"%s"
|
||||||
|
',
|
||||||
|
self$`color`
|
||||||
|
)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
jsoncontent <- paste(jsoncontent, collapse = ",")
|
||||||
|
as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
|
||||||
|
},
|
||||||
|
#' Deserialize JSON string into an instance of BasquePig
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Deserialize JSON string into an instance of BasquePig
|
||||||
|
#'
|
||||||
|
#' @param input_json the JSON input
|
||||||
|
#' @return the instance of BasquePig
|
||||||
|
#' @export
|
||||||
|
fromJSONString = function(input_json) {
|
||||||
|
this_object <- jsonlite::fromJSON(input_json)
|
||||||
|
self$`className` <- this_object$`className`
|
||||||
|
self$`color` <- this_object$`color`
|
||||||
|
self
|
||||||
|
},
|
||||||
|
#' Validate JSON input with respect to BasquePig
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Validate JSON input with respect to BasquePig and throw an exception if invalid
|
||||||
|
#'
|
||||||
|
#' @param input the JSON input
|
||||||
|
#' @export
|
||||||
|
validateJSON = function(input) {
|
||||||
|
input_json <- jsonlite::fromJSON(input)
|
||||||
|
# check the required field `className`
|
||||||
|
if (!is.null(input_json$`className`)) {
|
||||||
|
stopifnot(is.character(input_json$`className`), length(input_json$`className`) == 1)
|
||||||
|
} else {
|
||||||
|
stop(paste("The JSON input `", input, "` is invalid for BasquePig: the required field `className` is missing."))
|
||||||
|
}
|
||||||
|
# check the required field `color`
|
||||||
|
if (!is.null(input_json$`color`)) {
|
||||||
|
stopifnot(is.character(input_json$`color`), length(input_json$`color`) == 1)
|
||||||
|
} else {
|
||||||
|
stop(paste("The JSON input `", input, "` is invalid for BasquePig: the required field `color` is missing."))
|
||||||
|
}
|
||||||
|
},
|
||||||
|
#' To string (JSON format)
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' To string (JSON format)
|
||||||
|
#'
|
||||||
|
#' @return String representation of BasquePig
|
||||||
|
#' @export
|
||||||
|
toString = function() {
|
||||||
|
self$toJSONString()
|
||||||
|
},
|
||||||
|
#' Return true if the values in all fields are valid.
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Return true if the values in all fields are valid.
|
||||||
|
#'
|
||||||
|
#' @return true if the values in all fields are valid.
|
||||||
|
#' @export
|
||||||
|
isValid = function() {
|
||||||
|
# check if the required `className` is null
|
||||||
|
if (is.null(self$`className`)) {
|
||||||
|
return(FALSE)
|
||||||
|
}
|
||||||
|
|
||||||
|
# check if the required `color` is null
|
||||||
|
if (is.null(self$`color`)) {
|
||||||
|
return(FALSE)
|
||||||
|
}
|
||||||
|
|
||||||
|
TRUE
|
||||||
|
},
|
||||||
|
#' Return a list of invalid fields (if any).
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Return a list of invalid fields (if any).
|
||||||
|
#'
|
||||||
|
#' @return A list of invalid fields (if any).
|
||||||
|
#' @export
|
||||||
|
getInvalidFields = function() {
|
||||||
|
invalid_fields <- list()
|
||||||
|
# check if the required `className` is null
|
||||||
|
if (is.null(self$`className`)) {
|
||||||
|
invalid_fields["className"] = "Non-nullable required field `className` cannot be null."
|
||||||
|
}
|
||||||
|
|
||||||
|
# check if the required `color` is null
|
||||||
|
if (is.null(self$`color`)) {
|
||||||
|
invalid_fields["color"] = "Non-nullable required field `color` cannot be null."
|
||||||
|
}
|
||||||
|
|
||||||
|
invalid_fields
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
207
samples/client/petstore/R-httr2-wrapper/R/cat.R
Normal file
207
samples/client/petstore/R-httr2-wrapper/R/cat.R
Normal file
@@ -0,0 +1,207 @@
|
|||||||
|
#' OpenAPI Petstore
|
||||||
|
#'
|
||||||
|
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||||
|
#'
|
||||||
|
#' The version of the OpenAPI document: 1.0.0
|
||||||
|
#' Generated by: https://openapi-generator.tech
|
||||||
|
#'
|
||||||
|
#' @docType class
|
||||||
|
#' @title Cat
|
||||||
|
#' @description Cat Class
|
||||||
|
#' @format An \code{R6Class} generator object
|
||||||
|
#' @field className character
|
||||||
|
#' @field color character [optional]
|
||||||
|
#' @field declawed character [optional]
|
||||||
|
#' @importFrom R6 R6Class
|
||||||
|
#' @importFrom jsonlite fromJSON toJSON
|
||||||
|
#' @export
|
||||||
|
Cat <- R6::R6Class(
|
||||||
|
"Cat",
|
||||||
|
inherit = Animal,
|
||||||
|
public = list(
|
||||||
|
`className` = NULL,
|
||||||
|
`color` = NULL,
|
||||||
|
`declawed` = NULL,
|
||||||
|
#' Initialize a new Cat class.
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Initialize a new Cat class.
|
||||||
|
#'
|
||||||
|
#' @param className className
|
||||||
|
#' @param color color. Default to "red".
|
||||||
|
#' @param declawed declawed
|
||||||
|
#' @param ... Other optional arguments.
|
||||||
|
#' @export
|
||||||
|
initialize = function(
|
||||||
|
`className`, `color` = "red", `declawed` = NULL, ...
|
||||||
|
) {
|
||||||
|
if (!missing(`className`)) {
|
||||||
|
stopifnot(is.character(`className`), length(`className`) == 1)
|
||||||
|
self$`className` <- `className`
|
||||||
|
}
|
||||||
|
if (!is.null(`color`)) {
|
||||||
|
stopifnot(is.character(`color`), length(`color`) == 1)
|
||||||
|
self$`color` <- `color`
|
||||||
|
}
|
||||||
|
if (!is.null(`declawed`)) {
|
||||||
|
stopifnot(is.logical(`declawed`), length(`declawed`) == 1)
|
||||||
|
self$`declawed` <- `declawed`
|
||||||
|
}
|
||||||
|
},
|
||||||
|
#' To JSON string
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' To JSON String
|
||||||
|
#'
|
||||||
|
#' @return Cat in JSON format
|
||||||
|
#' @export
|
||||||
|
toJSON = function() {
|
||||||
|
CatObject <- list()
|
||||||
|
if (!is.null(self$`className`)) {
|
||||||
|
CatObject[["className"]] <-
|
||||||
|
self$`className`
|
||||||
|
}
|
||||||
|
if (!is.null(self$`color`)) {
|
||||||
|
CatObject[["color"]] <-
|
||||||
|
self$`color`
|
||||||
|
}
|
||||||
|
if (!is.null(self$`declawed`)) {
|
||||||
|
CatObject[["declawed"]] <-
|
||||||
|
self$`declawed`
|
||||||
|
}
|
||||||
|
|
||||||
|
CatObject
|
||||||
|
},
|
||||||
|
#' Deserialize JSON string into an instance of Cat
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Deserialize JSON string into an instance of Cat
|
||||||
|
#'
|
||||||
|
#' @param input_json the JSON input
|
||||||
|
#' @return the instance of Cat
|
||||||
|
#' @export
|
||||||
|
fromJSON = function(input_json) {
|
||||||
|
this_object <- jsonlite::fromJSON(input_json)
|
||||||
|
if (!is.null(this_object$`className`)) {
|
||||||
|
self$`className` <- this_object$`className`
|
||||||
|
}
|
||||||
|
if (!is.null(this_object$`color`)) {
|
||||||
|
self$`color` <- this_object$`color`
|
||||||
|
}
|
||||||
|
if (!is.null(this_object$`declawed`)) {
|
||||||
|
self$`declawed` <- this_object$`declawed`
|
||||||
|
}
|
||||||
|
self
|
||||||
|
},
|
||||||
|
#' To JSON string
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' To JSON String
|
||||||
|
#'
|
||||||
|
#' @return Cat in JSON format
|
||||||
|
#' @export
|
||||||
|
toJSONString = function() {
|
||||||
|
jsoncontent <- c(
|
||||||
|
if (!is.null(self$`className`)) {
|
||||||
|
sprintf(
|
||||||
|
'"className":
|
||||||
|
"%s"
|
||||||
|
',
|
||||||
|
self$`className`
|
||||||
|
)
|
||||||
|
},
|
||||||
|
if (!is.null(self$`color`)) {
|
||||||
|
sprintf(
|
||||||
|
'"color":
|
||||||
|
"%s"
|
||||||
|
',
|
||||||
|
self$`color`
|
||||||
|
)
|
||||||
|
},
|
||||||
|
if (!is.null(self$`declawed`)) {
|
||||||
|
sprintf(
|
||||||
|
'"declawed":
|
||||||
|
%s
|
||||||
|
',
|
||||||
|
tolower(self$`declawed`)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
jsoncontent <- paste(jsoncontent, collapse = ",")
|
||||||
|
as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
|
||||||
|
},
|
||||||
|
#' Deserialize JSON string into an instance of Cat
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Deserialize JSON string into an instance of Cat
|
||||||
|
#'
|
||||||
|
#' @param input_json the JSON input
|
||||||
|
#' @return the instance of Cat
|
||||||
|
#' @export
|
||||||
|
fromJSONString = function(input_json) {
|
||||||
|
this_object <- jsonlite::fromJSON(input_json)
|
||||||
|
self$`className` <- this_object$`className`
|
||||||
|
self$`color` <- this_object$`color`
|
||||||
|
self$`declawed` <- this_object$`declawed`
|
||||||
|
self
|
||||||
|
},
|
||||||
|
#' Validate JSON input with respect to Cat
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Validate JSON input with respect to Cat and throw an exception if invalid
|
||||||
|
#'
|
||||||
|
#' @param input the JSON input
|
||||||
|
#' @export
|
||||||
|
validateJSON = function(input) {
|
||||||
|
input_json <- jsonlite::fromJSON(input)
|
||||||
|
# check the required field `className`
|
||||||
|
if (!is.null(input_json$`className`)) {
|
||||||
|
stopifnot(is.character(input_json$`className`), length(input_json$`className`) == 1)
|
||||||
|
} else {
|
||||||
|
stop(paste("The JSON input `", input, "` is invalid for Cat: the required field `className` is missing."))
|
||||||
|
}
|
||||||
|
},
|
||||||
|
#' To string (JSON format)
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' To string (JSON format)
|
||||||
|
#'
|
||||||
|
#' @return String representation of Cat
|
||||||
|
#' @export
|
||||||
|
toString = function() {
|
||||||
|
self$toJSONString()
|
||||||
|
},
|
||||||
|
#' Return true if the values in all fields are valid.
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Return true if the values in all fields are valid.
|
||||||
|
#'
|
||||||
|
#' @return true if the values in all fields are valid.
|
||||||
|
#' @export
|
||||||
|
isValid = function() {
|
||||||
|
# check if the required `className` is null
|
||||||
|
if (is.null(self$`className`)) {
|
||||||
|
return(FALSE)
|
||||||
|
}
|
||||||
|
|
||||||
|
TRUE
|
||||||
|
},
|
||||||
|
#' Return a list of invalid fields (if any).
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Return a list of invalid fields (if any).
|
||||||
|
#'
|
||||||
|
#' @return A list of invalid fields (if any).
|
||||||
|
#' @export
|
||||||
|
getInvalidFields = function() {
|
||||||
|
invalid_fields <- list()
|
||||||
|
# check if the required `className` is null
|
||||||
|
if (is.null(self$`className`)) {
|
||||||
|
invalid_fields["className"] = "Non-nullable required field `className` cannot be null."
|
||||||
|
}
|
||||||
|
|
||||||
|
invalid_fields
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
144
samples/client/petstore/R-httr2-wrapper/R/cat_all_of.R
Normal file
144
samples/client/petstore/R-httr2-wrapper/R/cat_all_of.R
Normal file
@@ -0,0 +1,144 @@
|
|||||||
|
#' OpenAPI Petstore
|
||||||
|
#'
|
||||||
|
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||||
|
#'
|
||||||
|
#' The version of the OpenAPI document: 1.0.0
|
||||||
|
#' Generated by: https://openapi-generator.tech
|
||||||
|
#'
|
||||||
|
#' @docType class
|
||||||
|
#' @title CatAllOf
|
||||||
|
#' @description CatAllOf Class
|
||||||
|
#' @format An \code{R6Class} generator object
|
||||||
|
#' @field declawed character [optional]
|
||||||
|
#' @importFrom R6 R6Class
|
||||||
|
#' @importFrom jsonlite fromJSON toJSON
|
||||||
|
#' @export
|
||||||
|
CatAllOf <- R6::R6Class(
|
||||||
|
"CatAllOf",
|
||||||
|
public = list(
|
||||||
|
`declawed` = NULL,
|
||||||
|
#' Initialize a new CatAllOf class.
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Initialize a new CatAllOf class.
|
||||||
|
#'
|
||||||
|
#' @param declawed declawed
|
||||||
|
#' @param ... Other optional arguments.
|
||||||
|
#' @export
|
||||||
|
initialize = function(
|
||||||
|
`declawed` = NULL, ...
|
||||||
|
) {
|
||||||
|
if (!is.null(`declawed`)) {
|
||||||
|
stopifnot(is.logical(`declawed`), length(`declawed`) == 1)
|
||||||
|
self$`declawed` <- `declawed`
|
||||||
|
}
|
||||||
|
},
|
||||||
|
#' To JSON string
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' To JSON String
|
||||||
|
#'
|
||||||
|
#' @return CatAllOf in JSON format
|
||||||
|
#' @export
|
||||||
|
toJSON = function() {
|
||||||
|
CatAllOfObject <- list()
|
||||||
|
if (!is.null(self$`declawed`)) {
|
||||||
|
CatAllOfObject[["declawed"]] <-
|
||||||
|
self$`declawed`
|
||||||
|
}
|
||||||
|
|
||||||
|
CatAllOfObject
|
||||||
|
},
|
||||||
|
#' Deserialize JSON string into an instance of CatAllOf
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Deserialize JSON string into an instance of CatAllOf
|
||||||
|
#'
|
||||||
|
#' @param input_json the JSON input
|
||||||
|
#' @return the instance of CatAllOf
|
||||||
|
#' @export
|
||||||
|
fromJSON = function(input_json) {
|
||||||
|
this_object <- jsonlite::fromJSON(input_json)
|
||||||
|
if (!is.null(this_object$`declawed`)) {
|
||||||
|
self$`declawed` <- this_object$`declawed`
|
||||||
|
}
|
||||||
|
self
|
||||||
|
},
|
||||||
|
#' To JSON string
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' To JSON String
|
||||||
|
#'
|
||||||
|
#' @return CatAllOf in JSON format
|
||||||
|
#' @export
|
||||||
|
toJSONString = function() {
|
||||||
|
jsoncontent <- c(
|
||||||
|
if (!is.null(self$`declawed`)) {
|
||||||
|
sprintf(
|
||||||
|
'"declawed":
|
||||||
|
%s
|
||||||
|
',
|
||||||
|
tolower(self$`declawed`)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
jsoncontent <- paste(jsoncontent, collapse = ",")
|
||||||
|
as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
|
||||||
|
},
|
||||||
|
#' Deserialize JSON string into an instance of CatAllOf
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Deserialize JSON string into an instance of CatAllOf
|
||||||
|
#'
|
||||||
|
#' @param input_json the JSON input
|
||||||
|
#' @return the instance of CatAllOf
|
||||||
|
#' @export
|
||||||
|
fromJSONString = function(input_json) {
|
||||||
|
this_object <- jsonlite::fromJSON(input_json)
|
||||||
|
self$`declawed` <- this_object$`declawed`
|
||||||
|
self
|
||||||
|
},
|
||||||
|
#' Validate JSON input with respect to CatAllOf
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Validate JSON input with respect to CatAllOf and throw an exception if invalid
|
||||||
|
#'
|
||||||
|
#' @param input the JSON input
|
||||||
|
#' @export
|
||||||
|
validateJSON = function(input) {
|
||||||
|
input_json <- jsonlite::fromJSON(input)
|
||||||
|
},
|
||||||
|
#' To string (JSON format)
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' To string (JSON format)
|
||||||
|
#'
|
||||||
|
#' @return String representation of CatAllOf
|
||||||
|
#' @export
|
||||||
|
toString = function() {
|
||||||
|
self$toJSONString()
|
||||||
|
},
|
||||||
|
#' Return true if the values in all fields are valid.
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Return true if the values in all fields are valid.
|
||||||
|
#'
|
||||||
|
#' @return true if the values in all fields are valid.
|
||||||
|
#' @export
|
||||||
|
isValid = function() {
|
||||||
|
TRUE
|
||||||
|
},
|
||||||
|
#' Return a list of invalid fields (if any).
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Return a list of invalid fields (if any).
|
||||||
|
#'
|
||||||
|
#' @return A list of invalid fields (if any).
|
||||||
|
#' @export
|
||||||
|
getInvalidFields = function() {
|
||||||
|
invalid_fields <- list()
|
||||||
|
invalid_fields
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
175
samples/client/petstore/R-httr2-wrapper/R/category.R
Normal file
175
samples/client/petstore/R-httr2-wrapper/R/category.R
Normal file
@@ -0,0 +1,175 @@
|
|||||||
|
#' OpenAPI Petstore
|
||||||
|
#'
|
||||||
|
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||||
|
#'
|
||||||
|
#' The version of the OpenAPI document: 1.0.0
|
||||||
|
#' Generated by: https://openapi-generator.tech
|
||||||
|
#'
|
||||||
|
#' @docType class
|
||||||
|
#' @title Category
|
||||||
|
#' @description Category Class
|
||||||
|
#' @format An \code{R6Class} generator object
|
||||||
|
#' @field id integer [optional]
|
||||||
|
#' @field name character [optional]
|
||||||
|
#' @importFrom R6 R6Class
|
||||||
|
#' @importFrom jsonlite fromJSON toJSON
|
||||||
|
#' @export
|
||||||
|
Category <- R6::R6Class(
|
||||||
|
"Category",
|
||||||
|
public = list(
|
||||||
|
`id` = NULL,
|
||||||
|
`name` = NULL,
|
||||||
|
#' Initialize a new Category class.
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Initialize a new Category class.
|
||||||
|
#'
|
||||||
|
#' @param id id
|
||||||
|
#' @param name name
|
||||||
|
#' @param ... Other optional arguments.
|
||||||
|
#' @export
|
||||||
|
initialize = function(
|
||||||
|
`id` = NULL, `name` = NULL, ...
|
||||||
|
) {
|
||||||
|
if (!is.null(`id`)) {
|
||||||
|
stopifnot(is.numeric(`id`), length(`id`) == 1)
|
||||||
|
self$`id` <- `id`
|
||||||
|
}
|
||||||
|
if (!is.null(`name`)) {
|
||||||
|
stopifnot(is.character(`name`), length(`name`) == 1)
|
||||||
|
self$`name` <- `name`
|
||||||
|
}
|
||||||
|
},
|
||||||
|
#' To JSON string
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' To JSON String
|
||||||
|
#'
|
||||||
|
#' @return Category in JSON format
|
||||||
|
#' @export
|
||||||
|
toJSON = function() {
|
||||||
|
CategoryObject <- list()
|
||||||
|
if (!is.null(self$`id`)) {
|
||||||
|
CategoryObject[["id"]] <-
|
||||||
|
self$`id`
|
||||||
|
}
|
||||||
|
if (!is.null(self$`name`)) {
|
||||||
|
CategoryObject[["name"]] <-
|
||||||
|
self$`name`
|
||||||
|
}
|
||||||
|
|
||||||
|
CategoryObject
|
||||||
|
},
|
||||||
|
#' Deserialize JSON string into an instance of Category
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Deserialize JSON string into an instance of Category
|
||||||
|
#'
|
||||||
|
#' @param input_json the JSON input
|
||||||
|
#' @return the instance of Category
|
||||||
|
#' @export
|
||||||
|
fromJSON = function(input_json) {
|
||||||
|
this_object <- jsonlite::fromJSON(input_json)
|
||||||
|
if (!is.null(this_object$`id`)) {
|
||||||
|
self$`id` <- this_object$`id`
|
||||||
|
}
|
||||||
|
if (!is.null(this_object$`name`)) {
|
||||||
|
self$`name` <- this_object$`name`
|
||||||
|
}
|
||||||
|
self
|
||||||
|
},
|
||||||
|
#' To JSON string
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' To JSON String
|
||||||
|
#'
|
||||||
|
#' @return Category in JSON format
|
||||||
|
#' @export
|
||||||
|
toJSONString = function() {
|
||||||
|
jsoncontent <- c(
|
||||||
|
if (!is.null(self$`id`)) {
|
||||||
|
sprintf(
|
||||||
|
'"id":
|
||||||
|
%d
|
||||||
|
',
|
||||||
|
self$`id`
|
||||||
|
)
|
||||||
|
},
|
||||||
|
if (!is.null(self$`name`)) {
|
||||||
|
sprintf(
|
||||||
|
'"name":
|
||||||
|
"%s"
|
||||||
|
',
|
||||||
|
self$`name`
|
||||||
|
)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
jsoncontent <- paste(jsoncontent, collapse = ",")
|
||||||
|
as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
|
||||||
|
},
|
||||||
|
#' Deserialize JSON string into an instance of Category
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Deserialize JSON string into an instance of Category
|
||||||
|
#'
|
||||||
|
#' @param input_json the JSON input
|
||||||
|
#' @return the instance of Category
|
||||||
|
#' @export
|
||||||
|
fromJSONString = function(input_json) {
|
||||||
|
this_object <- jsonlite::fromJSON(input_json)
|
||||||
|
self$`id` <- this_object$`id`
|
||||||
|
self$`name` <- this_object$`name`
|
||||||
|
self
|
||||||
|
},
|
||||||
|
#' Validate JSON input with respect to Category
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Validate JSON input with respect to Category and throw an exception if invalid
|
||||||
|
#'
|
||||||
|
#' @param input the JSON input
|
||||||
|
#' @export
|
||||||
|
validateJSON = function(input) {
|
||||||
|
input_json <- jsonlite::fromJSON(input)
|
||||||
|
},
|
||||||
|
#' To string (JSON format)
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' To string (JSON format)
|
||||||
|
#'
|
||||||
|
#' @return String representation of Category
|
||||||
|
#' @export
|
||||||
|
toString = function() {
|
||||||
|
self$toJSONString()
|
||||||
|
},
|
||||||
|
#' Return true if the values in all fields are valid.
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Return true if the values in all fields are valid.
|
||||||
|
#'
|
||||||
|
#' @return true if the values in all fields are valid.
|
||||||
|
#' @export
|
||||||
|
isValid = function() {
|
||||||
|
if (!str_detect(self$`name`, "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$")) {
|
||||||
|
return(FALSE)
|
||||||
|
}
|
||||||
|
|
||||||
|
TRUE
|
||||||
|
},
|
||||||
|
#' Return a list of invalid fields (if any).
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Return a list of invalid fields (if any).
|
||||||
|
#'
|
||||||
|
#' @return A list of invalid fields (if any).
|
||||||
|
#' @export
|
||||||
|
getInvalidFields = function() {
|
||||||
|
invalid_fields <- list()
|
||||||
|
if (!str_detect(self$`name`, "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$")) {
|
||||||
|
invalid_fields["name"] = "Invalid value for `name`, must conform to the pattern ^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$."
|
||||||
|
}
|
||||||
|
|
||||||
|
invalid_fields
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
199
samples/client/petstore/R-httr2-wrapper/R/danish_pig.R
Normal file
199
samples/client/petstore/R-httr2-wrapper/R/danish_pig.R
Normal file
@@ -0,0 +1,199 @@
|
|||||||
|
#' OpenAPI Petstore
|
||||||
|
#'
|
||||||
|
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||||
|
#'
|
||||||
|
#' The version of the OpenAPI document: 1.0.0
|
||||||
|
#' Generated by: https://openapi-generator.tech
|
||||||
|
#'
|
||||||
|
#' @docType class
|
||||||
|
#' @title DanishPig
|
||||||
|
#' @description DanishPig Class
|
||||||
|
#' @format An \code{R6Class} generator object
|
||||||
|
#' @field className character
|
||||||
|
#' @field size integer
|
||||||
|
#' @importFrom R6 R6Class
|
||||||
|
#' @importFrom jsonlite fromJSON toJSON
|
||||||
|
#' @export
|
||||||
|
DanishPig <- R6::R6Class(
|
||||||
|
"DanishPig",
|
||||||
|
public = list(
|
||||||
|
`className` = NULL,
|
||||||
|
`size` = NULL,
|
||||||
|
#' Initialize a new DanishPig class.
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Initialize a new DanishPig class.
|
||||||
|
#'
|
||||||
|
#' @param className className
|
||||||
|
#' @param size size
|
||||||
|
#' @param ... Other optional arguments.
|
||||||
|
#' @export
|
||||||
|
initialize = function(
|
||||||
|
`className`, `size`, ...
|
||||||
|
) {
|
||||||
|
if (!missing(`className`)) {
|
||||||
|
stopifnot(is.character(`className`), length(`className`) == 1)
|
||||||
|
self$`className` <- `className`
|
||||||
|
}
|
||||||
|
if (!missing(`size`)) {
|
||||||
|
stopifnot(is.numeric(`size`), length(`size`) == 1)
|
||||||
|
self$`size` <- `size`
|
||||||
|
}
|
||||||
|
},
|
||||||
|
#' To JSON string
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' To JSON String
|
||||||
|
#'
|
||||||
|
#' @return DanishPig in JSON format
|
||||||
|
#' @export
|
||||||
|
toJSON = function() {
|
||||||
|
DanishPigObject <- list()
|
||||||
|
if (!is.null(self$`className`)) {
|
||||||
|
DanishPigObject[["className"]] <-
|
||||||
|
self$`className`
|
||||||
|
}
|
||||||
|
if (!is.null(self$`size`)) {
|
||||||
|
DanishPigObject[["size"]] <-
|
||||||
|
self$`size`
|
||||||
|
}
|
||||||
|
|
||||||
|
DanishPigObject
|
||||||
|
},
|
||||||
|
#' Deserialize JSON string into an instance of DanishPig
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Deserialize JSON string into an instance of DanishPig
|
||||||
|
#'
|
||||||
|
#' @param input_json the JSON input
|
||||||
|
#' @return the instance of DanishPig
|
||||||
|
#' @export
|
||||||
|
fromJSON = function(input_json) {
|
||||||
|
this_object <- jsonlite::fromJSON(input_json)
|
||||||
|
if (!is.null(this_object$`className`)) {
|
||||||
|
self$`className` <- this_object$`className`
|
||||||
|
}
|
||||||
|
if (!is.null(this_object$`size`)) {
|
||||||
|
self$`size` <- this_object$`size`
|
||||||
|
}
|
||||||
|
self
|
||||||
|
},
|
||||||
|
#' To JSON string
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' To JSON String
|
||||||
|
#'
|
||||||
|
#' @return DanishPig in JSON format
|
||||||
|
#' @export
|
||||||
|
toJSONString = function() {
|
||||||
|
jsoncontent <- c(
|
||||||
|
if (!is.null(self$`className`)) {
|
||||||
|
sprintf(
|
||||||
|
'"className":
|
||||||
|
"%s"
|
||||||
|
',
|
||||||
|
self$`className`
|
||||||
|
)
|
||||||
|
},
|
||||||
|
if (!is.null(self$`size`)) {
|
||||||
|
sprintf(
|
||||||
|
'"size":
|
||||||
|
%d
|
||||||
|
',
|
||||||
|
self$`size`
|
||||||
|
)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
jsoncontent <- paste(jsoncontent, collapse = ",")
|
||||||
|
as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
|
||||||
|
},
|
||||||
|
#' Deserialize JSON string into an instance of DanishPig
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Deserialize JSON string into an instance of DanishPig
|
||||||
|
#'
|
||||||
|
#' @param input_json the JSON input
|
||||||
|
#' @return the instance of DanishPig
|
||||||
|
#' @export
|
||||||
|
fromJSONString = function(input_json) {
|
||||||
|
this_object <- jsonlite::fromJSON(input_json)
|
||||||
|
self$`className` <- this_object$`className`
|
||||||
|
self$`size` <- this_object$`size`
|
||||||
|
self
|
||||||
|
},
|
||||||
|
#' Validate JSON input with respect to DanishPig
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Validate JSON input with respect to DanishPig and throw an exception if invalid
|
||||||
|
#'
|
||||||
|
#' @param input the JSON input
|
||||||
|
#' @export
|
||||||
|
validateJSON = function(input) {
|
||||||
|
input_json <- jsonlite::fromJSON(input)
|
||||||
|
# check the required field `className`
|
||||||
|
if (!is.null(input_json$`className`)) {
|
||||||
|
stopifnot(is.character(input_json$`className`), length(input_json$`className`) == 1)
|
||||||
|
} else {
|
||||||
|
stop(paste("The JSON input `", input, "` is invalid for DanishPig: the required field `className` is missing."))
|
||||||
|
}
|
||||||
|
# check the required field `size`
|
||||||
|
if (!is.null(input_json$`size`)) {
|
||||||
|
stopifnot(is.numeric(input_json$`size`), length(input_json$`size`) == 1)
|
||||||
|
} else {
|
||||||
|
stop(paste("The JSON input `", input, "` is invalid for DanishPig: the required field `size` is missing."))
|
||||||
|
}
|
||||||
|
},
|
||||||
|
#' To string (JSON format)
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' To string (JSON format)
|
||||||
|
#'
|
||||||
|
#' @return String representation of DanishPig
|
||||||
|
#' @export
|
||||||
|
toString = function() {
|
||||||
|
self$toJSONString()
|
||||||
|
},
|
||||||
|
#' Return true if the values in all fields are valid.
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Return true if the values in all fields are valid.
|
||||||
|
#'
|
||||||
|
#' @return true if the values in all fields are valid.
|
||||||
|
#' @export
|
||||||
|
isValid = function() {
|
||||||
|
# check if the required `className` is null
|
||||||
|
if (is.null(self$`className`)) {
|
||||||
|
return(FALSE)
|
||||||
|
}
|
||||||
|
|
||||||
|
# check if the required `size` is null
|
||||||
|
if (is.null(self$`size`)) {
|
||||||
|
return(FALSE)
|
||||||
|
}
|
||||||
|
|
||||||
|
TRUE
|
||||||
|
},
|
||||||
|
#' Return a list of invalid fields (if any).
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Return a list of invalid fields (if any).
|
||||||
|
#'
|
||||||
|
#' @return A list of invalid fields (if any).
|
||||||
|
#' @export
|
||||||
|
getInvalidFields = function() {
|
||||||
|
invalid_fields <- list()
|
||||||
|
# check if the required `className` is null
|
||||||
|
if (is.null(self$`className`)) {
|
||||||
|
invalid_fields["className"] = "Non-nullable required field `className` cannot be null."
|
||||||
|
}
|
||||||
|
|
||||||
|
# check if the required `size` is null
|
||||||
|
if (is.null(self$`size`)) {
|
||||||
|
invalid_fields["size"] = "Non-nullable required field `size` cannot be null."
|
||||||
|
}
|
||||||
|
|
||||||
|
invalid_fields
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
207
samples/client/petstore/R-httr2-wrapper/R/dog.R
Normal file
207
samples/client/petstore/R-httr2-wrapper/R/dog.R
Normal file
@@ -0,0 +1,207 @@
|
|||||||
|
#' OpenAPI Petstore
|
||||||
|
#'
|
||||||
|
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||||
|
#'
|
||||||
|
#' The version of the OpenAPI document: 1.0.0
|
||||||
|
#' Generated by: https://openapi-generator.tech
|
||||||
|
#'
|
||||||
|
#' @docType class
|
||||||
|
#' @title Dog
|
||||||
|
#' @description Dog Class
|
||||||
|
#' @format An \code{R6Class} generator object
|
||||||
|
#' @field className character
|
||||||
|
#' @field color character [optional]
|
||||||
|
#' @field breed character [optional]
|
||||||
|
#' @importFrom R6 R6Class
|
||||||
|
#' @importFrom jsonlite fromJSON toJSON
|
||||||
|
#' @export
|
||||||
|
Dog <- R6::R6Class(
|
||||||
|
"Dog",
|
||||||
|
inherit = Animal,
|
||||||
|
public = list(
|
||||||
|
`className` = NULL,
|
||||||
|
`color` = NULL,
|
||||||
|
`breed` = NULL,
|
||||||
|
#' Initialize a new Dog class.
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Initialize a new Dog class.
|
||||||
|
#'
|
||||||
|
#' @param className className
|
||||||
|
#' @param color color. Default to "red".
|
||||||
|
#' @param breed breed
|
||||||
|
#' @param ... Other optional arguments.
|
||||||
|
#' @export
|
||||||
|
initialize = function(
|
||||||
|
`className`, `color` = "red", `breed` = NULL, ...
|
||||||
|
) {
|
||||||
|
if (!missing(`className`)) {
|
||||||
|
stopifnot(is.character(`className`), length(`className`) == 1)
|
||||||
|
self$`className` <- `className`
|
||||||
|
}
|
||||||
|
if (!is.null(`color`)) {
|
||||||
|
stopifnot(is.character(`color`), length(`color`) == 1)
|
||||||
|
self$`color` <- `color`
|
||||||
|
}
|
||||||
|
if (!is.null(`breed`)) {
|
||||||
|
stopifnot(is.character(`breed`), length(`breed`) == 1)
|
||||||
|
self$`breed` <- `breed`
|
||||||
|
}
|
||||||
|
},
|
||||||
|
#' To JSON string
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' To JSON String
|
||||||
|
#'
|
||||||
|
#' @return Dog in JSON format
|
||||||
|
#' @export
|
||||||
|
toJSON = function() {
|
||||||
|
DogObject <- list()
|
||||||
|
if (!is.null(self$`className`)) {
|
||||||
|
DogObject[["className"]] <-
|
||||||
|
self$`className`
|
||||||
|
}
|
||||||
|
if (!is.null(self$`color`)) {
|
||||||
|
DogObject[["color"]] <-
|
||||||
|
self$`color`
|
||||||
|
}
|
||||||
|
if (!is.null(self$`breed`)) {
|
||||||
|
DogObject[["breed"]] <-
|
||||||
|
self$`breed`
|
||||||
|
}
|
||||||
|
|
||||||
|
DogObject
|
||||||
|
},
|
||||||
|
#' Deserialize JSON string into an instance of Dog
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Deserialize JSON string into an instance of Dog
|
||||||
|
#'
|
||||||
|
#' @param input_json the JSON input
|
||||||
|
#' @return the instance of Dog
|
||||||
|
#' @export
|
||||||
|
fromJSON = function(input_json) {
|
||||||
|
this_object <- jsonlite::fromJSON(input_json)
|
||||||
|
if (!is.null(this_object$`className`)) {
|
||||||
|
self$`className` <- this_object$`className`
|
||||||
|
}
|
||||||
|
if (!is.null(this_object$`color`)) {
|
||||||
|
self$`color` <- this_object$`color`
|
||||||
|
}
|
||||||
|
if (!is.null(this_object$`breed`)) {
|
||||||
|
self$`breed` <- this_object$`breed`
|
||||||
|
}
|
||||||
|
self
|
||||||
|
},
|
||||||
|
#' To JSON string
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' To JSON String
|
||||||
|
#'
|
||||||
|
#' @return Dog in JSON format
|
||||||
|
#' @export
|
||||||
|
toJSONString = function() {
|
||||||
|
jsoncontent <- c(
|
||||||
|
if (!is.null(self$`className`)) {
|
||||||
|
sprintf(
|
||||||
|
'"className":
|
||||||
|
"%s"
|
||||||
|
',
|
||||||
|
self$`className`
|
||||||
|
)
|
||||||
|
},
|
||||||
|
if (!is.null(self$`color`)) {
|
||||||
|
sprintf(
|
||||||
|
'"color":
|
||||||
|
"%s"
|
||||||
|
',
|
||||||
|
self$`color`
|
||||||
|
)
|
||||||
|
},
|
||||||
|
if (!is.null(self$`breed`)) {
|
||||||
|
sprintf(
|
||||||
|
'"breed":
|
||||||
|
"%s"
|
||||||
|
',
|
||||||
|
self$`breed`
|
||||||
|
)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
jsoncontent <- paste(jsoncontent, collapse = ",")
|
||||||
|
as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
|
||||||
|
},
|
||||||
|
#' Deserialize JSON string into an instance of Dog
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Deserialize JSON string into an instance of Dog
|
||||||
|
#'
|
||||||
|
#' @param input_json the JSON input
|
||||||
|
#' @return the instance of Dog
|
||||||
|
#' @export
|
||||||
|
fromJSONString = function(input_json) {
|
||||||
|
this_object <- jsonlite::fromJSON(input_json)
|
||||||
|
self$`className` <- this_object$`className`
|
||||||
|
self$`color` <- this_object$`color`
|
||||||
|
self$`breed` <- this_object$`breed`
|
||||||
|
self
|
||||||
|
},
|
||||||
|
#' Validate JSON input with respect to Dog
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Validate JSON input with respect to Dog and throw an exception if invalid
|
||||||
|
#'
|
||||||
|
#' @param input the JSON input
|
||||||
|
#' @export
|
||||||
|
validateJSON = function(input) {
|
||||||
|
input_json <- jsonlite::fromJSON(input)
|
||||||
|
# check the required field `className`
|
||||||
|
if (!is.null(input_json$`className`)) {
|
||||||
|
stopifnot(is.character(input_json$`className`), length(input_json$`className`) == 1)
|
||||||
|
} else {
|
||||||
|
stop(paste("The JSON input `", input, "` is invalid for Dog: the required field `className` is missing."))
|
||||||
|
}
|
||||||
|
},
|
||||||
|
#' To string (JSON format)
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' To string (JSON format)
|
||||||
|
#'
|
||||||
|
#' @return String representation of Dog
|
||||||
|
#' @export
|
||||||
|
toString = function() {
|
||||||
|
self$toJSONString()
|
||||||
|
},
|
||||||
|
#' Return true if the values in all fields are valid.
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Return true if the values in all fields are valid.
|
||||||
|
#'
|
||||||
|
#' @return true if the values in all fields are valid.
|
||||||
|
#' @export
|
||||||
|
isValid = function() {
|
||||||
|
# check if the required `className` is null
|
||||||
|
if (is.null(self$`className`)) {
|
||||||
|
return(FALSE)
|
||||||
|
}
|
||||||
|
|
||||||
|
TRUE
|
||||||
|
},
|
||||||
|
#' Return a list of invalid fields (if any).
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Return a list of invalid fields (if any).
|
||||||
|
#'
|
||||||
|
#' @return A list of invalid fields (if any).
|
||||||
|
#' @export
|
||||||
|
getInvalidFields = function() {
|
||||||
|
invalid_fields <- list()
|
||||||
|
# check if the required `className` is null
|
||||||
|
if (is.null(self$`className`)) {
|
||||||
|
invalid_fields["className"] = "Non-nullable required field `className` cannot be null."
|
||||||
|
}
|
||||||
|
|
||||||
|
invalid_fields
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
144
samples/client/petstore/R-httr2-wrapper/R/dog_all_of.R
Normal file
144
samples/client/petstore/R-httr2-wrapper/R/dog_all_of.R
Normal file
@@ -0,0 +1,144 @@
|
|||||||
|
#' OpenAPI Petstore
|
||||||
|
#'
|
||||||
|
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||||
|
#'
|
||||||
|
#' The version of the OpenAPI document: 1.0.0
|
||||||
|
#' Generated by: https://openapi-generator.tech
|
||||||
|
#'
|
||||||
|
#' @docType class
|
||||||
|
#' @title DogAllOf
|
||||||
|
#' @description DogAllOf Class
|
||||||
|
#' @format An \code{R6Class} generator object
|
||||||
|
#' @field breed character [optional]
|
||||||
|
#' @importFrom R6 R6Class
|
||||||
|
#' @importFrom jsonlite fromJSON toJSON
|
||||||
|
#' @export
|
||||||
|
DogAllOf <- R6::R6Class(
|
||||||
|
"DogAllOf",
|
||||||
|
public = list(
|
||||||
|
`breed` = NULL,
|
||||||
|
#' Initialize a new DogAllOf class.
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Initialize a new DogAllOf class.
|
||||||
|
#'
|
||||||
|
#' @param breed breed
|
||||||
|
#' @param ... Other optional arguments.
|
||||||
|
#' @export
|
||||||
|
initialize = function(
|
||||||
|
`breed` = NULL, ...
|
||||||
|
) {
|
||||||
|
if (!is.null(`breed`)) {
|
||||||
|
stopifnot(is.character(`breed`), length(`breed`) == 1)
|
||||||
|
self$`breed` <- `breed`
|
||||||
|
}
|
||||||
|
},
|
||||||
|
#' To JSON string
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' To JSON String
|
||||||
|
#'
|
||||||
|
#' @return DogAllOf in JSON format
|
||||||
|
#' @export
|
||||||
|
toJSON = function() {
|
||||||
|
DogAllOfObject <- list()
|
||||||
|
if (!is.null(self$`breed`)) {
|
||||||
|
DogAllOfObject[["breed"]] <-
|
||||||
|
self$`breed`
|
||||||
|
}
|
||||||
|
|
||||||
|
DogAllOfObject
|
||||||
|
},
|
||||||
|
#' Deserialize JSON string into an instance of DogAllOf
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Deserialize JSON string into an instance of DogAllOf
|
||||||
|
#'
|
||||||
|
#' @param input_json the JSON input
|
||||||
|
#' @return the instance of DogAllOf
|
||||||
|
#' @export
|
||||||
|
fromJSON = function(input_json) {
|
||||||
|
this_object <- jsonlite::fromJSON(input_json)
|
||||||
|
if (!is.null(this_object$`breed`)) {
|
||||||
|
self$`breed` <- this_object$`breed`
|
||||||
|
}
|
||||||
|
self
|
||||||
|
},
|
||||||
|
#' To JSON string
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' To JSON String
|
||||||
|
#'
|
||||||
|
#' @return DogAllOf in JSON format
|
||||||
|
#' @export
|
||||||
|
toJSONString = function() {
|
||||||
|
jsoncontent <- c(
|
||||||
|
if (!is.null(self$`breed`)) {
|
||||||
|
sprintf(
|
||||||
|
'"breed":
|
||||||
|
"%s"
|
||||||
|
',
|
||||||
|
self$`breed`
|
||||||
|
)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
jsoncontent <- paste(jsoncontent, collapse = ",")
|
||||||
|
as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
|
||||||
|
},
|
||||||
|
#' Deserialize JSON string into an instance of DogAllOf
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Deserialize JSON string into an instance of DogAllOf
|
||||||
|
#'
|
||||||
|
#' @param input_json the JSON input
|
||||||
|
#' @return the instance of DogAllOf
|
||||||
|
#' @export
|
||||||
|
fromJSONString = function(input_json) {
|
||||||
|
this_object <- jsonlite::fromJSON(input_json)
|
||||||
|
self$`breed` <- this_object$`breed`
|
||||||
|
self
|
||||||
|
},
|
||||||
|
#' Validate JSON input with respect to DogAllOf
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Validate JSON input with respect to DogAllOf and throw an exception if invalid
|
||||||
|
#'
|
||||||
|
#' @param input the JSON input
|
||||||
|
#' @export
|
||||||
|
validateJSON = function(input) {
|
||||||
|
input_json <- jsonlite::fromJSON(input)
|
||||||
|
},
|
||||||
|
#' To string (JSON format)
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' To string (JSON format)
|
||||||
|
#'
|
||||||
|
#' @return String representation of DogAllOf
|
||||||
|
#' @export
|
||||||
|
toString = function() {
|
||||||
|
self$toJSONString()
|
||||||
|
},
|
||||||
|
#' Return true if the values in all fields are valid.
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Return true if the values in all fields are valid.
|
||||||
|
#'
|
||||||
|
#' @return true if the values in all fields are valid.
|
||||||
|
#' @export
|
||||||
|
isValid = function() {
|
||||||
|
TRUE
|
||||||
|
},
|
||||||
|
#' Return a list of invalid fields (if any).
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Return a list of invalid fields (if any).
|
||||||
|
#'
|
||||||
|
#' @return A list of invalid fields (if any).
|
||||||
|
#' @export
|
||||||
|
getInvalidFields = function() {
|
||||||
|
invalid_fields <- list()
|
||||||
|
invalid_fields
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
356
samples/client/petstore/R-httr2-wrapper/R/fake_api.R
Normal file
356
samples/client/petstore/R-httr2-wrapper/R/fake_api.R
Normal file
@@ -0,0 +1,356 @@
|
|||||||
|
#' OpenAPI Petstore
|
||||||
|
#'
|
||||||
|
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||||
|
#'
|
||||||
|
#' The version of the OpenAPI document: 1.0.0
|
||||||
|
#' Generated by: https://openapi-generator.tech
|
||||||
|
#'
|
||||||
|
#' @docType class
|
||||||
|
#' @title Fake operations
|
||||||
|
#' @description petstore.Fake
|
||||||
|
#' @format An \code{R6Class} generator object
|
||||||
|
#' @field api_client Handles the client-server communication.
|
||||||
|
#'
|
||||||
|
#' @section Methods:
|
||||||
|
#' \describe{
|
||||||
|
#' \strong{ fake_data_file } \emph{ test data_file to ensure it's escaped correctly }
|
||||||
|
#'
|
||||||
|
#'
|
||||||
|
#' \itemize{
|
||||||
|
#' \item \emph{ @param } dummy character
|
||||||
|
#' \item \emph{ @param } var_data_file character
|
||||||
|
#' \item \emph{ @returnType } \link{User} \cr
|
||||||
|
#'
|
||||||
|
#' \item On encountering errors, an error of subclass ApiException will be thrown.
|
||||||
|
#'
|
||||||
|
#' \item status code : 200 | successful operation
|
||||||
|
#'
|
||||||
|
#' \item return type : User
|
||||||
|
#' \item response headers :
|
||||||
|
#'
|
||||||
|
#' \tabular{ll}{
|
||||||
|
#' }
|
||||||
|
#' }
|
||||||
|
#'
|
||||||
|
#' \strong{ fake_regular_expression } \emph{ test regular expression to ensure no exception }
|
||||||
|
#'
|
||||||
|
#'
|
||||||
|
#' \itemize{
|
||||||
|
#' \item \emph{ @param } reg_exp_test character
|
||||||
|
#'
|
||||||
|
#' \item On encountering errors, an error of subclass ApiException will be thrown.
|
||||||
|
#'
|
||||||
|
#' \item status code : 200 | successful operation
|
||||||
|
#'
|
||||||
|
#'
|
||||||
|
#' \item response headers :
|
||||||
|
#'
|
||||||
|
#' \tabular{ll}{
|
||||||
|
#' }
|
||||||
|
#' }
|
||||||
|
#'
|
||||||
|
#' }
|
||||||
|
#'
|
||||||
|
#'
|
||||||
|
#' @examples
|
||||||
|
#' \dontrun{
|
||||||
|
#' #################### fake_data_file ####################
|
||||||
|
#'
|
||||||
|
#' library(petstore)
|
||||||
|
#' var.dummy <- "dummy_example" # character | dummy required parameter
|
||||||
|
#' var.var_data_file <- "var_data_file_example" # character | header data file
|
||||||
|
#'
|
||||||
|
#' #test data_file to ensure it's escaped correctly
|
||||||
|
#' api.instance <- FakeApi$new()
|
||||||
|
#'
|
||||||
|
#'result <- tryCatch(
|
||||||
|
#' api.instance$fake_data_file(var.dummy, var_data_file=var.var_data_file),
|
||||||
|
#' ApiException = function(ex) ex
|
||||||
|
#' )
|
||||||
|
#' # In case of error, print the error object
|
||||||
|
#' if(!is.null(result$ApiException)) {
|
||||||
|
#' cat(result$ApiException$toString())
|
||||||
|
#' } else {
|
||||||
|
#' # deserialized response object
|
||||||
|
#' response.object <- result$content
|
||||||
|
#' # response headers
|
||||||
|
#' response.headers <- result$response$headers
|
||||||
|
#' # response status code
|
||||||
|
#' response.status.code <- result$response$status_code
|
||||||
|
#' }
|
||||||
|
#'
|
||||||
|
#'
|
||||||
|
#' #################### fake_regular_expression ####################
|
||||||
|
#'
|
||||||
|
#' library(petstore)
|
||||||
|
#' var.reg_exp_test <- "reg_exp_test_example" # character | dummy required parameter
|
||||||
|
#'
|
||||||
|
#' #test regular expression to ensure no exception
|
||||||
|
#' api.instance <- FakeApi$new()
|
||||||
|
#'
|
||||||
|
#'result <- tryCatch(
|
||||||
|
#' api.instance$fake_regular_expression(var.reg_exp_test),
|
||||||
|
#' ApiException = function(ex) ex
|
||||||
|
#' )
|
||||||
|
#' # In case of error, print the error object
|
||||||
|
#' if(!is.null(result$ApiException)) {
|
||||||
|
#' cat(result$ApiException$toString())
|
||||||
|
#' } else {
|
||||||
|
#' # response headers
|
||||||
|
#' response.headers <- result$response$headers
|
||||||
|
#' # response status code
|
||||||
|
#' response.status.code <- result$response$status_code
|
||||||
|
#' }
|
||||||
|
#'
|
||||||
|
#'
|
||||||
|
#' }
|
||||||
|
#' @importFrom R6 R6Class
|
||||||
|
#' @importFrom base64enc base64encode
|
||||||
|
#' @importFrom rlang abort
|
||||||
|
#' @export
|
||||||
|
FakeApi <- R6::R6Class(
|
||||||
|
"FakeApi",
|
||||||
|
public = list(
|
||||||
|
api_client = NULL,
|
||||||
|
#' Initialize a new FakeApi.
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Initialize a new FakeApi.
|
||||||
|
#'
|
||||||
|
#' @param api_client An instance of API client.
|
||||||
|
#' @export
|
||||||
|
initialize = function(api_client) {
|
||||||
|
if (!missing(api_client)) {
|
||||||
|
self$api_client <- api_client
|
||||||
|
} else {
|
||||||
|
self$api_client <- ApiClient$new()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
#' test data_file to ensure it's escaped correctly
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' test data_file to ensure it's escaped correctly
|
||||||
|
#'
|
||||||
|
#' @param dummy dummy required parameter
|
||||||
|
#' @param var_data_file (optional) header data file
|
||||||
|
#' @param data_file (optional) name of the data file to save the result
|
||||||
|
#' @param ... Other optional arguments
|
||||||
|
#' @return User
|
||||||
|
#' @export
|
||||||
|
fake_data_file = function(dummy, var_data_file = NULL, data_file = NULL, ...) {
|
||||||
|
local_var_response <- self$fake_data_file_with_http_info(dummy, var_data_file, data_file = data_file, ...)
|
||||||
|
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
|
||||||
|
local_var_response$content
|
||||||
|
} else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) {
|
||||||
|
local_var_response
|
||||||
|
} else if (local_var_response$status_code >= 400 && local_var_response$status_code <= 499) {
|
||||||
|
local_var_response
|
||||||
|
} else if (local_var_response$status_code >= 500 && local_var_response$status_code <= 599) {
|
||||||
|
local_var_response
|
||||||
|
}
|
||||||
|
},
|
||||||
|
#' test data_file to ensure it's escaped correctly
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' test data_file to ensure it's escaped correctly
|
||||||
|
#'
|
||||||
|
#' @param dummy dummy required parameter
|
||||||
|
#' @param var_data_file (optional) header data file
|
||||||
|
#' @param data_file (optional) name of the data file to save the result
|
||||||
|
#' @param ... Other optional arguments
|
||||||
|
#' @return API response (User) with additional information such as HTTP status code, headers
|
||||||
|
#' @export
|
||||||
|
fake_data_file_with_http_info = function(dummy, var_data_file = NULL, data_file = NULL, ...) {
|
||||||
|
args <- list(...)
|
||||||
|
query_params <- list()
|
||||||
|
header_params <- c()
|
||||||
|
form_params <- list()
|
||||||
|
file_params <- list()
|
||||||
|
local_var_body <- NULL
|
||||||
|
oauth_scopes <- NULL
|
||||||
|
is_oauth <- FALSE
|
||||||
|
|
||||||
|
if (missing(`dummy`)) {
|
||||||
|
rlang::abort(message = "Missing required parameter `dummy`.",
|
||||||
|
.subclass = "ApiException",
|
||||||
|
ApiException = ApiException$new(status = 0,
|
||||||
|
reason = "Missing required parameter `dummy`."))
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
header_params["dummy"] <- `dummy`
|
||||||
|
|
||||||
|
header_params["data_file"] <- `var_data_file`
|
||||||
|
|
||||||
|
local_var_url_path <- "/fake/data_file"
|
||||||
|
|
||||||
|
# The Accept request HTTP header
|
||||||
|
local_var_accepts <- list("application/xml", "application/json")
|
||||||
|
|
||||||
|
# The Content-Type representation header
|
||||||
|
local_var_content_types <- list()
|
||||||
|
|
||||||
|
local_var_resp <- self$api_client$CallApi(url = paste0(self$api_client$base_path, local_var_url_path),
|
||||||
|
method = "GET",
|
||||||
|
query_params = query_params,
|
||||||
|
header_params = header_params,
|
||||||
|
form_params = form_params,
|
||||||
|
file_params = file_params,
|
||||||
|
accepts = local_var_accepts,
|
||||||
|
content_types = local_var_content_types,
|
||||||
|
body = local_var_body,
|
||||||
|
is_oauth = is_oauth,
|
||||||
|
oauth_scopes = oauth_scopes,
|
||||||
|
...)
|
||||||
|
|
||||||
|
if (local_var_resp$status_code >= 200 && local_var_resp$status_code <= 299) {
|
||||||
|
# save response in a file
|
||||||
|
if (!is.null(data_file)) {
|
||||||
|
write(local_var_resp$response, data_file)
|
||||||
|
}
|
||||||
|
|
||||||
|
deserialized_resp_obj <- tryCatch(
|
||||||
|
self$api_client$deserialize(local_var_resp$response, "User", loadNamespace("petstore")),
|
||||||
|
error = function(e) {
|
||||||
|
rlang::abort(message = "Failed to deserialize response",
|
||||||
|
.subclass = "ApiException",
|
||||||
|
ApiException = ApiException$new(http_response = local_var_resp))
|
||||||
|
}
|
||||||
|
)
|
||||||
|
local_var_resp$content <- deserialized_resp_obj
|
||||||
|
local_var_resp
|
||||||
|
} else if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
|
||||||
|
local_var_error_msg <- local_var_resp$response
|
||||||
|
if (local_var_error_msg == "") {
|
||||||
|
local_var_error_msg <- paste("Server returned ", local_var_resp$status_code, " response status code.")
|
||||||
|
}
|
||||||
|
rlang::abort(message = local_var_error_msg,
|
||||||
|
.subclass = "ApiException",
|
||||||
|
ApiException = ApiException$new(http_response = local_var_resp))
|
||||||
|
} else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
|
||||||
|
local_var_error_msg <- local_var_resp$response
|
||||||
|
if (local_var_error_msg == "") {
|
||||||
|
local_var_error_msg <- "Api client exception encountered."
|
||||||
|
}
|
||||||
|
rlang::abort(message = local_var_error_msg,
|
||||||
|
.subclass = "ApiException",
|
||||||
|
ApiException = ApiException$new(http_response = local_var_resp))
|
||||||
|
} else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
|
||||||
|
local_var_error_msg <- local_var_resp$response
|
||||||
|
if (local_var_error_msg == "") {
|
||||||
|
local_var_error_msg <- "Api server exception encountered."
|
||||||
|
}
|
||||||
|
rlang::abort(message = error_msg,
|
||||||
|
.subclass = "ApiException",
|
||||||
|
ApiException = ApiException$new(http_response = local_var_resp))
|
||||||
|
}
|
||||||
|
},
|
||||||
|
#' test regular expression to ensure no exception
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' test regular expression to ensure no exception
|
||||||
|
#'
|
||||||
|
#' @param reg_exp_test dummy required parameter
|
||||||
|
#' @param ... Other optional arguments
|
||||||
|
#' @return void
|
||||||
|
#' @export
|
||||||
|
fake_regular_expression = function(reg_exp_test, ...) {
|
||||||
|
local_var_response <- self$fake_regular_expression_with_http_info(reg_exp_test, ...)
|
||||||
|
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
|
||||||
|
local_var_response$content
|
||||||
|
} else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) {
|
||||||
|
local_var_response
|
||||||
|
} else if (local_var_response$status_code >= 400 && local_var_response$status_code <= 499) {
|
||||||
|
local_var_response
|
||||||
|
} else if (local_var_response$status_code >= 500 && local_var_response$status_code <= 599) {
|
||||||
|
local_var_response
|
||||||
|
}
|
||||||
|
},
|
||||||
|
#' test regular expression to ensure no exception
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' test regular expression to ensure no exception
|
||||||
|
#'
|
||||||
|
#' @param reg_exp_test dummy required parameter
|
||||||
|
#' @param ... Other optional arguments
|
||||||
|
#' @return API response (void) with additional information such as HTTP status code, headers
|
||||||
|
#' @export
|
||||||
|
fake_regular_expression_with_http_info = function(reg_exp_test, ...) {
|
||||||
|
args <- list(...)
|
||||||
|
query_params <- list()
|
||||||
|
header_params <- c()
|
||||||
|
form_params <- list()
|
||||||
|
file_params <- list()
|
||||||
|
local_var_body <- NULL
|
||||||
|
oauth_scopes <- NULL
|
||||||
|
is_oauth <- FALSE
|
||||||
|
|
||||||
|
if (missing(`reg_exp_test`)) {
|
||||||
|
rlang::abort(message = "Missing required parameter `reg_exp_test`.",
|
||||||
|
.subclass = "ApiException",
|
||||||
|
ApiException = ApiException$new(status = 0,
|
||||||
|
reason = "Missing required parameter `reg_exp_test`."))
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!str_detect(`reg_exp_test`, "^[A-Za-z0-9_]{1,15}$")) {
|
||||||
|
rlang::abort(message = "Invalid value for `reg_exp_test` when calling FakeApi$fake_regular_expression, must conform to the pattern ^[A-Za-z0-9_]{1,15}$.",
|
||||||
|
.subclass = "ApiException",
|
||||||
|
ApiException = ApiException$new(status = 0,
|
||||||
|
reason = "Invalid value for `reg_exp_test` when calling FakeApi$fake_regular_expression, must conform to the pattern ^[A-Za-z0-9_]{1,15}$."))
|
||||||
|
}
|
||||||
|
|
||||||
|
header_params["reg_exp_test"] <- `reg_exp_test`
|
||||||
|
|
||||||
|
local_var_url_path <- "/fake/regular_expression"
|
||||||
|
|
||||||
|
# The Accept request HTTP header
|
||||||
|
local_var_accepts <- list()
|
||||||
|
|
||||||
|
# The Content-Type representation header
|
||||||
|
local_var_content_types <- list()
|
||||||
|
|
||||||
|
local_var_resp <- self$api_client$CallApi(url = paste0(self$api_client$base_path, local_var_url_path),
|
||||||
|
method = "GET",
|
||||||
|
query_params = query_params,
|
||||||
|
header_params = header_params,
|
||||||
|
form_params = form_params,
|
||||||
|
file_params = file_params,
|
||||||
|
accepts = local_var_accepts,
|
||||||
|
content_types = local_var_content_types,
|
||||||
|
body = local_var_body,
|
||||||
|
is_oauth = is_oauth,
|
||||||
|
oauth_scopes = oauth_scopes,
|
||||||
|
...)
|
||||||
|
|
||||||
|
if (local_var_resp$status_code >= 200 && local_var_resp$status_code <= 299) {
|
||||||
|
local_var_resp$content <- NULL
|
||||||
|
local_var_resp
|
||||||
|
} else if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
|
||||||
|
local_var_error_msg <- local_var_resp$response
|
||||||
|
if (local_var_error_msg == "") {
|
||||||
|
local_var_error_msg <- paste("Server returned ", local_var_resp$status_code, " response status code.")
|
||||||
|
}
|
||||||
|
rlang::abort(message = local_var_error_msg,
|
||||||
|
.subclass = "ApiException",
|
||||||
|
ApiException = ApiException$new(http_response = local_var_resp))
|
||||||
|
} else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
|
||||||
|
local_var_error_msg <- local_var_resp$response
|
||||||
|
if (local_var_error_msg == "") {
|
||||||
|
local_var_error_msg <- "Api client exception encountered."
|
||||||
|
}
|
||||||
|
rlang::abort(message = local_var_error_msg,
|
||||||
|
.subclass = "ApiException",
|
||||||
|
ApiException = ApiException$new(http_response = local_var_resp))
|
||||||
|
} else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
|
||||||
|
local_var_error_msg <- local_var_resp$response
|
||||||
|
if (local_var_error_msg == "") {
|
||||||
|
local_var_error_msg <- "Api server exception encountered."
|
||||||
|
}
|
||||||
|
rlang::abort(message = error_msg,
|
||||||
|
.subclass = "ApiException",
|
||||||
|
ApiException = ApiException$new(http_response = local_var_resp))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
190
samples/client/petstore/R-httr2-wrapper/R/model_api_response.R
Normal file
190
samples/client/petstore/R-httr2-wrapper/R/model_api_response.R
Normal file
@@ -0,0 +1,190 @@
|
|||||||
|
#' OpenAPI Petstore
|
||||||
|
#'
|
||||||
|
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||||
|
#'
|
||||||
|
#' The version of the OpenAPI document: 1.0.0
|
||||||
|
#' Generated by: https://openapi-generator.tech
|
||||||
|
#'
|
||||||
|
#' @docType class
|
||||||
|
#' @title ModelApiResponse
|
||||||
|
#' @description ModelApiResponse Class
|
||||||
|
#' @format An \code{R6Class} generator object
|
||||||
|
#' @field code integer [optional]
|
||||||
|
#' @field type character [optional]
|
||||||
|
#' @field message character [optional]
|
||||||
|
#' @importFrom R6 R6Class
|
||||||
|
#' @importFrom jsonlite fromJSON toJSON
|
||||||
|
#' @export
|
||||||
|
ModelApiResponse <- R6::R6Class(
|
||||||
|
"ModelApiResponse",
|
||||||
|
public = list(
|
||||||
|
`code` = NULL,
|
||||||
|
`type` = NULL,
|
||||||
|
`message` = NULL,
|
||||||
|
#' Initialize a new ModelApiResponse class.
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Initialize a new ModelApiResponse class.
|
||||||
|
#'
|
||||||
|
#' @param code code
|
||||||
|
#' @param type type
|
||||||
|
#' @param message message
|
||||||
|
#' @param ... Other optional arguments.
|
||||||
|
#' @export
|
||||||
|
initialize = function(
|
||||||
|
`code` = NULL, `type` = NULL, `message` = NULL, ...
|
||||||
|
) {
|
||||||
|
if (!is.null(`code`)) {
|
||||||
|
stopifnot(is.numeric(`code`), length(`code`) == 1)
|
||||||
|
self$`code` <- `code`
|
||||||
|
}
|
||||||
|
if (!is.null(`type`)) {
|
||||||
|
stopifnot(is.character(`type`), length(`type`) == 1)
|
||||||
|
self$`type` <- `type`
|
||||||
|
}
|
||||||
|
if (!is.null(`message`)) {
|
||||||
|
stopifnot(is.character(`message`), length(`message`) == 1)
|
||||||
|
self$`message` <- `message`
|
||||||
|
}
|
||||||
|
},
|
||||||
|
#' To JSON string
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' To JSON String
|
||||||
|
#'
|
||||||
|
#' @return ModelApiResponse in JSON format
|
||||||
|
#' @export
|
||||||
|
toJSON = function() {
|
||||||
|
ModelApiResponseObject <- list()
|
||||||
|
if (!is.null(self$`code`)) {
|
||||||
|
ModelApiResponseObject[["code"]] <-
|
||||||
|
self$`code`
|
||||||
|
}
|
||||||
|
if (!is.null(self$`type`)) {
|
||||||
|
ModelApiResponseObject[["type"]] <-
|
||||||
|
self$`type`
|
||||||
|
}
|
||||||
|
if (!is.null(self$`message`)) {
|
||||||
|
ModelApiResponseObject[["message"]] <-
|
||||||
|
self$`message`
|
||||||
|
}
|
||||||
|
|
||||||
|
ModelApiResponseObject
|
||||||
|
},
|
||||||
|
#' Deserialize JSON string into an instance of ModelApiResponse
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Deserialize JSON string into an instance of ModelApiResponse
|
||||||
|
#'
|
||||||
|
#' @param input_json the JSON input
|
||||||
|
#' @return the instance of ModelApiResponse
|
||||||
|
#' @export
|
||||||
|
fromJSON = function(input_json) {
|
||||||
|
this_object <- jsonlite::fromJSON(input_json)
|
||||||
|
if (!is.null(this_object$`code`)) {
|
||||||
|
self$`code` <- this_object$`code`
|
||||||
|
}
|
||||||
|
if (!is.null(this_object$`type`)) {
|
||||||
|
self$`type` <- this_object$`type`
|
||||||
|
}
|
||||||
|
if (!is.null(this_object$`message`)) {
|
||||||
|
self$`message` <- this_object$`message`
|
||||||
|
}
|
||||||
|
self
|
||||||
|
},
|
||||||
|
#' To JSON string
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' To JSON String
|
||||||
|
#'
|
||||||
|
#' @return ModelApiResponse in JSON format
|
||||||
|
#' @export
|
||||||
|
toJSONString = function() {
|
||||||
|
jsoncontent <- c(
|
||||||
|
if (!is.null(self$`code`)) {
|
||||||
|
sprintf(
|
||||||
|
'"code":
|
||||||
|
%d
|
||||||
|
',
|
||||||
|
self$`code`
|
||||||
|
)
|
||||||
|
},
|
||||||
|
if (!is.null(self$`type`)) {
|
||||||
|
sprintf(
|
||||||
|
'"type":
|
||||||
|
"%s"
|
||||||
|
',
|
||||||
|
self$`type`
|
||||||
|
)
|
||||||
|
},
|
||||||
|
if (!is.null(self$`message`)) {
|
||||||
|
sprintf(
|
||||||
|
'"message":
|
||||||
|
"%s"
|
||||||
|
',
|
||||||
|
self$`message`
|
||||||
|
)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
jsoncontent <- paste(jsoncontent, collapse = ",")
|
||||||
|
as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
|
||||||
|
},
|
||||||
|
#' Deserialize JSON string into an instance of ModelApiResponse
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Deserialize JSON string into an instance of ModelApiResponse
|
||||||
|
#'
|
||||||
|
#' @param input_json the JSON input
|
||||||
|
#' @return the instance of ModelApiResponse
|
||||||
|
#' @export
|
||||||
|
fromJSONString = function(input_json) {
|
||||||
|
this_object <- jsonlite::fromJSON(input_json)
|
||||||
|
self$`code` <- this_object$`code`
|
||||||
|
self$`type` <- this_object$`type`
|
||||||
|
self$`message` <- this_object$`message`
|
||||||
|
self
|
||||||
|
},
|
||||||
|
#' Validate JSON input with respect to ModelApiResponse
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Validate JSON input with respect to ModelApiResponse and throw an exception if invalid
|
||||||
|
#'
|
||||||
|
#' @param input the JSON input
|
||||||
|
#' @export
|
||||||
|
validateJSON = function(input) {
|
||||||
|
input_json <- jsonlite::fromJSON(input)
|
||||||
|
},
|
||||||
|
#' To string (JSON format)
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' To string (JSON format)
|
||||||
|
#'
|
||||||
|
#' @return String representation of ModelApiResponse
|
||||||
|
#' @export
|
||||||
|
toString = function() {
|
||||||
|
self$toJSONString()
|
||||||
|
},
|
||||||
|
#' Return true if the values in all fields are valid.
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Return true if the values in all fields are valid.
|
||||||
|
#'
|
||||||
|
#' @return true if the values in all fields are valid.
|
||||||
|
#' @export
|
||||||
|
isValid = function() {
|
||||||
|
TRUE
|
||||||
|
},
|
||||||
|
#' Return a list of invalid fields (if any).
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Return a list of invalid fields (if any).
|
||||||
|
#'
|
||||||
|
#' @return A list of invalid fields (if any).
|
||||||
|
#' @export
|
||||||
|
getInvalidFields = function() {
|
||||||
|
invalid_fields <- list()
|
||||||
|
invalid_fields
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
169
samples/client/petstore/R-httr2-wrapper/R/nested_one_of.R
Normal file
169
samples/client/petstore/R-httr2-wrapper/R/nested_one_of.R
Normal file
@@ -0,0 +1,169 @@
|
|||||||
|
#' OpenAPI Petstore
|
||||||
|
#'
|
||||||
|
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||||
|
#'
|
||||||
|
#' The version of the OpenAPI document: 1.0.0
|
||||||
|
#' Generated by: https://openapi-generator.tech
|
||||||
|
#'
|
||||||
|
#' @docType class
|
||||||
|
#' @title NestedOneOf
|
||||||
|
#' @description NestedOneOf Class
|
||||||
|
#' @format An \code{R6Class} generator object
|
||||||
|
#' @field size integer [optional]
|
||||||
|
#' @field nested_pig \link{Pig} [optional]
|
||||||
|
#' @importFrom R6 R6Class
|
||||||
|
#' @importFrom jsonlite fromJSON toJSON
|
||||||
|
#' @export
|
||||||
|
NestedOneOf <- R6::R6Class(
|
||||||
|
"NestedOneOf",
|
||||||
|
public = list(
|
||||||
|
`size` = NULL,
|
||||||
|
`nested_pig` = NULL,
|
||||||
|
#' Initialize a new NestedOneOf class.
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Initialize a new NestedOneOf class.
|
||||||
|
#'
|
||||||
|
#' @param size size
|
||||||
|
#' @param nested_pig nested_pig
|
||||||
|
#' @param ... Other optional arguments.
|
||||||
|
#' @export
|
||||||
|
initialize = function(
|
||||||
|
`size` = NULL, `nested_pig` = NULL, ...
|
||||||
|
) {
|
||||||
|
if (!is.null(`size`)) {
|
||||||
|
stopifnot(is.numeric(`size`), length(`size`) == 1)
|
||||||
|
self$`size` <- `size`
|
||||||
|
}
|
||||||
|
if (!is.null(`nested_pig`)) {
|
||||||
|
stopifnot(R6::is.R6(`nested_pig`))
|
||||||
|
self$`nested_pig` <- `nested_pig`
|
||||||
|
}
|
||||||
|
},
|
||||||
|
#' To JSON string
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' To JSON String
|
||||||
|
#'
|
||||||
|
#' @return NestedOneOf in JSON format
|
||||||
|
#' @export
|
||||||
|
toJSON = function() {
|
||||||
|
NestedOneOfObject <- list()
|
||||||
|
if (!is.null(self$`size`)) {
|
||||||
|
NestedOneOfObject[["size"]] <-
|
||||||
|
self$`size`
|
||||||
|
}
|
||||||
|
if (!is.null(self$`nested_pig`)) {
|
||||||
|
NestedOneOfObject[["nested_pig"]] <-
|
||||||
|
self$`nested_pig`$toJSON()
|
||||||
|
}
|
||||||
|
|
||||||
|
NestedOneOfObject
|
||||||
|
},
|
||||||
|
#' Deserialize JSON string into an instance of NestedOneOf
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Deserialize JSON string into an instance of NestedOneOf
|
||||||
|
#'
|
||||||
|
#' @param input_json the JSON input
|
||||||
|
#' @return the instance of NestedOneOf
|
||||||
|
#' @export
|
||||||
|
fromJSON = function(input_json) {
|
||||||
|
this_object <- jsonlite::fromJSON(input_json)
|
||||||
|
if (!is.null(this_object$`size`)) {
|
||||||
|
self$`size` <- this_object$`size`
|
||||||
|
}
|
||||||
|
if (!is.null(this_object$`nested_pig`)) {
|
||||||
|
nested_pig_object <- Pig$new()
|
||||||
|
nested_pig_object$fromJSON(jsonlite::toJSON(this_object$nested_pig, auto_unbox = TRUE, digits = NA))
|
||||||
|
self$`nested_pig` <- nested_pig_object
|
||||||
|
}
|
||||||
|
self
|
||||||
|
},
|
||||||
|
#' To JSON string
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' To JSON String
|
||||||
|
#'
|
||||||
|
#' @return NestedOneOf in JSON format
|
||||||
|
#' @export
|
||||||
|
toJSONString = function() {
|
||||||
|
jsoncontent <- c(
|
||||||
|
if (!is.null(self$`size`)) {
|
||||||
|
sprintf(
|
||||||
|
'"size":
|
||||||
|
%d
|
||||||
|
',
|
||||||
|
self$`size`
|
||||||
|
)
|
||||||
|
},
|
||||||
|
if (!is.null(self$`nested_pig`)) {
|
||||||
|
sprintf(
|
||||||
|
'"nested_pig":
|
||||||
|
%s
|
||||||
|
',
|
||||||
|
jsonlite::toJSON(self$`nested_pig`$toJSON(), auto_unbox = TRUE, digits = NA)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
jsoncontent <- paste(jsoncontent, collapse = ",")
|
||||||
|
as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
|
||||||
|
},
|
||||||
|
#' Deserialize JSON string into an instance of NestedOneOf
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Deserialize JSON string into an instance of NestedOneOf
|
||||||
|
#'
|
||||||
|
#' @param input_json the JSON input
|
||||||
|
#' @return the instance of NestedOneOf
|
||||||
|
#' @export
|
||||||
|
fromJSONString = function(input_json) {
|
||||||
|
this_object <- jsonlite::fromJSON(input_json)
|
||||||
|
self$`size` <- this_object$`size`
|
||||||
|
self$`nested_pig` <- Pig$new()$fromJSON(jsonlite::toJSON(this_object$nested_pig, auto_unbox = TRUE, digits = NA))
|
||||||
|
self
|
||||||
|
},
|
||||||
|
#' Validate JSON input with respect to NestedOneOf
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Validate JSON input with respect to NestedOneOf and throw an exception if invalid
|
||||||
|
#'
|
||||||
|
#' @param input the JSON input
|
||||||
|
#' @export
|
||||||
|
validateJSON = function(input) {
|
||||||
|
input_json <- jsonlite::fromJSON(input)
|
||||||
|
},
|
||||||
|
#' To string (JSON format)
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' To string (JSON format)
|
||||||
|
#'
|
||||||
|
#' @return String representation of NestedOneOf
|
||||||
|
#' @export
|
||||||
|
toString = function() {
|
||||||
|
self$toJSONString()
|
||||||
|
},
|
||||||
|
#' Return true if the values in all fields are valid.
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Return true if the values in all fields are valid.
|
||||||
|
#'
|
||||||
|
#' @return true if the values in all fields are valid.
|
||||||
|
#' @export
|
||||||
|
isValid = function() {
|
||||||
|
TRUE
|
||||||
|
},
|
||||||
|
#' Return a list of invalid fields (if any).
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Return a list of invalid fields (if any).
|
||||||
|
#'
|
||||||
|
#' @return A list of invalid fields (if any).
|
||||||
|
#' @export
|
||||||
|
getInvalidFields = function() {
|
||||||
|
invalid_fields <- list()
|
||||||
|
invalid_fields
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
259
samples/client/petstore/R-httr2-wrapper/R/order.R
Normal file
259
samples/client/petstore/R-httr2-wrapper/R/order.R
Normal file
@@ -0,0 +1,259 @@
|
|||||||
|
#' OpenAPI Petstore
|
||||||
|
#'
|
||||||
|
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||||
|
#'
|
||||||
|
#' The version of the OpenAPI document: 1.0.0
|
||||||
|
#' Generated by: https://openapi-generator.tech
|
||||||
|
#'
|
||||||
|
#' @docType class
|
||||||
|
#' @title Order
|
||||||
|
#' @description Order Class
|
||||||
|
#' @format An \code{R6Class} generator object
|
||||||
|
#' @field id integer [optional]
|
||||||
|
#' @field petId integer [optional]
|
||||||
|
#' @field quantity integer [optional]
|
||||||
|
#' @field shipDate character [optional]
|
||||||
|
#' @field status character [optional]
|
||||||
|
#' @field complete character [optional]
|
||||||
|
#' @importFrom R6 R6Class
|
||||||
|
#' @importFrom jsonlite fromJSON toJSON
|
||||||
|
#' @export
|
||||||
|
Order <- R6::R6Class(
|
||||||
|
"Order",
|
||||||
|
public = list(
|
||||||
|
`id` = NULL,
|
||||||
|
`petId` = NULL,
|
||||||
|
`quantity` = NULL,
|
||||||
|
`shipDate` = NULL,
|
||||||
|
`status` = NULL,
|
||||||
|
`complete` = NULL,
|
||||||
|
#' Initialize a new Order class.
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Initialize a new Order class.
|
||||||
|
#'
|
||||||
|
#' @param id id
|
||||||
|
#' @param petId petId
|
||||||
|
#' @param quantity quantity
|
||||||
|
#' @param shipDate shipDate
|
||||||
|
#' @param status Order Status
|
||||||
|
#' @param complete complete. Default to FALSE.
|
||||||
|
#' @param ... Other optional arguments.
|
||||||
|
#' @export
|
||||||
|
initialize = function(
|
||||||
|
`id` = NULL, `petId` = NULL, `quantity` = NULL, `shipDate` = NULL, `status` = NULL, `complete` = FALSE, ...
|
||||||
|
) {
|
||||||
|
if (!is.null(`id`)) {
|
||||||
|
stopifnot(is.numeric(`id`), length(`id`) == 1)
|
||||||
|
self$`id` <- `id`
|
||||||
|
}
|
||||||
|
if (!is.null(`petId`)) {
|
||||||
|
stopifnot(is.numeric(`petId`), length(`petId`) == 1)
|
||||||
|
self$`petId` <- `petId`
|
||||||
|
}
|
||||||
|
if (!is.null(`quantity`)) {
|
||||||
|
stopifnot(is.numeric(`quantity`), length(`quantity`) == 1)
|
||||||
|
self$`quantity` <- `quantity`
|
||||||
|
}
|
||||||
|
if (!is.null(`shipDate`)) {
|
||||||
|
stopifnot(is.character(`shipDate`), length(`shipDate`) == 1)
|
||||||
|
self$`shipDate` <- `shipDate`
|
||||||
|
}
|
||||||
|
if (!is.null(`status`)) {
|
||||||
|
stopifnot(is.character(`status`), length(`status`) == 1)
|
||||||
|
self$`status` <- `status`
|
||||||
|
}
|
||||||
|
if (!is.null(`complete`)) {
|
||||||
|
stopifnot(is.logical(`complete`), length(`complete`) == 1)
|
||||||
|
self$`complete` <- `complete`
|
||||||
|
}
|
||||||
|
},
|
||||||
|
#' To JSON string
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' To JSON String
|
||||||
|
#'
|
||||||
|
#' @return Order in JSON format
|
||||||
|
#' @export
|
||||||
|
toJSON = function() {
|
||||||
|
OrderObject <- list()
|
||||||
|
if (!is.null(self$`id`)) {
|
||||||
|
OrderObject[["id"]] <-
|
||||||
|
self$`id`
|
||||||
|
}
|
||||||
|
if (!is.null(self$`petId`)) {
|
||||||
|
OrderObject[["petId"]] <-
|
||||||
|
self$`petId`
|
||||||
|
}
|
||||||
|
if (!is.null(self$`quantity`)) {
|
||||||
|
OrderObject[["quantity"]] <-
|
||||||
|
self$`quantity`
|
||||||
|
}
|
||||||
|
if (!is.null(self$`shipDate`)) {
|
||||||
|
OrderObject[["shipDate"]] <-
|
||||||
|
self$`shipDate`
|
||||||
|
}
|
||||||
|
if (!is.null(self$`status`)) {
|
||||||
|
OrderObject[["status"]] <-
|
||||||
|
self$`status`
|
||||||
|
}
|
||||||
|
if (!is.null(self$`complete`)) {
|
||||||
|
OrderObject[["complete"]] <-
|
||||||
|
self$`complete`
|
||||||
|
}
|
||||||
|
|
||||||
|
OrderObject
|
||||||
|
},
|
||||||
|
#' Deserialize JSON string into an instance of Order
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Deserialize JSON string into an instance of Order
|
||||||
|
#'
|
||||||
|
#' @param input_json the JSON input
|
||||||
|
#' @return the instance of Order
|
||||||
|
#' @export
|
||||||
|
fromJSON = function(input_json) {
|
||||||
|
this_object <- jsonlite::fromJSON(input_json)
|
||||||
|
if (!is.null(this_object$`id`)) {
|
||||||
|
self$`id` <- this_object$`id`
|
||||||
|
}
|
||||||
|
if (!is.null(this_object$`petId`)) {
|
||||||
|
self$`petId` <- this_object$`petId`
|
||||||
|
}
|
||||||
|
if (!is.null(this_object$`quantity`)) {
|
||||||
|
self$`quantity` <- this_object$`quantity`
|
||||||
|
}
|
||||||
|
if (!is.null(this_object$`shipDate`)) {
|
||||||
|
self$`shipDate` <- this_object$`shipDate`
|
||||||
|
}
|
||||||
|
if (!is.null(this_object$`status`)) {
|
||||||
|
self$`status` <- this_object$`status`
|
||||||
|
}
|
||||||
|
if (!is.null(this_object$`complete`)) {
|
||||||
|
self$`complete` <- this_object$`complete`
|
||||||
|
}
|
||||||
|
self
|
||||||
|
},
|
||||||
|
#' To JSON string
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' To JSON String
|
||||||
|
#'
|
||||||
|
#' @return Order in JSON format
|
||||||
|
#' @export
|
||||||
|
toJSONString = function() {
|
||||||
|
jsoncontent <- c(
|
||||||
|
if (!is.null(self$`id`)) {
|
||||||
|
sprintf(
|
||||||
|
'"id":
|
||||||
|
%d
|
||||||
|
',
|
||||||
|
self$`id`
|
||||||
|
)
|
||||||
|
},
|
||||||
|
if (!is.null(self$`petId`)) {
|
||||||
|
sprintf(
|
||||||
|
'"petId":
|
||||||
|
%d
|
||||||
|
',
|
||||||
|
self$`petId`
|
||||||
|
)
|
||||||
|
},
|
||||||
|
if (!is.null(self$`quantity`)) {
|
||||||
|
sprintf(
|
||||||
|
'"quantity":
|
||||||
|
%d
|
||||||
|
',
|
||||||
|
self$`quantity`
|
||||||
|
)
|
||||||
|
},
|
||||||
|
if (!is.null(self$`shipDate`)) {
|
||||||
|
sprintf(
|
||||||
|
'"shipDate":
|
||||||
|
"%s"
|
||||||
|
',
|
||||||
|
self$`shipDate`
|
||||||
|
)
|
||||||
|
},
|
||||||
|
if (!is.null(self$`status`)) {
|
||||||
|
sprintf(
|
||||||
|
'"status":
|
||||||
|
"%s"
|
||||||
|
',
|
||||||
|
self$`status`
|
||||||
|
)
|
||||||
|
},
|
||||||
|
if (!is.null(self$`complete`)) {
|
||||||
|
sprintf(
|
||||||
|
'"complete":
|
||||||
|
%s
|
||||||
|
',
|
||||||
|
tolower(self$`complete`)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
jsoncontent <- paste(jsoncontent, collapse = ",")
|
||||||
|
as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
|
||||||
|
},
|
||||||
|
#' Deserialize JSON string into an instance of Order
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Deserialize JSON string into an instance of Order
|
||||||
|
#'
|
||||||
|
#' @param input_json the JSON input
|
||||||
|
#' @return the instance of Order
|
||||||
|
#' @export
|
||||||
|
fromJSONString = function(input_json) {
|
||||||
|
this_object <- jsonlite::fromJSON(input_json)
|
||||||
|
self$`id` <- this_object$`id`
|
||||||
|
self$`petId` <- this_object$`petId`
|
||||||
|
self$`quantity` <- this_object$`quantity`
|
||||||
|
self$`shipDate` <- this_object$`shipDate`
|
||||||
|
self$`status` <- this_object$`status`
|
||||||
|
self$`complete` <- this_object$`complete`
|
||||||
|
self
|
||||||
|
},
|
||||||
|
#' Validate JSON input with respect to Order
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Validate JSON input with respect to Order and throw an exception if invalid
|
||||||
|
#'
|
||||||
|
#' @param input the JSON input
|
||||||
|
#' @export
|
||||||
|
validateJSON = function(input) {
|
||||||
|
input_json <- jsonlite::fromJSON(input)
|
||||||
|
},
|
||||||
|
#' To string (JSON format)
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' To string (JSON format)
|
||||||
|
#'
|
||||||
|
#' @return String representation of Order
|
||||||
|
#' @export
|
||||||
|
toString = function() {
|
||||||
|
self$toJSONString()
|
||||||
|
},
|
||||||
|
#' Return true if the values in all fields are valid.
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Return true if the values in all fields are valid.
|
||||||
|
#'
|
||||||
|
#' @return true if the values in all fields are valid.
|
||||||
|
#' @export
|
||||||
|
isValid = function() {
|
||||||
|
TRUE
|
||||||
|
},
|
||||||
|
#' Return a list of invalid fields (if any).
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Return a list of invalid fields (if any).
|
||||||
|
#'
|
||||||
|
#' @return A list of invalid fields (if any).
|
||||||
|
#' @export
|
||||||
|
getInvalidFields = function() {
|
||||||
|
invalid_fields <- list()
|
||||||
|
invalid_fields
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
296
samples/client/petstore/R-httr2-wrapper/R/pet.R
Normal file
296
samples/client/petstore/R-httr2-wrapper/R/pet.R
Normal file
@@ -0,0 +1,296 @@
|
|||||||
|
#' OpenAPI Petstore
|
||||||
|
#'
|
||||||
|
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||||
|
#'
|
||||||
|
#' The version of the OpenAPI document: 1.0.0
|
||||||
|
#' Generated by: https://openapi-generator.tech
|
||||||
|
#'
|
||||||
|
#' @docType class
|
||||||
|
#' @title Pet
|
||||||
|
#' @description Pet Class
|
||||||
|
#' @format An \code{R6Class} generator object
|
||||||
|
#' @field id integer [optional]
|
||||||
|
#' @field category \link{Category} [optional]
|
||||||
|
#' @field name character
|
||||||
|
#' @field photoUrls list( character )
|
||||||
|
#' @field tags list( \link{Tag} ) [optional]
|
||||||
|
#' @field status character [optional]
|
||||||
|
#' @importFrom R6 R6Class
|
||||||
|
#' @importFrom jsonlite fromJSON toJSON
|
||||||
|
#' @export
|
||||||
|
Pet <- R6::R6Class(
|
||||||
|
"Pet",
|
||||||
|
public = list(
|
||||||
|
`id` = NULL,
|
||||||
|
`category` = NULL,
|
||||||
|
`name` = NULL,
|
||||||
|
`photoUrls` = NULL,
|
||||||
|
`tags` = NULL,
|
||||||
|
`status` = NULL,
|
||||||
|
#' Initialize a new Pet class.
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Initialize a new Pet class.
|
||||||
|
#'
|
||||||
|
#' @param name name
|
||||||
|
#' @param photoUrls photoUrls
|
||||||
|
#' @param id id
|
||||||
|
#' @param category category
|
||||||
|
#' @param tags tags
|
||||||
|
#' @param status pet status in the store
|
||||||
|
#' @param ... Other optional arguments.
|
||||||
|
#' @export
|
||||||
|
initialize = function(
|
||||||
|
`name`, `photoUrls`, `id` = NULL, `category` = NULL, `tags` = NULL, `status` = NULL, ...
|
||||||
|
) {
|
||||||
|
if (!missing(`name`)) {
|
||||||
|
stopifnot(is.character(`name`), length(`name`) == 1)
|
||||||
|
self$`name` <- `name`
|
||||||
|
}
|
||||||
|
if (!missing(`photoUrls`)) {
|
||||||
|
stopifnot(is.vector(`photoUrls`), length(`photoUrls`) != 0)
|
||||||
|
sapply(`photoUrls`, function(x) stopifnot(is.character(x)))
|
||||||
|
self$`photoUrls` <- `photoUrls`
|
||||||
|
}
|
||||||
|
if (!is.null(`id`)) {
|
||||||
|
stopifnot(is.numeric(`id`), length(`id`) == 1)
|
||||||
|
self$`id` <- `id`
|
||||||
|
}
|
||||||
|
if (!is.null(`category`)) {
|
||||||
|
stopifnot(R6::is.R6(`category`))
|
||||||
|
self$`category` <- `category`
|
||||||
|
}
|
||||||
|
if (!is.null(`tags`)) {
|
||||||
|
stopifnot(is.vector(`tags`), length(`tags`) != 0)
|
||||||
|
sapply(`tags`, function(x) stopifnot(R6::is.R6(x)))
|
||||||
|
self$`tags` <- `tags`
|
||||||
|
}
|
||||||
|
if (!is.null(`status`)) {
|
||||||
|
stopifnot(is.character(`status`), length(`status`) == 1)
|
||||||
|
self$`status` <- `status`
|
||||||
|
}
|
||||||
|
},
|
||||||
|
#' To JSON string
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' To JSON String
|
||||||
|
#'
|
||||||
|
#' @return Pet in JSON format
|
||||||
|
#' @export
|
||||||
|
toJSON = function() {
|
||||||
|
PetObject <- list()
|
||||||
|
if (!is.null(self$`id`)) {
|
||||||
|
PetObject[["id"]] <-
|
||||||
|
self$`id`
|
||||||
|
}
|
||||||
|
if (!is.null(self$`category`)) {
|
||||||
|
PetObject[["category"]] <-
|
||||||
|
self$`category`$toJSON()
|
||||||
|
}
|
||||||
|
if (!is.null(self$`name`)) {
|
||||||
|
PetObject[["name"]] <-
|
||||||
|
self$`name`
|
||||||
|
}
|
||||||
|
if (!is.null(self$`photoUrls`)) {
|
||||||
|
PetObject[["photoUrls"]] <-
|
||||||
|
self$`photoUrls`
|
||||||
|
}
|
||||||
|
if (!is.null(self$`tags`)) {
|
||||||
|
PetObject[["tags"]] <-
|
||||||
|
lapply(self$`tags`, function(x) x$toJSON())
|
||||||
|
}
|
||||||
|
if (!is.null(self$`status`)) {
|
||||||
|
PetObject[["status"]] <-
|
||||||
|
self$`status`
|
||||||
|
}
|
||||||
|
|
||||||
|
PetObject
|
||||||
|
},
|
||||||
|
#' Deserialize JSON string into an instance of Pet
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Deserialize JSON string into an instance of Pet
|
||||||
|
#'
|
||||||
|
#' @param input_json the JSON input
|
||||||
|
#' @return the instance of Pet
|
||||||
|
#' @export
|
||||||
|
fromJSON = function(input_json) {
|
||||||
|
this_object <- jsonlite::fromJSON(input_json)
|
||||||
|
if (!is.null(this_object$`id`)) {
|
||||||
|
self$`id` <- this_object$`id`
|
||||||
|
}
|
||||||
|
if (!is.null(this_object$`category`)) {
|
||||||
|
category_object <- Category$new()
|
||||||
|
category_object$fromJSON(jsonlite::toJSON(this_object$category, auto_unbox = TRUE, digits = NA))
|
||||||
|
self$`category` <- category_object
|
||||||
|
}
|
||||||
|
if (!is.null(this_object$`name`)) {
|
||||||
|
self$`name` <- this_object$`name`
|
||||||
|
}
|
||||||
|
if (!is.null(this_object$`photoUrls`)) {
|
||||||
|
self$`photoUrls` <- ApiClient$new()$deserializeObj(this_object$`photoUrls`, "array[character]", loadNamespace("petstore"))
|
||||||
|
}
|
||||||
|
if (!is.null(this_object$`tags`)) {
|
||||||
|
self$`tags` <- ApiClient$new()$deserializeObj(this_object$`tags`, "array[Tag]", loadNamespace("petstore"))
|
||||||
|
}
|
||||||
|
if (!is.null(this_object$`status`)) {
|
||||||
|
self$`status` <- this_object$`status`
|
||||||
|
}
|
||||||
|
self
|
||||||
|
},
|
||||||
|
#' To JSON string
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' To JSON String
|
||||||
|
#'
|
||||||
|
#' @return Pet in JSON format
|
||||||
|
#' @export
|
||||||
|
toJSONString = function() {
|
||||||
|
jsoncontent <- c(
|
||||||
|
if (!is.null(self$`id`)) {
|
||||||
|
sprintf(
|
||||||
|
'"id":
|
||||||
|
%d
|
||||||
|
',
|
||||||
|
self$`id`
|
||||||
|
)
|
||||||
|
},
|
||||||
|
if (!is.null(self$`category`)) {
|
||||||
|
sprintf(
|
||||||
|
'"category":
|
||||||
|
%s
|
||||||
|
',
|
||||||
|
jsonlite::toJSON(self$`category`$toJSON(), auto_unbox = TRUE, digits = NA)
|
||||||
|
)
|
||||||
|
},
|
||||||
|
if (!is.null(self$`name`)) {
|
||||||
|
sprintf(
|
||||||
|
'"name":
|
||||||
|
"%s"
|
||||||
|
',
|
||||||
|
self$`name`
|
||||||
|
)
|
||||||
|
},
|
||||||
|
if (!is.null(self$`photoUrls`)) {
|
||||||
|
sprintf(
|
||||||
|
'"photoUrls":
|
||||||
|
[%s]
|
||||||
|
',
|
||||||
|
paste(unlist(lapply(self$`photoUrls`, function(x) paste0('"', x, '"'))), collapse = ",")
|
||||||
|
)
|
||||||
|
},
|
||||||
|
if (!is.null(self$`tags`)) {
|
||||||
|
sprintf(
|
||||||
|
'"tags":
|
||||||
|
[%s]
|
||||||
|
',
|
||||||
|
paste(sapply(self$`tags`, function(x) jsonlite::toJSON(x$toJSON(), auto_unbox = TRUE, digits = NA)), collapse = ",")
|
||||||
|
)
|
||||||
|
},
|
||||||
|
if (!is.null(self$`status`)) {
|
||||||
|
sprintf(
|
||||||
|
'"status":
|
||||||
|
"%s"
|
||||||
|
',
|
||||||
|
self$`status`
|
||||||
|
)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
jsoncontent <- paste(jsoncontent, collapse = ",")
|
||||||
|
as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
|
||||||
|
},
|
||||||
|
#' Deserialize JSON string into an instance of Pet
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Deserialize JSON string into an instance of Pet
|
||||||
|
#'
|
||||||
|
#' @param input_json the JSON input
|
||||||
|
#' @return the instance of Pet
|
||||||
|
#' @export
|
||||||
|
fromJSONString = function(input_json) {
|
||||||
|
this_object <- jsonlite::fromJSON(input_json)
|
||||||
|
self$`id` <- this_object$`id`
|
||||||
|
self$`category` <- Category$new()$fromJSON(jsonlite::toJSON(this_object$category, auto_unbox = TRUE, digits = NA))
|
||||||
|
self$`name` <- this_object$`name`
|
||||||
|
self$`photoUrls` <- ApiClient$new()$deserializeObj(this_object$`photoUrls`, "array[character]", loadNamespace("petstore"))
|
||||||
|
self$`tags` <- ApiClient$new()$deserializeObj(this_object$`tags`, "array[Tag]", loadNamespace("petstore"))
|
||||||
|
self$`status` <- this_object$`status`
|
||||||
|
self
|
||||||
|
},
|
||||||
|
#' Validate JSON input with respect to Pet
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Validate JSON input with respect to Pet and throw an exception if invalid
|
||||||
|
#'
|
||||||
|
#' @param input the JSON input
|
||||||
|
#' @export
|
||||||
|
validateJSON = function(input) {
|
||||||
|
input_json <- jsonlite::fromJSON(input)
|
||||||
|
# check the required field `name`
|
||||||
|
if (!is.null(input_json$`name`)) {
|
||||||
|
stopifnot(is.character(input_json$`name`), length(input_json$`name`) == 1)
|
||||||
|
} else {
|
||||||
|
stop(paste("The JSON input `", input, "` is invalid for Pet: the required field `name` is missing."))
|
||||||
|
}
|
||||||
|
# check the required field `photoUrls`
|
||||||
|
if (!is.null(input_json$`photoUrls`)) {
|
||||||
|
stopifnot(is.vector(input_json$`photoUrls`), length(input_json$`photoUrls`) != 0)
|
||||||
|
tmp <- sapply(input_json$`photoUrls`, function(x) stopifnot(is.character(x)))
|
||||||
|
} else {
|
||||||
|
stop(paste("The JSON input `", input, "` is invalid for Pet: the required field `photoUrls` is missing."))
|
||||||
|
}
|
||||||
|
},
|
||||||
|
#' To string (JSON format)
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' To string (JSON format)
|
||||||
|
#'
|
||||||
|
#' @return String representation of Pet
|
||||||
|
#' @export
|
||||||
|
toString = function() {
|
||||||
|
self$toJSONString()
|
||||||
|
},
|
||||||
|
#' Return true if the values in all fields are valid.
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Return true if the values in all fields are valid.
|
||||||
|
#'
|
||||||
|
#' @return true if the values in all fields are valid.
|
||||||
|
#' @export
|
||||||
|
isValid = function() {
|
||||||
|
# check if the required `name` is null
|
||||||
|
if (is.null(self$`name`)) {
|
||||||
|
return(FALSE)
|
||||||
|
}
|
||||||
|
|
||||||
|
# check if the required `photoUrls` is null
|
||||||
|
if (is.null(self$`photoUrls`)) {
|
||||||
|
return(FALSE)
|
||||||
|
}
|
||||||
|
|
||||||
|
TRUE
|
||||||
|
},
|
||||||
|
#' Return a list of invalid fields (if any).
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Return a list of invalid fields (if any).
|
||||||
|
#'
|
||||||
|
#' @return A list of invalid fields (if any).
|
||||||
|
#' @export
|
||||||
|
getInvalidFields = function() {
|
||||||
|
invalid_fields <- list()
|
||||||
|
# check if the required `name` is null
|
||||||
|
if (is.null(self$`name`)) {
|
||||||
|
invalid_fields["name"] = "Non-nullable required field `name` cannot be null."
|
||||||
|
}
|
||||||
|
|
||||||
|
# check if the required `photoUrls` is null
|
||||||
|
if (is.null(self$`photoUrls`)) {
|
||||||
|
invalid_fields["photoUrls"] = "Non-nullable required field `photoUrls` cannot be null."
|
||||||
|
}
|
||||||
|
|
||||||
|
invalid_fields
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
1809
samples/client/petstore/R-httr2-wrapper/R/pet_api.R
Normal file
1809
samples/client/petstore/R-httr2-wrapper/R/pet_api.R
Normal file
File diff suppressed because it is too large
Load Diff
59
samples/client/petstore/R-httr2-wrapper/R/petstore_api.R
Normal file
59
samples/client/petstore/R-httr2-wrapper/R/petstore_api.R
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
#' OpenAPI Petstore
|
||||||
|
#'
|
||||||
|
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||||
|
#'
|
||||||
|
#' The version of the OpenAPI document: 1.0.0
|
||||||
|
#' Generated by: https://openapi-generator.tech
|
||||||
|
#'
|
||||||
|
#' petstore API Class
|
||||||
|
#'
|
||||||
|
#' A single point of access to the petstore API.
|
||||||
|
#'
|
||||||
|
#' NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
#' Ref: https://openapi-generator.tech
|
||||||
|
#' Do not edit the class manually.
|
||||||
|
#'
|
||||||
|
#' @docType class
|
||||||
|
#' @title ApiClient
|
||||||
|
#' @description ApiClient Class
|
||||||
|
#' @format An \code{R6Class} generator object
|
||||||
|
#' @field api_client API client
|
||||||
|
#' @field fake_api an instance of FakeApi
|
||||||
|
#' @field pet_api an instance of PetApi
|
||||||
|
#' @field store_api an instance of StoreApi
|
||||||
|
#' @field user_api an instance of UserApi
|
||||||
|
#' @importFrom rlang abort
|
||||||
|
#' @export
|
||||||
|
petstore_api <- R6::R6Class(
|
||||||
|
"petstore_api",
|
||||||
|
public = list(
|
||||||
|
api_client = NULL,
|
||||||
|
fake_api = NULL,
|
||||||
|
pet_api = NULL,
|
||||||
|
store_api = NULL,
|
||||||
|
user_api = NULL,
|
||||||
|
#' Initialize a new petstore API Class.
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Initialize a new petstore API Class.
|
||||||
|
#'
|
||||||
|
#' @param api_client An instance of API client (optional).
|
||||||
|
#' @export
|
||||||
|
initialize = function(api_client) {
|
||||||
|
if (missing(api_client)) {
|
||||||
|
self$api_client <- ApiClient$new()
|
||||||
|
} else {
|
||||||
|
self$api_client <- api_client
|
||||||
|
}
|
||||||
|
|
||||||
|
self$fake_api <- FakeApi$new(self$api_client)
|
||||||
|
|
||||||
|
self$pet_api <- PetApi$new(self$api_client)
|
||||||
|
|
||||||
|
self$store_api <- StoreApi$new(self$api_client)
|
||||||
|
|
||||||
|
self$user_api <- UserApi$new(self$api_client)
|
||||||
|
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
172
samples/client/petstore/R-httr2-wrapper/R/pig.R
Normal file
172
samples/client/petstore/R-httr2-wrapper/R/pig.R
Normal file
@@ -0,0 +1,172 @@
|
|||||||
|
#' OpenAPI Petstore
|
||||||
|
#'
|
||||||
|
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||||
|
#'
|
||||||
|
#' The version of the OpenAPI document: 1.0.0
|
||||||
|
#' Generated by: https://openapi-generator.tech
|
||||||
|
#'
|
||||||
|
#' @docType class
|
||||||
|
#' @title Pig
|
||||||
|
#'
|
||||||
|
#' @description Pig Class
|
||||||
|
#'
|
||||||
|
#' @format An \code{R6Class} generator object
|
||||||
|
#'
|
||||||
|
#' @importFrom R6 R6Class
|
||||||
|
#' @importFrom jsonlite fromJSON toJSON
|
||||||
|
#' @export
|
||||||
|
Pig <- R6::R6Class(
|
||||||
|
"Pig",
|
||||||
|
public = list(
|
||||||
|
#' @field actual_instance the object stored in this instance.
|
||||||
|
actual_instance = NULL,
|
||||||
|
#' @field actual_type the type of the object stored in this instance.
|
||||||
|
actual_type = NULL,
|
||||||
|
#' @field one_of a list of object types defined in the oneOf schema.
|
||||||
|
one_of = list("BasquePig", "DanishPig"),
|
||||||
|
#' Initialize a new Pig.
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Initialize a new Pig.
|
||||||
|
#'
|
||||||
|
#' @param instance an instance of the object defined in the oneOf schemas: "BasquePig", "DanishPig"
|
||||||
|
#' @export
|
||||||
|
initialize = function(instance = NULL) {
|
||||||
|
if (is.null(instance)) {
|
||||||
|
# do nothing
|
||||||
|
} else if (get(class(instance)[[1]], pos = -1)$classname == "BasquePig") {
|
||||||
|
self$actual_instance <- instance
|
||||||
|
self$actual_type <- "BasquePig"
|
||||||
|
} else if (get(class(instance)[[1]], pos = -1)$classname == "DanishPig") {
|
||||||
|
self$actual_instance <- instance
|
||||||
|
self$actual_type <- "DanishPig"
|
||||||
|
} else {
|
||||||
|
stop(paste("Failed to initialize Pig with oneOf schemas BasquePig, DanishPig. Provided class name: ",
|
||||||
|
get(class(instance)[[1]], pos = -1)$classname))
|
||||||
|
}
|
||||||
|
},
|
||||||
|
#' Deserialize JSON string into an instance of Pig.
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Deserialize JSON string into an instance of Pig.
|
||||||
|
#'
|
||||||
|
#' @param input The input JSON.
|
||||||
|
#' @return An instance of Pig.
|
||||||
|
#' @export
|
||||||
|
fromJSON = function(input) {
|
||||||
|
matched <- 0 # match counter
|
||||||
|
matched_schemas <- list() #names of matched schemas
|
||||||
|
error_messages <- list()
|
||||||
|
instance <- NULL
|
||||||
|
|
||||||
|
BasquePig_result <- tryCatch({
|
||||||
|
BasquePig$public_methods$validateJSON(input)
|
||||||
|
BasquePig_instance <- BasquePig$new()
|
||||||
|
instance <- BasquePig_instance$fromJSON(input)
|
||||||
|
instance_type <- "BasquePig"
|
||||||
|
matched_schemas <- append(matched_schemas, "BasquePig")
|
||||||
|
matched <- matched + 1
|
||||||
|
},
|
||||||
|
error = function(err) err
|
||||||
|
)
|
||||||
|
|
||||||
|
if (!is.null(BasquePig_result["error"])) {
|
||||||
|
error_messages <- append(error_messages, BasquePig_result["message"])
|
||||||
|
}
|
||||||
|
|
||||||
|
DanishPig_result <- tryCatch({
|
||||||
|
DanishPig$public_methods$validateJSON(input)
|
||||||
|
DanishPig_instance <- DanishPig$new()
|
||||||
|
instance <- DanishPig_instance$fromJSON(input)
|
||||||
|
instance_type <- "DanishPig"
|
||||||
|
matched_schemas <- append(matched_schemas, "DanishPig")
|
||||||
|
matched <- matched + 1
|
||||||
|
},
|
||||||
|
error = function(err) err
|
||||||
|
)
|
||||||
|
|
||||||
|
if (!is.null(DanishPig_result["error"])) {
|
||||||
|
error_messages <- append(error_messages, DanishPig_result["message"])
|
||||||
|
}
|
||||||
|
|
||||||
|
if (matched == 1) {
|
||||||
|
# successfully match exactly 1 schema specified in oneOf
|
||||||
|
self$actual_instance <- instance
|
||||||
|
self$actual_type <- instance_type
|
||||||
|
} else if (matched > 1) {
|
||||||
|
# more than 1 match
|
||||||
|
stop("Multiple matches found when deserializing the payload into Pig with oneOf schemas BasquePig, DanishPig.")
|
||||||
|
} else {
|
||||||
|
# no match
|
||||||
|
stop(paste("No match found when deserializing the payload into Pig with oneOf schemas BasquePig, DanishPig. Details: ",
|
||||||
|
paste(error_messages, collapse = ", ")))
|
||||||
|
}
|
||||||
|
|
||||||
|
self
|
||||||
|
},
|
||||||
|
#' Serialize Pig to JSON string.
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Serialize Pig to JSON string.
|
||||||
|
#'
|
||||||
|
#' @return JSON string representation of the Pig.
|
||||||
|
#' @export
|
||||||
|
toJSONString = function() {
|
||||||
|
if (!is.null(self$actual_instance)) {
|
||||||
|
as.character(jsonlite::minify(self$actual_instance$toJSONString()))
|
||||||
|
} else {
|
||||||
|
NULL
|
||||||
|
}
|
||||||
|
},
|
||||||
|
#' Serialize Pig to JSON.
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Serialize Pig to JSON.
|
||||||
|
#'
|
||||||
|
#' @return JSON representation of the Pig.
|
||||||
|
#' @export
|
||||||
|
toJSON = function() {
|
||||||
|
if (!is.null(self$actual_instance)) {
|
||||||
|
self$actual_instance$toJSON()
|
||||||
|
} else {
|
||||||
|
NULL
|
||||||
|
}
|
||||||
|
},
|
||||||
|
#' Validate the input JSON with respect to Pig.
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Validate the input JSON with respect to Pig and
|
||||||
|
#' throw exception if invalid.
|
||||||
|
#'
|
||||||
|
#' @param input The input JSON.
|
||||||
|
#' @export
|
||||||
|
validateJSON = function(input) {
|
||||||
|
# backup current values
|
||||||
|
actual_instance_bak <- self$actual_instance
|
||||||
|
actual_type_bak <- self$actual_type
|
||||||
|
|
||||||
|
# if it's not valid, an error will be thrown
|
||||||
|
self$fromJSON(input)
|
||||||
|
|
||||||
|
# no error thrown, restore old values
|
||||||
|
self$actual_instance <- actual_instance_bak
|
||||||
|
self$actual_type <- actual_type_bak
|
||||||
|
},
|
||||||
|
#' Returns the string representation of the instance.
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Returns the string representation of the instance.
|
||||||
|
#'
|
||||||
|
#' @return The string representation of the instance.
|
||||||
|
#' @export
|
||||||
|
toString = function() {
|
||||||
|
jsoncontent <- c(
|
||||||
|
sprintf('"actual_instance": %s', if (is.null(self$actual_instance)) NULL else self$actual_instance$toJSONString()),
|
||||||
|
sprintf('"actual_type": "%s"', self$actual_type),
|
||||||
|
sprintf('"one_of": "%s"', paste(unlist(self$one_of), collapse = ", "))
|
||||||
|
)
|
||||||
|
jsoncontent <- paste(jsoncontent, collapse = ",")
|
||||||
|
as.character(jsonlite::prettify(paste("{", jsoncontent, "}", sep = "")))
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
259
samples/client/petstore/R-httr2-wrapper/R/special.R
Normal file
259
samples/client/petstore/R-httr2-wrapper/R/special.R
Normal file
@@ -0,0 +1,259 @@
|
|||||||
|
#' OpenAPI Petstore
|
||||||
|
#'
|
||||||
|
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||||
|
#'
|
||||||
|
#' The version of the OpenAPI document: 1.0.0
|
||||||
|
#' Generated by: https://openapi-generator.tech
|
||||||
|
#'
|
||||||
|
#' @docType class
|
||||||
|
#' @title Special
|
||||||
|
#' @description Special Class
|
||||||
|
#' @format An \code{R6Class} generator object
|
||||||
|
#' @field item_self integer [optional]
|
||||||
|
#' @field item_private character [optional]
|
||||||
|
#' @field item_super character [optional]
|
||||||
|
#' @field 123_number character [optional]
|
||||||
|
#' @field array[test] character [optional]
|
||||||
|
#' @field empty_string character [optional]
|
||||||
|
#' @importFrom R6 R6Class
|
||||||
|
#' @importFrom jsonlite fromJSON toJSON
|
||||||
|
#' @export
|
||||||
|
Special <- R6::R6Class(
|
||||||
|
"Special",
|
||||||
|
public = list(
|
||||||
|
`item_self` = NULL,
|
||||||
|
`item_private` = NULL,
|
||||||
|
`item_super` = NULL,
|
||||||
|
`123_number` = NULL,
|
||||||
|
`array[test]` = NULL,
|
||||||
|
`empty_string` = NULL,
|
||||||
|
#' Initialize a new Special class.
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Initialize a new Special class.
|
||||||
|
#'
|
||||||
|
#' @param item_self item_self
|
||||||
|
#' @param item_private item_private
|
||||||
|
#' @param item_super item_super
|
||||||
|
#' @param 123_number 123_number
|
||||||
|
#' @param array[test] array[test]
|
||||||
|
#' @param empty_string empty_string
|
||||||
|
#' @param ... Other optional arguments.
|
||||||
|
#' @export
|
||||||
|
initialize = function(
|
||||||
|
`item_self` = NULL, `item_private` = NULL, `item_super` = NULL, `123_number` = NULL, `array[test]` = NULL, `empty_string` = NULL, ...
|
||||||
|
) {
|
||||||
|
if (!is.null(`item_self`)) {
|
||||||
|
stopifnot(is.numeric(`item_self`), length(`item_self`) == 1)
|
||||||
|
self$`item_self` <- `item_self`
|
||||||
|
}
|
||||||
|
if (!is.null(`item_private`)) {
|
||||||
|
stopifnot(is.character(`item_private`), length(`item_private`) == 1)
|
||||||
|
self$`item_private` <- `item_private`
|
||||||
|
}
|
||||||
|
if (!is.null(`item_super`)) {
|
||||||
|
stopifnot(is.character(`item_super`), length(`item_super`) == 1)
|
||||||
|
self$`item_super` <- `item_super`
|
||||||
|
}
|
||||||
|
if (!is.null(`123_number`)) {
|
||||||
|
stopifnot(is.character(`123_number`), length(`123_number`) == 1)
|
||||||
|
self$`123_number` <- `123_number`
|
||||||
|
}
|
||||||
|
if (!is.null(`array[test]`)) {
|
||||||
|
stopifnot(is.character(`array[test]`), length(`array[test]`) == 1)
|
||||||
|
self$`array[test]` <- `array[test]`
|
||||||
|
}
|
||||||
|
if (!is.null(`empty_string`)) {
|
||||||
|
stopifnot(is.character(`empty_string`), length(`empty_string`) == 1)
|
||||||
|
self$`empty_string` <- `empty_string`
|
||||||
|
}
|
||||||
|
},
|
||||||
|
#' To JSON string
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' To JSON String
|
||||||
|
#'
|
||||||
|
#' @return Special in JSON format
|
||||||
|
#' @export
|
||||||
|
toJSON = function() {
|
||||||
|
SpecialObject <- list()
|
||||||
|
if (!is.null(self$`item_self`)) {
|
||||||
|
SpecialObject[["self"]] <-
|
||||||
|
self$`item_self`
|
||||||
|
}
|
||||||
|
if (!is.null(self$`item_private`)) {
|
||||||
|
SpecialObject[["private"]] <-
|
||||||
|
self$`item_private`
|
||||||
|
}
|
||||||
|
if (!is.null(self$`item_super`)) {
|
||||||
|
SpecialObject[["super"]] <-
|
||||||
|
self$`item_super`
|
||||||
|
}
|
||||||
|
if (!is.null(self$`123_number`)) {
|
||||||
|
SpecialObject[["123_number"]] <-
|
||||||
|
self$`123_number`
|
||||||
|
}
|
||||||
|
if (!is.null(self$`array[test]`)) {
|
||||||
|
SpecialObject[["array[test]"]] <-
|
||||||
|
self$`array[test]`
|
||||||
|
}
|
||||||
|
if (!is.null(self$`empty_string`)) {
|
||||||
|
SpecialObject[["empty_string"]] <-
|
||||||
|
self$`empty_string`
|
||||||
|
}
|
||||||
|
|
||||||
|
SpecialObject
|
||||||
|
},
|
||||||
|
#' Deserialize JSON string into an instance of Special
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Deserialize JSON string into an instance of Special
|
||||||
|
#'
|
||||||
|
#' @param input_json the JSON input
|
||||||
|
#' @return the instance of Special
|
||||||
|
#' @export
|
||||||
|
fromJSON = function(input_json) {
|
||||||
|
this_object <- jsonlite::fromJSON(input_json)
|
||||||
|
if (!is.null(this_object$`self`)) {
|
||||||
|
self$`item_self` <- this_object$`self`
|
||||||
|
}
|
||||||
|
if (!is.null(this_object$`private`)) {
|
||||||
|
self$`item_private` <- this_object$`private`
|
||||||
|
}
|
||||||
|
if (!is.null(this_object$`super`)) {
|
||||||
|
self$`item_super` <- this_object$`super`
|
||||||
|
}
|
||||||
|
if (!is.null(this_object$`123_number`)) {
|
||||||
|
self$`123_number` <- this_object$`123_number`
|
||||||
|
}
|
||||||
|
if (!is.null(this_object$`array[test]`)) {
|
||||||
|
self$`array[test]` <- this_object$`array[test]`
|
||||||
|
}
|
||||||
|
if (!is.null(this_object$`empty_string`)) {
|
||||||
|
self$`empty_string` <- this_object$`empty_string`
|
||||||
|
}
|
||||||
|
self
|
||||||
|
},
|
||||||
|
#' To JSON string
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' To JSON String
|
||||||
|
#'
|
||||||
|
#' @return Special in JSON format
|
||||||
|
#' @export
|
||||||
|
toJSONString = function() {
|
||||||
|
jsoncontent <- c(
|
||||||
|
if (!is.null(self$`item_self`)) {
|
||||||
|
sprintf(
|
||||||
|
'"self":
|
||||||
|
%d
|
||||||
|
',
|
||||||
|
self$`item_self`
|
||||||
|
)
|
||||||
|
},
|
||||||
|
if (!is.null(self$`item_private`)) {
|
||||||
|
sprintf(
|
||||||
|
'"private":
|
||||||
|
"%s"
|
||||||
|
',
|
||||||
|
self$`item_private`
|
||||||
|
)
|
||||||
|
},
|
||||||
|
if (!is.null(self$`item_super`)) {
|
||||||
|
sprintf(
|
||||||
|
'"super":
|
||||||
|
"%s"
|
||||||
|
',
|
||||||
|
self$`item_super`
|
||||||
|
)
|
||||||
|
},
|
||||||
|
if (!is.null(self$`123_number`)) {
|
||||||
|
sprintf(
|
||||||
|
'"123_number":
|
||||||
|
"%s"
|
||||||
|
',
|
||||||
|
self$`123_number`
|
||||||
|
)
|
||||||
|
},
|
||||||
|
if (!is.null(self$`array[test]`)) {
|
||||||
|
sprintf(
|
||||||
|
'"array[test]":
|
||||||
|
"%s"
|
||||||
|
',
|
||||||
|
self$`array[test]`
|
||||||
|
)
|
||||||
|
},
|
||||||
|
if (!is.null(self$`empty_string`)) {
|
||||||
|
sprintf(
|
||||||
|
'"empty_string":
|
||||||
|
"%s"
|
||||||
|
',
|
||||||
|
self$`empty_string`
|
||||||
|
)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
jsoncontent <- paste(jsoncontent, collapse = ",")
|
||||||
|
as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
|
||||||
|
},
|
||||||
|
#' Deserialize JSON string into an instance of Special
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Deserialize JSON string into an instance of Special
|
||||||
|
#'
|
||||||
|
#' @param input_json the JSON input
|
||||||
|
#' @return the instance of Special
|
||||||
|
#' @export
|
||||||
|
fromJSONString = function(input_json) {
|
||||||
|
this_object <- jsonlite::fromJSON(input_json)
|
||||||
|
self$`item_self` <- this_object$`item_self`
|
||||||
|
self$`item_private` <- this_object$`item_private`
|
||||||
|
self$`item_super` <- this_object$`item_super`
|
||||||
|
self$`123_number` <- this_object$`123_number`
|
||||||
|
self$`array[test]` <- this_object$`array[test]`
|
||||||
|
self$`empty_string` <- this_object$`empty_string`
|
||||||
|
self
|
||||||
|
},
|
||||||
|
#' Validate JSON input with respect to Special
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Validate JSON input with respect to Special and throw an exception if invalid
|
||||||
|
#'
|
||||||
|
#' @param input the JSON input
|
||||||
|
#' @export
|
||||||
|
validateJSON = function(input) {
|
||||||
|
input_json <- jsonlite::fromJSON(input)
|
||||||
|
},
|
||||||
|
#' To string (JSON format)
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' To string (JSON format)
|
||||||
|
#'
|
||||||
|
#' @return String representation of Special
|
||||||
|
#' @export
|
||||||
|
toString = function() {
|
||||||
|
self$toJSONString()
|
||||||
|
},
|
||||||
|
#' Return true if the values in all fields are valid.
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Return true if the values in all fields are valid.
|
||||||
|
#'
|
||||||
|
#' @return true if the values in all fields are valid.
|
||||||
|
#' @export
|
||||||
|
isValid = function() {
|
||||||
|
TRUE
|
||||||
|
},
|
||||||
|
#' Return a list of invalid fields (if any).
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Return a list of invalid fields (if any).
|
||||||
|
#'
|
||||||
|
#' @return A list of invalid fields (if any).
|
||||||
|
#' @export
|
||||||
|
getInvalidFields = function() {
|
||||||
|
invalid_fields <- list()
|
||||||
|
invalid_fields
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
699
samples/client/petstore/R-httr2-wrapper/R/store_api.R
Normal file
699
samples/client/petstore/R-httr2-wrapper/R/store_api.R
Normal file
@@ -0,0 +1,699 @@
|
|||||||
|
#' OpenAPI Petstore
|
||||||
|
#'
|
||||||
|
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||||
|
#'
|
||||||
|
#' The version of the OpenAPI document: 1.0.0
|
||||||
|
#' Generated by: https://openapi-generator.tech
|
||||||
|
#'
|
||||||
|
#' @docType class
|
||||||
|
#' @title Store operations
|
||||||
|
#' @description petstore.Store
|
||||||
|
#' @format An \code{R6Class} generator object
|
||||||
|
#' @field api_client Handles the client-server communication.
|
||||||
|
#'
|
||||||
|
#' @section Methods:
|
||||||
|
#' \describe{
|
||||||
|
#' \strong{ delete_order } \emph{ Delete purchase order by ID }
|
||||||
|
#' For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||||
|
#'
|
||||||
|
#' \itemize{
|
||||||
|
#' \item \emph{ @param } order_id character
|
||||||
|
#'
|
||||||
|
#' \item On encountering errors, an error of subclass ApiException will be thrown.
|
||||||
|
#'
|
||||||
|
#' \item status code : 400 | Invalid ID supplied
|
||||||
|
#'
|
||||||
|
#'
|
||||||
|
#' \item response headers :
|
||||||
|
#'
|
||||||
|
#' \tabular{ll}{
|
||||||
|
#' }
|
||||||
|
#' \item status code : 404 | Order not found
|
||||||
|
#'
|
||||||
|
#'
|
||||||
|
#' \item response headers :
|
||||||
|
#'
|
||||||
|
#' \tabular{ll}{
|
||||||
|
#' }
|
||||||
|
#' }
|
||||||
|
#'
|
||||||
|
#' \strong{ get_inventory } \emph{ Returns pet inventories by status }
|
||||||
|
#' Returns a map of status codes to quantities
|
||||||
|
#'
|
||||||
|
#' \itemize{
|
||||||
|
#'
|
||||||
|
#' \item On encountering errors, an error of subclass ApiException will be thrown.
|
||||||
|
#'
|
||||||
|
#' \item status code : 200 | successful operation
|
||||||
|
#'
|
||||||
|
#' \item return type : map(integer)
|
||||||
|
#' \item response headers :
|
||||||
|
#'
|
||||||
|
#' \tabular{ll}{
|
||||||
|
#' }
|
||||||
|
#' }
|
||||||
|
#'
|
||||||
|
#' \strong{ get_order_by_id } \emph{ Find purchase order by ID }
|
||||||
|
#' For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||||
|
#'
|
||||||
|
#' \itemize{
|
||||||
|
#' \item \emph{ @param } order_id integer
|
||||||
|
#' \item \emph{ @returnType } \link{Order} \cr
|
||||||
|
#'
|
||||||
|
#' \item On encountering errors, an error of subclass ApiException will be thrown.
|
||||||
|
#'
|
||||||
|
#' \item status code : 200 | successful operation
|
||||||
|
#'
|
||||||
|
#' \item return type : Order
|
||||||
|
#' \item response headers :
|
||||||
|
#'
|
||||||
|
#' \tabular{ll}{
|
||||||
|
#' }
|
||||||
|
#' \item status code : 400 | Invalid ID supplied
|
||||||
|
#'
|
||||||
|
#'
|
||||||
|
#' \item response headers :
|
||||||
|
#'
|
||||||
|
#' \tabular{ll}{
|
||||||
|
#' }
|
||||||
|
#' \item status code : 404 | Order not found
|
||||||
|
#'
|
||||||
|
#'
|
||||||
|
#' \item response headers :
|
||||||
|
#'
|
||||||
|
#' \tabular{ll}{
|
||||||
|
#' }
|
||||||
|
#' }
|
||||||
|
#'
|
||||||
|
#' \strong{ place_order } \emph{ Place an order for a pet }
|
||||||
|
#'
|
||||||
|
#'
|
||||||
|
#' \itemize{
|
||||||
|
#' \item \emph{ @param } order \link{Order}
|
||||||
|
#' \item \emph{ @returnType } \link{Order} \cr
|
||||||
|
#'
|
||||||
|
#' \item On encountering errors, an error of subclass ApiException will be thrown.
|
||||||
|
#'
|
||||||
|
#' \item status code : 200 | successful operation
|
||||||
|
#'
|
||||||
|
#' \item return type : Order
|
||||||
|
#' \item response headers :
|
||||||
|
#'
|
||||||
|
#' \tabular{ll}{
|
||||||
|
#' }
|
||||||
|
#' \item status code : 400 | Invalid Order
|
||||||
|
#'
|
||||||
|
#'
|
||||||
|
#' \item response headers :
|
||||||
|
#'
|
||||||
|
#' \tabular{ll}{
|
||||||
|
#' }
|
||||||
|
#' }
|
||||||
|
#'
|
||||||
|
#' }
|
||||||
|
#'
|
||||||
|
#'
|
||||||
|
#' @examples
|
||||||
|
#' \dontrun{
|
||||||
|
#' #################### delete_order ####################
|
||||||
|
#'
|
||||||
|
#' 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()
|
||||||
|
#'
|
||||||
|
#'result <- tryCatch(
|
||||||
|
#' api.instance$delete_order(var.order_id),
|
||||||
|
#' ApiException = function(ex) ex
|
||||||
|
#' )
|
||||||
|
#' # In case of error, print the error object
|
||||||
|
#' if(!is.null(result$ApiException)) {
|
||||||
|
#' cat(result$ApiException$toString())
|
||||||
|
#' } else {
|
||||||
|
#' # response headers
|
||||||
|
#' response.headers <- result$response$headers
|
||||||
|
#' # response status code
|
||||||
|
#' response.status.code <- result$response$status_code
|
||||||
|
#' }
|
||||||
|
#'
|
||||||
|
#'
|
||||||
|
#' #################### get_inventory ####################
|
||||||
|
#'
|
||||||
|
#' library(petstore)
|
||||||
|
#'
|
||||||
|
#' #Returns pet inventories by status
|
||||||
|
#' api.instance <- StoreApi$new()
|
||||||
|
#'
|
||||||
|
#' #Configure API key authorization: api_key
|
||||||
|
#' api.instance$api_client$api_keys['api_key'] <- 'TODO_YOUR_API_KEY';
|
||||||
|
#'
|
||||||
|
#'result <- tryCatch(
|
||||||
|
#' api.instance$get_inventory(),
|
||||||
|
#' ApiException = function(ex) ex
|
||||||
|
#' )
|
||||||
|
#' # In case of error, print the error object
|
||||||
|
#' if(!is.null(result$ApiException)) {
|
||||||
|
#' cat(result$ApiException$toString())
|
||||||
|
#' } else {
|
||||||
|
#' # deserialized response object
|
||||||
|
#' response.object <- result$content
|
||||||
|
#' # response headers
|
||||||
|
#' response.headers <- result$response$headers
|
||||||
|
#' # response status code
|
||||||
|
#' response.status.code <- result$response$status_code
|
||||||
|
#' }
|
||||||
|
#'
|
||||||
|
#'
|
||||||
|
#' #################### get_order_by_id ####################
|
||||||
|
#'
|
||||||
|
#' 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 <- tryCatch(
|
||||||
|
#' api.instance$get_order_by_id(var.order_id),
|
||||||
|
#' ApiException = function(ex) ex
|
||||||
|
#' )
|
||||||
|
#' # In case of error, print the error object
|
||||||
|
#' if(!is.null(result$ApiException)) {
|
||||||
|
#' cat(result$ApiException$toString())
|
||||||
|
#' } else {
|
||||||
|
#' # deserialized response object
|
||||||
|
#' response.object <- result$content
|
||||||
|
#' # response headers
|
||||||
|
#' response.headers <- result$response$headers
|
||||||
|
#' # response status code
|
||||||
|
#' response.status.code <- result$response$status_code
|
||||||
|
#' }
|
||||||
|
#'
|
||||||
|
#'
|
||||||
|
#' #################### place_order ####################
|
||||||
|
#'
|
||||||
|
#' library(petstore)
|
||||||
|
#' var.order <- Order$new() # Order | order placed for purchasing the pet
|
||||||
|
#'
|
||||||
|
#' #Place an order for a pet
|
||||||
|
#' api.instance <- StoreApi$new()
|
||||||
|
#'
|
||||||
|
#'result <- tryCatch(
|
||||||
|
#' api.instance$place_order(var.order),
|
||||||
|
#' ApiException = function(ex) ex
|
||||||
|
#' )
|
||||||
|
#' # In case of error, print the error object
|
||||||
|
#' if(!is.null(result$ApiException)) {
|
||||||
|
#' cat(result$ApiException$toString())
|
||||||
|
#' } else {
|
||||||
|
#' # deserialized response object
|
||||||
|
#' response.object <- result$content
|
||||||
|
#' # response headers
|
||||||
|
#' response.headers <- result$response$headers
|
||||||
|
#' # response status code
|
||||||
|
#' response.status.code <- result$response$status_code
|
||||||
|
#' }
|
||||||
|
#'
|
||||||
|
#'
|
||||||
|
#' }
|
||||||
|
#' @importFrom R6 R6Class
|
||||||
|
#' @importFrom base64enc base64encode
|
||||||
|
#' @importFrom rlang abort
|
||||||
|
#' @export
|
||||||
|
StoreApi <- R6::R6Class(
|
||||||
|
"StoreApi",
|
||||||
|
public = list(
|
||||||
|
api_client = NULL,
|
||||||
|
#' Initialize a new StoreApi.
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Initialize a new StoreApi.
|
||||||
|
#'
|
||||||
|
#' @param api_client An instance of API client.
|
||||||
|
#' @export
|
||||||
|
initialize = function(api_client) {
|
||||||
|
if (!missing(api_client)) {
|
||||||
|
self$api_client <- api_client
|
||||||
|
} else {
|
||||||
|
self$api_client <- ApiClient$new()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
#' Delete purchase order by ID
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Delete purchase order by ID
|
||||||
|
#'
|
||||||
|
#' @param order_id ID of the order that needs to be deleted
|
||||||
|
#' @param ... Other optional arguments
|
||||||
|
#' @return void
|
||||||
|
#' @export
|
||||||
|
delete_order = function(order_id, ...) {
|
||||||
|
local_var_response <- self$delete_order_with_http_info(order_id, ...)
|
||||||
|
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
|
||||||
|
local_var_response$content
|
||||||
|
} else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) {
|
||||||
|
local_var_response
|
||||||
|
} else if (local_var_response$status_code >= 400 && local_var_response$status_code <= 499) {
|
||||||
|
local_var_response
|
||||||
|
} else if (local_var_response$status_code >= 500 && local_var_response$status_code <= 599) {
|
||||||
|
local_var_response
|
||||||
|
}
|
||||||
|
},
|
||||||
|
#' Delete purchase order by ID
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Delete purchase order by ID
|
||||||
|
#'
|
||||||
|
#' @param order_id ID of the order that needs to be deleted
|
||||||
|
#' @param ... Other optional arguments
|
||||||
|
#' @return API response (void) with additional information such as HTTP status code, headers
|
||||||
|
#' @export
|
||||||
|
delete_order_with_http_info = function(order_id, ...) {
|
||||||
|
args <- list(...)
|
||||||
|
query_params <- list()
|
||||||
|
header_params <- c()
|
||||||
|
form_params <- list()
|
||||||
|
file_params <- list()
|
||||||
|
local_var_body <- NULL
|
||||||
|
oauth_scopes <- NULL
|
||||||
|
is_oauth <- FALSE
|
||||||
|
|
||||||
|
if (missing(`order_id`)) {
|
||||||
|
rlang::abort(message = "Missing required parameter `order_id`.",
|
||||||
|
.subclass = "ApiException",
|
||||||
|
ApiException = ApiException$new(status = 0,
|
||||||
|
reason = "Missing required parameter `order_id`."))
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
local_var_url_path <- "/store/order/{orderId}"
|
||||||
|
if (!missing(`order_id`)) {
|
||||||
|
local_var_url_path <- gsub(paste0("\\{", "orderId", "\\}"), URLencode(as.character(`order_id`), reserved = TRUE), local_var_url_path)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# The Accept request HTTP header
|
||||||
|
local_var_accepts <- list()
|
||||||
|
|
||||||
|
# The Content-Type representation header
|
||||||
|
local_var_content_types <- list()
|
||||||
|
|
||||||
|
local_var_resp <- self$api_client$CallApi(url = paste0(self$api_client$base_path, local_var_url_path),
|
||||||
|
method = "DELETE",
|
||||||
|
query_params = query_params,
|
||||||
|
header_params = header_params,
|
||||||
|
form_params = form_params,
|
||||||
|
file_params = file_params,
|
||||||
|
accepts = local_var_accepts,
|
||||||
|
content_types = local_var_content_types,
|
||||||
|
body = local_var_body,
|
||||||
|
is_oauth = is_oauth,
|
||||||
|
oauth_scopes = oauth_scopes,
|
||||||
|
...)
|
||||||
|
|
||||||
|
if (local_var_resp$status_code >= 200 && local_var_resp$status_code <= 299) {
|
||||||
|
local_var_resp$content <- NULL
|
||||||
|
local_var_resp
|
||||||
|
} else if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
|
||||||
|
local_var_error_msg <- local_var_resp$response
|
||||||
|
if (local_var_error_msg == "") {
|
||||||
|
local_var_error_msg <- paste("Server returned ", local_var_resp$status_code, " response status code.")
|
||||||
|
}
|
||||||
|
rlang::abort(message = local_var_error_msg,
|
||||||
|
.subclass = "ApiException",
|
||||||
|
ApiException = ApiException$new(http_response = local_var_resp))
|
||||||
|
} else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
|
||||||
|
local_var_error_msg <- local_var_resp$response
|
||||||
|
if (local_var_error_msg == "") {
|
||||||
|
local_var_error_msg <- "Api client exception encountered."
|
||||||
|
}
|
||||||
|
rlang::abort(message = local_var_error_msg,
|
||||||
|
.subclass = "ApiException",
|
||||||
|
ApiException = ApiException$new(http_response = local_var_resp))
|
||||||
|
} else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
|
||||||
|
local_var_error_msg <- local_var_resp$response
|
||||||
|
if (local_var_error_msg == "") {
|
||||||
|
local_var_error_msg <- "Api server exception encountered."
|
||||||
|
}
|
||||||
|
rlang::abort(message = error_msg,
|
||||||
|
.subclass = "ApiException",
|
||||||
|
ApiException = ApiException$new(http_response = local_var_resp))
|
||||||
|
}
|
||||||
|
},
|
||||||
|
#' Returns pet inventories by status
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Returns pet inventories by status
|
||||||
|
#'
|
||||||
|
#' @param data_file (optional) name of the data file to save the result
|
||||||
|
#' @param ... Other optional arguments
|
||||||
|
#' @return map(integer)
|
||||||
|
#' @export
|
||||||
|
get_inventory = function(data_file = NULL, ...) {
|
||||||
|
local_var_response <- self$get_inventory_with_http_info(data_file = data_file, ...)
|
||||||
|
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
|
||||||
|
local_var_response$content
|
||||||
|
} else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) {
|
||||||
|
local_var_response
|
||||||
|
} else if (local_var_response$status_code >= 400 && local_var_response$status_code <= 499) {
|
||||||
|
local_var_response
|
||||||
|
} else if (local_var_response$status_code >= 500 && local_var_response$status_code <= 599) {
|
||||||
|
local_var_response
|
||||||
|
}
|
||||||
|
},
|
||||||
|
#' Returns pet inventories by status
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Returns pet inventories by status
|
||||||
|
#'
|
||||||
|
#' @param data_file (optional) name of the data file to save the result
|
||||||
|
#' @param ... Other optional arguments
|
||||||
|
#' @return API response (map(integer)) with additional information such as HTTP status code, headers
|
||||||
|
#' @export
|
||||||
|
get_inventory_with_http_info = function(data_file = NULL, ...) {
|
||||||
|
args <- list(...)
|
||||||
|
query_params <- list()
|
||||||
|
header_params <- c()
|
||||||
|
form_params <- list()
|
||||||
|
file_params <- list()
|
||||||
|
local_var_body <- NULL
|
||||||
|
oauth_scopes <- NULL
|
||||||
|
is_oauth <- FALSE
|
||||||
|
|
||||||
|
local_var_url_path <- "/store/inventory"
|
||||||
|
# API key authentication
|
||||||
|
if ("api_key" %in% names(self$api_client$api_keys) && nchar(self$api_client$api_keys["api_key"]) > 0) {
|
||||||
|
header_params["api_key"] <- paste(unlist(self$api_client$api_keys["api_key"]), collapse = "")
|
||||||
|
}
|
||||||
|
|
||||||
|
# The Accept request HTTP header
|
||||||
|
local_var_accepts <- list("application/json")
|
||||||
|
|
||||||
|
# The Content-Type representation header
|
||||||
|
local_var_content_types <- list()
|
||||||
|
|
||||||
|
local_var_resp <- self$api_client$CallApi(url = paste0(self$api_client$base_path, local_var_url_path),
|
||||||
|
method = "GET",
|
||||||
|
query_params = query_params,
|
||||||
|
header_params = header_params,
|
||||||
|
form_params = form_params,
|
||||||
|
file_params = file_params,
|
||||||
|
accepts = local_var_accepts,
|
||||||
|
content_types = local_var_content_types,
|
||||||
|
body = local_var_body,
|
||||||
|
is_oauth = is_oauth,
|
||||||
|
oauth_scopes = oauth_scopes,
|
||||||
|
...)
|
||||||
|
|
||||||
|
if (local_var_resp$status_code >= 200 && local_var_resp$status_code <= 299) {
|
||||||
|
# save response in a file
|
||||||
|
if (!is.null(data_file)) {
|
||||||
|
write(local_var_resp$response, data_file)
|
||||||
|
}
|
||||||
|
|
||||||
|
deserialized_resp_obj <- tryCatch(
|
||||||
|
self$api_client$deserialize(local_var_resp$response, "map(integer)", loadNamespace("petstore")),
|
||||||
|
error = function(e) {
|
||||||
|
rlang::abort(message = "Failed to deserialize response",
|
||||||
|
.subclass = "ApiException",
|
||||||
|
ApiException = ApiException$new(http_response = local_var_resp))
|
||||||
|
}
|
||||||
|
)
|
||||||
|
local_var_resp$content <- deserialized_resp_obj
|
||||||
|
local_var_resp
|
||||||
|
} else if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
|
||||||
|
local_var_error_msg <- local_var_resp$response
|
||||||
|
if (local_var_error_msg == "") {
|
||||||
|
local_var_error_msg <- paste("Server returned ", local_var_resp$status_code, " response status code.")
|
||||||
|
}
|
||||||
|
rlang::abort(message = local_var_error_msg,
|
||||||
|
.subclass = "ApiException",
|
||||||
|
ApiException = ApiException$new(http_response = local_var_resp))
|
||||||
|
} else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
|
||||||
|
local_var_error_msg <- local_var_resp$response
|
||||||
|
if (local_var_error_msg == "") {
|
||||||
|
local_var_error_msg <- "Api client exception encountered."
|
||||||
|
}
|
||||||
|
rlang::abort(message = local_var_error_msg,
|
||||||
|
.subclass = "ApiException",
|
||||||
|
ApiException = ApiException$new(http_response = local_var_resp))
|
||||||
|
} else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
|
||||||
|
local_var_error_msg <- local_var_resp$response
|
||||||
|
if (local_var_error_msg == "") {
|
||||||
|
local_var_error_msg <- "Api server exception encountered."
|
||||||
|
}
|
||||||
|
rlang::abort(message = error_msg,
|
||||||
|
.subclass = "ApiException",
|
||||||
|
ApiException = ApiException$new(http_response = local_var_resp))
|
||||||
|
}
|
||||||
|
},
|
||||||
|
#' Find purchase order by ID
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Find purchase order by ID
|
||||||
|
#'
|
||||||
|
#' @param order_id ID of pet that needs to be fetched
|
||||||
|
#' @param data_file (optional) name of the data file to save the result
|
||||||
|
#' @param ... Other optional arguments
|
||||||
|
#' @return Order
|
||||||
|
#' @export
|
||||||
|
get_order_by_id = function(order_id, data_file = NULL, ...) {
|
||||||
|
local_var_response <- self$get_order_by_id_with_http_info(order_id, data_file = data_file, ...)
|
||||||
|
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
|
||||||
|
local_var_response$content
|
||||||
|
} else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) {
|
||||||
|
local_var_response
|
||||||
|
} else if (local_var_response$status_code >= 400 && local_var_response$status_code <= 499) {
|
||||||
|
local_var_response
|
||||||
|
} else if (local_var_response$status_code >= 500 && local_var_response$status_code <= 599) {
|
||||||
|
local_var_response
|
||||||
|
}
|
||||||
|
},
|
||||||
|
#' Find purchase order by ID
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Find purchase order by ID
|
||||||
|
#'
|
||||||
|
#' @param order_id ID of pet that needs to be fetched
|
||||||
|
#' @param data_file (optional) name of the data file to save the result
|
||||||
|
#' @param ... Other optional arguments
|
||||||
|
#' @return API response (Order) with additional information such as HTTP status code, headers
|
||||||
|
#' @export
|
||||||
|
get_order_by_id_with_http_info = function(order_id, data_file = NULL, ...) {
|
||||||
|
args <- list(...)
|
||||||
|
query_params <- list()
|
||||||
|
header_params <- c()
|
||||||
|
form_params <- list()
|
||||||
|
file_params <- list()
|
||||||
|
local_var_body <- NULL
|
||||||
|
oauth_scopes <- NULL
|
||||||
|
is_oauth <- FALSE
|
||||||
|
|
||||||
|
if (missing(`order_id`)) {
|
||||||
|
rlang::abort(message = "Missing required parameter `order_id`.",
|
||||||
|
.subclass = "ApiException",
|
||||||
|
ApiException = ApiException$new(status = 0,
|
||||||
|
reason = "Missing required parameter `order_id`."))
|
||||||
|
}
|
||||||
|
|
||||||
|
if (`order_id` > 5) {
|
||||||
|
rlang::abort(message = "Invalid value for `order_id` when calling StoreApi$get_order_by_id, must be smaller than or equal to 5.",
|
||||||
|
.subclass = "ApiException",
|
||||||
|
ApiException = ApiException$new(status = 0,
|
||||||
|
reason = "Invalid value for `order_id` when calling StoreApi$get_order_by_id, must be smaller than or equal to 5."))
|
||||||
|
}
|
||||||
|
if (`order_id` < 1) {
|
||||||
|
rlang::abort(message = "Invalid value for `order_id` when calling StoreApi$get_order_by_id, must be bigger than or equal to 1.",
|
||||||
|
.subclass = "ApiException",
|
||||||
|
ApiException = ApiException$new(status = 0,
|
||||||
|
reason = "Invalid value for `order_id` when calling StoreApi$get_order_by_id, must be bigger than or equal to 1."))
|
||||||
|
}
|
||||||
|
|
||||||
|
local_var_url_path <- "/store/order/{orderId}"
|
||||||
|
if (!missing(`order_id`)) {
|
||||||
|
local_var_url_path <- gsub(paste0("\\{", "orderId", "\\}"), URLencode(as.character(`order_id`), reserved = TRUE), local_var_url_path)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# The Accept request HTTP header
|
||||||
|
local_var_accepts <- list("application/xml", "application/json")
|
||||||
|
|
||||||
|
# The Content-Type representation header
|
||||||
|
local_var_content_types <- list()
|
||||||
|
|
||||||
|
local_var_resp <- self$api_client$CallApi(url = paste0(self$api_client$base_path, local_var_url_path),
|
||||||
|
method = "GET",
|
||||||
|
query_params = query_params,
|
||||||
|
header_params = header_params,
|
||||||
|
form_params = form_params,
|
||||||
|
file_params = file_params,
|
||||||
|
accepts = local_var_accepts,
|
||||||
|
content_types = local_var_content_types,
|
||||||
|
body = local_var_body,
|
||||||
|
is_oauth = is_oauth,
|
||||||
|
oauth_scopes = oauth_scopes,
|
||||||
|
...)
|
||||||
|
|
||||||
|
if (local_var_resp$status_code >= 200 && local_var_resp$status_code <= 299) {
|
||||||
|
# save response in a file
|
||||||
|
if (!is.null(data_file)) {
|
||||||
|
write(local_var_resp$response, data_file)
|
||||||
|
}
|
||||||
|
|
||||||
|
deserialized_resp_obj <- tryCatch(
|
||||||
|
self$api_client$deserialize(local_var_resp$response, "Order", loadNamespace("petstore")),
|
||||||
|
error = function(e) {
|
||||||
|
rlang::abort(message = "Failed to deserialize response",
|
||||||
|
.subclass = "ApiException",
|
||||||
|
ApiException = ApiException$new(http_response = local_var_resp))
|
||||||
|
}
|
||||||
|
)
|
||||||
|
local_var_resp$content <- deserialized_resp_obj
|
||||||
|
local_var_resp
|
||||||
|
} else if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
|
||||||
|
local_var_error_msg <- local_var_resp$response
|
||||||
|
if (local_var_error_msg == "") {
|
||||||
|
local_var_error_msg <- paste("Server returned ", local_var_resp$status_code, " response status code.")
|
||||||
|
}
|
||||||
|
rlang::abort(message = local_var_error_msg,
|
||||||
|
.subclass = "ApiException",
|
||||||
|
ApiException = ApiException$new(http_response = local_var_resp))
|
||||||
|
} else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
|
||||||
|
local_var_error_msg <- local_var_resp$response
|
||||||
|
if (local_var_error_msg == "") {
|
||||||
|
local_var_error_msg <- "Api client exception encountered."
|
||||||
|
}
|
||||||
|
rlang::abort(message = local_var_error_msg,
|
||||||
|
.subclass = "ApiException",
|
||||||
|
ApiException = ApiException$new(http_response = local_var_resp))
|
||||||
|
} else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
|
||||||
|
local_var_error_msg <- local_var_resp$response
|
||||||
|
if (local_var_error_msg == "") {
|
||||||
|
local_var_error_msg <- "Api server exception encountered."
|
||||||
|
}
|
||||||
|
rlang::abort(message = error_msg,
|
||||||
|
.subclass = "ApiException",
|
||||||
|
ApiException = ApiException$new(http_response = local_var_resp))
|
||||||
|
}
|
||||||
|
},
|
||||||
|
#' Place an order for a pet
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Place an order for a pet
|
||||||
|
#'
|
||||||
|
#' @param order order placed for purchasing the pet
|
||||||
|
#' @param data_file (optional) name of the data file to save the result
|
||||||
|
#' @param ... Other optional arguments
|
||||||
|
#' @return Order
|
||||||
|
#' @export
|
||||||
|
place_order = function(order, data_file = NULL, ...) {
|
||||||
|
local_var_response <- self$place_order_with_http_info(order, data_file = data_file, ...)
|
||||||
|
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
|
||||||
|
local_var_response$content
|
||||||
|
} else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) {
|
||||||
|
local_var_response
|
||||||
|
} else if (local_var_response$status_code >= 400 && local_var_response$status_code <= 499) {
|
||||||
|
local_var_response
|
||||||
|
} else if (local_var_response$status_code >= 500 && local_var_response$status_code <= 599) {
|
||||||
|
local_var_response
|
||||||
|
}
|
||||||
|
},
|
||||||
|
#' Place an order for a pet
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Place an order for a pet
|
||||||
|
#'
|
||||||
|
#' @param order order placed for purchasing the pet
|
||||||
|
#' @param data_file (optional) name of the data file to save the result
|
||||||
|
#' @param ... Other optional arguments
|
||||||
|
#' @return API response (Order) with additional information such as HTTP status code, headers
|
||||||
|
#' @export
|
||||||
|
place_order_with_http_info = function(order, data_file = NULL, ...) {
|
||||||
|
args <- list(...)
|
||||||
|
query_params <- list()
|
||||||
|
header_params <- c()
|
||||||
|
form_params <- list()
|
||||||
|
file_params <- list()
|
||||||
|
local_var_body <- NULL
|
||||||
|
oauth_scopes <- NULL
|
||||||
|
is_oauth <- FALSE
|
||||||
|
|
||||||
|
if (missing(`order`)) {
|
||||||
|
rlang::abort(message = "Missing required parameter `order`.",
|
||||||
|
.subclass = "ApiException",
|
||||||
|
ApiException = ApiException$new(status = 0,
|
||||||
|
reason = "Missing required parameter `order`."))
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (!missing(`order`)) {
|
||||||
|
local_var_body <- `order`$toJSONString()
|
||||||
|
} else {
|
||||||
|
body <- NULL
|
||||||
|
}
|
||||||
|
|
||||||
|
local_var_url_path <- "/store/order"
|
||||||
|
|
||||||
|
# The Accept request HTTP header
|
||||||
|
local_var_accepts <- list("application/xml", "application/json")
|
||||||
|
|
||||||
|
# The Content-Type representation header
|
||||||
|
local_var_content_types <- list("application/json")
|
||||||
|
|
||||||
|
local_var_resp <- self$api_client$CallApi(url = paste0(self$api_client$base_path, local_var_url_path),
|
||||||
|
method = "POST",
|
||||||
|
query_params = query_params,
|
||||||
|
header_params = header_params,
|
||||||
|
form_params = form_params,
|
||||||
|
file_params = file_params,
|
||||||
|
accepts = local_var_accepts,
|
||||||
|
content_types = local_var_content_types,
|
||||||
|
body = local_var_body,
|
||||||
|
is_oauth = is_oauth,
|
||||||
|
oauth_scopes = oauth_scopes,
|
||||||
|
...)
|
||||||
|
|
||||||
|
if (local_var_resp$status_code >= 200 && local_var_resp$status_code <= 299) {
|
||||||
|
# save response in a file
|
||||||
|
if (!is.null(data_file)) {
|
||||||
|
write(local_var_resp$response, data_file)
|
||||||
|
}
|
||||||
|
|
||||||
|
deserialized_resp_obj <- tryCatch(
|
||||||
|
self$api_client$deserialize(local_var_resp$response, "Order", loadNamespace("petstore")),
|
||||||
|
error = function(e) {
|
||||||
|
rlang::abort(message = "Failed to deserialize response",
|
||||||
|
.subclass = "ApiException",
|
||||||
|
ApiException = ApiException$new(http_response = local_var_resp))
|
||||||
|
}
|
||||||
|
)
|
||||||
|
local_var_resp$content <- deserialized_resp_obj
|
||||||
|
local_var_resp
|
||||||
|
} else if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
|
||||||
|
local_var_error_msg <- local_var_resp$response
|
||||||
|
if (local_var_error_msg == "") {
|
||||||
|
local_var_error_msg <- paste("Server returned ", local_var_resp$status_code, " response status code.")
|
||||||
|
}
|
||||||
|
rlang::abort(message = local_var_error_msg,
|
||||||
|
.subclass = "ApiException",
|
||||||
|
ApiException = ApiException$new(http_response = local_var_resp))
|
||||||
|
} else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
|
||||||
|
local_var_error_msg <- local_var_resp$response
|
||||||
|
if (local_var_error_msg == "") {
|
||||||
|
local_var_error_msg <- "Api client exception encountered."
|
||||||
|
}
|
||||||
|
rlang::abort(message = local_var_error_msg,
|
||||||
|
.subclass = "ApiException",
|
||||||
|
ApiException = ApiException$new(http_response = local_var_resp))
|
||||||
|
} else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
|
||||||
|
local_var_error_msg <- local_var_resp$response
|
||||||
|
if (local_var_error_msg == "") {
|
||||||
|
local_var_error_msg <- "Api server exception encountered."
|
||||||
|
}
|
||||||
|
rlang::abort(message = error_msg,
|
||||||
|
.subclass = "ApiException",
|
||||||
|
ApiException = ApiException$new(http_response = local_var_resp))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
167
samples/client/petstore/R-httr2-wrapper/R/tag.R
Normal file
167
samples/client/petstore/R-httr2-wrapper/R/tag.R
Normal file
@@ -0,0 +1,167 @@
|
|||||||
|
#' OpenAPI Petstore
|
||||||
|
#'
|
||||||
|
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||||
|
#'
|
||||||
|
#' The version of the OpenAPI document: 1.0.0
|
||||||
|
#' Generated by: https://openapi-generator.tech
|
||||||
|
#'
|
||||||
|
#' @docType class
|
||||||
|
#' @title Tag
|
||||||
|
#' @description Tag Class
|
||||||
|
#' @format An \code{R6Class} generator object
|
||||||
|
#' @field id integer [optional]
|
||||||
|
#' @field name character [optional]
|
||||||
|
#' @importFrom R6 R6Class
|
||||||
|
#' @importFrom jsonlite fromJSON toJSON
|
||||||
|
#' @export
|
||||||
|
Tag <- R6::R6Class(
|
||||||
|
"Tag",
|
||||||
|
public = list(
|
||||||
|
`id` = NULL,
|
||||||
|
`name` = NULL,
|
||||||
|
#' Initialize a new Tag class.
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Initialize a new Tag class.
|
||||||
|
#'
|
||||||
|
#' @param id id
|
||||||
|
#' @param name name
|
||||||
|
#' @param ... Other optional arguments.
|
||||||
|
#' @export
|
||||||
|
initialize = function(
|
||||||
|
`id` = NULL, `name` = NULL, ...
|
||||||
|
) {
|
||||||
|
if (!is.null(`id`)) {
|
||||||
|
stopifnot(is.numeric(`id`), length(`id`) == 1)
|
||||||
|
self$`id` <- `id`
|
||||||
|
}
|
||||||
|
if (!is.null(`name`)) {
|
||||||
|
stopifnot(is.character(`name`), length(`name`) == 1)
|
||||||
|
self$`name` <- `name`
|
||||||
|
}
|
||||||
|
},
|
||||||
|
#' To JSON string
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' To JSON String
|
||||||
|
#'
|
||||||
|
#' @return Tag in JSON format
|
||||||
|
#' @export
|
||||||
|
toJSON = function() {
|
||||||
|
TagObject <- list()
|
||||||
|
if (!is.null(self$`id`)) {
|
||||||
|
TagObject[["id"]] <-
|
||||||
|
self$`id`
|
||||||
|
}
|
||||||
|
if (!is.null(self$`name`)) {
|
||||||
|
TagObject[["name"]] <-
|
||||||
|
self$`name`
|
||||||
|
}
|
||||||
|
|
||||||
|
TagObject
|
||||||
|
},
|
||||||
|
#' Deserialize JSON string into an instance of Tag
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Deserialize JSON string into an instance of Tag
|
||||||
|
#'
|
||||||
|
#' @param input_json the JSON input
|
||||||
|
#' @return the instance of Tag
|
||||||
|
#' @export
|
||||||
|
fromJSON = function(input_json) {
|
||||||
|
this_object <- jsonlite::fromJSON(input_json)
|
||||||
|
if (!is.null(this_object$`id`)) {
|
||||||
|
self$`id` <- this_object$`id`
|
||||||
|
}
|
||||||
|
if (!is.null(this_object$`name`)) {
|
||||||
|
self$`name` <- this_object$`name`
|
||||||
|
}
|
||||||
|
self
|
||||||
|
},
|
||||||
|
#' To JSON string
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' To JSON String
|
||||||
|
#'
|
||||||
|
#' @return Tag in JSON format
|
||||||
|
#' @export
|
||||||
|
toJSONString = function() {
|
||||||
|
jsoncontent <- c(
|
||||||
|
if (!is.null(self$`id`)) {
|
||||||
|
sprintf(
|
||||||
|
'"id":
|
||||||
|
%d
|
||||||
|
',
|
||||||
|
self$`id`
|
||||||
|
)
|
||||||
|
},
|
||||||
|
if (!is.null(self$`name`)) {
|
||||||
|
sprintf(
|
||||||
|
'"name":
|
||||||
|
"%s"
|
||||||
|
',
|
||||||
|
self$`name`
|
||||||
|
)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
jsoncontent <- paste(jsoncontent, collapse = ",")
|
||||||
|
as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
|
||||||
|
},
|
||||||
|
#' Deserialize JSON string into an instance of Tag
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Deserialize JSON string into an instance of Tag
|
||||||
|
#'
|
||||||
|
#' @param input_json the JSON input
|
||||||
|
#' @return the instance of Tag
|
||||||
|
#' @export
|
||||||
|
fromJSONString = function(input_json) {
|
||||||
|
this_object <- jsonlite::fromJSON(input_json)
|
||||||
|
self$`id` <- this_object$`id`
|
||||||
|
self$`name` <- this_object$`name`
|
||||||
|
self
|
||||||
|
},
|
||||||
|
#' Validate JSON input with respect to Tag
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Validate JSON input with respect to Tag and throw an exception if invalid
|
||||||
|
#'
|
||||||
|
#' @param input the JSON input
|
||||||
|
#' @export
|
||||||
|
validateJSON = function(input) {
|
||||||
|
input_json <- jsonlite::fromJSON(input)
|
||||||
|
},
|
||||||
|
#' To string (JSON format)
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' To string (JSON format)
|
||||||
|
#'
|
||||||
|
#' @return String representation of Tag
|
||||||
|
#' @export
|
||||||
|
toString = function() {
|
||||||
|
self$toJSONString()
|
||||||
|
},
|
||||||
|
#' Return true if the values in all fields are valid.
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Return true if the values in all fields are valid.
|
||||||
|
#'
|
||||||
|
#' @return true if the values in all fields are valid.
|
||||||
|
#' @export
|
||||||
|
isValid = function() {
|
||||||
|
TRUE
|
||||||
|
},
|
||||||
|
#' Return a list of invalid fields (if any).
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Return a list of invalid fields (if any).
|
||||||
|
#'
|
||||||
|
#' @return A list of invalid fields (if any).
|
||||||
|
#' @export
|
||||||
|
getInvalidFields = function() {
|
||||||
|
invalid_fields <- list()
|
||||||
|
invalid_fields
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
168
samples/client/petstore/R-httr2-wrapper/R/update_pet_request.R
Normal file
168
samples/client/petstore/R-httr2-wrapper/R/update_pet_request.R
Normal file
@@ -0,0 +1,168 @@
|
|||||||
|
#' OpenAPI Petstore
|
||||||
|
#'
|
||||||
|
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||||
|
#'
|
||||||
|
#' The version of the OpenAPI document: 1.0.0
|
||||||
|
#' Generated by: https://openapi-generator.tech
|
||||||
|
#'
|
||||||
|
#' @docType class
|
||||||
|
#' @title UpdatePetRequest
|
||||||
|
#' @description UpdatePetRequest Class
|
||||||
|
#' @format An \code{R6Class} generator object
|
||||||
|
#' @field jsonData \link{Pet} [optional]
|
||||||
|
#' @field binaryDataN2Information data.frame [optional]
|
||||||
|
#' @importFrom R6 R6Class
|
||||||
|
#' @importFrom jsonlite fromJSON toJSON
|
||||||
|
#' @export
|
||||||
|
UpdatePetRequest <- R6::R6Class(
|
||||||
|
"UpdatePetRequest",
|
||||||
|
public = list(
|
||||||
|
`jsonData` = NULL,
|
||||||
|
`binaryDataN2Information` = NULL,
|
||||||
|
#' Initialize a new UpdatePetRequest class.
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Initialize a new UpdatePetRequest class.
|
||||||
|
#'
|
||||||
|
#' @param jsonData jsonData
|
||||||
|
#' @param binaryDataN2Information binaryDataN2Information
|
||||||
|
#' @param ... Other optional arguments.
|
||||||
|
#' @export
|
||||||
|
initialize = function(
|
||||||
|
`jsonData` = NULL, `binaryDataN2Information` = NULL, ...
|
||||||
|
) {
|
||||||
|
if (!is.null(`jsonData`)) {
|
||||||
|
stopifnot(R6::is.R6(`jsonData`))
|
||||||
|
self$`jsonData` <- `jsonData`
|
||||||
|
}
|
||||||
|
if (!is.null(`binaryDataN2Information`)) {
|
||||||
|
self$`binaryDataN2Information` <- `binaryDataN2Information`
|
||||||
|
}
|
||||||
|
},
|
||||||
|
#' To JSON string
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' To JSON String
|
||||||
|
#'
|
||||||
|
#' @return UpdatePetRequest in JSON format
|
||||||
|
#' @export
|
||||||
|
toJSON = function() {
|
||||||
|
UpdatePetRequestObject <- list()
|
||||||
|
if (!is.null(self$`jsonData`)) {
|
||||||
|
UpdatePetRequestObject[["jsonData"]] <-
|
||||||
|
self$`jsonData`$toJSON()
|
||||||
|
}
|
||||||
|
if (!is.null(self$`binaryDataN2Information`)) {
|
||||||
|
UpdatePetRequestObject[["binaryDataN2Information"]] <-
|
||||||
|
self$`binaryDataN2Information`
|
||||||
|
}
|
||||||
|
|
||||||
|
UpdatePetRequestObject
|
||||||
|
},
|
||||||
|
#' Deserialize JSON string into an instance of UpdatePetRequest
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Deserialize JSON string into an instance of UpdatePetRequest
|
||||||
|
#'
|
||||||
|
#' @param input_json the JSON input
|
||||||
|
#' @return the instance of UpdatePetRequest
|
||||||
|
#' @export
|
||||||
|
fromJSON = function(input_json) {
|
||||||
|
this_object <- jsonlite::fromJSON(input_json)
|
||||||
|
if (!is.null(this_object$`jsonData`)) {
|
||||||
|
jsondata_object <- Pet$new()
|
||||||
|
jsondata_object$fromJSON(jsonlite::toJSON(this_object$jsonData, auto_unbox = TRUE, digits = NA))
|
||||||
|
self$`jsonData` <- jsondata_object
|
||||||
|
}
|
||||||
|
if (!is.null(this_object$`binaryDataN2Information`)) {
|
||||||
|
self$`binaryDataN2Information` <- this_object$`binaryDataN2Information`
|
||||||
|
}
|
||||||
|
self
|
||||||
|
},
|
||||||
|
#' To JSON string
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' To JSON String
|
||||||
|
#'
|
||||||
|
#' @return UpdatePetRequest in JSON format
|
||||||
|
#' @export
|
||||||
|
toJSONString = function() {
|
||||||
|
jsoncontent <- c(
|
||||||
|
if (!is.null(self$`jsonData`)) {
|
||||||
|
sprintf(
|
||||||
|
'"jsonData":
|
||||||
|
%s
|
||||||
|
',
|
||||||
|
jsonlite::toJSON(self$`jsonData`$toJSON(), auto_unbox = TRUE, digits = NA)
|
||||||
|
)
|
||||||
|
},
|
||||||
|
if (!is.null(self$`binaryDataN2Information`)) {
|
||||||
|
sprintf(
|
||||||
|
'"binaryDataN2Information":
|
||||||
|
"%s"
|
||||||
|
',
|
||||||
|
self$`binaryDataN2Information`
|
||||||
|
)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
jsoncontent <- paste(jsoncontent, collapse = ",")
|
||||||
|
as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
|
||||||
|
},
|
||||||
|
#' Deserialize JSON string into an instance of UpdatePetRequest
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Deserialize JSON string into an instance of UpdatePetRequest
|
||||||
|
#'
|
||||||
|
#' @param input_json the JSON input
|
||||||
|
#' @return the instance of UpdatePetRequest
|
||||||
|
#' @export
|
||||||
|
fromJSONString = function(input_json) {
|
||||||
|
this_object <- jsonlite::fromJSON(input_json)
|
||||||
|
self$`jsonData` <- Pet$new()$fromJSON(jsonlite::toJSON(this_object$jsonData, auto_unbox = TRUE, digits = NA))
|
||||||
|
self$`binaryDataN2Information` <- this_object$`binaryDataN2Information`
|
||||||
|
self
|
||||||
|
},
|
||||||
|
#' Validate JSON input with respect to UpdatePetRequest
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Validate JSON input with respect to UpdatePetRequest and throw an exception if invalid
|
||||||
|
#'
|
||||||
|
#' @param input the JSON input
|
||||||
|
#' @export
|
||||||
|
validateJSON = function(input) {
|
||||||
|
input_json <- jsonlite::fromJSON(input)
|
||||||
|
},
|
||||||
|
#' To string (JSON format)
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' To string (JSON format)
|
||||||
|
#'
|
||||||
|
#' @return String representation of UpdatePetRequest
|
||||||
|
#' @export
|
||||||
|
toString = function() {
|
||||||
|
self$toJSONString()
|
||||||
|
},
|
||||||
|
#' Return true if the values in all fields are valid.
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Return true if the values in all fields are valid.
|
||||||
|
#'
|
||||||
|
#' @return true if the values in all fields are valid.
|
||||||
|
#' @export
|
||||||
|
isValid = function() {
|
||||||
|
TRUE
|
||||||
|
},
|
||||||
|
#' Return a list of invalid fields (if any).
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Return a list of invalid fields (if any).
|
||||||
|
#'
|
||||||
|
#' @return A list of invalid fields (if any).
|
||||||
|
#' @export
|
||||||
|
getInvalidFields = function() {
|
||||||
|
invalid_fields <- list()
|
||||||
|
invalid_fields
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
305
samples/client/petstore/R-httr2-wrapper/R/user.R
Normal file
305
samples/client/petstore/R-httr2-wrapper/R/user.R
Normal file
@@ -0,0 +1,305 @@
|
|||||||
|
#' OpenAPI Petstore
|
||||||
|
#'
|
||||||
|
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||||
|
#'
|
||||||
|
#' The version of the OpenAPI document: 1.0.0
|
||||||
|
#' Generated by: https://openapi-generator.tech
|
||||||
|
#'
|
||||||
|
#' @docType class
|
||||||
|
#' @title User
|
||||||
|
#' @description User Class
|
||||||
|
#' @format An \code{R6Class} generator object
|
||||||
|
#' @field id integer [optional]
|
||||||
|
#' @field username character [optional]
|
||||||
|
#' @field firstName character [optional]
|
||||||
|
#' @field lastName character [optional]
|
||||||
|
#' @field email character [optional]
|
||||||
|
#' @field password character [optional]
|
||||||
|
#' @field phone character [optional]
|
||||||
|
#' @field userStatus integer [optional]
|
||||||
|
#' @importFrom R6 R6Class
|
||||||
|
#' @importFrom jsonlite fromJSON toJSON
|
||||||
|
#' @export
|
||||||
|
User <- R6::R6Class(
|
||||||
|
"User",
|
||||||
|
public = list(
|
||||||
|
`id` = NULL,
|
||||||
|
`username` = NULL,
|
||||||
|
`firstName` = NULL,
|
||||||
|
`lastName` = NULL,
|
||||||
|
`email` = NULL,
|
||||||
|
`password` = NULL,
|
||||||
|
`phone` = NULL,
|
||||||
|
`userStatus` = NULL,
|
||||||
|
#' Initialize a new User class.
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Initialize a new User class.
|
||||||
|
#'
|
||||||
|
#' @param id id
|
||||||
|
#' @param username username
|
||||||
|
#' @param firstName firstName
|
||||||
|
#' @param lastName lastName
|
||||||
|
#' @param email email
|
||||||
|
#' @param password password
|
||||||
|
#' @param phone phone
|
||||||
|
#' @param userStatus User Status
|
||||||
|
#' @param ... Other optional arguments.
|
||||||
|
#' @export
|
||||||
|
initialize = function(
|
||||||
|
`id` = NULL, `username` = NULL, `firstName` = NULL, `lastName` = NULL, `email` = NULL, `password` = NULL, `phone` = NULL, `userStatus` = NULL, ...
|
||||||
|
) {
|
||||||
|
if (!is.null(`id`)) {
|
||||||
|
stopifnot(is.numeric(`id`), length(`id`) == 1)
|
||||||
|
self$`id` <- `id`
|
||||||
|
}
|
||||||
|
if (!is.null(`username`)) {
|
||||||
|
stopifnot(is.character(`username`), length(`username`) == 1)
|
||||||
|
self$`username` <- `username`
|
||||||
|
}
|
||||||
|
if (!is.null(`firstName`)) {
|
||||||
|
stopifnot(is.character(`firstName`), length(`firstName`) == 1)
|
||||||
|
self$`firstName` <- `firstName`
|
||||||
|
}
|
||||||
|
if (!is.null(`lastName`)) {
|
||||||
|
stopifnot(is.character(`lastName`), length(`lastName`) == 1)
|
||||||
|
self$`lastName` <- `lastName`
|
||||||
|
}
|
||||||
|
if (!is.null(`email`)) {
|
||||||
|
stopifnot(is.character(`email`), length(`email`) == 1)
|
||||||
|
self$`email` <- `email`
|
||||||
|
}
|
||||||
|
if (!is.null(`password`)) {
|
||||||
|
stopifnot(is.character(`password`), length(`password`) == 1)
|
||||||
|
self$`password` <- `password`
|
||||||
|
}
|
||||||
|
if (!is.null(`phone`)) {
|
||||||
|
stopifnot(is.character(`phone`), length(`phone`) == 1)
|
||||||
|
self$`phone` <- `phone`
|
||||||
|
}
|
||||||
|
if (!is.null(`userStatus`)) {
|
||||||
|
stopifnot(is.numeric(`userStatus`), length(`userStatus`) == 1)
|
||||||
|
self$`userStatus` <- `userStatus`
|
||||||
|
}
|
||||||
|
},
|
||||||
|
#' To JSON string
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' To JSON String
|
||||||
|
#'
|
||||||
|
#' @return User in JSON format
|
||||||
|
#' @export
|
||||||
|
toJSON = function() {
|
||||||
|
UserObject <- list()
|
||||||
|
if (!is.null(self$`id`)) {
|
||||||
|
UserObject[["id"]] <-
|
||||||
|
self$`id`
|
||||||
|
}
|
||||||
|
if (!is.null(self$`username`)) {
|
||||||
|
UserObject[["username"]] <-
|
||||||
|
self$`username`
|
||||||
|
}
|
||||||
|
if (!is.null(self$`firstName`)) {
|
||||||
|
UserObject[["firstName"]] <-
|
||||||
|
self$`firstName`
|
||||||
|
}
|
||||||
|
if (!is.null(self$`lastName`)) {
|
||||||
|
UserObject[["lastName"]] <-
|
||||||
|
self$`lastName`
|
||||||
|
}
|
||||||
|
if (!is.null(self$`email`)) {
|
||||||
|
UserObject[["email"]] <-
|
||||||
|
self$`email`
|
||||||
|
}
|
||||||
|
if (!is.null(self$`password`)) {
|
||||||
|
UserObject[["password"]] <-
|
||||||
|
self$`password`
|
||||||
|
}
|
||||||
|
if (!is.null(self$`phone`)) {
|
||||||
|
UserObject[["phone"]] <-
|
||||||
|
self$`phone`
|
||||||
|
}
|
||||||
|
if (!is.null(self$`userStatus`)) {
|
||||||
|
UserObject[["userStatus"]] <-
|
||||||
|
self$`userStatus`
|
||||||
|
}
|
||||||
|
|
||||||
|
UserObject
|
||||||
|
},
|
||||||
|
#' Deserialize JSON string into an instance of User
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Deserialize JSON string into an instance of User
|
||||||
|
#'
|
||||||
|
#' @param input_json the JSON input
|
||||||
|
#' @return the instance of User
|
||||||
|
#' @export
|
||||||
|
fromJSON = function(input_json) {
|
||||||
|
this_object <- jsonlite::fromJSON(input_json)
|
||||||
|
if (!is.null(this_object$`id`)) {
|
||||||
|
self$`id` <- this_object$`id`
|
||||||
|
}
|
||||||
|
if (!is.null(this_object$`username`)) {
|
||||||
|
self$`username` <- this_object$`username`
|
||||||
|
}
|
||||||
|
if (!is.null(this_object$`firstName`)) {
|
||||||
|
self$`firstName` <- this_object$`firstName`
|
||||||
|
}
|
||||||
|
if (!is.null(this_object$`lastName`)) {
|
||||||
|
self$`lastName` <- this_object$`lastName`
|
||||||
|
}
|
||||||
|
if (!is.null(this_object$`email`)) {
|
||||||
|
self$`email` <- this_object$`email`
|
||||||
|
}
|
||||||
|
if (!is.null(this_object$`password`)) {
|
||||||
|
self$`password` <- this_object$`password`
|
||||||
|
}
|
||||||
|
if (!is.null(this_object$`phone`)) {
|
||||||
|
self$`phone` <- this_object$`phone`
|
||||||
|
}
|
||||||
|
if (!is.null(this_object$`userStatus`)) {
|
||||||
|
self$`userStatus` <- this_object$`userStatus`
|
||||||
|
}
|
||||||
|
self
|
||||||
|
},
|
||||||
|
#' To JSON string
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' To JSON String
|
||||||
|
#'
|
||||||
|
#' @return User in JSON format
|
||||||
|
#' @export
|
||||||
|
toJSONString = function() {
|
||||||
|
jsoncontent <- c(
|
||||||
|
if (!is.null(self$`id`)) {
|
||||||
|
sprintf(
|
||||||
|
'"id":
|
||||||
|
%d
|
||||||
|
',
|
||||||
|
self$`id`
|
||||||
|
)
|
||||||
|
},
|
||||||
|
if (!is.null(self$`username`)) {
|
||||||
|
sprintf(
|
||||||
|
'"username":
|
||||||
|
"%s"
|
||||||
|
',
|
||||||
|
self$`username`
|
||||||
|
)
|
||||||
|
},
|
||||||
|
if (!is.null(self$`firstName`)) {
|
||||||
|
sprintf(
|
||||||
|
'"firstName":
|
||||||
|
"%s"
|
||||||
|
',
|
||||||
|
self$`firstName`
|
||||||
|
)
|
||||||
|
},
|
||||||
|
if (!is.null(self$`lastName`)) {
|
||||||
|
sprintf(
|
||||||
|
'"lastName":
|
||||||
|
"%s"
|
||||||
|
',
|
||||||
|
self$`lastName`
|
||||||
|
)
|
||||||
|
},
|
||||||
|
if (!is.null(self$`email`)) {
|
||||||
|
sprintf(
|
||||||
|
'"email":
|
||||||
|
"%s"
|
||||||
|
',
|
||||||
|
self$`email`
|
||||||
|
)
|
||||||
|
},
|
||||||
|
if (!is.null(self$`password`)) {
|
||||||
|
sprintf(
|
||||||
|
'"password":
|
||||||
|
"%s"
|
||||||
|
',
|
||||||
|
self$`password`
|
||||||
|
)
|
||||||
|
},
|
||||||
|
if (!is.null(self$`phone`)) {
|
||||||
|
sprintf(
|
||||||
|
'"phone":
|
||||||
|
"%s"
|
||||||
|
',
|
||||||
|
self$`phone`
|
||||||
|
)
|
||||||
|
},
|
||||||
|
if (!is.null(self$`userStatus`)) {
|
||||||
|
sprintf(
|
||||||
|
'"userStatus":
|
||||||
|
%d
|
||||||
|
',
|
||||||
|
self$`userStatus`
|
||||||
|
)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
jsoncontent <- paste(jsoncontent, collapse = ",")
|
||||||
|
as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
|
||||||
|
},
|
||||||
|
#' Deserialize JSON string into an instance of User
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Deserialize JSON string into an instance of User
|
||||||
|
#'
|
||||||
|
#' @param input_json the JSON input
|
||||||
|
#' @return the instance of User
|
||||||
|
#' @export
|
||||||
|
fromJSONString = function(input_json) {
|
||||||
|
this_object <- jsonlite::fromJSON(input_json)
|
||||||
|
self$`id` <- this_object$`id`
|
||||||
|
self$`username` <- this_object$`username`
|
||||||
|
self$`firstName` <- this_object$`firstName`
|
||||||
|
self$`lastName` <- this_object$`lastName`
|
||||||
|
self$`email` <- this_object$`email`
|
||||||
|
self$`password` <- this_object$`password`
|
||||||
|
self$`phone` <- this_object$`phone`
|
||||||
|
self$`userStatus` <- this_object$`userStatus`
|
||||||
|
self
|
||||||
|
},
|
||||||
|
#' Validate JSON input with respect to User
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Validate JSON input with respect to User and throw an exception if invalid
|
||||||
|
#'
|
||||||
|
#' @param input the JSON input
|
||||||
|
#' @export
|
||||||
|
validateJSON = function(input) {
|
||||||
|
input_json <- jsonlite::fromJSON(input)
|
||||||
|
},
|
||||||
|
#' To string (JSON format)
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' To string (JSON format)
|
||||||
|
#'
|
||||||
|
#' @return String representation of User
|
||||||
|
#' @export
|
||||||
|
toString = function() {
|
||||||
|
self$toJSONString()
|
||||||
|
},
|
||||||
|
#' Return true if the values in all fields are valid.
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Return true if the values in all fields are valid.
|
||||||
|
#'
|
||||||
|
#' @return true if the values in all fields are valid.
|
||||||
|
#' @export
|
||||||
|
isValid = function() {
|
||||||
|
TRUE
|
||||||
|
},
|
||||||
|
#' Return a list of invalid fields (if any).
|
||||||
|
#'
|
||||||
|
#' @description
|
||||||
|
#' Return a list of invalid fields (if any).
|
||||||
|
#'
|
||||||
|
#' @return A list of invalid fields (if any).
|
||||||
|
#' @export
|
||||||
|
getInvalidFields = function() {
|
||||||
|
invalid_fields <- list()
|
||||||
|
invalid_fields
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
1328
samples/client/petstore/R-httr2-wrapper/R/user_api.R
Normal file
1328
samples/client/petstore/R-httr2-wrapper/R/user_api.R
Normal file
File diff suppressed because it is too large
Load Diff
144
samples/client/petstore/R-httr2-wrapper/README.md
Normal file
144
samples/client/petstore/R-httr2-wrapper/README.md
Normal file
@@ -0,0 +1,144 @@
|
|||||||
|
# R API client for petstore
|
||||||
|
|
||||||
|
This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||||
|
|
||||||
|
## Overview
|
||||||
|
This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI spec](https://openapis.org) from a remote server, you can easily generate an API client.
|
||||||
|
|
||||||
|
- API version: 1.0.0
|
||||||
|
- Package version: 1.0.0
|
||||||
|
- Build package: org.openapitools.codegen.languages.RClientCodegen
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
### Prerequisites
|
||||||
|
|
||||||
|
Install the dependencies
|
||||||
|
|
||||||
|
```R
|
||||||
|
install.packages("jsonlite")
|
||||||
|
install.packages("httr")
|
||||||
|
install.packages("base64enc")
|
||||||
|
```
|
||||||
|
|
||||||
|
### Build the package
|
||||||
|
|
||||||
|
```sh
|
||||||
|
git clone https://github.com/GIT_USER_ID/GIT_REPO_ID
|
||||||
|
cd GIT_REPO_ID
|
||||||
|
R CMD build .
|
||||||
|
R CMD check petstore_1.0.0.tar.gz --no-manual
|
||||||
|
R CMD INSTALL --preclean petstore_1.0.0.tar.gz
|
||||||
|
```
|
||||||
|
|
||||||
|
### Install the package
|
||||||
|
|
||||||
|
```R
|
||||||
|
install.packages("petstore")
|
||||||
|
```
|
||||||
|
|
||||||
|
To install directly from Github, use `devtools`:
|
||||||
|
```R
|
||||||
|
install.packages("devtools")
|
||||||
|
library(devtools)
|
||||||
|
install_github("GIT_USER_ID/GIT_REPO_ID")
|
||||||
|
```
|
||||||
|
|
||||||
|
To install the package from a local file:
|
||||||
|
```R
|
||||||
|
install.packages("petstore_1.0.0.tar.gz", repos = NULL, type = "source")
|
||||||
|
```
|
||||||
|
|
||||||
|
### Usage
|
||||||
|
|
||||||
|
```R
|
||||||
|
library(petstore)
|
||||||
|
```
|
||||||
|
|
||||||
|
## Documentation for API Endpoints
|
||||||
|
|
||||||
|
All URIs are relative to *http://petstore.swagger.io/v2*
|
||||||
|
|
||||||
|
Class | Method | HTTP request | Description
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
*FakeApi* | [**fake_data_file**](docs/FakeApi.md#fake_data_file) | **GET** /fake/data_file | test data_file to ensure it's escaped correctly
|
||||||
|
*FakeApi* | [**fake_regular_expression**](docs/FakeApi.md#fake_regular_expression) | **GET** /fake/regular_expression | test regular expression to ensure no exception
|
||||||
|
*PetApi* | [**add_pet**](docs/PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store
|
||||||
|
*PetApi* | [**delete_pet**](docs/PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet
|
||||||
|
*PetApi* | [**find_pets_by_status**](docs/PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status
|
||||||
|
*PetApi* | [**find_pets_by_tags**](docs/PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags
|
||||||
|
*PetApi* | [**get_pet_by_id**](docs/PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID
|
||||||
|
*PetApi* | [**get_pet_by_id_streaming**](docs/PetApi.md#get_pet_by_id_streaming) | **GET** /pet/{petId}?streaming | Find pet by ID (streaming)
|
||||||
|
*PetApi* | [**test_header**](docs/PetApi.md#test_header) | **GET** /pet_header_test | Header test
|
||||||
|
*PetApi* | [**update_pet**](docs/PetApi.md#update_pet) | **PUT** /pet | Update an existing pet
|
||||||
|
*PetApi* | [**update_pet_with_form**](docs/PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data
|
||||||
|
*PetApi* | [**upload_file**](docs/PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image
|
||||||
|
*StoreApi* | [**delete_order**](docs/StoreApi.md#delete_order) | **DELETE** /store/order/{orderId} | Delete purchase order by ID
|
||||||
|
*StoreApi* | [**get_inventory**](docs/StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status
|
||||||
|
*StoreApi* | [**get_order_by_id**](docs/StoreApi.md#get_order_by_id) | **GET** /store/order/{orderId} | Find purchase order by ID
|
||||||
|
*StoreApi* | [**place_order**](docs/StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet
|
||||||
|
*UserApi* | [**create_user**](docs/UserApi.md#create_user) | **POST** /user | Create user
|
||||||
|
*UserApi* | [**create_users_with_array_input**](docs/UserApi.md#create_users_with_array_input) | **POST** /user/createWithArray | Creates list of users with given input array
|
||||||
|
*UserApi* | [**create_users_with_list_input**](docs/UserApi.md#create_users_with_list_input) | **POST** /user/createWithList | Creates list of users with given input array
|
||||||
|
*UserApi* | [**delete_user**](docs/UserApi.md#delete_user) | **DELETE** /user/{username} | Delete user
|
||||||
|
*UserApi* | [**get_user_by_name**](docs/UserApi.md#get_user_by_name) | **GET** /user/{username} | Get user by user name
|
||||||
|
*UserApi* | [**login_user**](docs/UserApi.md#login_user) | **GET** /user/login | Logs user into the system
|
||||||
|
*UserApi* | [**logout_user**](docs/UserApi.md#logout_user) | **GET** /user/logout | Logs out current logged in user session
|
||||||
|
*UserApi* | [**update_user**](docs/UserApi.md#update_user) | **PUT** /user/{username} | Updated user
|
||||||
|
|
||||||
|
|
||||||
|
## Documentation for Models
|
||||||
|
|
||||||
|
- [AllofTagApiResponse](docs/AllofTagApiResponse.md)
|
||||||
|
- [Animal](docs/Animal.md)
|
||||||
|
- [AnyOfPig](docs/AnyOfPig.md)
|
||||||
|
- [BasquePig](docs/BasquePig.md)
|
||||||
|
- [Cat](docs/Cat.md)
|
||||||
|
- [CatAllOf](docs/CatAllOf.md)
|
||||||
|
- [Category](docs/Category.md)
|
||||||
|
- [DanishPig](docs/DanishPig.md)
|
||||||
|
- [Dog](docs/Dog.md)
|
||||||
|
- [DogAllOf](docs/DogAllOf.md)
|
||||||
|
- [ModelApiResponse](docs/ModelApiResponse.md)
|
||||||
|
- [NestedOneOf](docs/NestedOneOf.md)
|
||||||
|
- [Order](docs/Order.md)
|
||||||
|
- [Pet](docs/Pet.md)
|
||||||
|
- [Pig](docs/Pig.md)
|
||||||
|
- [Special](docs/Special.md)
|
||||||
|
- [Tag](docs/Tag.md)
|
||||||
|
- [UpdatePetRequest](docs/UpdatePetRequest.md)
|
||||||
|
- [User](docs/User.md)
|
||||||
|
|
||||||
|
|
||||||
|
## Documentation for Authorization
|
||||||
|
|
||||||
|
|
||||||
|
### BearerToken
|
||||||
|
|
||||||
|
- **Type**: Bearer authentication
|
||||||
|
|
||||||
|
### api_key
|
||||||
|
|
||||||
|
- **Type**: API key
|
||||||
|
- **API key parameter name**: api_key
|
||||||
|
- **Location**: HTTP header
|
||||||
|
|
||||||
|
### http_auth
|
||||||
|
|
||||||
|
- **Type**: HTTP basic authentication
|
||||||
|
|
||||||
|
### petstore_auth
|
||||||
|
|
||||||
|
- **Type**: OAuth
|
||||||
|
- **Flow**: implicit
|
||||||
|
- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog
|
||||||
|
- **Scopes**:
|
||||||
|
- write:pets: modify pets in your account
|
||||||
|
- read:pets: read your pets
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Author
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
26
samples/client/petstore/R-httr2-wrapper/build_and_test.bash
Normal file
26
samples/client/petstore/R-httr2-wrapper/build_and_test.bash
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
REPO=https://cloud.r-project.org
|
||||||
|
|
||||||
|
export R_LIBS_USER=$HOME/R
|
||||||
|
|
||||||
|
echo "R lib directory: $R_LIBS_USER"
|
||||||
|
|
||||||
|
mkdir $R_LIBS_USER || true
|
||||||
|
|
||||||
|
Rscript -e "install.packages('jsonlite', repos='$REPO', lib='$R_LIBS_USER')"
|
||||||
|
Rscript -e "install.packages('httr', repos='$REPO', lib='$R_LIBS_USER')"
|
||||||
|
Rscript -e "install.packages('testthat', repos='$REPO', lib='$R_LIBS_USER')"
|
||||||
|
Rscript -e "install.packages('R6', repos='$REPO', lib='$R_LIBS_USER')"
|
||||||
|
Rscript -e "install.packages('base64enc', repos='$REPO', lib='$R_LIBS_USER')"
|
||||||
|
Rscript -e "install.packages('rlang', repos='$REPO', lib='$R_LIBS_USER')"
|
||||||
|
Rscript -e "install.packages('rjson', repos='$REPO', lib='$R_LIBS_USER')"
|
||||||
|
Rscript -e "install.packages('devtools', repos='$REPO', lib='$R_LIBS_USER')"
|
||||||
|
|
||||||
|
rm petstore_1.0.0.tar.gz || true
|
||||||
|
|
||||||
|
R CMD build .
|
||||||
|
R CMD check *tar.gz --no-manual
|
||||||
|
R CMD install --preclean *tar.gz
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
# petstore::AllofTagApiResponse
|
||||||
|
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**id** | **integer** | | [optional]
|
||||||
|
**name** | **character** | | [optional]
|
||||||
|
**code** | **integer** | | [optional]
|
||||||
|
**type** | **character** | | [optional]
|
||||||
|
**message** | **character** | | [optional]
|
||||||
|
|
||||||
|
|
||||||
10
samples/client/petstore/R-httr2-wrapper/docs/Animal.md
Normal file
10
samples/client/petstore/R-httr2-wrapper/docs/Animal.md
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
# petstore::Animal
|
||||||
|
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**className** | **character** | |
|
||||||
|
**color** | **character** | | [optional] [default to "red"]
|
||||||
|
|
||||||
|
|
||||||
11
samples/client/petstore/R-httr2-wrapper/docs/AnyOfPig.md
Normal file
11
samples/client/petstore/R-httr2-wrapper/docs/AnyOfPig.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# petstore::AnyOfPig
|
||||||
|
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**className** | **character** | |
|
||||||
|
**color** | **character** | |
|
||||||
|
**size** | **integer** | |
|
||||||
|
|
||||||
|
|
||||||
10
samples/client/petstore/R-httr2-wrapper/docs/ApiResponse.md
Normal file
10
samples/client/petstore/R-httr2-wrapper/docs/ApiResponse.md
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
# petstore::ApiResponse
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**code** | **integer** | | [optional]
|
||||||
|
**type** | **character** | | [optional]
|
||||||
|
**message** | **character** | | [optional]
|
||||||
|
|
||||||
|
|
||||||
10
samples/client/petstore/R-httr2-wrapper/docs/BasquePig.md
Normal file
10
samples/client/petstore/R-httr2-wrapper/docs/BasquePig.md
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
# petstore::BasquePig
|
||||||
|
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**className** | **character** | |
|
||||||
|
**color** | **character** | |
|
||||||
|
|
||||||
|
|
||||||
11
samples/client/petstore/R-httr2-wrapper/docs/Cat.md
Normal file
11
samples/client/petstore/R-httr2-wrapper/docs/Cat.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# petstore::Cat
|
||||||
|
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**className** | **character** | |
|
||||||
|
**color** | **character** | | [optional] [default to "red"]
|
||||||
|
**declawed** | **character** | | [optional]
|
||||||
|
|
||||||
|
|
||||||
9
samples/client/petstore/R-httr2-wrapper/docs/CatAllOf.md
Normal file
9
samples/client/petstore/R-httr2-wrapper/docs/CatAllOf.md
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
# petstore::CatAllOf
|
||||||
|
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**declawed** | **character** | | [optional]
|
||||||
|
|
||||||
|
|
||||||
11
samples/client/petstore/R-httr2-wrapper/docs/Category.md
Normal file
11
samples/client/petstore/R-httr2-wrapper/docs/Category.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# petstore::Category
|
||||||
|
|
||||||
|
A category for a pet
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**id** | **integer** | | [optional]
|
||||||
|
**name** | **character** | | [optional]
|
||||||
|
|
||||||
|
|
||||||
10
samples/client/petstore/R-httr2-wrapper/docs/DanishPig.md
Normal file
10
samples/client/petstore/R-httr2-wrapper/docs/DanishPig.md
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
# petstore::DanishPig
|
||||||
|
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**className** | **character** | |
|
||||||
|
**size** | **integer** | |
|
||||||
|
|
||||||
|
|
||||||
11
samples/client/petstore/R-httr2-wrapper/docs/Dog.md
Normal file
11
samples/client/petstore/R-httr2-wrapper/docs/Dog.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# petstore::Dog
|
||||||
|
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**className** | **character** | |
|
||||||
|
**color** | **character** | | [optional] [default to "red"]
|
||||||
|
**breed** | **character** | | [optional]
|
||||||
|
|
||||||
|
|
||||||
9
samples/client/petstore/R-httr2-wrapper/docs/DogAllOf.md
Normal file
9
samples/client/petstore/R-httr2-wrapper/docs/DogAllOf.md
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
# petstore::DogAllOf
|
||||||
|
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**breed** | **character** | | [optional]
|
||||||
|
|
||||||
|
|
||||||
124
samples/client/petstore/R-httr2-wrapper/docs/FakeApi.md
Normal file
124
samples/client/petstore/R-httr2-wrapper/docs/FakeApi.md
Normal file
@@ -0,0 +1,124 @@
|
|||||||
|
# FakeApi
|
||||||
|
|
||||||
|
All URIs are relative to *http://petstore.swagger.io/v2*
|
||||||
|
|
||||||
|
Method | HTTP request | Description
|
||||||
|
------------- | ------------- | -------------
|
||||||
|
[**fake_data_file**](FakeApi.md#fake_data_file) | **GET** /fake/data_file | test data_file to ensure it's escaped correctly
|
||||||
|
[**fake_regular_expression**](FakeApi.md#fake_regular_expression) | **GET** /fake/regular_expression | test regular expression to ensure no exception
|
||||||
|
|
||||||
|
|
||||||
|
# **fake_data_file**
|
||||||
|
> User fake_data_file(dummy, var_data_file = var.var_data_file)
|
||||||
|
|
||||||
|
test data_file to ensure it's escaped correctly
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```R
|
||||||
|
library(petstore)
|
||||||
|
|
||||||
|
var_dummy <- "dummy_example" # character | dummy required parameter
|
||||||
|
var_var_data_file <- "var_data_file_example" # character | header data file (Optional)
|
||||||
|
|
||||||
|
#test data_file to ensure it's escaped correctly
|
||||||
|
api_instance <- petstore_api$new()
|
||||||
|
result <- tryCatch(
|
||||||
|
# to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
||||||
|
# api_instance$fake_data_file(var_dummy, var_data_file = var_var_data_file, data_file = "result.txt"),
|
||||||
|
api_instance$fake_api$fake_data_file(var_dummy, var_data_file = var_var_data_file),
|
||||||
|
ApiException = function(ex) ex
|
||||||
|
)
|
||||||
|
# In case of error, print the error object
|
||||||
|
if (!is.null(result$ApiException)) {
|
||||||
|
print("Exception occurs when calling `fake_data_file`:")
|
||||||
|
dput(result$ApiException$toString())
|
||||||
|
# error object
|
||||||
|
dput(result$ApiException$error_object)
|
||||||
|
} else {
|
||||||
|
# deserialized response object
|
||||||
|
print("The response is ...")
|
||||||
|
dput(result$toString())
|
||||||
|
}
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**dummy** | **character**| dummy required parameter |
|
||||||
|
**var_data_file** | **character**| header data file | [optional]
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**User**](User.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
| **200** | successful operation | - |
|
||||||
|
|
||||||
|
# **fake_regular_expression**
|
||||||
|
> fake_regular_expression(reg_exp_test)
|
||||||
|
|
||||||
|
test regular expression to ensure no exception
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```R
|
||||||
|
library(petstore)
|
||||||
|
|
||||||
|
var_reg_exp_test <- "reg_exp_test_example" # character | dummy required parameter
|
||||||
|
|
||||||
|
#test regular expression to ensure no exception
|
||||||
|
api_instance <- petstore_api$new()
|
||||||
|
result <- tryCatch(
|
||||||
|
api_instance$fake_api$fake_regular_expression(var_reg_exp_test),
|
||||||
|
ApiException = function(ex) ex
|
||||||
|
)
|
||||||
|
# In case of error, print the error object
|
||||||
|
if (!is.null(result$ApiException)) {
|
||||||
|
print("Exception occurs when calling `fake_regular_expression`:")
|
||||||
|
dput(result$ApiException$toString())
|
||||||
|
# error object
|
||||||
|
dput(result$ApiException$error_object)
|
||||||
|
}
|
||||||
|
# This endpoint doesn't return data
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**reg_exp_test** | **character**| dummy required parameter |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
void (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
| **200** | successful operation | - |
|
||||||
|
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
# petstore::ModelApiResponse
|
||||||
|
|
||||||
|
Describes the result of uploading an image resource
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**code** | **integer** | | [optional]
|
||||||
|
**type** | **character** | | [optional]
|
||||||
|
**message** | **character** | | [optional]
|
||||||
|
|
||||||
|
|
||||||
10
samples/client/petstore/R-httr2-wrapper/docs/NestedOneOf.md
Normal file
10
samples/client/petstore/R-httr2-wrapper/docs/NestedOneOf.md
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
# petstore::NestedOneOf
|
||||||
|
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**size** | **integer** | | [optional]
|
||||||
|
**nested_pig** | [**Pig**](Pig.md) | | [optional]
|
||||||
|
|
||||||
|
|
||||||
15
samples/client/petstore/R-httr2-wrapper/docs/Order.md
Normal file
15
samples/client/petstore/R-httr2-wrapper/docs/Order.md
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
# petstore::Order
|
||||||
|
|
||||||
|
An order for a pets from the pet store
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**id** | **integer** | | [optional]
|
||||||
|
**petId** | **integer** | | [optional]
|
||||||
|
**quantity** | **integer** | | [optional]
|
||||||
|
**shipDate** | **character** | | [optional]
|
||||||
|
**status** | **character** | Order Status | [optional]
|
||||||
|
**complete** | **character** | | [optional] [default to FALSE]
|
||||||
|
|
||||||
|
|
||||||
15
samples/client/petstore/R-httr2-wrapper/docs/Pet.md
Normal file
15
samples/client/petstore/R-httr2-wrapper/docs/Pet.md
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
# petstore::Pet
|
||||||
|
|
||||||
|
A pet for sale in the pet store
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**id** | **integer** | | [optional]
|
||||||
|
**category** | [**Category**](Category.md) | | [optional]
|
||||||
|
**name** | **character** | |
|
||||||
|
**photoUrls** | **array[character]** | |
|
||||||
|
**tags** | [**array[Tag]**](Tag.md) | | [optional]
|
||||||
|
**status** | **character** | pet status in the store | [optional]
|
||||||
|
|
||||||
|
|
||||||
641
samples/client/petstore/R-httr2-wrapper/docs/PetApi.md
Normal file
641
samples/client/petstore/R-httr2-wrapper/docs/PetApi.md
Normal file
@@ -0,0 +1,641 @@
|
|||||||
|
# PetApi
|
||||||
|
|
||||||
|
All URIs are relative to *http://petstore.swagger.io/v2*
|
||||||
|
|
||||||
|
Method | HTTP request | Description
|
||||||
|
------------- | ------------- | -------------
|
||||||
|
[**add_pet**](PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store
|
||||||
|
[**delete_pet**](PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet
|
||||||
|
[**find_pets_by_status**](PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status
|
||||||
|
[**find_pets_by_tags**](PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags
|
||||||
|
[**get_pet_by_id**](PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID
|
||||||
|
[**get_pet_by_id_streaming**](PetApi.md#get_pet_by_id_streaming) | **GET** /pet/{petId}?streaming | Find pet by ID (streaming)
|
||||||
|
[**test_header**](PetApi.md#test_header) | **GET** /pet_header_test | Header test
|
||||||
|
[**update_pet**](PetApi.md#update_pet) | **PUT** /pet | Update an existing pet
|
||||||
|
[**update_pet_with_form**](PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data
|
||||||
|
[**upload_file**](PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image
|
||||||
|
|
||||||
|
|
||||||
|
# **add_pet**
|
||||||
|
> Pet add_pet(pet)
|
||||||
|
|
||||||
|
Add a new pet to the store
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```R
|
||||||
|
library(petstore)
|
||||||
|
|
||||||
|
var_pet <- Pet$new("name_example", list("photoUrls_example"), 123, Category$new(123, "name_example"), list(Tag$new(123, "name_example")), "available") # Pet | Pet object that needs to be added to the store
|
||||||
|
|
||||||
|
#Add a new pet to the store
|
||||||
|
api_instance <- petstore_api$new()
|
||||||
|
# Configure HTTP basic authorization: http_auth
|
||||||
|
api_instance$api_client$username <- Sys.getenv("USERNAME")
|
||||||
|
api_instance$api_client$password <- Sys.getenv("PASSWORD")
|
||||||
|
result <- tryCatch(
|
||||||
|
# to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
||||||
|
# api_instance$add_pet(var_pet, data_file = "result.txt"),
|
||||||
|
api_instance$pet_api$add_pet(var_pet),
|
||||||
|
ApiException = function(ex) ex
|
||||||
|
)
|
||||||
|
# In case of error, print the error object
|
||||||
|
if (!is.null(result$ApiException)) {
|
||||||
|
print("Exception occurs when calling `add_pet`:")
|
||||||
|
dput(result$ApiException$toString())
|
||||||
|
# error object
|
||||||
|
dput(result$ApiException$error_object)
|
||||||
|
} else {
|
||||||
|
# deserialized response object
|
||||||
|
print("The response is ...")
|
||||||
|
dput(result$toString())
|
||||||
|
}
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**Pet**](Pet.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[http_auth](../README.md#http_auth)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: application/json, application/xml, multipart/related
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
| **200** | successful operation | - |
|
||||||
|
| **405** | Invalid input | - |
|
||||||
|
|
||||||
|
# **delete_pet**
|
||||||
|
> delete_pet(pet_id, api_key = var.api_key)
|
||||||
|
|
||||||
|
Deletes a pet
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```R
|
||||||
|
library(petstore)
|
||||||
|
|
||||||
|
var_pet_id <- 56 # integer | Pet id to delete
|
||||||
|
var_api_key <- "api_key_example" # character | (Optional)
|
||||||
|
|
||||||
|
#Deletes a pet
|
||||||
|
api_instance <- petstore_api$new()
|
||||||
|
# Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
api_instance$api_client$access_token <- Sys.getenv("ACCESS_TOKEN")
|
||||||
|
result <- tryCatch(
|
||||||
|
api_instance$pet_api$delete_pet(var_pet_id, api_key = var_api_key),
|
||||||
|
ApiException = function(ex) ex
|
||||||
|
)
|
||||||
|
# In case of error, print the error object
|
||||||
|
if (!is.null(result$ApiException)) {
|
||||||
|
print("Exception occurs when calling `delete_pet`:")
|
||||||
|
dput(result$ApiException$toString())
|
||||||
|
# error object
|
||||||
|
dput(result$ApiException$error_object)
|
||||||
|
}
|
||||||
|
# This endpoint doesn't return data
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**pet_id** | **integer**| Pet id to delete |
|
||||||
|
**api_key** | **character**| | [optional]
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
void (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
| **400** | Invalid pet value | - |
|
||||||
|
|
||||||
|
# **find_pets_by_status**
|
||||||
|
> array[Pet] find_pets_by_status(status)
|
||||||
|
|
||||||
|
Finds Pets by status
|
||||||
|
|
||||||
|
Multiple status values can be provided with comma separated strings
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```R
|
||||||
|
library(petstore)
|
||||||
|
|
||||||
|
var_status <- list("available") # array[character] | Status values that need to be considered for filter
|
||||||
|
|
||||||
|
#Finds Pets by status
|
||||||
|
api_instance <- petstore_api$new()
|
||||||
|
# Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
api_instance$api_client$access_token <- Sys.getenv("ACCESS_TOKEN")
|
||||||
|
result <- tryCatch(
|
||||||
|
# to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
||||||
|
# api_instance$find_pets_by_status(var_status, data_file = "result.txt"),
|
||||||
|
api_instance$pet_api$find_pets_by_status(var_status),
|
||||||
|
ApiException = function(ex) ex
|
||||||
|
)
|
||||||
|
# In case of error, print the error object
|
||||||
|
if (!is.null(result$ApiException)) {
|
||||||
|
print("Exception occurs when calling `find_pets_by_status`:")
|
||||||
|
dput(result$ApiException$toString())
|
||||||
|
# error object
|
||||||
|
dput(result$ApiException$error_object)
|
||||||
|
} else {
|
||||||
|
# deserialized response object
|
||||||
|
print("The response is ...")
|
||||||
|
dput(result$toString())
|
||||||
|
}
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**status** | Enum [available, pending, sold] | Status values that need to be considered for filter |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**array[Pet]**](Pet.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
| **200** | successful operation | - |
|
||||||
|
| **400** | Invalid status value | - |
|
||||||
|
|
||||||
|
# **find_pets_by_tags**
|
||||||
|
> array[Pet] find_pets_by_tags(tags)
|
||||||
|
|
||||||
|
Finds Pets by tags
|
||||||
|
|
||||||
|
Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```R
|
||||||
|
library(petstore)
|
||||||
|
|
||||||
|
var_tags <- list("inner_example") # array[character] | Tags to filter by
|
||||||
|
|
||||||
|
#Finds Pets by tags
|
||||||
|
api_instance <- petstore_api$new()
|
||||||
|
# Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
api_instance$api_client$access_token <- Sys.getenv("ACCESS_TOKEN")
|
||||||
|
result <- tryCatch(
|
||||||
|
# to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
||||||
|
# api_instance$find_pets_by_tags(var_tags, data_file = "result.txt"),
|
||||||
|
api_instance$pet_api$find_pets_by_tags(var_tags),
|
||||||
|
ApiException = function(ex) ex
|
||||||
|
)
|
||||||
|
# In case of error, print the error object
|
||||||
|
if (!is.null(result$ApiException)) {
|
||||||
|
print("Exception occurs when calling `find_pets_by_tags`:")
|
||||||
|
dput(result$ApiException$toString())
|
||||||
|
# error object
|
||||||
|
dput(result$ApiException$error_object)
|
||||||
|
} else {
|
||||||
|
# deserialized response object
|
||||||
|
print("The response is ...")
|
||||||
|
dput(result$toString())
|
||||||
|
}
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**tags** | list( **character** )| Tags to filter by |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**array[Pet]**](Pet.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
| **200** | successful operation | - |
|
||||||
|
| **400** | Invalid tag value | - |
|
||||||
|
|
||||||
|
# **get_pet_by_id**
|
||||||
|
> Pet get_pet_by_id(pet_id)
|
||||||
|
|
||||||
|
Find pet by ID
|
||||||
|
|
||||||
|
Returns a single pet
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```R
|
||||||
|
library(petstore)
|
||||||
|
|
||||||
|
var_pet_id <- 56 # integer | ID of pet to return
|
||||||
|
|
||||||
|
#Find pet by ID
|
||||||
|
api_instance <- petstore_api$new()
|
||||||
|
# Configure HTTP bearer authorization: BearerToken
|
||||||
|
api_instance$api_client$bearer_token <- Sys.getenv("BEARER_TOKEN")
|
||||||
|
result <- tryCatch(
|
||||||
|
# to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
||||||
|
# api_instance$get_pet_by_id(var_pet_id, data_file = "result.txt"),
|
||||||
|
api_instance$pet_api$get_pet_by_id(var_pet_id),
|
||||||
|
ApiException = function(ex) ex
|
||||||
|
)
|
||||||
|
# In case of error, print the error object
|
||||||
|
if (!is.null(result$ApiException)) {
|
||||||
|
print("Exception occurs when calling `get_pet_by_id`:")
|
||||||
|
dput(result$ApiException$toString())
|
||||||
|
# error object
|
||||||
|
dput(result$ApiException$error_object)
|
||||||
|
} else {
|
||||||
|
# deserialized response object
|
||||||
|
print("The response is ...")
|
||||||
|
dput(result$toString())
|
||||||
|
}
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**pet_id** | **integer**| ID of pet to return |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**Pet**](Pet.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[BearerToken](../README.md#BearerToken)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
| **200** | successful operation | - |
|
||||||
|
| **400** | Invalid ID supplied | - |
|
||||||
|
| **404** | Pet not found | - |
|
||||||
|
|
||||||
|
# **get_pet_by_id_streaming**
|
||||||
|
> Pet get_pet_by_id_streaming(pet_id)
|
||||||
|
|
||||||
|
Find pet by ID (streaming)
|
||||||
|
|
||||||
|
Returns a single pet
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```R
|
||||||
|
library(petstore)
|
||||||
|
|
||||||
|
var_pet_id <- 56 # integer | ID of pet to return
|
||||||
|
|
||||||
|
#Find pet by ID (streaming)
|
||||||
|
api_instance <- petstore_api$new()
|
||||||
|
# Configure API key authorization: api_key
|
||||||
|
api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
||||||
|
result <- tryCatch(
|
||||||
|
# to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
||||||
|
# api_instance$get_pet_by_id_streaming(var_pet_id, data_file = "result.txt"),
|
||||||
|
# this endpoint supports data streaming via a callback function using the optional `stream_callback` parameter, e.g.
|
||||||
|
# api_instance$get_pet_by_id_streaming(var_pet_id, stream_callback = function(x){ print(length(x)) }),
|
||||||
|
api_instance$pet_api$get_pet_by_id_streaming(var_pet_id),
|
||||||
|
ApiException = function(ex) ex
|
||||||
|
)
|
||||||
|
# In case of error, print the error object
|
||||||
|
if (!is.null(result$ApiException)) {
|
||||||
|
print("Exception occurs when calling `get_pet_by_id_streaming`:")
|
||||||
|
dput(result$ApiException$toString())
|
||||||
|
# error object
|
||||||
|
dput(result$ApiException$error_object)
|
||||||
|
} else {
|
||||||
|
# deserialized response object
|
||||||
|
print("The response is ...")
|
||||||
|
dput(result$toString())
|
||||||
|
}
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**pet_id** | **integer**| ID of pet to return |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**Pet**](Pet.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[api_key](../README.md#api_key)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
| **200** | successful operation | - |
|
||||||
|
| **400** | Invalid ID supplied | - |
|
||||||
|
| **404** | Pet not found | - |
|
||||||
|
|
||||||
|
# **test_header**
|
||||||
|
> Pet test_header(header_test_int)
|
||||||
|
|
||||||
|
Header test
|
||||||
|
|
||||||
|
Header test
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```R
|
||||||
|
library(petstore)
|
||||||
|
|
||||||
|
var_header_test_int <- 56 # integer | header test int
|
||||||
|
|
||||||
|
#Header test
|
||||||
|
api_instance <- petstore_api$new()
|
||||||
|
# Configure API key authorization: api_key
|
||||||
|
api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
||||||
|
result <- tryCatch(
|
||||||
|
# to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
||||||
|
# api_instance$test_header(var_header_test_int, data_file = "result.txt"),
|
||||||
|
# this endpoint supports data streaming via a callback function using the optional `stream_callback` parameter, e.g.
|
||||||
|
# api_instance$test_header(var_header_test_int, stream_callback = function(x){ print(length(x)) }),
|
||||||
|
api_instance$pet_api$test_header(var_header_test_int),
|
||||||
|
ApiException = function(ex) ex
|
||||||
|
)
|
||||||
|
# In case of error, print the error object
|
||||||
|
if (!is.null(result$ApiException)) {
|
||||||
|
print("Exception occurs when calling `test_header`:")
|
||||||
|
dput(result$ApiException$toString())
|
||||||
|
# error object
|
||||||
|
dput(result$ApiException$error_object)
|
||||||
|
} else {
|
||||||
|
# deserialized response object
|
||||||
|
print("The response is ...")
|
||||||
|
dput(result$toString())
|
||||||
|
}
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**header_test_int** | **integer**| header test int |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**Pet**](Pet.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[api_key](../README.md#api_key)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
| **200** | successful operation | - |
|
||||||
|
| **400** | Invalid ID supplied | - |
|
||||||
|
| **404** | Pet not found | - |
|
||||||
|
|
||||||
|
# **update_pet**
|
||||||
|
> Pet update_pet(pet)
|
||||||
|
|
||||||
|
Update an existing pet
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```R
|
||||||
|
library(petstore)
|
||||||
|
|
||||||
|
var_pet <- Pet$new("name_example", list("photoUrls_example"), 123, Category$new(123, "name_example"), list(Tag$new(123, "name_example")), "available") # Pet | Pet object that needs to be added to the store
|
||||||
|
|
||||||
|
#Update an existing pet
|
||||||
|
api_instance <- petstore_api$new()
|
||||||
|
# Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
api_instance$api_client$access_token <- Sys.getenv("ACCESS_TOKEN")
|
||||||
|
result <- tryCatch(
|
||||||
|
# to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
||||||
|
# api_instance$update_pet(var_pet, data_file = "result.txt"),
|
||||||
|
api_instance$pet_api$update_pet(var_pet),
|
||||||
|
ApiException = function(ex) ex
|
||||||
|
)
|
||||||
|
# In case of error, print the error object
|
||||||
|
if (!is.null(result$ApiException)) {
|
||||||
|
print("Exception occurs when calling `update_pet`:")
|
||||||
|
dput(result$ApiException$toString())
|
||||||
|
# error object
|
||||||
|
dput(result$ApiException$error_object)
|
||||||
|
} else {
|
||||||
|
# deserialized response object
|
||||||
|
print("The response is ...")
|
||||||
|
dput(result$toString())
|
||||||
|
}
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**Pet**](Pet.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: application/json, application/xml, multipart/related
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
| **200** | successful operation | - |
|
||||||
|
| **400** | Invalid ID supplied | - |
|
||||||
|
| **404** | Pet not found | - |
|
||||||
|
| **405** | Validation exception | - |
|
||||||
|
|
||||||
|
# **update_pet_with_form**
|
||||||
|
> update_pet_with_form(pet_id, name = var.name, status = var.status)
|
||||||
|
|
||||||
|
Updates a pet in the store with form data
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```R
|
||||||
|
library(petstore)
|
||||||
|
|
||||||
|
var_pet_id <- 56 # integer | ID of pet that needs to be updated
|
||||||
|
var_name <- "name_example" # character | Updated name of the pet (Optional)
|
||||||
|
var_status <- "status_example" # character | Updated status of the pet (Optional)
|
||||||
|
|
||||||
|
#Updates a pet in the store with form data
|
||||||
|
api_instance <- petstore_api$new()
|
||||||
|
result <- tryCatch(
|
||||||
|
api_instance$pet_api$update_pet_with_form(var_pet_id, name = var_name, status = var_status),
|
||||||
|
ApiException = function(ex) ex
|
||||||
|
)
|
||||||
|
# In case of error, print the error object
|
||||||
|
if (!is.null(result$ApiException)) {
|
||||||
|
print("Exception occurs when calling `update_pet_with_form`:")
|
||||||
|
dput(result$ApiException$toString())
|
||||||
|
# error object
|
||||||
|
dput(result$ApiException$error_object)
|
||||||
|
}
|
||||||
|
# This endpoint doesn't return data
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**pet_id** | **integer**| ID of pet that needs to be updated |
|
||||||
|
**name** | **character**| Updated name of the pet | [optional]
|
||||||
|
**status** | **character**| Updated status of the pet | [optional]
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
void (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: application/x-www-form-urlencoded
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
| **405** | Invalid input | - |
|
||||||
|
|
||||||
|
# **upload_file**
|
||||||
|
> ModelApiResponse upload_file(pet_id, additional_metadata = var.additional_metadata, file = var.file)
|
||||||
|
|
||||||
|
uploads an image
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```R
|
||||||
|
library(petstore)
|
||||||
|
|
||||||
|
var_pet_id <- 56 # integer | ID of pet to update
|
||||||
|
var_additional_metadata <- "additional_metadata_example" # character | Additional data to pass to server (Optional)
|
||||||
|
var_file <- File.new('/path/to/file') # data.frame | file to upload (Optional)
|
||||||
|
|
||||||
|
#uploads an image
|
||||||
|
api_instance <- petstore_api$new()
|
||||||
|
# Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
api_instance$api_client$access_token <- Sys.getenv("ACCESS_TOKEN")
|
||||||
|
result <- tryCatch(
|
||||||
|
# to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
||||||
|
# api_instance$upload_file(var_pet_id, additional_metadata = var_additional_metadata, file = var_file, data_file = "result.txt"),
|
||||||
|
api_instance$pet_api$upload_file(var_pet_id, additional_metadata = var_additional_metadata, file = var_file),
|
||||||
|
ApiException = function(ex) ex
|
||||||
|
)
|
||||||
|
# In case of error, print the error object
|
||||||
|
if (!is.null(result$ApiException)) {
|
||||||
|
print("Exception occurs when calling `upload_file`:")
|
||||||
|
dput(result$ApiException$toString())
|
||||||
|
# error object
|
||||||
|
dput(result$ApiException$error_object)
|
||||||
|
} else {
|
||||||
|
# deserialized response object
|
||||||
|
print("The response is ...")
|
||||||
|
dput(result$toString())
|
||||||
|
}
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**pet_id** | **integer**| ID of pet to update |
|
||||||
|
**additional_metadata** | **character**| Additional data to pass to server | [optional]
|
||||||
|
**file** | **data.frame**| file to upload | [optional]
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**ModelApiResponse**](ApiResponse.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: multipart/form-data
|
||||||
|
- **Accept**: application/json
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
| **200** | successful operation | - |
|
||||||
|
|
||||||
11
samples/client/petstore/R-httr2-wrapper/docs/Pig.md
Normal file
11
samples/client/petstore/R-httr2-wrapper/docs/Pig.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# petstore::Pig
|
||||||
|
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**className** | **character** | |
|
||||||
|
**color** | **character** | |
|
||||||
|
**size** | **integer** | |
|
||||||
|
|
||||||
|
|
||||||
15
samples/client/petstore/R-httr2-wrapper/docs/Special.md
Normal file
15
samples/client/petstore/R-httr2-wrapper/docs/Special.md
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
# petstore::Special
|
||||||
|
|
||||||
|
Describes the result of uploading an image resource
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**item_self** | **integer** | | [optional]
|
||||||
|
**item_private** | **character** | | [optional]
|
||||||
|
**item_super** | **character** | | [optional]
|
||||||
|
**123_number** | **character** | | [optional]
|
||||||
|
**array[test]** | **character** | | [optional]
|
||||||
|
**empty_string** | **character** | | [optional]
|
||||||
|
|
||||||
|
|
||||||
244
samples/client/petstore/R-httr2-wrapper/docs/StoreApi.md
Normal file
244
samples/client/petstore/R-httr2-wrapper/docs/StoreApi.md
Normal file
@@ -0,0 +1,244 @@
|
|||||||
|
# StoreApi
|
||||||
|
|
||||||
|
All URIs are relative to *http://petstore.swagger.io/v2*
|
||||||
|
|
||||||
|
Method | HTTP request | Description
|
||||||
|
------------- | ------------- | -------------
|
||||||
|
[**delete_order**](StoreApi.md#delete_order) | **DELETE** /store/order/{orderId} | Delete purchase order by ID
|
||||||
|
[**get_inventory**](StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status
|
||||||
|
[**get_order_by_id**](StoreApi.md#get_order_by_id) | **GET** /store/order/{orderId} | Find purchase order by ID
|
||||||
|
[**place_order**](StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet
|
||||||
|
|
||||||
|
|
||||||
|
# **delete_order**
|
||||||
|
> delete_order(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
|
||||||
|
```R
|
||||||
|
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 <- petstore_api$new()
|
||||||
|
result <- tryCatch(
|
||||||
|
api_instance$store_api$delete_order(var_order_id),
|
||||||
|
ApiException = function(ex) ex
|
||||||
|
)
|
||||||
|
# In case of error, print the error object
|
||||||
|
if (!is.null(result$ApiException)) {
|
||||||
|
print("Exception occurs when calling `delete_order`:")
|
||||||
|
dput(result$ApiException$toString())
|
||||||
|
# error object
|
||||||
|
dput(result$ApiException$error_object)
|
||||||
|
}
|
||||||
|
# This endpoint doesn't return data
|
||||||
|
```
|
||||||
|
|
||||||
|
### 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
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
| **400** | Invalid ID supplied | - |
|
||||||
|
| **404** | Order not found | - |
|
||||||
|
|
||||||
|
# **get_inventory**
|
||||||
|
> map(integer) get_inventory()
|
||||||
|
|
||||||
|
Returns pet inventories by status
|
||||||
|
|
||||||
|
Returns a map of status codes to quantities
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```R
|
||||||
|
library(petstore)
|
||||||
|
|
||||||
|
|
||||||
|
#Returns pet inventories by status
|
||||||
|
api_instance <- petstore_api$new()
|
||||||
|
# Configure API key authorization: api_key
|
||||||
|
api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
||||||
|
result <- tryCatch(
|
||||||
|
# to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
||||||
|
# api_instance$get_inventory(data_file = "result.txt"),
|
||||||
|
api_instance$store_api$get_inventory(),
|
||||||
|
ApiException = function(ex) ex
|
||||||
|
)
|
||||||
|
# In case of error, print the error object
|
||||||
|
if (!is.null(result$ApiException)) {
|
||||||
|
print("Exception occurs when calling `get_inventory`:")
|
||||||
|
dput(result$ApiException$toString())
|
||||||
|
# error object
|
||||||
|
dput(result$ApiException$error_object)
|
||||||
|
} else {
|
||||||
|
# deserialized response object
|
||||||
|
print("The response is ...")
|
||||||
|
dput(result$toString())
|
||||||
|
}
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
This endpoint does not need any parameter.
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
**map(integer)**
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[api_key](../README.md#api_key)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/json
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
| **200** | successful operation | - |
|
||||||
|
|
||||||
|
# **get_order_by_id**
|
||||||
|
> Order get_order_by_id(order_id)
|
||||||
|
|
||||||
|
Find purchase order by ID
|
||||||
|
|
||||||
|
For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```R
|
||||||
|
library(petstore)
|
||||||
|
|
||||||
|
var_order_id <- 56 # integer | ID of pet that needs to be fetched
|
||||||
|
|
||||||
|
#Find purchase order by ID
|
||||||
|
api_instance <- petstore_api$new()
|
||||||
|
result <- tryCatch(
|
||||||
|
# to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
||||||
|
# api_instance$get_order_by_id(var_order_id, data_file = "result.txt"),
|
||||||
|
api_instance$store_api$get_order_by_id(var_order_id),
|
||||||
|
ApiException = function(ex) ex
|
||||||
|
)
|
||||||
|
# In case of error, print the error object
|
||||||
|
if (!is.null(result$ApiException)) {
|
||||||
|
print("Exception occurs when calling `get_order_by_id`:")
|
||||||
|
dput(result$ApiException$toString())
|
||||||
|
# error object
|
||||||
|
dput(result$ApiException$error_object)
|
||||||
|
} else {
|
||||||
|
# deserialized response object
|
||||||
|
print("The response is ...")
|
||||||
|
dput(result$toString())
|
||||||
|
}
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**order_id** | **integer**| ID of pet that needs to be fetched |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**Order**](Order.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
| **200** | successful operation | - |
|
||||||
|
| **400** | Invalid ID supplied | - |
|
||||||
|
| **404** | Order not found | - |
|
||||||
|
|
||||||
|
# **place_order**
|
||||||
|
> Order place_order(order)
|
||||||
|
|
||||||
|
Place an order for a pet
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```R
|
||||||
|
library(petstore)
|
||||||
|
|
||||||
|
var_order <- Order$new(123, 123, 123, "shipDate_example", "placed", "complete_example") # Order | order placed for purchasing the pet
|
||||||
|
|
||||||
|
#Place an order for a pet
|
||||||
|
api_instance <- petstore_api$new()
|
||||||
|
result <- tryCatch(
|
||||||
|
# to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
||||||
|
# api_instance$place_order(var_order, data_file = "result.txt"),
|
||||||
|
api_instance$store_api$place_order(var_order),
|
||||||
|
ApiException = function(ex) ex
|
||||||
|
)
|
||||||
|
# In case of error, print the error object
|
||||||
|
if (!is.null(result$ApiException)) {
|
||||||
|
print("Exception occurs when calling `place_order`:")
|
||||||
|
dput(result$ApiException$toString())
|
||||||
|
# error object
|
||||||
|
dput(result$ApiException$error_object)
|
||||||
|
} else {
|
||||||
|
# deserialized response object
|
||||||
|
print("The response is ...")
|
||||||
|
dput(result$toString())
|
||||||
|
}
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**order** | [**Order**](Order.md)| order placed for purchasing the pet |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**Order**](Order.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: application/json
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
| **200** | successful operation | - |
|
||||||
|
| **400** | Invalid Order | - |
|
||||||
|
|
||||||
11
samples/client/petstore/R-httr2-wrapper/docs/Tag.md
Normal file
11
samples/client/petstore/R-httr2-wrapper/docs/Tag.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# petstore::Tag
|
||||||
|
|
||||||
|
A tag for a pet
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**id** | **integer** | | [optional]
|
||||||
|
**name** | **character** | | [optional]
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
# petstore::UpdatePetRequest
|
||||||
|
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**jsonData** | [**Pet**](Pet.md) | | [optional]
|
||||||
|
**binaryDataN2Information** | **data.frame** | | [optional]
|
||||||
|
|
||||||
|
|
||||||
17
samples/client/petstore/R-httr2-wrapper/docs/User.md
Normal file
17
samples/client/petstore/R-httr2-wrapper/docs/User.md
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
# petstore::User
|
||||||
|
|
||||||
|
A User who is purchasing from the pet store
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**id** | **integer** | | [optional]
|
||||||
|
**username** | **character** | | [optional]
|
||||||
|
**firstName** | **character** | | [optional]
|
||||||
|
**lastName** | **character** | | [optional]
|
||||||
|
**email** | **character** | | [optional]
|
||||||
|
**password** | **character** | | [optional]
|
||||||
|
**phone** | **character** | | [optional]
|
||||||
|
**userStatus** | **integer** | User Status | [optional]
|
||||||
|
|
||||||
|
|
||||||
469
samples/client/petstore/R-httr2-wrapper/docs/UserApi.md
Normal file
469
samples/client/petstore/R-httr2-wrapper/docs/UserApi.md
Normal file
@@ -0,0 +1,469 @@
|
|||||||
|
# UserApi
|
||||||
|
|
||||||
|
All URIs are relative to *http://petstore.swagger.io/v2*
|
||||||
|
|
||||||
|
Method | HTTP request | Description
|
||||||
|
------------- | ------------- | -------------
|
||||||
|
[**create_user**](UserApi.md#create_user) | **POST** /user | Create user
|
||||||
|
[**create_users_with_array_input**](UserApi.md#create_users_with_array_input) | **POST** /user/createWithArray | Creates list of users with given input array
|
||||||
|
[**create_users_with_list_input**](UserApi.md#create_users_with_list_input) | **POST** /user/createWithList | Creates list of users with given input array
|
||||||
|
[**delete_user**](UserApi.md#delete_user) | **DELETE** /user/{username} | Delete user
|
||||||
|
[**get_user_by_name**](UserApi.md#get_user_by_name) | **GET** /user/{username} | Get user by user name
|
||||||
|
[**login_user**](UserApi.md#login_user) | **GET** /user/login | Logs user into the system
|
||||||
|
[**logout_user**](UserApi.md#logout_user) | **GET** /user/logout | Logs out current logged in user session
|
||||||
|
[**update_user**](UserApi.md#update_user) | **PUT** /user/{username} | Updated user
|
||||||
|
|
||||||
|
|
||||||
|
# **create_user**
|
||||||
|
> create_user(user)
|
||||||
|
|
||||||
|
Create user
|
||||||
|
|
||||||
|
This can only be done by the logged in user.
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```R
|
||||||
|
library(petstore)
|
||||||
|
|
||||||
|
var_user <- User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123) # User | Created user object
|
||||||
|
|
||||||
|
#Create user
|
||||||
|
api_instance <- petstore_api$new()
|
||||||
|
# Configure API key authorization: api_key
|
||||||
|
api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
||||||
|
result <- tryCatch(
|
||||||
|
api_instance$user_api$create_user(var_user),
|
||||||
|
ApiException = function(ex) ex
|
||||||
|
)
|
||||||
|
# In case of error, print the error object
|
||||||
|
if (!is.null(result$ApiException)) {
|
||||||
|
print("Exception occurs when calling `create_user`:")
|
||||||
|
dput(result$ApiException$toString())
|
||||||
|
# error object
|
||||||
|
dput(result$ApiException$error_object)
|
||||||
|
}
|
||||||
|
# This endpoint doesn't return data
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**user** | [**User**](User.md)| Created user object |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
void (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[api_key](../README.md#api_key)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: application/json
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
| **0** | successful operation | - |
|
||||||
|
|
||||||
|
# **create_users_with_array_input**
|
||||||
|
> create_users_with_array_input(user)
|
||||||
|
|
||||||
|
Creates list of users with given input array
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```R
|
||||||
|
library(petstore)
|
||||||
|
|
||||||
|
var_user <- list(User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123)) # array[User] | List of user object
|
||||||
|
|
||||||
|
#Creates list of users with given input array
|
||||||
|
api_instance <- petstore_api$new()
|
||||||
|
# Configure API key authorization: api_key
|
||||||
|
api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
||||||
|
result <- tryCatch(
|
||||||
|
api_instance$user_api$create_users_with_array_input(var_user),
|
||||||
|
ApiException = function(ex) ex
|
||||||
|
)
|
||||||
|
# In case of error, print the error object
|
||||||
|
if (!is.null(result$ApiException)) {
|
||||||
|
print("Exception occurs when calling `create_users_with_array_input`:")
|
||||||
|
dput(result$ApiException$toString())
|
||||||
|
# error object
|
||||||
|
dput(result$ApiException$error_object)
|
||||||
|
}
|
||||||
|
# This endpoint doesn't return data
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**user** | list( [**User**](User.md) )| List of user object |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
void (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[api_key](../README.md#api_key)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: application/json
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
| **0** | successful operation | - |
|
||||||
|
|
||||||
|
# **create_users_with_list_input**
|
||||||
|
> create_users_with_list_input(user)
|
||||||
|
|
||||||
|
Creates list of users with given input array
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```R
|
||||||
|
library(petstore)
|
||||||
|
|
||||||
|
var_user <- list(User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123)) # array[User] | List of user object
|
||||||
|
|
||||||
|
#Creates list of users with given input array
|
||||||
|
api_instance <- petstore_api$new()
|
||||||
|
# Configure API key authorization: api_key
|
||||||
|
api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
||||||
|
result <- tryCatch(
|
||||||
|
api_instance$user_api$create_users_with_list_input(var_user),
|
||||||
|
ApiException = function(ex) ex
|
||||||
|
)
|
||||||
|
# In case of error, print the error object
|
||||||
|
if (!is.null(result$ApiException)) {
|
||||||
|
print("Exception occurs when calling `create_users_with_list_input`:")
|
||||||
|
dput(result$ApiException$toString())
|
||||||
|
# error object
|
||||||
|
dput(result$ApiException$error_object)
|
||||||
|
}
|
||||||
|
# This endpoint doesn't return data
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**user** | list( [**User**](User.md) )| List of user object |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
void (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[api_key](../README.md#api_key)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: application/json
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
| **0** | successful operation | - |
|
||||||
|
|
||||||
|
# **delete_user**
|
||||||
|
> delete_user(username)
|
||||||
|
|
||||||
|
Delete user
|
||||||
|
|
||||||
|
This can only be done by the logged in user.
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```R
|
||||||
|
library(petstore)
|
||||||
|
|
||||||
|
var_username <- "username_example" # character | The name that needs to be deleted
|
||||||
|
|
||||||
|
#Delete user
|
||||||
|
api_instance <- petstore_api$new()
|
||||||
|
# Configure API key authorization: api_key
|
||||||
|
api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
||||||
|
result <- tryCatch(
|
||||||
|
api_instance$user_api$delete_user(var_username),
|
||||||
|
ApiException = function(ex) ex
|
||||||
|
)
|
||||||
|
# In case of error, print the error object
|
||||||
|
if (!is.null(result$ApiException)) {
|
||||||
|
print("Exception occurs when calling `delete_user`:")
|
||||||
|
dput(result$ApiException$toString())
|
||||||
|
# error object
|
||||||
|
dput(result$ApiException$error_object)
|
||||||
|
}
|
||||||
|
# This endpoint doesn't return data
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**username** | **character**| The name that needs to be deleted |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
void (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[api_key](../README.md#api_key)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
| **400** | Invalid username supplied | - |
|
||||||
|
| **404** | User not found | - |
|
||||||
|
|
||||||
|
# **get_user_by_name**
|
||||||
|
> User get_user_by_name(username)
|
||||||
|
|
||||||
|
Get user by user name
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```R
|
||||||
|
library(petstore)
|
||||||
|
|
||||||
|
var_username <- "username_example" # character | The name that needs to be fetched. Use user1 for testing.
|
||||||
|
|
||||||
|
#Get user by user name
|
||||||
|
api_instance <- petstore_api$new()
|
||||||
|
result <- tryCatch(
|
||||||
|
# to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
||||||
|
# api_instance$get_user_by_name(var_username, data_file = "result.txt"),
|
||||||
|
api_instance$user_api$get_user_by_name(var_username),
|
||||||
|
ApiException = function(ex) ex
|
||||||
|
)
|
||||||
|
# In case of error, print the error object
|
||||||
|
if (!is.null(result$ApiException)) {
|
||||||
|
print("Exception occurs when calling `get_user_by_name`:")
|
||||||
|
dput(result$ApiException$toString())
|
||||||
|
# error object
|
||||||
|
dput(result$ApiException$error_object)
|
||||||
|
} else {
|
||||||
|
# deserialized response object
|
||||||
|
print("The response is ...")
|
||||||
|
dput(result$toString())
|
||||||
|
}
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**username** | **character**| The name that needs to be fetched. Use user1 for testing. |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**User**](User.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
| **200** | successful operation | - |
|
||||||
|
| **400** | Invalid username supplied | - |
|
||||||
|
| **404** | User not found | - |
|
||||||
|
|
||||||
|
# **login_user**
|
||||||
|
> character login_user(username, password)
|
||||||
|
|
||||||
|
Logs user into the system
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```R
|
||||||
|
library(petstore)
|
||||||
|
|
||||||
|
var_username <- "username_example" # character | The user name for login
|
||||||
|
var_password <- "password_example" # character | The password for login in clear text
|
||||||
|
|
||||||
|
#Logs user into the system
|
||||||
|
api_instance <- petstore_api$new()
|
||||||
|
result <- tryCatch(
|
||||||
|
# to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
||||||
|
# api_instance$login_user(var_username, var_password, data_file = "result.txt"),
|
||||||
|
api_instance$user_api$login_user(var_username, var_password),
|
||||||
|
ApiException = function(ex) ex
|
||||||
|
)
|
||||||
|
# In case of error, print the error object
|
||||||
|
if (!is.null(result$ApiException)) {
|
||||||
|
print("Exception occurs when calling `login_user`:")
|
||||||
|
dput(result$ApiException$toString())
|
||||||
|
# error object
|
||||||
|
dput(result$ApiException$error_object)
|
||||||
|
} else {
|
||||||
|
# deserialized response object
|
||||||
|
print("The response is ...")
|
||||||
|
dput(result$toString())
|
||||||
|
}
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**username** | **character**| The user name for login |
|
||||||
|
**password** | **character**| The password for login in clear text |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
**character**
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
| **200** | successful operation | * Set-Cookie - Cookie authentication key for use with the `api_key` apiKey authentication. <br> * X-Rate-Limit - calls per hour allowed by the user <br> * X-Expires-After - date in UTC when token expires <br> |
|
||||||
|
| **400** | Invalid username/password supplied | - |
|
||||||
|
|
||||||
|
# **logout_user**
|
||||||
|
> logout_user()
|
||||||
|
|
||||||
|
Logs out current logged in user session
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```R
|
||||||
|
library(petstore)
|
||||||
|
|
||||||
|
|
||||||
|
#Logs out current logged in user session
|
||||||
|
api_instance <- petstore_api$new()
|
||||||
|
# Configure API key authorization: api_key
|
||||||
|
api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
||||||
|
result <- tryCatch(
|
||||||
|
api_instance$user_api$logout_user(),
|
||||||
|
ApiException = function(ex) ex
|
||||||
|
)
|
||||||
|
# In case of error, print the error object
|
||||||
|
if (!is.null(result$ApiException)) {
|
||||||
|
print("Exception occurs when calling `logout_user`:")
|
||||||
|
dput(result$ApiException$toString())
|
||||||
|
# error object
|
||||||
|
dput(result$ApiException$error_object)
|
||||||
|
}
|
||||||
|
# This endpoint doesn't return data
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
This endpoint does not need any parameter.
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
void (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[api_key](../README.md#api_key)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
| **0** | successful operation | - |
|
||||||
|
|
||||||
|
# **update_user**
|
||||||
|
> update_user(username, user)
|
||||||
|
|
||||||
|
Updated user
|
||||||
|
|
||||||
|
This can only be done by the logged in user.
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```R
|
||||||
|
library(petstore)
|
||||||
|
|
||||||
|
var_username <- "username_example" # character | name that need to be deleted
|
||||||
|
var_user <- User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123) # User | Updated user object
|
||||||
|
|
||||||
|
#Updated user
|
||||||
|
api_instance <- petstore_api$new()
|
||||||
|
# Configure API key authorization: api_key
|
||||||
|
api_instance$api_client$api_keys["api_key"] <- Sys.getenv("API_KEY")
|
||||||
|
result <- tryCatch(
|
||||||
|
api_instance$user_api$update_user(var_username, var_user),
|
||||||
|
ApiException = function(ex) ex
|
||||||
|
)
|
||||||
|
# In case of error, print the error object
|
||||||
|
if (!is.null(result$ApiException)) {
|
||||||
|
print("Exception occurs when calling `update_user`:")
|
||||||
|
dput(result$ApiException$toString())
|
||||||
|
# error object
|
||||||
|
dput(result$ApiException$error_object)
|
||||||
|
}
|
||||||
|
# This endpoint doesn't return data
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**username** | **character**| name that need to be deleted |
|
||||||
|
**user** | [**User**](User.md)| Updated user object |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
void (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[api_key](../README.md#api_key)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: application/json
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
| **400** | Invalid user supplied | - |
|
||||||
|
| **404** | User not found | - |
|
||||||
|
|
||||||
57
samples/client/petstore/R-httr2-wrapper/git_push.sh
Normal file
57
samples/client/petstore/R-httr2-wrapper/git_push.sh
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
|
||||||
|
#
|
||||||
|
# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com"
|
||||||
|
|
||||||
|
git_user_id=$1
|
||||||
|
git_repo_id=$2
|
||||||
|
release_note=$3
|
||||||
|
git_host=$4
|
||||||
|
|
||||||
|
if [ "$git_host" = "" ]; then
|
||||||
|
git_host="github.com"
|
||||||
|
echo "[INFO] No command line input provided. Set \$git_host to $git_host"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$git_user_id" = "" ]; then
|
||||||
|
git_user_id="GIT_USER_ID"
|
||||||
|
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$git_repo_id" = "" ]; then
|
||||||
|
git_repo_id="GIT_REPO_ID"
|
||||||
|
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$release_note" = "" ]; then
|
||||||
|
release_note="Minor update"
|
||||||
|
echo "[INFO] No command line input provided. Set \$release_note to $release_note"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Initialize the local directory as a Git repository
|
||||||
|
git init
|
||||||
|
|
||||||
|
# Adds the files in the local repository and stages them for commit.
|
||||||
|
git add .
|
||||||
|
|
||||||
|
# Commits the tracked changes and prepares them to be pushed to a remote repository.
|
||||||
|
git commit -m "$release_note"
|
||||||
|
|
||||||
|
# Sets the new remote
|
||||||
|
git_remote=$(git remote)
|
||||||
|
if [ "$git_remote" = "" ]; then # git remote not defined
|
||||||
|
|
||||||
|
if [ "$GIT_TOKEN" = "" ]; then
|
||||||
|
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
|
||||||
|
git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
|
||||||
|
else
|
||||||
|
git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git
|
||||||
|
fi
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
git pull origin master
|
||||||
|
|
||||||
|
# Pushes (Forces) the changes in the local repository up to the remote repository
|
||||||
|
echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
|
||||||
|
git push origin master 2>&1 | grep -v 'To https'
|
||||||
@@ -0,0 +1,196 @@
|
|||||||
|
% Generated by roxygen2: do not edit by hand
|
||||||
|
% Please edit documentation in R/allof_tag_api_response.R
|
||||||
|
\docType{class}
|
||||||
|
\name{AllofTagApiResponse}
|
||||||
|
\alias{AllofTagApiResponse}
|
||||||
|
\title{AllofTagApiResponse}
|
||||||
|
\format{
|
||||||
|
An \code{R6Class} generator object
|
||||||
|
}
|
||||||
|
\description{
|
||||||
|
AllofTagApiResponse Class
|
||||||
|
}
|
||||||
|
\details{
|
||||||
|
OpenAPI Petstore
|
||||||
|
|
||||||
|
This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
}
|
||||||
|
\section{Public fields}{
|
||||||
|
\if{html}{\out{<div class="r6-fields">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{id}}{integer [optional]}
|
||||||
|
|
||||||
|
\item{\code{name}}{character [optional]}
|
||||||
|
|
||||||
|
\item{\code{code}}{integer [optional]}
|
||||||
|
|
||||||
|
\item{\code{type}}{character [optional]}
|
||||||
|
|
||||||
|
\item{\code{message}}{character [optional]}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\section{Methods}{
|
||||||
|
\subsection{Public methods}{
|
||||||
|
\itemize{
|
||||||
|
\item \href{#method-AllofTagApiResponse-new}{\code{AllofTagApiResponse$new()}}
|
||||||
|
\item \href{#method-AllofTagApiResponse-toJSON}{\code{AllofTagApiResponse$toJSON()}}
|
||||||
|
\item \href{#method-AllofTagApiResponse-fromJSON}{\code{AllofTagApiResponse$fromJSON()}}
|
||||||
|
\item \href{#method-AllofTagApiResponse-toJSONString}{\code{AllofTagApiResponse$toJSONString()}}
|
||||||
|
\item \href{#method-AllofTagApiResponse-fromJSONString}{\code{AllofTagApiResponse$fromJSONString()}}
|
||||||
|
\item \href{#method-AllofTagApiResponse-validateJSON}{\code{AllofTagApiResponse$validateJSON()}}
|
||||||
|
\item \href{#method-AllofTagApiResponse-toString}{\code{AllofTagApiResponse$toString()}}
|
||||||
|
\item \href{#method-AllofTagApiResponse-clone}{\code{AllofTagApiResponse$clone()}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-AllofTagApiResponse-new"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-AllofTagApiResponse-new}{}}}
|
||||||
|
\subsection{Method \code{new()}}{
|
||||||
|
Initialize a new AllofTagApiResponse class.
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{AllofTagApiResponse$new(
|
||||||
|
id = NULL,
|
||||||
|
name = NULL,
|
||||||
|
code = NULL,
|
||||||
|
type = NULL,
|
||||||
|
message = NULL,
|
||||||
|
...
|
||||||
|
)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{id}}{id}
|
||||||
|
|
||||||
|
\item{\code{name}}{name}
|
||||||
|
|
||||||
|
\item{\code{code}}{code}
|
||||||
|
|
||||||
|
\item{\code{type}}{type}
|
||||||
|
|
||||||
|
\item{\code{message}}{message}
|
||||||
|
|
||||||
|
\item{\code{...}}{Other optional arguments.}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-AllofTagApiResponse-toJSON"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-AllofTagApiResponse-toJSON}{}}}
|
||||||
|
\subsection{Method \code{toJSON()}}{
|
||||||
|
To JSON String
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{AllofTagApiResponse$toJSON()}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Returns}{
|
||||||
|
AllofTagApiResponse in JSON format
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-AllofTagApiResponse-fromJSON"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-AllofTagApiResponse-fromJSON}{}}}
|
||||||
|
\subsection{Method \code{fromJSON()}}{
|
||||||
|
Deserialize JSON string into an instance of AllofTagApiResponse
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{AllofTagApiResponse$fromJSON(input_json)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{input_json}}{the JSON input}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\subsection{Returns}{
|
||||||
|
the instance of AllofTagApiResponse
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-AllofTagApiResponse-toJSONString"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-AllofTagApiResponse-toJSONString}{}}}
|
||||||
|
\subsection{Method \code{toJSONString()}}{
|
||||||
|
To JSON String
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{AllofTagApiResponse$toJSONString()}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Returns}{
|
||||||
|
AllofTagApiResponse in JSON format
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-AllofTagApiResponse-fromJSONString"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-AllofTagApiResponse-fromJSONString}{}}}
|
||||||
|
\subsection{Method \code{fromJSONString()}}{
|
||||||
|
Deserialize JSON string into an instance of AllofTagApiResponse
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{AllofTagApiResponse$fromJSONString(input_json)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{input_json}}{the JSON input}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\subsection{Returns}{
|
||||||
|
the instance of AllofTagApiResponse
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-AllofTagApiResponse-validateJSON"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-AllofTagApiResponse-validateJSON}{}}}
|
||||||
|
\subsection{Method \code{validateJSON()}}{
|
||||||
|
Validate JSON input with respect to AllofTagApiResponse and throw an exception if invalid
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{AllofTagApiResponse$validateJSON(input)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{input}}{the JSON input}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-AllofTagApiResponse-toString"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-AllofTagApiResponse-toString}{}}}
|
||||||
|
\subsection{Method \code{toString()}}{
|
||||||
|
To string (JSON format)
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{AllofTagApiResponse$toString()}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Returns}{
|
||||||
|
String representation of AllofTagApiResponse
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-AllofTagApiResponse-clone"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-AllofTagApiResponse-clone}{}}}
|
||||||
|
\subsection{Method \code{clone()}}{
|
||||||
|
The objects of this class are cloneable with this method.
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{AllofTagApiResponse$clone(deep = FALSE)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{deep}}{Whether to make a deep clone.}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
177
samples/client/petstore/R-httr2-wrapper/man/Animal.Rd
Normal file
177
samples/client/petstore/R-httr2-wrapper/man/Animal.Rd
Normal file
@@ -0,0 +1,177 @@
|
|||||||
|
% Generated by roxygen2: do not edit by hand
|
||||||
|
% Please edit documentation in R/animal.R
|
||||||
|
\docType{class}
|
||||||
|
\name{Animal}
|
||||||
|
\alias{Animal}
|
||||||
|
\title{Animal}
|
||||||
|
\format{
|
||||||
|
An \code{R6Class} generator object
|
||||||
|
}
|
||||||
|
\description{
|
||||||
|
Animal Class
|
||||||
|
}
|
||||||
|
\details{
|
||||||
|
OpenAPI Petstore
|
||||||
|
|
||||||
|
This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
}
|
||||||
|
\section{Public fields}{
|
||||||
|
\if{html}{\out{<div class="r6-fields">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{className}}{character}
|
||||||
|
|
||||||
|
\item{\code{color}}{character [optional]}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\section{Methods}{
|
||||||
|
\subsection{Public methods}{
|
||||||
|
\itemize{
|
||||||
|
\item \href{#method-Animal-new}{\code{Animal$new()}}
|
||||||
|
\item \href{#method-Animal-toJSON}{\code{Animal$toJSON()}}
|
||||||
|
\item \href{#method-Animal-fromJSON}{\code{Animal$fromJSON()}}
|
||||||
|
\item \href{#method-Animal-toJSONString}{\code{Animal$toJSONString()}}
|
||||||
|
\item \href{#method-Animal-fromJSONString}{\code{Animal$fromJSONString()}}
|
||||||
|
\item \href{#method-Animal-validateJSON}{\code{Animal$validateJSON()}}
|
||||||
|
\item \href{#method-Animal-toString}{\code{Animal$toString()}}
|
||||||
|
\item \href{#method-Animal-clone}{\code{Animal$clone()}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-Animal-new"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-Animal-new}{}}}
|
||||||
|
\subsection{Method \code{new()}}{
|
||||||
|
Initialize a new Animal class.
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{Animal$new(className, color = "red", ...)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{className}}{className}
|
||||||
|
|
||||||
|
\item{\code{color}}{color. Default to 'red'.}
|
||||||
|
|
||||||
|
\item{\code{...}}{Other optional arguments.}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-Animal-toJSON"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-Animal-toJSON}{}}}
|
||||||
|
\subsection{Method \code{toJSON()}}{
|
||||||
|
To JSON String
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{Animal$toJSON()}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Returns}{
|
||||||
|
Animal in JSON format
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-Animal-fromJSON"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-Animal-fromJSON}{}}}
|
||||||
|
\subsection{Method \code{fromJSON()}}{
|
||||||
|
Deserialize JSON string into an instance of Animal
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{Animal$fromJSON(input_json)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{input_json}}{the JSON input}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\subsection{Returns}{
|
||||||
|
the instance of Animal
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-Animal-toJSONString"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-Animal-toJSONString}{}}}
|
||||||
|
\subsection{Method \code{toJSONString()}}{
|
||||||
|
To JSON String
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{Animal$toJSONString()}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Returns}{
|
||||||
|
Animal in JSON format
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-Animal-fromJSONString"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-Animal-fromJSONString}{}}}
|
||||||
|
\subsection{Method \code{fromJSONString()}}{
|
||||||
|
Deserialize JSON string into an instance of Animal
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{Animal$fromJSONString(input_json)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{input_json}}{the JSON input}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\subsection{Returns}{
|
||||||
|
the instance of Animal
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-Animal-validateJSON"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-Animal-validateJSON}{}}}
|
||||||
|
\subsection{Method \code{validateJSON()}}{
|
||||||
|
Validate JSON input with respect to Animal and throw an exception if invalid
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{Animal$validateJSON(input)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{input}}{the JSON input}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-Animal-toString"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-Animal-toString}{}}}
|
||||||
|
\subsection{Method \code{toString()}}{
|
||||||
|
To string (JSON format)
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{Animal$toString()}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Returns}{
|
||||||
|
String representation of Animal
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-Animal-clone"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-Animal-clone}{}}}
|
||||||
|
\subsection{Method \code{clone()}}{
|
||||||
|
The objects of this class are cloneable with this method.
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{Animal$clone(deep = FALSE)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{deep}}{Whether to make a deep clone.}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
156
samples/client/petstore/R-httr2-wrapper/man/AnyOfPig.Rd
Normal file
156
samples/client/petstore/R-httr2-wrapper/man/AnyOfPig.Rd
Normal file
@@ -0,0 +1,156 @@
|
|||||||
|
% Generated by roxygen2: do not edit by hand
|
||||||
|
% Please edit documentation in R/any_of_pig.R
|
||||||
|
\docType{class}
|
||||||
|
\name{AnyOfPig}
|
||||||
|
\alias{AnyOfPig}
|
||||||
|
\title{AnyOfPig}
|
||||||
|
\format{
|
||||||
|
An \code{R6Class} generator object
|
||||||
|
}
|
||||||
|
\description{
|
||||||
|
AnyOfPig Class
|
||||||
|
}
|
||||||
|
\details{
|
||||||
|
OpenAPI Petstore
|
||||||
|
|
||||||
|
This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
}
|
||||||
|
\section{Public fields}{
|
||||||
|
\if{html}{\out{<div class="r6-fields">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{actual_instance}}{the object stored in this instance.}
|
||||||
|
|
||||||
|
\item{\code{actual_type}}{the type of the object stored in this instance.}
|
||||||
|
|
||||||
|
\item{\code{any_of}}{a list of object types defined in the anyOf schema.
|
||||||
|
Initialize a new AnyOfPig.}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\section{Methods}{
|
||||||
|
\subsection{Public methods}{
|
||||||
|
\itemize{
|
||||||
|
\item \href{#method-AnyOfPig-new}{\code{AnyOfPig$new()}}
|
||||||
|
\item \href{#method-AnyOfPig-fromJSON}{\code{AnyOfPig$fromJSON()}}
|
||||||
|
\item \href{#method-AnyOfPig-toJSONString}{\code{AnyOfPig$toJSONString()}}
|
||||||
|
\item \href{#method-AnyOfPig-toJSON}{\code{AnyOfPig$toJSON()}}
|
||||||
|
\item \href{#method-AnyOfPig-validateJSON}{\code{AnyOfPig$validateJSON()}}
|
||||||
|
\item \href{#method-AnyOfPig-toString}{\code{AnyOfPig$toString()}}
|
||||||
|
\item \href{#method-AnyOfPig-clone}{\code{AnyOfPig$clone()}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-AnyOfPig-new"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-AnyOfPig-new}{}}}
|
||||||
|
\subsection{Method \code{new()}}{
|
||||||
|
Initialize a new AnyOfPig.
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{AnyOfPig$new(instance = NULL)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{instance}}{an instance of the object defined in the anyOf schemas: "BasquePig", "DanishPig"}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-AnyOfPig-fromJSON"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-AnyOfPig-fromJSON}{}}}
|
||||||
|
\subsection{Method \code{fromJSON()}}{
|
||||||
|
Deserialize JSON string into an instance of AnyOfPig.
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{AnyOfPig$fromJSON(input)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{input}}{The input JSON.}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\subsection{Returns}{
|
||||||
|
An instance of AnyOfPig.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-AnyOfPig-toJSONString"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-AnyOfPig-toJSONString}{}}}
|
||||||
|
\subsection{Method \code{toJSONString()}}{
|
||||||
|
Serialize AnyOfPig to JSON string.
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{AnyOfPig$toJSONString()}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Returns}{
|
||||||
|
JSON string representation of the AnyOfPig.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-AnyOfPig-toJSON"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-AnyOfPig-toJSON}{}}}
|
||||||
|
\subsection{Method \code{toJSON()}}{
|
||||||
|
Serialize AnyOfPig to JSON.
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{AnyOfPig$toJSON()}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Returns}{
|
||||||
|
JSON representation of the AnyOfPig.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-AnyOfPig-validateJSON"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-AnyOfPig-validateJSON}{}}}
|
||||||
|
\subsection{Method \code{validateJSON()}}{
|
||||||
|
Validate the input JSON with respect to AnyOfPig and
|
||||||
|
throw exception if invalid.
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{AnyOfPig$validateJSON(input)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{input}}{The input JSON.}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-AnyOfPig-toString"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-AnyOfPig-toString}{}}}
|
||||||
|
\subsection{Method \code{toString()}}{
|
||||||
|
Returns the string representation of the instance.
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{AnyOfPig$toString()}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Returns}{
|
||||||
|
The string representation of the instance.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-AnyOfPig-clone"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-AnyOfPig-clone}{}}}
|
||||||
|
\subsection{Method \code{clone()}}{
|
||||||
|
The objects of this class are cloneable with this method.
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{AnyOfPig$clone(deep = FALSE)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{deep}}{Whether to make a deep clone.}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
260
samples/client/petstore/R-httr2-wrapper/man/ApiClient.Rd
Normal file
260
samples/client/petstore/R-httr2-wrapper/man/ApiClient.Rd
Normal file
@@ -0,0 +1,260 @@
|
|||||||
|
% Generated by roxygen2: do not edit by hand
|
||||||
|
% Please edit documentation in R/api_client.R
|
||||||
|
\docType{class}
|
||||||
|
\name{ApiClient}
|
||||||
|
\alias{ApiClient}
|
||||||
|
\title{ApiClient}
|
||||||
|
\format{
|
||||||
|
An \code{R6Class} generator object
|
||||||
|
}
|
||||||
|
\description{
|
||||||
|
ApiClient Class
|
||||||
|
}
|
||||||
|
\details{
|
||||||
|
OpenAPI Petstore
|
||||||
|
|
||||||
|
This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
|
||||||
|
ApiClient Class
|
||||||
|
|
||||||
|
Generic API client for OpenAPI client library builds.
|
||||||
|
OpenAPI generic API client. This client handles the client-
|
||||||
|
server communication, and is invariant across implementations. Specifics of
|
||||||
|
the methods and models for each application are generated from the OpenAPI Generator
|
||||||
|
templates.
|
||||||
|
|
||||||
|
NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
Ref: https://openapi-generator.tech
|
||||||
|
Do not edit the class manually.
|
||||||
|
}
|
||||||
|
\section{Public fields}{
|
||||||
|
\if{html}{\out{<div class="r6-fields">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{base_path}}{Base url}
|
||||||
|
|
||||||
|
\item{\code{user_agent}}{Default user agent}
|
||||||
|
|
||||||
|
\item{\code{default_headers}}{Default headers}
|
||||||
|
|
||||||
|
\item{\code{username}}{Username for HTTP basic authentication}
|
||||||
|
|
||||||
|
\item{\code{password}}{Password for HTTP basic authentication}
|
||||||
|
|
||||||
|
\item{\code{api_keys}}{API keys}
|
||||||
|
|
||||||
|
\item{\code{access_token}}{Access token}
|
||||||
|
|
||||||
|
\item{\code{timeout}}{Default timeout in seconds}
|
||||||
|
|
||||||
|
\item{\code{retry_status_codes}}{vector of status codes to retry}
|
||||||
|
|
||||||
|
\item{\code{max_retry_attempts}}{maximum number of retries for the status codes}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\section{Methods}{
|
||||||
|
\subsection{Public methods}{
|
||||||
|
\itemize{
|
||||||
|
\item \href{#method-ApiClient-new}{\code{ApiClient$new()}}
|
||||||
|
\item \href{#method-ApiClient-CallApi}{\code{ApiClient$CallApi()}}
|
||||||
|
\item \href{#method-ApiClient-Execute}{\code{ApiClient$Execute()}}
|
||||||
|
\item \href{#method-ApiClient-deserialize}{\code{ApiClient$deserialize()}}
|
||||||
|
\item \href{#method-ApiClient-deserializeObj}{\code{ApiClient$deserializeObj()}}
|
||||||
|
\item \href{#method-ApiClient-clone}{\code{ApiClient$clone()}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-ApiClient-new"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-ApiClient-new}{}}}
|
||||||
|
\subsection{Method \code{new()}}{
|
||||||
|
Initialize a new ApiClient.
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{ApiClient$new(
|
||||||
|
base_path = NULL,
|
||||||
|
user_agent = NULL,
|
||||||
|
default_headers = NULL,
|
||||||
|
username = NULL,
|
||||||
|
password = NULL,
|
||||||
|
api_keys = NULL,
|
||||||
|
access_token = NULL,
|
||||||
|
timeout = NULL,
|
||||||
|
retry_status_codes = NULL,
|
||||||
|
max_retry_attempts = NULL
|
||||||
|
)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{base_path}}{Base path.}
|
||||||
|
|
||||||
|
\item{\code{user_agent}}{User agent.}
|
||||||
|
|
||||||
|
\item{\code{default_headers}}{Default headers.}
|
||||||
|
|
||||||
|
\item{\code{username}}{User name.}
|
||||||
|
|
||||||
|
\item{\code{password}}{Password.}
|
||||||
|
|
||||||
|
\item{\code{api_keys}}{API keys.}
|
||||||
|
|
||||||
|
\item{\code{access_token}}{Access token.}
|
||||||
|
|
||||||
|
\item{\code{timeout}}{Timeout.}
|
||||||
|
|
||||||
|
\item{\code{retry_status_codes}}{Status codes for retry.}
|
||||||
|
|
||||||
|
\item{\code{max_retry_attempts}}{Maxmium number of retry.}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-ApiClient-CallApi"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-ApiClient-CallApi}{}}}
|
||||||
|
\subsection{Method \code{CallApi()}}{
|
||||||
|
Prepare to make an API call with the retry logic.
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{ApiClient$CallApi(
|
||||||
|
url,
|
||||||
|
method,
|
||||||
|
query_params,
|
||||||
|
header_params,
|
||||||
|
body,
|
||||||
|
stream_callback = NULL,
|
||||||
|
...
|
||||||
|
)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{url}}{URL.}
|
||||||
|
|
||||||
|
\item{\code{method}}{HTTP method.}
|
||||||
|
|
||||||
|
\item{\code{query_params}}{The query parameters.}
|
||||||
|
|
||||||
|
\item{\code{header_params}}{The header parameters.}
|
||||||
|
|
||||||
|
\item{\code{body}}{The HTTP request body.}
|
||||||
|
|
||||||
|
\item{\code{...}}{Other optional arguments.}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\subsection{Returns}{
|
||||||
|
HTTP response
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-ApiClient-Execute"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-ApiClient-Execute}{}}}
|
||||||
|
\subsection{Method \code{Execute()}}{
|
||||||
|
Make an API call
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{ApiClient$Execute(
|
||||||
|
url,
|
||||||
|
method,
|
||||||
|
query_params,
|
||||||
|
header_params,
|
||||||
|
body,
|
||||||
|
stream_callback = NULL,
|
||||||
|
...
|
||||||
|
)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{url}}{URL.}
|
||||||
|
|
||||||
|
\item{\code{method}}{HTTP method.}
|
||||||
|
|
||||||
|
\item{\code{query_params}}{The query parameters.}
|
||||||
|
|
||||||
|
\item{\code{header_params}}{The header parameters.}
|
||||||
|
|
||||||
|
\item{\code{body}}{The HTTP request body.}
|
||||||
|
|
||||||
|
\item{\code{stream_callback}}{callback function to process data stream}
|
||||||
|
|
||||||
|
\item{\code{...}}{Other optional arguments.}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\subsection{Returns}{
|
||||||
|
HTTP response
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-ApiClient-deserialize"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-ApiClient-deserialize}{}}}
|
||||||
|
\subsection{Method \code{deserialize()}}{
|
||||||
|
Deserialize the content of api response to the given type.
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{ApiClient$deserialize(resp, return_type, pkg_env)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{resp}}{Response object.}
|
||||||
|
|
||||||
|
\item{\code{return_type}}{R return type.}
|
||||||
|
|
||||||
|
\item{\code{pkg_env}}{Package environment.}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\subsection{Returns}{
|
||||||
|
Deserialized object.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-ApiClient-deserializeObj"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-ApiClient-deserializeObj}{}}}
|
||||||
|
\subsection{Method \code{deserializeObj()}}{
|
||||||
|
Deserialize the response from jsonlite object based on the given type
|
||||||
|
by handling complex and nested types by iterating recursively
|
||||||
|
Example return_types will be like "array[integer]", "map(Pet)", "array[map(Tag)]", etc.,
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{ApiClient$deserializeObj(obj, return_type, pkg_env)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{obj}}{Response object.}
|
||||||
|
|
||||||
|
\item{\code{return_type}}{R return type.}
|
||||||
|
|
||||||
|
\item{\code{pkg_env}}{Package environment.}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\subsection{Returns}{
|
||||||
|
Deserialized object.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-ApiClient-clone"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-ApiClient-clone}{}}}
|
||||||
|
\subsection{Method \code{clone()}}{
|
||||||
|
The objects of this class are cloneable with this method.
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{ApiClient$clone(deep = FALSE)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{deep}}{Whether to make a deep clone.}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
95
samples/client/petstore/R-httr2-wrapper/man/ApiException.Rd
Normal file
95
samples/client/petstore/R-httr2-wrapper/man/ApiException.Rd
Normal file
@@ -0,0 +1,95 @@
|
|||||||
|
% Generated by roxygen2: do not edit by hand
|
||||||
|
% Please edit documentation in R/api_exception.R
|
||||||
|
\docType{class}
|
||||||
|
\name{ApiException}
|
||||||
|
\alias{ApiException}
|
||||||
|
\title{ApiException}
|
||||||
|
\format{
|
||||||
|
An \code{R6Class} generator object
|
||||||
|
}
|
||||||
|
\description{
|
||||||
|
ApiException Class
|
||||||
|
}
|
||||||
|
\details{
|
||||||
|
OpenAPI Petstore
|
||||||
|
|
||||||
|
This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
}
|
||||||
|
\section{Public fields}{
|
||||||
|
\if{html}{\out{<div class="r6-fields">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{status}}{Status of the ApiException}
|
||||||
|
|
||||||
|
\item{\code{reason}}{Reason of the ApiException}
|
||||||
|
|
||||||
|
\item{\code{body}}{Body of the http response}
|
||||||
|
|
||||||
|
\item{\code{headers}}{Headers of the http response}
|
||||||
|
|
||||||
|
\item{\code{errorObject}}{error object type}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\section{Methods}{
|
||||||
|
\subsection{Public methods}{
|
||||||
|
\itemize{
|
||||||
|
\item \href{#method-ApiException-new}{\code{ApiException$new()}}
|
||||||
|
\item \href{#method-ApiException-toString}{\code{ApiException$toString()}}
|
||||||
|
\item \href{#method-ApiException-clone}{\code{ApiException$clone()}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-ApiException-new"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-ApiException-new}{}}}
|
||||||
|
\subsection{Method \code{new()}}{
|
||||||
|
Initialize a new ApiExceptino class.
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{ApiException$new(status = NULL, reason = NULL, http_response = NULL)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{status}}{HTTP status.}
|
||||||
|
|
||||||
|
\item{\code{reason}}{Reason of the ApiException.}
|
||||||
|
|
||||||
|
\item{\code{http_response}}{HTTP response object.}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-ApiException-toString"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-ApiException-toString}{}}}
|
||||||
|
\subsection{Method \code{toString()}}{
|
||||||
|
Returns the string format of ApiException.
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{ApiException$toString()}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Returns}{
|
||||||
|
the string format of ApiException.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-ApiException-clone"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-ApiException-clone}{}}}
|
||||||
|
\subsection{Method \code{clone()}}{
|
||||||
|
The objects of this class are cloneable with this method.
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{ApiException$clone(deep = FALSE)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{deep}}{Whether to make a deep clone.}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
73
samples/client/petstore/R-httr2-wrapper/man/ApiResponse.Rd
Normal file
73
samples/client/petstore/R-httr2-wrapper/man/ApiResponse.Rd
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
% Generated by roxygen2: do not edit by hand
|
||||||
|
% Please edit documentation in R/api_response.R
|
||||||
|
\docType{class}
|
||||||
|
\name{ApiResponse}
|
||||||
|
\alias{ApiResponse}
|
||||||
|
\title{ApiResponse}
|
||||||
|
\format{
|
||||||
|
An \code{R6Class} generator object
|
||||||
|
}
|
||||||
|
\description{
|
||||||
|
ApiResponse Class
|
||||||
|
}
|
||||||
|
\details{
|
||||||
|
OpenAPI Petstore
|
||||||
|
|
||||||
|
This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
}
|
||||||
|
\section{Public fields}{
|
||||||
|
\if{html}{\out{<div class="r6-fields">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{content}}{The deserialized response body.}
|
||||||
|
|
||||||
|
\item{\code{response}}{The raw response from the endpoint.}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\section{Methods}{
|
||||||
|
\subsection{Public methods}{
|
||||||
|
\itemize{
|
||||||
|
\item \href{#method-ApiResponse-new}{\code{ApiResponse$new()}}
|
||||||
|
\item \href{#method-ApiResponse-clone}{\code{ApiResponse$clone()}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-ApiResponse-new"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-ApiResponse-new}{}}}
|
||||||
|
\subsection{Method \code{new()}}{
|
||||||
|
Initialize a new ApiResponse class.
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{ApiResponse$new(content, response)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{content}}{The deserialized response body.}
|
||||||
|
|
||||||
|
\item{\code{response}}{The raw response from the endpoint.}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-ApiResponse-clone"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-ApiResponse-clone}{}}}
|
||||||
|
\subsection{Method \code{clone()}}{
|
||||||
|
The objects of this class are cloneable with this method.
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{ApiResponse$clone(deep = FALSE)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{deep}}{Whether to make a deep clone.}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
177
samples/client/petstore/R-httr2-wrapper/man/BasquePig.Rd
Normal file
177
samples/client/petstore/R-httr2-wrapper/man/BasquePig.Rd
Normal file
@@ -0,0 +1,177 @@
|
|||||||
|
% Generated by roxygen2: do not edit by hand
|
||||||
|
% Please edit documentation in R/basque_pig.R
|
||||||
|
\docType{class}
|
||||||
|
\name{BasquePig}
|
||||||
|
\alias{BasquePig}
|
||||||
|
\title{BasquePig}
|
||||||
|
\format{
|
||||||
|
An \code{R6Class} generator object
|
||||||
|
}
|
||||||
|
\description{
|
||||||
|
BasquePig Class
|
||||||
|
}
|
||||||
|
\details{
|
||||||
|
OpenAPI Petstore
|
||||||
|
|
||||||
|
This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
}
|
||||||
|
\section{Public fields}{
|
||||||
|
\if{html}{\out{<div class="r6-fields">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{className}}{character}
|
||||||
|
|
||||||
|
\item{\code{color}}{character}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\section{Methods}{
|
||||||
|
\subsection{Public methods}{
|
||||||
|
\itemize{
|
||||||
|
\item \href{#method-BasquePig-new}{\code{BasquePig$new()}}
|
||||||
|
\item \href{#method-BasquePig-toJSON}{\code{BasquePig$toJSON()}}
|
||||||
|
\item \href{#method-BasquePig-fromJSON}{\code{BasquePig$fromJSON()}}
|
||||||
|
\item \href{#method-BasquePig-toJSONString}{\code{BasquePig$toJSONString()}}
|
||||||
|
\item \href{#method-BasquePig-fromJSONString}{\code{BasquePig$fromJSONString()}}
|
||||||
|
\item \href{#method-BasquePig-validateJSON}{\code{BasquePig$validateJSON()}}
|
||||||
|
\item \href{#method-BasquePig-toString}{\code{BasquePig$toString()}}
|
||||||
|
\item \href{#method-BasquePig-clone}{\code{BasquePig$clone()}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-BasquePig-new"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-BasquePig-new}{}}}
|
||||||
|
\subsection{Method \code{new()}}{
|
||||||
|
Initialize a new BasquePig class.
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{BasquePig$new(className, color, ...)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{className}}{className}
|
||||||
|
|
||||||
|
\item{\code{color}}{color}
|
||||||
|
|
||||||
|
\item{\code{...}}{Other optional arguments.}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-BasquePig-toJSON"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-BasquePig-toJSON}{}}}
|
||||||
|
\subsection{Method \code{toJSON()}}{
|
||||||
|
To JSON String
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{BasquePig$toJSON()}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Returns}{
|
||||||
|
BasquePig in JSON format
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-BasquePig-fromJSON"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-BasquePig-fromJSON}{}}}
|
||||||
|
\subsection{Method \code{fromJSON()}}{
|
||||||
|
Deserialize JSON string into an instance of BasquePig
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{BasquePig$fromJSON(input_json)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{input_json}}{the JSON input}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\subsection{Returns}{
|
||||||
|
the instance of BasquePig
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-BasquePig-toJSONString"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-BasquePig-toJSONString}{}}}
|
||||||
|
\subsection{Method \code{toJSONString()}}{
|
||||||
|
To JSON String
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{BasquePig$toJSONString()}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Returns}{
|
||||||
|
BasquePig in JSON format
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-BasquePig-fromJSONString"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-BasquePig-fromJSONString}{}}}
|
||||||
|
\subsection{Method \code{fromJSONString()}}{
|
||||||
|
Deserialize JSON string into an instance of BasquePig
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{BasquePig$fromJSONString(input_json)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{input_json}}{the JSON input}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\subsection{Returns}{
|
||||||
|
the instance of BasquePig
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-BasquePig-validateJSON"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-BasquePig-validateJSON}{}}}
|
||||||
|
\subsection{Method \code{validateJSON()}}{
|
||||||
|
Validate JSON input with respect to BasquePig and throw an exception if invalid
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{BasquePig$validateJSON(input)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{input}}{the JSON input}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-BasquePig-toString"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-BasquePig-toString}{}}}
|
||||||
|
\subsection{Method \code{toString()}}{
|
||||||
|
To string (JSON format)
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{BasquePig$toString()}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Returns}{
|
||||||
|
String representation of BasquePig
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-BasquePig-clone"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-BasquePig-clone}{}}}
|
||||||
|
\subsection{Method \code{clone()}}{
|
||||||
|
The objects of this class are cloneable with this method.
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{BasquePig$clone(deep = FALSE)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{deep}}{Whether to make a deep clone.}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
190
samples/client/petstore/R-httr2-wrapper/man/Cat.Rd
Normal file
190
samples/client/petstore/R-httr2-wrapper/man/Cat.Rd
Normal file
@@ -0,0 +1,190 @@
|
|||||||
|
% Generated by roxygen2: do not edit by hand
|
||||||
|
% Please edit documentation in R/cat.R
|
||||||
|
\docType{class}
|
||||||
|
\name{Cat}
|
||||||
|
\alias{Cat}
|
||||||
|
\title{Cat}
|
||||||
|
\format{
|
||||||
|
An \code{R6Class} generator object
|
||||||
|
}
|
||||||
|
\description{
|
||||||
|
Cat Class
|
||||||
|
}
|
||||||
|
\details{
|
||||||
|
OpenAPI Petstore
|
||||||
|
|
||||||
|
This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
}
|
||||||
|
\section{Super class}{
|
||||||
|
\code{\link[petstore:Animal]{petstore::Animal}} -> \code{Cat}
|
||||||
|
}
|
||||||
|
\section{Public fields}{
|
||||||
|
\if{html}{\out{<div class="r6-fields">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{className}}{character}
|
||||||
|
|
||||||
|
\item{\code{color}}{character [optional]}
|
||||||
|
|
||||||
|
\item{\code{declawed}}{character [optional]}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\section{Methods}{
|
||||||
|
\subsection{Public methods}{
|
||||||
|
\itemize{
|
||||||
|
\item \href{#method-Cat-new}{\code{Cat$new()}}
|
||||||
|
\item \href{#method-Cat-toJSON}{\code{Cat$toJSON()}}
|
||||||
|
\item \href{#method-Cat-fromJSON}{\code{Cat$fromJSON()}}
|
||||||
|
\item \href{#method-Cat-toJSONString}{\code{Cat$toJSONString()}}
|
||||||
|
\item \href{#method-Cat-fromJSONString}{\code{Cat$fromJSONString()}}
|
||||||
|
\item \href{#method-Cat-validateJSON}{\code{Cat$validateJSON()}}
|
||||||
|
\item \href{#method-Cat-toString}{\code{Cat$toString()}}
|
||||||
|
\item \href{#method-Cat-clone}{\code{Cat$clone()}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{
|
||||||
|
<details open><summary>Inherited methods</summary>
|
||||||
|
<ul>
|
||||||
|
</ul>
|
||||||
|
</details>
|
||||||
|
}}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-Cat-new"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-Cat-new}{}}}
|
||||||
|
\subsection{Method \code{new()}}{
|
||||||
|
Initialize a new Cat class.
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{Cat$new(className, color = "red", declawed = NULL, ...)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{className}}{className}
|
||||||
|
|
||||||
|
\item{\code{color}}{color. Default to 'red'.}
|
||||||
|
|
||||||
|
\item{\code{declawed}}{declawed}
|
||||||
|
|
||||||
|
\item{\code{...}}{Other optional arguments.}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-Cat-toJSON"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-Cat-toJSON}{}}}
|
||||||
|
\subsection{Method \code{toJSON()}}{
|
||||||
|
To JSON String
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{Cat$toJSON()}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Returns}{
|
||||||
|
Cat in JSON format
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-Cat-fromJSON"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-Cat-fromJSON}{}}}
|
||||||
|
\subsection{Method \code{fromJSON()}}{
|
||||||
|
Deserialize JSON string into an instance of Cat
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{Cat$fromJSON(input_json)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{input_json}}{the JSON input}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\subsection{Returns}{
|
||||||
|
the instance of Cat
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-Cat-toJSONString"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-Cat-toJSONString}{}}}
|
||||||
|
\subsection{Method \code{toJSONString()}}{
|
||||||
|
To JSON String
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{Cat$toJSONString()}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Returns}{
|
||||||
|
Cat in JSON format
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-Cat-fromJSONString"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-Cat-fromJSONString}{}}}
|
||||||
|
\subsection{Method \code{fromJSONString()}}{
|
||||||
|
Deserialize JSON string into an instance of Cat
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{Cat$fromJSONString(input_json)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{input_json}}{the JSON input}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\subsection{Returns}{
|
||||||
|
the instance of Cat
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-Cat-validateJSON"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-Cat-validateJSON}{}}}
|
||||||
|
\subsection{Method \code{validateJSON()}}{
|
||||||
|
Validate JSON input with respect to Cat and throw an exception if invalid
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{Cat$validateJSON(input)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{input}}{the JSON input}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-Cat-toString"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-Cat-toString}{}}}
|
||||||
|
\subsection{Method \code{toString()}}{
|
||||||
|
To string (JSON format)
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{Cat$toString()}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Returns}{
|
||||||
|
String representation of Cat
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-Cat-clone"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-Cat-clone}{}}}
|
||||||
|
\subsection{Method \code{clone()}}{
|
||||||
|
The objects of this class are cloneable with this method.
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{Cat$clone(deep = FALSE)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{deep}}{Whether to make a deep clone.}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
173
samples/client/petstore/R-httr2-wrapper/man/CatAllOf.Rd
Normal file
173
samples/client/petstore/R-httr2-wrapper/man/CatAllOf.Rd
Normal file
@@ -0,0 +1,173 @@
|
|||||||
|
% Generated by roxygen2: do not edit by hand
|
||||||
|
% Please edit documentation in R/cat_all_of.R
|
||||||
|
\docType{class}
|
||||||
|
\name{CatAllOf}
|
||||||
|
\alias{CatAllOf}
|
||||||
|
\title{CatAllOf}
|
||||||
|
\format{
|
||||||
|
An \code{R6Class} generator object
|
||||||
|
}
|
||||||
|
\description{
|
||||||
|
CatAllOf Class
|
||||||
|
}
|
||||||
|
\details{
|
||||||
|
OpenAPI Petstore
|
||||||
|
|
||||||
|
This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
}
|
||||||
|
\section{Public fields}{
|
||||||
|
\if{html}{\out{<div class="r6-fields">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{declawed}}{character [optional]}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\section{Methods}{
|
||||||
|
\subsection{Public methods}{
|
||||||
|
\itemize{
|
||||||
|
\item \href{#method-CatAllOf-new}{\code{CatAllOf$new()}}
|
||||||
|
\item \href{#method-CatAllOf-toJSON}{\code{CatAllOf$toJSON()}}
|
||||||
|
\item \href{#method-CatAllOf-fromJSON}{\code{CatAllOf$fromJSON()}}
|
||||||
|
\item \href{#method-CatAllOf-toJSONString}{\code{CatAllOf$toJSONString()}}
|
||||||
|
\item \href{#method-CatAllOf-fromJSONString}{\code{CatAllOf$fromJSONString()}}
|
||||||
|
\item \href{#method-CatAllOf-validateJSON}{\code{CatAllOf$validateJSON()}}
|
||||||
|
\item \href{#method-CatAllOf-toString}{\code{CatAllOf$toString()}}
|
||||||
|
\item \href{#method-CatAllOf-clone}{\code{CatAllOf$clone()}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-CatAllOf-new"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-CatAllOf-new}{}}}
|
||||||
|
\subsection{Method \code{new()}}{
|
||||||
|
Initialize a new CatAllOf class.
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{CatAllOf$new(declawed = NULL, ...)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{declawed}}{declawed}
|
||||||
|
|
||||||
|
\item{\code{...}}{Other optional arguments.}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-CatAllOf-toJSON"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-CatAllOf-toJSON}{}}}
|
||||||
|
\subsection{Method \code{toJSON()}}{
|
||||||
|
To JSON String
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{CatAllOf$toJSON()}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Returns}{
|
||||||
|
CatAllOf in JSON format
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-CatAllOf-fromJSON"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-CatAllOf-fromJSON}{}}}
|
||||||
|
\subsection{Method \code{fromJSON()}}{
|
||||||
|
Deserialize JSON string into an instance of CatAllOf
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{CatAllOf$fromJSON(input_json)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{input_json}}{the JSON input}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\subsection{Returns}{
|
||||||
|
the instance of CatAllOf
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-CatAllOf-toJSONString"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-CatAllOf-toJSONString}{}}}
|
||||||
|
\subsection{Method \code{toJSONString()}}{
|
||||||
|
To JSON String
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{CatAllOf$toJSONString()}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Returns}{
|
||||||
|
CatAllOf in JSON format
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-CatAllOf-fromJSONString"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-CatAllOf-fromJSONString}{}}}
|
||||||
|
\subsection{Method \code{fromJSONString()}}{
|
||||||
|
Deserialize JSON string into an instance of CatAllOf
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{CatAllOf$fromJSONString(input_json)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{input_json}}{the JSON input}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\subsection{Returns}{
|
||||||
|
the instance of CatAllOf
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-CatAllOf-validateJSON"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-CatAllOf-validateJSON}{}}}
|
||||||
|
\subsection{Method \code{validateJSON()}}{
|
||||||
|
Validate JSON input with respect to CatAllOf and throw an exception if invalid
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{CatAllOf$validateJSON(input)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{input}}{the JSON input}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-CatAllOf-toString"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-CatAllOf-toString}{}}}
|
||||||
|
\subsection{Method \code{toString()}}{
|
||||||
|
To string (JSON format)
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{CatAllOf$toString()}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Returns}{
|
||||||
|
String representation of CatAllOf
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-CatAllOf-clone"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-CatAllOf-clone}{}}}
|
||||||
|
\subsection{Method \code{clone()}}{
|
||||||
|
The objects of this class are cloneable with this method.
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{CatAllOf$clone(deep = FALSE)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{deep}}{Whether to make a deep clone.}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
177
samples/client/petstore/R-httr2-wrapper/man/Category.Rd
Normal file
177
samples/client/petstore/R-httr2-wrapper/man/Category.Rd
Normal file
@@ -0,0 +1,177 @@
|
|||||||
|
% Generated by roxygen2: do not edit by hand
|
||||||
|
% Please edit documentation in R/category.R
|
||||||
|
\docType{class}
|
||||||
|
\name{Category}
|
||||||
|
\alias{Category}
|
||||||
|
\title{Category}
|
||||||
|
\format{
|
||||||
|
An \code{R6Class} generator object
|
||||||
|
}
|
||||||
|
\description{
|
||||||
|
Category Class
|
||||||
|
}
|
||||||
|
\details{
|
||||||
|
OpenAPI Petstore
|
||||||
|
|
||||||
|
This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
}
|
||||||
|
\section{Public fields}{
|
||||||
|
\if{html}{\out{<div class="r6-fields">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{id}}{integer [optional]}
|
||||||
|
|
||||||
|
\item{\code{name}}{character [optional]}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\section{Methods}{
|
||||||
|
\subsection{Public methods}{
|
||||||
|
\itemize{
|
||||||
|
\item \href{#method-Category-new}{\code{Category$new()}}
|
||||||
|
\item \href{#method-Category-toJSON}{\code{Category$toJSON()}}
|
||||||
|
\item \href{#method-Category-fromJSON}{\code{Category$fromJSON()}}
|
||||||
|
\item \href{#method-Category-toJSONString}{\code{Category$toJSONString()}}
|
||||||
|
\item \href{#method-Category-fromJSONString}{\code{Category$fromJSONString()}}
|
||||||
|
\item \href{#method-Category-validateJSON}{\code{Category$validateJSON()}}
|
||||||
|
\item \href{#method-Category-toString}{\code{Category$toString()}}
|
||||||
|
\item \href{#method-Category-clone}{\code{Category$clone()}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-Category-new"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-Category-new}{}}}
|
||||||
|
\subsection{Method \code{new()}}{
|
||||||
|
Initialize a new Category class.
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{Category$new(id = NULL, name = NULL, ...)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{id}}{id}
|
||||||
|
|
||||||
|
\item{\code{name}}{name}
|
||||||
|
|
||||||
|
\item{\code{...}}{Other optional arguments.}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-Category-toJSON"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-Category-toJSON}{}}}
|
||||||
|
\subsection{Method \code{toJSON()}}{
|
||||||
|
To JSON String
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{Category$toJSON()}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Returns}{
|
||||||
|
Category in JSON format
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-Category-fromJSON"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-Category-fromJSON}{}}}
|
||||||
|
\subsection{Method \code{fromJSON()}}{
|
||||||
|
Deserialize JSON string into an instance of Category
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{Category$fromJSON(input_json)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{input_json}}{the JSON input}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\subsection{Returns}{
|
||||||
|
the instance of Category
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-Category-toJSONString"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-Category-toJSONString}{}}}
|
||||||
|
\subsection{Method \code{toJSONString()}}{
|
||||||
|
To JSON String
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{Category$toJSONString()}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Returns}{
|
||||||
|
Category in JSON format
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-Category-fromJSONString"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-Category-fromJSONString}{}}}
|
||||||
|
\subsection{Method \code{fromJSONString()}}{
|
||||||
|
Deserialize JSON string into an instance of Category
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{Category$fromJSONString(input_json)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{input_json}}{the JSON input}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\subsection{Returns}{
|
||||||
|
the instance of Category
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-Category-validateJSON"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-Category-validateJSON}{}}}
|
||||||
|
\subsection{Method \code{validateJSON()}}{
|
||||||
|
Validate JSON input with respect to Category and throw an exception if invalid
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{Category$validateJSON(input)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{input}}{the JSON input}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-Category-toString"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-Category-toString}{}}}
|
||||||
|
\subsection{Method \code{toString()}}{
|
||||||
|
To string (JSON format)
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{Category$toString()}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Returns}{
|
||||||
|
String representation of Category
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-Category-clone"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-Category-clone}{}}}
|
||||||
|
\subsection{Method \code{clone()}}{
|
||||||
|
The objects of this class are cloneable with this method.
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{Category$clone(deep = FALSE)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{deep}}{Whether to make a deep clone.}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
177
samples/client/petstore/R-httr2-wrapper/man/DanishPig.Rd
Normal file
177
samples/client/petstore/R-httr2-wrapper/man/DanishPig.Rd
Normal file
@@ -0,0 +1,177 @@
|
|||||||
|
% Generated by roxygen2: do not edit by hand
|
||||||
|
% Please edit documentation in R/danish_pig.R
|
||||||
|
\docType{class}
|
||||||
|
\name{DanishPig}
|
||||||
|
\alias{DanishPig}
|
||||||
|
\title{DanishPig}
|
||||||
|
\format{
|
||||||
|
An \code{R6Class} generator object
|
||||||
|
}
|
||||||
|
\description{
|
||||||
|
DanishPig Class
|
||||||
|
}
|
||||||
|
\details{
|
||||||
|
OpenAPI Petstore
|
||||||
|
|
||||||
|
This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
}
|
||||||
|
\section{Public fields}{
|
||||||
|
\if{html}{\out{<div class="r6-fields">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{className}}{character}
|
||||||
|
|
||||||
|
\item{\code{size}}{integer}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\section{Methods}{
|
||||||
|
\subsection{Public methods}{
|
||||||
|
\itemize{
|
||||||
|
\item \href{#method-DanishPig-new}{\code{DanishPig$new()}}
|
||||||
|
\item \href{#method-DanishPig-toJSON}{\code{DanishPig$toJSON()}}
|
||||||
|
\item \href{#method-DanishPig-fromJSON}{\code{DanishPig$fromJSON()}}
|
||||||
|
\item \href{#method-DanishPig-toJSONString}{\code{DanishPig$toJSONString()}}
|
||||||
|
\item \href{#method-DanishPig-fromJSONString}{\code{DanishPig$fromJSONString()}}
|
||||||
|
\item \href{#method-DanishPig-validateJSON}{\code{DanishPig$validateJSON()}}
|
||||||
|
\item \href{#method-DanishPig-toString}{\code{DanishPig$toString()}}
|
||||||
|
\item \href{#method-DanishPig-clone}{\code{DanishPig$clone()}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-DanishPig-new"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-DanishPig-new}{}}}
|
||||||
|
\subsection{Method \code{new()}}{
|
||||||
|
Initialize a new DanishPig class.
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{DanishPig$new(className, size, ...)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{className}}{className}
|
||||||
|
|
||||||
|
\item{\code{size}}{size}
|
||||||
|
|
||||||
|
\item{\code{...}}{Other optional arguments.}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-DanishPig-toJSON"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-DanishPig-toJSON}{}}}
|
||||||
|
\subsection{Method \code{toJSON()}}{
|
||||||
|
To JSON String
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{DanishPig$toJSON()}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Returns}{
|
||||||
|
DanishPig in JSON format
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-DanishPig-fromJSON"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-DanishPig-fromJSON}{}}}
|
||||||
|
\subsection{Method \code{fromJSON()}}{
|
||||||
|
Deserialize JSON string into an instance of DanishPig
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{DanishPig$fromJSON(input_json)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{input_json}}{the JSON input}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\subsection{Returns}{
|
||||||
|
the instance of DanishPig
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-DanishPig-toJSONString"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-DanishPig-toJSONString}{}}}
|
||||||
|
\subsection{Method \code{toJSONString()}}{
|
||||||
|
To JSON String
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{DanishPig$toJSONString()}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Returns}{
|
||||||
|
DanishPig in JSON format
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-DanishPig-fromJSONString"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-DanishPig-fromJSONString}{}}}
|
||||||
|
\subsection{Method \code{fromJSONString()}}{
|
||||||
|
Deserialize JSON string into an instance of DanishPig
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{DanishPig$fromJSONString(input_json)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{input_json}}{the JSON input}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\subsection{Returns}{
|
||||||
|
the instance of DanishPig
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-DanishPig-validateJSON"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-DanishPig-validateJSON}{}}}
|
||||||
|
\subsection{Method \code{validateJSON()}}{
|
||||||
|
Validate JSON input with respect to DanishPig and throw an exception if invalid
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{DanishPig$validateJSON(input)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{input}}{the JSON input}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-DanishPig-toString"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-DanishPig-toString}{}}}
|
||||||
|
\subsection{Method \code{toString()}}{
|
||||||
|
To string (JSON format)
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{DanishPig$toString()}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Returns}{
|
||||||
|
String representation of DanishPig
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-DanishPig-clone"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-DanishPig-clone}{}}}
|
||||||
|
\subsection{Method \code{clone()}}{
|
||||||
|
The objects of this class are cloneable with this method.
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{DanishPig$clone(deep = FALSE)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{deep}}{Whether to make a deep clone.}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
190
samples/client/petstore/R-httr2-wrapper/man/Dog.Rd
Normal file
190
samples/client/petstore/R-httr2-wrapper/man/Dog.Rd
Normal file
@@ -0,0 +1,190 @@
|
|||||||
|
% Generated by roxygen2: do not edit by hand
|
||||||
|
% Please edit documentation in R/dog.R
|
||||||
|
\docType{class}
|
||||||
|
\name{Dog}
|
||||||
|
\alias{Dog}
|
||||||
|
\title{Dog}
|
||||||
|
\format{
|
||||||
|
An \code{R6Class} generator object
|
||||||
|
}
|
||||||
|
\description{
|
||||||
|
Dog Class
|
||||||
|
}
|
||||||
|
\details{
|
||||||
|
OpenAPI Petstore
|
||||||
|
|
||||||
|
This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
}
|
||||||
|
\section{Super class}{
|
||||||
|
\code{\link[petstore:Animal]{petstore::Animal}} -> \code{Dog}
|
||||||
|
}
|
||||||
|
\section{Public fields}{
|
||||||
|
\if{html}{\out{<div class="r6-fields">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{className}}{character}
|
||||||
|
|
||||||
|
\item{\code{color}}{character [optional]}
|
||||||
|
|
||||||
|
\item{\code{breed}}{character [optional]}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\section{Methods}{
|
||||||
|
\subsection{Public methods}{
|
||||||
|
\itemize{
|
||||||
|
\item \href{#method-Dog-new}{\code{Dog$new()}}
|
||||||
|
\item \href{#method-Dog-toJSON}{\code{Dog$toJSON()}}
|
||||||
|
\item \href{#method-Dog-fromJSON}{\code{Dog$fromJSON()}}
|
||||||
|
\item \href{#method-Dog-toJSONString}{\code{Dog$toJSONString()}}
|
||||||
|
\item \href{#method-Dog-fromJSONString}{\code{Dog$fromJSONString()}}
|
||||||
|
\item \href{#method-Dog-validateJSON}{\code{Dog$validateJSON()}}
|
||||||
|
\item \href{#method-Dog-toString}{\code{Dog$toString()}}
|
||||||
|
\item \href{#method-Dog-clone}{\code{Dog$clone()}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{
|
||||||
|
<details open><summary>Inherited methods</summary>
|
||||||
|
<ul>
|
||||||
|
</ul>
|
||||||
|
</details>
|
||||||
|
}}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-Dog-new"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-Dog-new}{}}}
|
||||||
|
\subsection{Method \code{new()}}{
|
||||||
|
Initialize a new Dog class.
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{Dog$new(className, color = "red", breed = NULL, ...)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{className}}{className}
|
||||||
|
|
||||||
|
\item{\code{color}}{color. Default to 'red'.}
|
||||||
|
|
||||||
|
\item{\code{breed}}{breed}
|
||||||
|
|
||||||
|
\item{\code{...}}{Other optional arguments.}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-Dog-toJSON"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-Dog-toJSON}{}}}
|
||||||
|
\subsection{Method \code{toJSON()}}{
|
||||||
|
To JSON String
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{Dog$toJSON()}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Returns}{
|
||||||
|
Dog in JSON format
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-Dog-fromJSON"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-Dog-fromJSON}{}}}
|
||||||
|
\subsection{Method \code{fromJSON()}}{
|
||||||
|
Deserialize JSON string into an instance of Dog
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{Dog$fromJSON(input_json)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{input_json}}{the JSON input}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\subsection{Returns}{
|
||||||
|
the instance of Dog
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-Dog-toJSONString"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-Dog-toJSONString}{}}}
|
||||||
|
\subsection{Method \code{toJSONString()}}{
|
||||||
|
To JSON String
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{Dog$toJSONString()}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Returns}{
|
||||||
|
Dog in JSON format
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-Dog-fromJSONString"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-Dog-fromJSONString}{}}}
|
||||||
|
\subsection{Method \code{fromJSONString()}}{
|
||||||
|
Deserialize JSON string into an instance of Dog
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{Dog$fromJSONString(input_json)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{input_json}}{the JSON input}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\subsection{Returns}{
|
||||||
|
the instance of Dog
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-Dog-validateJSON"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-Dog-validateJSON}{}}}
|
||||||
|
\subsection{Method \code{validateJSON()}}{
|
||||||
|
Validate JSON input with respect to Dog and throw an exception if invalid
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{Dog$validateJSON(input)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{input}}{the JSON input}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-Dog-toString"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-Dog-toString}{}}}
|
||||||
|
\subsection{Method \code{toString()}}{
|
||||||
|
To string (JSON format)
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{Dog$toString()}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Returns}{
|
||||||
|
String representation of Dog
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-Dog-clone"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-Dog-clone}{}}}
|
||||||
|
\subsection{Method \code{clone()}}{
|
||||||
|
The objects of this class are cloneable with this method.
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{Dog$clone(deep = FALSE)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{deep}}{Whether to make a deep clone.}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
173
samples/client/petstore/R-httr2-wrapper/man/DogAllOf.Rd
Normal file
173
samples/client/petstore/R-httr2-wrapper/man/DogAllOf.Rd
Normal file
@@ -0,0 +1,173 @@
|
|||||||
|
% Generated by roxygen2: do not edit by hand
|
||||||
|
% Please edit documentation in R/dog_all_of.R
|
||||||
|
\docType{class}
|
||||||
|
\name{DogAllOf}
|
||||||
|
\alias{DogAllOf}
|
||||||
|
\title{DogAllOf}
|
||||||
|
\format{
|
||||||
|
An \code{R6Class} generator object
|
||||||
|
}
|
||||||
|
\description{
|
||||||
|
DogAllOf Class
|
||||||
|
}
|
||||||
|
\details{
|
||||||
|
OpenAPI Petstore
|
||||||
|
|
||||||
|
This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
}
|
||||||
|
\section{Public fields}{
|
||||||
|
\if{html}{\out{<div class="r6-fields">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{breed}}{character [optional]}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\section{Methods}{
|
||||||
|
\subsection{Public methods}{
|
||||||
|
\itemize{
|
||||||
|
\item \href{#method-DogAllOf-new}{\code{DogAllOf$new()}}
|
||||||
|
\item \href{#method-DogAllOf-toJSON}{\code{DogAllOf$toJSON()}}
|
||||||
|
\item \href{#method-DogAllOf-fromJSON}{\code{DogAllOf$fromJSON()}}
|
||||||
|
\item \href{#method-DogAllOf-toJSONString}{\code{DogAllOf$toJSONString()}}
|
||||||
|
\item \href{#method-DogAllOf-fromJSONString}{\code{DogAllOf$fromJSONString()}}
|
||||||
|
\item \href{#method-DogAllOf-validateJSON}{\code{DogAllOf$validateJSON()}}
|
||||||
|
\item \href{#method-DogAllOf-toString}{\code{DogAllOf$toString()}}
|
||||||
|
\item \href{#method-DogAllOf-clone}{\code{DogAllOf$clone()}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-DogAllOf-new"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-DogAllOf-new}{}}}
|
||||||
|
\subsection{Method \code{new()}}{
|
||||||
|
Initialize a new DogAllOf class.
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{DogAllOf$new(breed = NULL, ...)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{breed}}{breed}
|
||||||
|
|
||||||
|
\item{\code{...}}{Other optional arguments.}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-DogAllOf-toJSON"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-DogAllOf-toJSON}{}}}
|
||||||
|
\subsection{Method \code{toJSON()}}{
|
||||||
|
To JSON String
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{DogAllOf$toJSON()}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Returns}{
|
||||||
|
DogAllOf in JSON format
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-DogAllOf-fromJSON"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-DogAllOf-fromJSON}{}}}
|
||||||
|
\subsection{Method \code{fromJSON()}}{
|
||||||
|
Deserialize JSON string into an instance of DogAllOf
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{DogAllOf$fromJSON(input_json)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{input_json}}{the JSON input}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\subsection{Returns}{
|
||||||
|
the instance of DogAllOf
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-DogAllOf-toJSONString"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-DogAllOf-toJSONString}{}}}
|
||||||
|
\subsection{Method \code{toJSONString()}}{
|
||||||
|
To JSON String
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{DogAllOf$toJSONString()}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Returns}{
|
||||||
|
DogAllOf in JSON format
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-DogAllOf-fromJSONString"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-DogAllOf-fromJSONString}{}}}
|
||||||
|
\subsection{Method \code{fromJSONString()}}{
|
||||||
|
Deserialize JSON string into an instance of DogAllOf
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{DogAllOf$fromJSONString(input_json)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{input_json}}{the JSON input}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\subsection{Returns}{
|
||||||
|
the instance of DogAllOf
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-DogAllOf-validateJSON"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-DogAllOf-validateJSON}{}}}
|
||||||
|
\subsection{Method \code{validateJSON()}}{
|
||||||
|
Validate JSON input with respect to DogAllOf and throw an exception if invalid
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{DogAllOf$validateJSON(input)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{input}}{the JSON input}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-DogAllOf-toString"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-DogAllOf-toString}{}}}
|
||||||
|
\subsection{Method \code{toString()}}{
|
||||||
|
To string (JSON format)
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{DogAllOf$toString()}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Returns}{
|
||||||
|
String representation of DogAllOf
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-DogAllOf-clone"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-DogAllOf-clone}{}}}
|
||||||
|
\subsection{Method \code{clone()}}{
|
||||||
|
The objects of this class are cloneable with this method.
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{DogAllOf$clone(deep = FALSE)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{deep}}{Whether to make a deep clone.}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
183
samples/client/petstore/R-httr2-wrapper/man/FakeApi.Rd
Normal file
183
samples/client/petstore/R-httr2-wrapper/man/FakeApi.Rd
Normal file
@@ -0,0 +1,183 @@
|
|||||||
|
% Generated by roxygen2: do not edit by hand
|
||||||
|
% Please edit documentation in R/fake_api.R
|
||||||
|
\docType{class}
|
||||||
|
\name{FakeApi}
|
||||||
|
\alias{FakeApi}
|
||||||
|
\title{Fake operations}
|
||||||
|
\format{
|
||||||
|
An \code{R6Class} generator object
|
||||||
|
}
|
||||||
|
\description{
|
||||||
|
petstore.Fake
|
||||||
|
}
|
||||||
|
\details{
|
||||||
|
OpenAPI Petstore
|
||||||
|
|
||||||
|
This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
}
|
||||||
|
\section{Methods}{
|
||||||
|
|
||||||
|
\describe{
|
||||||
|
\strong{ FakeDataFile } \emph{ test data_file to ensure it's escaped correctly }
|
||||||
|
|
||||||
|
|
||||||
|
\itemize{
|
||||||
|
\item \emph{ @param } dummy character
|
||||||
|
\item \emph{ @param } var_data_file character
|
||||||
|
\item \emph{ @returnType } \link{User} \cr
|
||||||
|
|
||||||
|
\item On encountering errors, an error of subclass ApiException will be thrown.
|
||||||
|
|
||||||
|
\item status code : 200 | successful operation
|
||||||
|
|
||||||
|
\item return type : User
|
||||||
|
\item response headers :
|
||||||
|
|
||||||
|
\tabular{ll}{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
\examples{
|
||||||
|
\dontrun{
|
||||||
|
#################### FakeDataFile ####################
|
||||||
|
|
||||||
|
library(petstore)
|
||||||
|
var.dummy <- 'dummy_example' # character | dummy required parameter
|
||||||
|
var.var_data_file <- 'var_data_file_example' # character | header data file
|
||||||
|
|
||||||
|
#test data_file to ensure it's escaped correctly
|
||||||
|
api.instance <- FakeApi$new()
|
||||||
|
|
||||||
|
result <- tryCatch(
|
||||||
|
api.instance$FakeDataFile(var.dummy, var_data_file=var.var_data_file),
|
||||||
|
ApiException = function(ex) ex
|
||||||
|
)
|
||||||
|
# In case of error, print the error object
|
||||||
|
if(!is.null(result$ApiException)) {
|
||||||
|
cat(result$ApiException$toString())
|
||||||
|
} else {
|
||||||
|
# deserialized response object
|
||||||
|
response.object <- result$content
|
||||||
|
# response headers
|
||||||
|
response.headers <- result$response$headers
|
||||||
|
# response status code
|
||||||
|
response.status.code <- result$response$status_code
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\section{Public fields}{
|
||||||
|
\if{html}{\out{<div class="r6-fields">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{api_client}}{Handles the client-server communication.}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\section{Methods}{
|
||||||
|
\subsection{Public methods}{
|
||||||
|
\itemize{
|
||||||
|
\item \href{#method-FakeApi-new}{\code{FakeApi$new()}}
|
||||||
|
\item \href{#method-FakeApi-FakeDataFile}{\code{FakeApi$FakeDataFile()}}
|
||||||
|
\item \href{#method-FakeApi-FakeDataFileWithHttpInfo}{\code{FakeApi$FakeDataFileWithHttpInfo()}}
|
||||||
|
\item \href{#method-FakeApi-clone}{\code{FakeApi$clone()}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-FakeApi-new"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-FakeApi-new}{}}}
|
||||||
|
\subsection{Method \code{new()}}{
|
||||||
|
Initialize a new FakeApi.
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{FakeApi$new(api_client)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{api_client}}{An instance of API client.}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-FakeApi-FakeDataFile"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-FakeApi-FakeDataFile}{}}}
|
||||||
|
\subsection{Method \code{FakeDataFile()}}{
|
||||||
|
test data_file to ensure it's escaped correctly
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{FakeApi$FakeDataFile(dummy, var_data_file = NULL, data_file = NULL, ...)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{dummy}}{dummy required parameter}
|
||||||
|
|
||||||
|
\item{\code{var_data_file}}{(optional) header data file}
|
||||||
|
|
||||||
|
\item{\code{data_file}}{(optional) name of the data file to save the result}
|
||||||
|
|
||||||
|
\item{\code{...}}{Other optional arguments}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\subsection{Returns}{
|
||||||
|
User
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-FakeApi-FakeDataFileWithHttpInfo"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-FakeApi-FakeDataFileWithHttpInfo}{}}}
|
||||||
|
\subsection{Method \code{FakeDataFileWithHttpInfo()}}{
|
||||||
|
test data_file to ensure it's escaped correctly
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{FakeApi$FakeDataFileWithHttpInfo(
|
||||||
|
dummy,
|
||||||
|
var_data_file = NULL,
|
||||||
|
data_file = NULL,
|
||||||
|
...
|
||||||
|
)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{dummy}}{dummy required parameter}
|
||||||
|
|
||||||
|
\item{\code{var_data_file}}{(optional) header data file}
|
||||||
|
|
||||||
|
\item{\code{data_file}}{(optional) name of the data file to save the result}
|
||||||
|
|
||||||
|
\item{\code{...}}{Other optional arguments}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\subsection{Returns}{
|
||||||
|
API response (User) with additional information such as HTTP status code, headers
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-FakeApi-clone"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-FakeApi-clone}{}}}
|
||||||
|
\subsection{Method \code{clone()}}{
|
||||||
|
The objects of this class are cloneable with this method.
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{FakeApi$clone(deep = FALSE)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{deep}}{Whether to make a deep clone.}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
181
samples/client/petstore/R-httr2-wrapper/man/ModelApiResponse.Rd
Normal file
181
samples/client/petstore/R-httr2-wrapper/man/ModelApiResponse.Rd
Normal file
@@ -0,0 +1,181 @@
|
|||||||
|
% Generated by roxygen2: do not edit by hand
|
||||||
|
% Please edit documentation in R/model_api_response.R
|
||||||
|
\docType{class}
|
||||||
|
\name{ModelApiResponse}
|
||||||
|
\alias{ModelApiResponse}
|
||||||
|
\title{ModelApiResponse}
|
||||||
|
\format{
|
||||||
|
An \code{R6Class} generator object
|
||||||
|
}
|
||||||
|
\description{
|
||||||
|
ModelApiResponse Class
|
||||||
|
}
|
||||||
|
\details{
|
||||||
|
OpenAPI Petstore
|
||||||
|
|
||||||
|
This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
}
|
||||||
|
\section{Public fields}{
|
||||||
|
\if{html}{\out{<div class="r6-fields">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{code}}{integer [optional]}
|
||||||
|
|
||||||
|
\item{\code{type}}{character [optional]}
|
||||||
|
|
||||||
|
\item{\code{message}}{character [optional]}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\section{Methods}{
|
||||||
|
\subsection{Public methods}{
|
||||||
|
\itemize{
|
||||||
|
\item \href{#method-ModelApiResponse-new}{\code{ModelApiResponse$new()}}
|
||||||
|
\item \href{#method-ModelApiResponse-toJSON}{\code{ModelApiResponse$toJSON()}}
|
||||||
|
\item \href{#method-ModelApiResponse-fromJSON}{\code{ModelApiResponse$fromJSON()}}
|
||||||
|
\item \href{#method-ModelApiResponse-toJSONString}{\code{ModelApiResponse$toJSONString()}}
|
||||||
|
\item \href{#method-ModelApiResponse-fromJSONString}{\code{ModelApiResponse$fromJSONString()}}
|
||||||
|
\item \href{#method-ModelApiResponse-validateJSON}{\code{ModelApiResponse$validateJSON()}}
|
||||||
|
\item \href{#method-ModelApiResponse-toString}{\code{ModelApiResponse$toString()}}
|
||||||
|
\item \href{#method-ModelApiResponse-clone}{\code{ModelApiResponse$clone()}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-ModelApiResponse-new"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-ModelApiResponse-new}{}}}
|
||||||
|
\subsection{Method \code{new()}}{
|
||||||
|
Initialize a new ModelApiResponse class.
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{ModelApiResponse$new(code = NULL, type = NULL, message = NULL, ...)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{code}}{code}
|
||||||
|
|
||||||
|
\item{\code{type}}{type}
|
||||||
|
|
||||||
|
\item{\code{message}}{message}
|
||||||
|
|
||||||
|
\item{\code{...}}{Other optional arguments.}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-ModelApiResponse-toJSON"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-ModelApiResponse-toJSON}{}}}
|
||||||
|
\subsection{Method \code{toJSON()}}{
|
||||||
|
To JSON String
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{ModelApiResponse$toJSON()}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Returns}{
|
||||||
|
ModelApiResponse in JSON format
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-ModelApiResponse-fromJSON"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-ModelApiResponse-fromJSON}{}}}
|
||||||
|
\subsection{Method \code{fromJSON()}}{
|
||||||
|
Deserialize JSON string into an instance of ModelApiResponse
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{ModelApiResponse$fromJSON(input_json)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{input_json}}{the JSON input}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\subsection{Returns}{
|
||||||
|
the instance of ModelApiResponse
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-ModelApiResponse-toJSONString"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-ModelApiResponse-toJSONString}{}}}
|
||||||
|
\subsection{Method \code{toJSONString()}}{
|
||||||
|
To JSON String
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{ModelApiResponse$toJSONString()}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Returns}{
|
||||||
|
ModelApiResponse in JSON format
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-ModelApiResponse-fromJSONString"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-ModelApiResponse-fromJSONString}{}}}
|
||||||
|
\subsection{Method \code{fromJSONString()}}{
|
||||||
|
Deserialize JSON string into an instance of ModelApiResponse
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{ModelApiResponse$fromJSONString(input_json)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{input_json}}{the JSON input}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\subsection{Returns}{
|
||||||
|
the instance of ModelApiResponse
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-ModelApiResponse-validateJSON"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-ModelApiResponse-validateJSON}{}}}
|
||||||
|
\subsection{Method \code{validateJSON()}}{
|
||||||
|
Validate JSON input with respect to ModelApiResponse and throw an exception if invalid
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{ModelApiResponse$validateJSON(input)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{input}}{the JSON input}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-ModelApiResponse-toString"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-ModelApiResponse-toString}{}}}
|
||||||
|
\subsection{Method \code{toString()}}{
|
||||||
|
To string (JSON format)
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{ModelApiResponse$toString()}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Returns}{
|
||||||
|
String representation of ModelApiResponse
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-ModelApiResponse-clone"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-ModelApiResponse-clone}{}}}
|
||||||
|
\subsection{Method \code{clone()}}{
|
||||||
|
The objects of this class are cloneable with this method.
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{ModelApiResponse$clone(deep = FALSE)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{deep}}{Whether to make a deep clone.}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
177
samples/client/petstore/R-httr2-wrapper/man/NestedOneOf.Rd
Normal file
177
samples/client/petstore/R-httr2-wrapper/man/NestedOneOf.Rd
Normal file
@@ -0,0 +1,177 @@
|
|||||||
|
% Generated by roxygen2: do not edit by hand
|
||||||
|
% Please edit documentation in R/nested_one_of.R
|
||||||
|
\docType{class}
|
||||||
|
\name{NestedOneOf}
|
||||||
|
\alias{NestedOneOf}
|
||||||
|
\title{NestedOneOf}
|
||||||
|
\format{
|
||||||
|
An \code{R6Class} generator object
|
||||||
|
}
|
||||||
|
\description{
|
||||||
|
NestedOneOf Class
|
||||||
|
}
|
||||||
|
\details{
|
||||||
|
OpenAPI Petstore
|
||||||
|
|
||||||
|
This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
}
|
||||||
|
\section{Public fields}{
|
||||||
|
\if{html}{\out{<div class="r6-fields">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{size}}{integer [optional]}
|
||||||
|
|
||||||
|
\item{\code{nested_pig}}{\link{Pig} [optional]}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\section{Methods}{
|
||||||
|
\subsection{Public methods}{
|
||||||
|
\itemize{
|
||||||
|
\item \href{#method-NestedOneOf-new}{\code{NestedOneOf$new()}}
|
||||||
|
\item \href{#method-NestedOneOf-toJSON}{\code{NestedOneOf$toJSON()}}
|
||||||
|
\item \href{#method-NestedOneOf-fromJSON}{\code{NestedOneOf$fromJSON()}}
|
||||||
|
\item \href{#method-NestedOneOf-toJSONString}{\code{NestedOneOf$toJSONString()}}
|
||||||
|
\item \href{#method-NestedOneOf-fromJSONString}{\code{NestedOneOf$fromJSONString()}}
|
||||||
|
\item \href{#method-NestedOneOf-validateJSON}{\code{NestedOneOf$validateJSON()}}
|
||||||
|
\item \href{#method-NestedOneOf-toString}{\code{NestedOneOf$toString()}}
|
||||||
|
\item \href{#method-NestedOneOf-clone}{\code{NestedOneOf$clone()}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-NestedOneOf-new"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-NestedOneOf-new}{}}}
|
||||||
|
\subsection{Method \code{new()}}{
|
||||||
|
Initialize a new NestedOneOf class.
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{NestedOneOf$new(size = NULL, nested_pig = NULL, ...)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{size}}{size}
|
||||||
|
|
||||||
|
\item{\code{nested_pig}}{nested_pig}
|
||||||
|
|
||||||
|
\item{\code{...}}{Other optional arguments.}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-NestedOneOf-toJSON"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-NestedOneOf-toJSON}{}}}
|
||||||
|
\subsection{Method \code{toJSON()}}{
|
||||||
|
To JSON String
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{NestedOneOf$toJSON()}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Returns}{
|
||||||
|
NestedOneOf in JSON format
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-NestedOneOf-fromJSON"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-NestedOneOf-fromJSON}{}}}
|
||||||
|
\subsection{Method \code{fromJSON()}}{
|
||||||
|
Deserialize JSON string into an instance of NestedOneOf
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{NestedOneOf$fromJSON(input_json)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{input_json}}{the JSON input}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\subsection{Returns}{
|
||||||
|
the instance of NestedOneOf
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-NestedOneOf-toJSONString"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-NestedOneOf-toJSONString}{}}}
|
||||||
|
\subsection{Method \code{toJSONString()}}{
|
||||||
|
To JSON String
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{NestedOneOf$toJSONString()}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Returns}{
|
||||||
|
NestedOneOf in JSON format
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-NestedOneOf-fromJSONString"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-NestedOneOf-fromJSONString}{}}}
|
||||||
|
\subsection{Method \code{fromJSONString()}}{
|
||||||
|
Deserialize JSON string into an instance of NestedOneOf
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{NestedOneOf$fromJSONString(input_json)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{input_json}}{the JSON input}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\subsection{Returns}{
|
||||||
|
the instance of NestedOneOf
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-NestedOneOf-validateJSON"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-NestedOneOf-validateJSON}{}}}
|
||||||
|
\subsection{Method \code{validateJSON()}}{
|
||||||
|
Validate JSON input with respect to NestedOneOf and throw an exception if invalid
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{NestedOneOf$validateJSON(input)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{input}}{the JSON input}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-NestedOneOf-toString"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-NestedOneOf-toString}{}}}
|
||||||
|
\subsection{Method \code{toString()}}{
|
||||||
|
To string (JSON format)
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{NestedOneOf$toString()}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Returns}{
|
||||||
|
String representation of NestedOneOf
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-NestedOneOf-clone"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-NestedOneOf-clone}{}}}
|
||||||
|
\subsection{Method \code{clone()}}{
|
||||||
|
The objects of this class are cloneable with this method.
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{NestedOneOf$clone(deep = FALSE)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{deep}}{Whether to make a deep clone.}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
201
samples/client/petstore/R-httr2-wrapper/man/Order.Rd
Normal file
201
samples/client/petstore/R-httr2-wrapper/man/Order.Rd
Normal file
@@ -0,0 +1,201 @@
|
|||||||
|
% Generated by roxygen2: do not edit by hand
|
||||||
|
% Please edit documentation in R/order.R
|
||||||
|
\docType{class}
|
||||||
|
\name{Order}
|
||||||
|
\alias{Order}
|
||||||
|
\title{Order}
|
||||||
|
\format{
|
||||||
|
An \code{R6Class} generator object
|
||||||
|
}
|
||||||
|
\description{
|
||||||
|
Order Class
|
||||||
|
}
|
||||||
|
\details{
|
||||||
|
OpenAPI Petstore
|
||||||
|
|
||||||
|
This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
}
|
||||||
|
\section{Public fields}{
|
||||||
|
\if{html}{\out{<div class="r6-fields">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{id}}{integer [optional]}
|
||||||
|
|
||||||
|
\item{\code{petId}}{integer [optional]}
|
||||||
|
|
||||||
|
\item{\code{quantity}}{integer [optional]}
|
||||||
|
|
||||||
|
\item{\code{shipDate}}{character [optional]}
|
||||||
|
|
||||||
|
\item{\code{status}}{character [optional]}
|
||||||
|
|
||||||
|
\item{\code{complete}}{character [optional]}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\section{Methods}{
|
||||||
|
\subsection{Public methods}{
|
||||||
|
\itemize{
|
||||||
|
\item \href{#method-Order-new}{\code{Order$new()}}
|
||||||
|
\item \href{#method-Order-toJSON}{\code{Order$toJSON()}}
|
||||||
|
\item \href{#method-Order-fromJSON}{\code{Order$fromJSON()}}
|
||||||
|
\item \href{#method-Order-toJSONString}{\code{Order$toJSONString()}}
|
||||||
|
\item \href{#method-Order-fromJSONString}{\code{Order$fromJSONString()}}
|
||||||
|
\item \href{#method-Order-validateJSON}{\code{Order$validateJSON()}}
|
||||||
|
\item \href{#method-Order-toString}{\code{Order$toString()}}
|
||||||
|
\item \href{#method-Order-clone}{\code{Order$clone()}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-Order-new"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-Order-new}{}}}
|
||||||
|
\subsection{Method \code{new()}}{
|
||||||
|
Initialize a new Order class.
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{Order$new(
|
||||||
|
id = NULL,
|
||||||
|
petId = NULL,
|
||||||
|
quantity = NULL,
|
||||||
|
shipDate = NULL,
|
||||||
|
status = NULL,
|
||||||
|
complete = FALSE,
|
||||||
|
...
|
||||||
|
)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{id}}{id}
|
||||||
|
|
||||||
|
\item{\code{petId}}{petId}
|
||||||
|
|
||||||
|
\item{\code{quantity}}{quantity}
|
||||||
|
|
||||||
|
\item{\code{shipDate}}{shipDate}
|
||||||
|
|
||||||
|
\item{\code{status}}{Order Status}
|
||||||
|
|
||||||
|
\item{\code{complete}}{complete. Default to FALSE.}
|
||||||
|
|
||||||
|
\item{\code{...}}{Other optional arguments.}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-Order-toJSON"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-Order-toJSON}{}}}
|
||||||
|
\subsection{Method \code{toJSON()}}{
|
||||||
|
To JSON String
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{Order$toJSON()}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Returns}{
|
||||||
|
Order in JSON format
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-Order-fromJSON"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-Order-fromJSON}{}}}
|
||||||
|
\subsection{Method \code{fromJSON()}}{
|
||||||
|
Deserialize JSON string into an instance of Order
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{Order$fromJSON(input_json)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{input_json}}{the JSON input}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\subsection{Returns}{
|
||||||
|
the instance of Order
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-Order-toJSONString"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-Order-toJSONString}{}}}
|
||||||
|
\subsection{Method \code{toJSONString()}}{
|
||||||
|
To JSON String
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{Order$toJSONString()}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Returns}{
|
||||||
|
Order in JSON format
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-Order-fromJSONString"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-Order-fromJSONString}{}}}
|
||||||
|
\subsection{Method \code{fromJSONString()}}{
|
||||||
|
Deserialize JSON string into an instance of Order
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{Order$fromJSONString(input_json)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{input_json}}{the JSON input}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\subsection{Returns}{
|
||||||
|
the instance of Order
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-Order-validateJSON"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-Order-validateJSON}{}}}
|
||||||
|
\subsection{Method \code{validateJSON()}}{
|
||||||
|
Validate JSON input with respect to Order and throw an exception if invalid
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{Order$validateJSON(input)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{input}}{the JSON input}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-Order-toString"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-Order-toString}{}}}
|
||||||
|
\subsection{Method \code{toString()}}{
|
||||||
|
To string (JSON format)
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{Order$toString()}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Returns}{
|
||||||
|
String representation of Order
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-Order-clone"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-Order-clone}{}}}
|
||||||
|
\subsection{Method \code{clone()}}{
|
||||||
|
The objects of this class are cloneable with this method.
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{Order$clone(deep = FALSE)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{deep}}{Whether to make a deep clone.}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
201
samples/client/petstore/R-httr2-wrapper/man/Pet.Rd
Normal file
201
samples/client/petstore/R-httr2-wrapper/man/Pet.Rd
Normal file
@@ -0,0 +1,201 @@
|
|||||||
|
% Generated by roxygen2: do not edit by hand
|
||||||
|
% Please edit documentation in R/pet.R
|
||||||
|
\docType{class}
|
||||||
|
\name{Pet}
|
||||||
|
\alias{Pet}
|
||||||
|
\title{Pet}
|
||||||
|
\format{
|
||||||
|
An \code{R6Class} generator object
|
||||||
|
}
|
||||||
|
\description{
|
||||||
|
Pet Class
|
||||||
|
}
|
||||||
|
\details{
|
||||||
|
OpenAPI Petstore
|
||||||
|
|
||||||
|
This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
}
|
||||||
|
\section{Public fields}{
|
||||||
|
\if{html}{\out{<div class="r6-fields">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{id}}{integer [optional]}
|
||||||
|
|
||||||
|
\item{\code{category}}{\link{Category} [optional]}
|
||||||
|
|
||||||
|
\item{\code{name}}{character}
|
||||||
|
|
||||||
|
\item{\code{photoUrls}}{list( character )}
|
||||||
|
|
||||||
|
\item{\code{tags}}{list( \link{Tag} ) [optional]}
|
||||||
|
|
||||||
|
\item{\code{status}}{character [optional]}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\section{Methods}{
|
||||||
|
\subsection{Public methods}{
|
||||||
|
\itemize{
|
||||||
|
\item \href{#method-Pet-new}{\code{Pet$new()}}
|
||||||
|
\item \href{#method-Pet-toJSON}{\code{Pet$toJSON()}}
|
||||||
|
\item \href{#method-Pet-fromJSON}{\code{Pet$fromJSON()}}
|
||||||
|
\item \href{#method-Pet-toJSONString}{\code{Pet$toJSONString()}}
|
||||||
|
\item \href{#method-Pet-fromJSONString}{\code{Pet$fromJSONString()}}
|
||||||
|
\item \href{#method-Pet-validateJSON}{\code{Pet$validateJSON()}}
|
||||||
|
\item \href{#method-Pet-toString}{\code{Pet$toString()}}
|
||||||
|
\item \href{#method-Pet-clone}{\code{Pet$clone()}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-Pet-new"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-Pet-new}{}}}
|
||||||
|
\subsection{Method \code{new()}}{
|
||||||
|
Initialize a new Pet class.
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{Pet$new(
|
||||||
|
name,
|
||||||
|
photoUrls,
|
||||||
|
id = NULL,
|
||||||
|
category = NULL,
|
||||||
|
tags = NULL,
|
||||||
|
status = NULL,
|
||||||
|
...
|
||||||
|
)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{name}}{name}
|
||||||
|
|
||||||
|
\item{\code{photoUrls}}{photoUrls}
|
||||||
|
|
||||||
|
\item{\code{id}}{id}
|
||||||
|
|
||||||
|
\item{\code{category}}{category}
|
||||||
|
|
||||||
|
\item{\code{tags}}{tags}
|
||||||
|
|
||||||
|
\item{\code{status}}{pet status in the store}
|
||||||
|
|
||||||
|
\item{\code{...}}{Other optional arguments.}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-Pet-toJSON"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-Pet-toJSON}{}}}
|
||||||
|
\subsection{Method \code{toJSON()}}{
|
||||||
|
To JSON String
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{Pet$toJSON()}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Returns}{
|
||||||
|
Pet in JSON format
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-Pet-fromJSON"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-Pet-fromJSON}{}}}
|
||||||
|
\subsection{Method \code{fromJSON()}}{
|
||||||
|
Deserialize JSON string into an instance of Pet
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{Pet$fromJSON(input_json)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{input_json}}{the JSON input}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\subsection{Returns}{
|
||||||
|
the instance of Pet
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-Pet-toJSONString"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-Pet-toJSONString}{}}}
|
||||||
|
\subsection{Method \code{toJSONString()}}{
|
||||||
|
To JSON String
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{Pet$toJSONString()}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Returns}{
|
||||||
|
Pet in JSON format
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-Pet-fromJSONString"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-Pet-fromJSONString}{}}}
|
||||||
|
\subsection{Method \code{fromJSONString()}}{
|
||||||
|
Deserialize JSON string into an instance of Pet
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{Pet$fromJSONString(input_json)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{input_json}}{the JSON input}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\subsection{Returns}{
|
||||||
|
the instance of Pet
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-Pet-validateJSON"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-Pet-validateJSON}{}}}
|
||||||
|
\subsection{Method \code{validateJSON()}}{
|
||||||
|
Validate JSON input with respect to Pet and throw an exception if invalid
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{Pet$validateJSON(input)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{input}}{the JSON input}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-Pet-toString"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-Pet-toString}{}}}
|
||||||
|
\subsection{Method \code{toString()}}{
|
||||||
|
To string (JSON format)
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{Pet$toString()}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Returns}{
|
||||||
|
String representation of Pet
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-Pet-clone"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-Pet-clone}{}}}
|
||||||
|
\subsection{Method \code{clone()}}{
|
||||||
|
The objects of this class are cloneable with this method.
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{Pet$clone(deep = FALSE)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{deep}}{Whether to make a deep clone.}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
1055
samples/client/petstore/R-httr2-wrapper/man/PetApi.Rd
Normal file
1055
samples/client/petstore/R-httr2-wrapper/man/PetApi.Rd
Normal file
File diff suppressed because it is too large
Load Diff
156
samples/client/petstore/R-httr2-wrapper/man/Pig.Rd
Normal file
156
samples/client/petstore/R-httr2-wrapper/man/Pig.Rd
Normal file
@@ -0,0 +1,156 @@
|
|||||||
|
% Generated by roxygen2: do not edit by hand
|
||||||
|
% Please edit documentation in R/pig.R
|
||||||
|
\docType{class}
|
||||||
|
\name{Pig}
|
||||||
|
\alias{Pig}
|
||||||
|
\title{Pig}
|
||||||
|
\format{
|
||||||
|
An \code{R6Class} generator object
|
||||||
|
}
|
||||||
|
\description{
|
||||||
|
Pig Class
|
||||||
|
}
|
||||||
|
\details{
|
||||||
|
OpenAPI Petstore
|
||||||
|
|
||||||
|
This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
}
|
||||||
|
\section{Public fields}{
|
||||||
|
\if{html}{\out{<div class="r6-fields">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{actual_instance}}{the object stored in this instance.}
|
||||||
|
|
||||||
|
\item{\code{actual_type}}{the type of the object stored in this instance.}
|
||||||
|
|
||||||
|
\item{\code{one_of}}{a list of object types defined in the oneOf schema.
|
||||||
|
Initialize a new Pig.}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\section{Methods}{
|
||||||
|
\subsection{Public methods}{
|
||||||
|
\itemize{
|
||||||
|
\item \href{#method-Pig-new}{\code{Pig$new()}}
|
||||||
|
\item \href{#method-Pig-fromJSON}{\code{Pig$fromJSON()}}
|
||||||
|
\item \href{#method-Pig-toJSONString}{\code{Pig$toJSONString()}}
|
||||||
|
\item \href{#method-Pig-toJSON}{\code{Pig$toJSON()}}
|
||||||
|
\item \href{#method-Pig-validateJSON}{\code{Pig$validateJSON()}}
|
||||||
|
\item \href{#method-Pig-toString}{\code{Pig$toString()}}
|
||||||
|
\item \href{#method-Pig-clone}{\code{Pig$clone()}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-Pig-new"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-Pig-new}{}}}
|
||||||
|
\subsection{Method \code{new()}}{
|
||||||
|
Initialize a new Pig.
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{Pig$new(instance = NULL)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{instance}}{an instance of the object defined in the oneOf schemas: "BasquePig", "DanishPig"}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-Pig-fromJSON"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-Pig-fromJSON}{}}}
|
||||||
|
\subsection{Method \code{fromJSON()}}{
|
||||||
|
Deserialize JSON string into an instance of Pig.
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{Pig$fromJSON(input)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{input}}{The input JSON.}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\subsection{Returns}{
|
||||||
|
An instance of Pig.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-Pig-toJSONString"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-Pig-toJSONString}{}}}
|
||||||
|
\subsection{Method \code{toJSONString()}}{
|
||||||
|
Serialize Pig to JSON string.
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{Pig$toJSONString()}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Returns}{
|
||||||
|
JSON string representation of the Pig.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-Pig-toJSON"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-Pig-toJSON}{}}}
|
||||||
|
\subsection{Method \code{toJSON()}}{
|
||||||
|
Serialize Pig to JSON.
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{Pig$toJSON()}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Returns}{
|
||||||
|
JSON representation of the Pig.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-Pig-validateJSON"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-Pig-validateJSON}{}}}
|
||||||
|
\subsection{Method \code{validateJSON()}}{
|
||||||
|
Validate the input JSON with respect to Pig and
|
||||||
|
throw exception if invalid.
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{Pig$validateJSON(input)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{input}}{The input JSON.}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-Pig-toString"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-Pig-toString}{}}}
|
||||||
|
\subsection{Method \code{toString()}}{
|
||||||
|
Returns the string representation of the instance.
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{Pig$toString()}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Returns}{
|
||||||
|
The string representation of the instance.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-Pig-clone"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-Pig-clone}{}}}
|
||||||
|
\subsection{Method \code{clone()}}{
|
||||||
|
The objects of this class are cloneable with this method.
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{Pig$clone(deep = FALSE)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{deep}}{Whether to make a deep clone.}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
201
samples/client/petstore/R-httr2-wrapper/man/Special.Rd
Normal file
201
samples/client/petstore/R-httr2-wrapper/man/Special.Rd
Normal file
@@ -0,0 +1,201 @@
|
|||||||
|
% Generated by roxygen2: do not edit by hand
|
||||||
|
% Please edit documentation in R/special.R
|
||||||
|
\docType{class}
|
||||||
|
\name{Special}
|
||||||
|
\alias{Special}
|
||||||
|
\title{Special}
|
||||||
|
\format{
|
||||||
|
An \code{R6Class} generator object
|
||||||
|
}
|
||||||
|
\description{
|
||||||
|
Special Class
|
||||||
|
}
|
||||||
|
\details{
|
||||||
|
OpenAPI Petstore
|
||||||
|
|
||||||
|
This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
}
|
||||||
|
\section{Public fields}{
|
||||||
|
\if{html}{\out{<div class="r6-fields">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{item_self}}{integer [optional]}
|
||||||
|
|
||||||
|
\item{\code{item_private}}{character [optional]}
|
||||||
|
|
||||||
|
\item{\code{item_super}}{character [optional]}
|
||||||
|
|
||||||
|
\item{\code{123_number}}{character [optional]}
|
||||||
|
|
||||||
|
\item{\code{array[test]}}{character [optional]}
|
||||||
|
|
||||||
|
\item{\code{empty_string}}{character [optional]}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\section{Methods}{
|
||||||
|
\subsection{Public methods}{
|
||||||
|
\itemize{
|
||||||
|
\item \href{#method-Special-new}{\code{Special$new()}}
|
||||||
|
\item \href{#method-Special-toJSON}{\code{Special$toJSON()}}
|
||||||
|
\item \href{#method-Special-fromJSON}{\code{Special$fromJSON()}}
|
||||||
|
\item \href{#method-Special-toJSONString}{\code{Special$toJSONString()}}
|
||||||
|
\item \href{#method-Special-fromJSONString}{\code{Special$fromJSONString()}}
|
||||||
|
\item \href{#method-Special-validateJSON}{\code{Special$validateJSON()}}
|
||||||
|
\item \href{#method-Special-toString}{\code{Special$toString()}}
|
||||||
|
\item \href{#method-Special-clone}{\code{Special$clone()}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-Special-new"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-Special-new}{}}}
|
||||||
|
\subsection{Method \code{new()}}{
|
||||||
|
Initialize a new Special class.
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{Special$new(
|
||||||
|
item_self = NULL,
|
||||||
|
item_private = NULL,
|
||||||
|
item_super = NULL,
|
||||||
|
`123_number` = NULL,
|
||||||
|
`array[test]` = NULL,
|
||||||
|
empty_string = NULL,
|
||||||
|
...
|
||||||
|
)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{item_self}}{item_self}
|
||||||
|
|
||||||
|
\item{\code{item_private}}{item_private}
|
||||||
|
|
||||||
|
\item{\code{item_super}}{item_super}
|
||||||
|
|
||||||
|
\item{\code{123_number}}{123_number}
|
||||||
|
|
||||||
|
\item{\code{array[test]}}{array[test]}
|
||||||
|
|
||||||
|
\item{\code{empty_string}}{empty_string}
|
||||||
|
|
||||||
|
\item{\code{...}}{Other optional arguments.}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-Special-toJSON"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-Special-toJSON}{}}}
|
||||||
|
\subsection{Method \code{toJSON()}}{
|
||||||
|
To JSON String
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{Special$toJSON()}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Returns}{
|
||||||
|
Special in JSON format
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-Special-fromJSON"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-Special-fromJSON}{}}}
|
||||||
|
\subsection{Method \code{fromJSON()}}{
|
||||||
|
Deserialize JSON string into an instance of Special
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{Special$fromJSON(input_json)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{input_json}}{the JSON input}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\subsection{Returns}{
|
||||||
|
the instance of Special
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-Special-toJSONString"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-Special-toJSONString}{}}}
|
||||||
|
\subsection{Method \code{toJSONString()}}{
|
||||||
|
To JSON String
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{Special$toJSONString()}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Returns}{
|
||||||
|
Special in JSON format
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-Special-fromJSONString"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-Special-fromJSONString}{}}}
|
||||||
|
\subsection{Method \code{fromJSONString()}}{
|
||||||
|
Deserialize JSON string into an instance of Special
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{Special$fromJSONString(input_json)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{input_json}}{the JSON input}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\subsection{Returns}{
|
||||||
|
the instance of Special
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-Special-validateJSON"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-Special-validateJSON}{}}}
|
||||||
|
\subsection{Method \code{validateJSON()}}{
|
||||||
|
Validate JSON input with respect to Special and throw an exception if invalid
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{Special$validateJSON(input)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{input}}{the JSON input}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-Special-toString"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-Special-toString}{}}}
|
||||||
|
\subsection{Method \code{toString()}}{
|
||||||
|
To string (JSON format)
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{Special$toString()}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Returns}{
|
||||||
|
String representation of Special
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-Special-clone"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-Special-clone}{}}}
|
||||||
|
\subsection{Method \code{clone()}}{
|
||||||
|
The objects of this class are cloneable with this method.
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{Special$clone(deep = FALSE)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{deep}}{Whether to make a deep clone.}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
468
samples/client/petstore/R-httr2-wrapper/man/StoreApi.Rd
Normal file
468
samples/client/petstore/R-httr2-wrapper/man/StoreApi.Rd
Normal file
@@ -0,0 +1,468 @@
|
|||||||
|
% Generated by roxygen2: do not edit by hand
|
||||||
|
% Please edit documentation in R/store_api.R
|
||||||
|
\docType{class}
|
||||||
|
\name{StoreApi}
|
||||||
|
\alias{StoreApi}
|
||||||
|
\title{Store operations}
|
||||||
|
\format{
|
||||||
|
An \code{R6Class} generator object
|
||||||
|
}
|
||||||
|
\description{
|
||||||
|
petstore.Store
|
||||||
|
}
|
||||||
|
\details{
|
||||||
|
OpenAPI Petstore
|
||||||
|
|
||||||
|
This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
}
|
||||||
|
\section{Methods}{
|
||||||
|
|
||||||
|
\describe{
|
||||||
|
\strong{ DeleteOrder } \emph{ Delete purchase order by ID }
|
||||||
|
For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||||
|
|
||||||
|
\itemize{
|
||||||
|
\item \emph{ @param } order_id character
|
||||||
|
|
||||||
|
\item On encountering errors, an error of subclass ApiException will be thrown.
|
||||||
|
|
||||||
|
\item status code : 400 | Invalid ID supplied
|
||||||
|
|
||||||
|
|
||||||
|
\item response headers :
|
||||||
|
|
||||||
|
\tabular{ll}{
|
||||||
|
}
|
||||||
|
\item status code : 404 | Order not found
|
||||||
|
|
||||||
|
|
||||||
|
\item response headers :
|
||||||
|
|
||||||
|
\tabular{ll}{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
\strong{ GetInventory } \emph{ Returns pet inventories by status }
|
||||||
|
Returns a map of status codes to quantities
|
||||||
|
|
||||||
|
\itemize{
|
||||||
|
|
||||||
|
\item On encountering errors, an error of subclass ApiException will be thrown.
|
||||||
|
|
||||||
|
\item status code : 200 | successful operation
|
||||||
|
|
||||||
|
\item return type : map(integer)
|
||||||
|
\item response headers :
|
||||||
|
|
||||||
|
\tabular{ll}{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
\strong{ GetOrderById } \emph{ Find purchase order by ID }
|
||||||
|
For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||||
|
|
||||||
|
\itemize{
|
||||||
|
\item \emph{ @param } order_id integer
|
||||||
|
\item \emph{ @returnType } \link{Order} \cr
|
||||||
|
|
||||||
|
\item On encountering errors, an error of subclass ApiException will be thrown.
|
||||||
|
|
||||||
|
\item status code : 200 | successful operation
|
||||||
|
|
||||||
|
\item return type : Order
|
||||||
|
\item response headers :
|
||||||
|
|
||||||
|
\tabular{ll}{
|
||||||
|
}
|
||||||
|
\item status code : 400 | Invalid ID supplied
|
||||||
|
|
||||||
|
|
||||||
|
\item response headers :
|
||||||
|
|
||||||
|
\tabular{ll}{
|
||||||
|
}
|
||||||
|
\item status code : 404 | Order not found
|
||||||
|
|
||||||
|
|
||||||
|
\item response headers :
|
||||||
|
|
||||||
|
\tabular{ll}{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
\strong{ PlaceOrder } \emph{ Place an order for a pet }
|
||||||
|
|
||||||
|
|
||||||
|
\itemize{
|
||||||
|
\item \emph{ @param } order \link{Order}
|
||||||
|
\item \emph{ @returnType } \link{Order} \cr
|
||||||
|
|
||||||
|
\item On encountering errors, an error of subclass ApiException will be thrown.
|
||||||
|
|
||||||
|
\item status code : 200 | successful operation
|
||||||
|
|
||||||
|
\item return type : Order
|
||||||
|
\item response headers :
|
||||||
|
|
||||||
|
\tabular{ll}{
|
||||||
|
}
|
||||||
|
\item status code : 400 | Invalid Order
|
||||||
|
|
||||||
|
|
||||||
|
\item response headers :
|
||||||
|
|
||||||
|
\tabular{ll}{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
\examples{
|
||||||
|
\dontrun{
|
||||||
|
#################### DeleteOrder ####################
|
||||||
|
|
||||||
|
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()
|
||||||
|
|
||||||
|
result <- tryCatch(
|
||||||
|
api.instance$DeleteOrder(var.order_id),
|
||||||
|
ApiException = function(ex) ex
|
||||||
|
)
|
||||||
|
# In case of error, print the error object
|
||||||
|
if(!is.null(result$ApiException)) {
|
||||||
|
cat(result$ApiException$toString())
|
||||||
|
} else {
|
||||||
|
# response headers
|
||||||
|
response.headers <- result$response$headers
|
||||||
|
# response status code
|
||||||
|
response.status.code <- result$response$status_code
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#################### GetInventory ####################
|
||||||
|
|
||||||
|
library(petstore)
|
||||||
|
|
||||||
|
#Returns pet inventories by status
|
||||||
|
api.instance <- StoreApi$new()
|
||||||
|
|
||||||
|
#Configure API key authorization: api_key
|
||||||
|
api.instance$api_client$api_keys['api_key'] <- 'TODO_YOUR_API_KEY';
|
||||||
|
|
||||||
|
result <- tryCatch(
|
||||||
|
api.instance$GetInventory(),
|
||||||
|
ApiException = function(ex) ex
|
||||||
|
)
|
||||||
|
# In case of error, print the error object
|
||||||
|
if(!is.null(result$ApiException)) {
|
||||||
|
cat(result$ApiException$toString())
|
||||||
|
} else {
|
||||||
|
# deserialized response object
|
||||||
|
response.object <- result$content
|
||||||
|
# response headers
|
||||||
|
response.headers <- result$response$headers
|
||||||
|
# response status code
|
||||||
|
response.status.code <- result$response$status_code
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#################### GetOrderById ####################
|
||||||
|
|
||||||
|
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 <- tryCatch(
|
||||||
|
api.instance$GetOrderById(var.order_id),
|
||||||
|
ApiException = function(ex) ex
|
||||||
|
)
|
||||||
|
# In case of error, print the error object
|
||||||
|
if(!is.null(result$ApiException)) {
|
||||||
|
cat(result$ApiException$toString())
|
||||||
|
} else {
|
||||||
|
# deserialized response object
|
||||||
|
response.object <- result$content
|
||||||
|
# response headers
|
||||||
|
response.headers <- result$response$headers
|
||||||
|
# response status code
|
||||||
|
response.status.code <- result$response$status_code
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#################### PlaceOrder ####################
|
||||||
|
|
||||||
|
library(petstore)
|
||||||
|
var.order <- Order$new() # Order | order placed for purchasing the pet
|
||||||
|
|
||||||
|
#Place an order for a pet
|
||||||
|
api.instance <- StoreApi$new()
|
||||||
|
|
||||||
|
result <- tryCatch(
|
||||||
|
api.instance$PlaceOrder(var.order),
|
||||||
|
ApiException = function(ex) ex
|
||||||
|
)
|
||||||
|
# In case of error, print the error object
|
||||||
|
if(!is.null(result$ApiException)) {
|
||||||
|
cat(result$ApiException$toString())
|
||||||
|
} else {
|
||||||
|
# deserialized response object
|
||||||
|
response.object <- result$content
|
||||||
|
# response headers
|
||||||
|
response.headers <- result$response$headers
|
||||||
|
# response status code
|
||||||
|
response.status.code <- result$response$status_code
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\section{Public fields}{
|
||||||
|
\if{html}{\out{<div class="r6-fields">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{api_client}}{Handles the client-server communication.}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\section{Methods}{
|
||||||
|
\subsection{Public methods}{
|
||||||
|
\itemize{
|
||||||
|
\item \href{#method-StoreApi-new}{\code{StoreApi$new()}}
|
||||||
|
\item \href{#method-StoreApi-DeleteOrder}{\code{StoreApi$DeleteOrder()}}
|
||||||
|
\item \href{#method-StoreApi-DeleteOrderWithHttpInfo}{\code{StoreApi$DeleteOrderWithHttpInfo()}}
|
||||||
|
\item \href{#method-StoreApi-GetInventory}{\code{StoreApi$GetInventory()}}
|
||||||
|
\item \href{#method-StoreApi-GetInventoryWithHttpInfo}{\code{StoreApi$GetInventoryWithHttpInfo()}}
|
||||||
|
\item \href{#method-StoreApi-GetOrderById}{\code{StoreApi$GetOrderById()}}
|
||||||
|
\item \href{#method-StoreApi-GetOrderByIdWithHttpInfo}{\code{StoreApi$GetOrderByIdWithHttpInfo()}}
|
||||||
|
\item \href{#method-StoreApi-PlaceOrder}{\code{StoreApi$PlaceOrder()}}
|
||||||
|
\item \href{#method-StoreApi-PlaceOrderWithHttpInfo}{\code{StoreApi$PlaceOrderWithHttpInfo()}}
|
||||||
|
\item \href{#method-StoreApi-clone}{\code{StoreApi$clone()}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-StoreApi-new"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-StoreApi-new}{}}}
|
||||||
|
\subsection{Method \code{new()}}{
|
||||||
|
Initialize a new StoreApi.
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{StoreApi$new(api_client)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{api_client}}{An instance of API client.}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-StoreApi-DeleteOrder"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-StoreApi-DeleteOrder}{}}}
|
||||||
|
\subsection{Method \code{DeleteOrder()}}{
|
||||||
|
Delete purchase order by ID
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{StoreApi$DeleteOrder(order_id, ...)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{order_id}}{ID of the order that needs to be deleted}
|
||||||
|
|
||||||
|
\item{\code{...}}{Other optional arguments}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\subsection{Returns}{
|
||||||
|
void
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-StoreApi-DeleteOrderWithHttpInfo"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-StoreApi-DeleteOrderWithHttpInfo}{}}}
|
||||||
|
\subsection{Method \code{DeleteOrderWithHttpInfo()}}{
|
||||||
|
Delete purchase order by ID
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{StoreApi$DeleteOrderWithHttpInfo(order_id, ...)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{order_id}}{ID of the order that needs to be deleted}
|
||||||
|
|
||||||
|
\item{\code{...}}{Other optional arguments}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\subsection{Returns}{
|
||||||
|
API response (void) with additional information such as HTTP status code, headers
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-StoreApi-GetInventory"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-StoreApi-GetInventory}{}}}
|
||||||
|
\subsection{Method \code{GetInventory()}}{
|
||||||
|
Returns pet inventories by status
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{StoreApi$GetInventory(data_file = NULL, ...)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{data_file}}{(optional) name of the data file to save the result}
|
||||||
|
|
||||||
|
\item{\code{...}}{Other optional arguments}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\subsection{Returns}{
|
||||||
|
map(integer)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-StoreApi-GetInventoryWithHttpInfo"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-StoreApi-GetInventoryWithHttpInfo}{}}}
|
||||||
|
\subsection{Method \code{GetInventoryWithHttpInfo()}}{
|
||||||
|
Returns pet inventories by status
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{StoreApi$GetInventoryWithHttpInfo(data_file = NULL, ...)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{data_file}}{(optional) name of the data file to save the result}
|
||||||
|
|
||||||
|
\item{\code{...}}{Other optional arguments}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\subsection{Returns}{
|
||||||
|
API response (map(integer)) with additional information such as HTTP status code, headers
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-StoreApi-GetOrderById"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-StoreApi-GetOrderById}{}}}
|
||||||
|
\subsection{Method \code{GetOrderById()}}{
|
||||||
|
Find purchase order by ID
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{StoreApi$GetOrderById(order_id, data_file = NULL, ...)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{order_id}}{ID of pet that needs to be fetched}
|
||||||
|
|
||||||
|
\item{\code{data_file}}{(optional) name of the data file to save the result}
|
||||||
|
|
||||||
|
\item{\code{...}}{Other optional arguments}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\subsection{Returns}{
|
||||||
|
Order
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-StoreApi-GetOrderByIdWithHttpInfo"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-StoreApi-GetOrderByIdWithHttpInfo}{}}}
|
||||||
|
\subsection{Method \code{GetOrderByIdWithHttpInfo()}}{
|
||||||
|
Find purchase order by ID
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{StoreApi$GetOrderByIdWithHttpInfo(order_id, data_file = NULL, ...)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{order_id}}{ID of pet that needs to be fetched}
|
||||||
|
|
||||||
|
\item{\code{data_file}}{(optional) name of the data file to save the result}
|
||||||
|
|
||||||
|
\item{\code{...}}{Other optional arguments}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\subsection{Returns}{
|
||||||
|
API response (Order) with additional information such as HTTP status code, headers
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-StoreApi-PlaceOrder"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-StoreApi-PlaceOrder}{}}}
|
||||||
|
\subsection{Method \code{PlaceOrder()}}{
|
||||||
|
Place an order for a pet
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{StoreApi$PlaceOrder(order, data_file = NULL, ...)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{order}}{order placed for purchasing the pet}
|
||||||
|
|
||||||
|
\item{\code{data_file}}{(optional) name of the data file to save the result}
|
||||||
|
|
||||||
|
\item{\code{...}}{Other optional arguments}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\subsection{Returns}{
|
||||||
|
Order
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-StoreApi-PlaceOrderWithHttpInfo"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-StoreApi-PlaceOrderWithHttpInfo}{}}}
|
||||||
|
\subsection{Method \code{PlaceOrderWithHttpInfo()}}{
|
||||||
|
Place an order for a pet
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{StoreApi$PlaceOrderWithHttpInfo(order, data_file = NULL, ...)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{order}}{order placed for purchasing the pet}
|
||||||
|
|
||||||
|
\item{\code{data_file}}{(optional) name of the data file to save the result}
|
||||||
|
|
||||||
|
\item{\code{...}}{Other optional arguments}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\subsection{Returns}{
|
||||||
|
API response (Order) with additional information such as HTTP status code, headers
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-StoreApi-clone"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-StoreApi-clone}{}}}
|
||||||
|
\subsection{Method \code{clone()}}{
|
||||||
|
The objects of this class are cloneable with this method.
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{StoreApi$clone(deep = FALSE)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{deep}}{Whether to make a deep clone.}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
177
samples/client/petstore/R-httr2-wrapper/man/Tag.Rd
Normal file
177
samples/client/petstore/R-httr2-wrapper/man/Tag.Rd
Normal file
@@ -0,0 +1,177 @@
|
|||||||
|
% Generated by roxygen2: do not edit by hand
|
||||||
|
% Please edit documentation in R/tag.R
|
||||||
|
\docType{class}
|
||||||
|
\name{Tag}
|
||||||
|
\alias{Tag}
|
||||||
|
\title{Tag}
|
||||||
|
\format{
|
||||||
|
An \code{R6Class} generator object
|
||||||
|
}
|
||||||
|
\description{
|
||||||
|
Tag Class
|
||||||
|
}
|
||||||
|
\details{
|
||||||
|
OpenAPI Petstore
|
||||||
|
|
||||||
|
This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
}
|
||||||
|
\section{Public fields}{
|
||||||
|
\if{html}{\out{<div class="r6-fields">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{id}}{integer [optional]}
|
||||||
|
|
||||||
|
\item{\code{name}}{character [optional]}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\section{Methods}{
|
||||||
|
\subsection{Public methods}{
|
||||||
|
\itemize{
|
||||||
|
\item \href{#method-Tag-new}{\code{Tag$new()}}
|
||||||
|
\item \href{#method-Tag-toJSON}{\code{Tag$toJSON()}}
|
||||||
|
\item \href{#method-Tag-fromJSON}{\code{Tag$fromJSON()}}
|
||||||
|
\item \href{#method-Tag-toJSONString}{\code{Tag$toJSONString()}}
|
||||||
|
\item \href{#method-Tag-fromJSONString}{\code{Tag$fromJSONString()}}
|
||||||
|
\item \href{#method-Tag-validateJSON}{\code{Tag$validateJSON()}}
|
||||||
|
\item \href{#method-Tag-toString}{\code{Tag$toString()}}
|
||||||
|
\item \href{#method-Tag-clone}{\code{Tag$clone()}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-Tag-new"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-Tag-new}{}}}
|
||||||
|
\subsection{Method \code{new()}}{
|
||||||
|
Initialize a new Tag class.
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{Tag$new(id = NULL, name = NULL, ...)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{id}}{id}
|
||||||
|
|
||||||
|
\item{\code{name}}{name}
|
||||||
|
|
||||||
|
\item{\code{...}}{Other optional arguments.}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-Tag-toJSON"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-Tag-toJSON}{}}}
|
||||||
|
\subsection{Method \code{toJSON()}}{
|
||||||
|
To JSON String
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{Tag$toJSON()}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Returns}{
|
||||||
|
Tag in JSON format
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-Tag-fromJSON"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-Tag-fromJSON}{}}}
|
||||||
|
\subsection{Method \code{fromJSON()}}{
|
||||||
|
Deserialize JSON string into an instance of Tag
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{Tag$fromJSON(input_json)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{input_json}}{the JSON input}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\subsection{Returns}{
|
||||||
|
the instance of Tag
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-Tag-toJSONString"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-Tag-toJSONString}{}}}
|
||||||
|
\subsection{Method \code{toJSONString()}}{
|
||||||
|
To JSON String
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{Tag$toJSONString()}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Returns}{
|
||||||
|
Tag in JSON format
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-Tag-fromJSONString"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-Tag-fromJSONString}{}}}
|
||||||
|
\subsection{Method \code{fromJSONString()}}{
|
||||||
|
Deserialize JSON string into an instance of Tag
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{Tag$fromJSONString(input_json)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{input_json}}{the JSON input}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\subsection{Returns}{
|
||||||
|
the instance of Tag
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-Tag-validateJSON"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-Tag-validateJSON}{}}}
|
||||||
|
\subsection{Method \code{validateJSON()}}{
|
||||||
|
Validate JSON input with respect to Tag and throw an exception if invalid
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{Tag$validateJSON(input)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{input}}{the JSON input}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-Tag-toString"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-Tag-toString}{}}}
|
||||||
|
\subsection{Method \code{toString()}}{
|
||||||
|
To string (JSON format)
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{Tag$toString()}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Returns}{
|
||||||
|
String representation of Tag
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-Tag-clone"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-Tag-clone}{}}}
|
||||||
|
\subsection{Method \code{clone()}}{
|
||||||
|
The objects of this class are cloneable with this method.
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{Tag$clone(deep = FALSE)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{deep}}{Whether to make a deep clone.}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
177
samples/client/petstore/R-httr2-wrapper/man/UpdatePetRequest.Rd
Normal file
177
samples/client/petstore/R-httr2-wrapper/man/UpdatePetRequest.Rd
Normal file
@@ -0,0 +1,177 @@
|
|||||||
|
% Generated by roxygen2: do not edit by hand
|
||||||
|
% Please edit documentation in R/update_pet_request.R
|
||||||
|
\docType{class}
|
||||||
|
\name{UpdatePetRequest}
|
||||||
|
\alias{UpdatePetRequest}
|
||||||
|
\title{UpdatePetRequest}
|
||||||
|
\format{
|
||||||
|
An \code{R6Class} generator object
|
||||||
|
}
|
||||||
|
\description{
|
||||||
|
UpdatePetRequest Class
|
||||||
|
}
|
||||||
|
\details{
|
||||||
|
OpenAPI Petstore
|
||||||
|
|
||||||
|
This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
}
|
||||||
|
\section{Public fields}{
|
||||||
|
\if{html}{\out{<div class="r6-fields">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{jsonData}}{\link{Pet} [optional]}
|
||||||
|
|
||||||
|
\item{\code{binaryDataN2Information}}{data.frame [optional]}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\section{Methods}{
|
||||||
|
\subsection{Public methods}{
|
||||||
|
\itemize{
|
||||||
|
\item \href{#method-UpdatePetRequest-new}{\code{UpdatePetRequest$new()}}
|
||||||
|
\item \href{#method-UpdatePetRequest-toJSON}{\code{UpdatePetRequest$toJSON()}}
|
||||||
|
\item \href{#method-UpdatePetRequest-fromJSON}{\code{UpdatePetRequest$fromJSON()}}
|
||||||
|
\item \href{#method-UpdatePetRequest-toJSONString}{\code{UpdatePetRequest$toJSONString()}}
|
||||||
|
\item \href{#method-UpdatePetRequest-fromJSONString}{\code{UpdatePetRequest$fromJSONString()}}
|
||||||
|
\item \href{#method-UpdatePetRequest-validateJSON}{\code{UpdatePetRequest$validateJSON()}}
|
||||||
|
\item \href{#method-UpdatePetRequest-toString}{\code{UpdatePetRequest$toString()}}
|
||||||
|
\item \href{#method-UpdatePetRequest-clone}{\code{UpdatePetRequest$clone()}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-UpdatePetRequest-new"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-UpdatePetRequest-new}{}}}
|
||||||
|
\subsection{Method \code{new()}}{
|
||||||
|
Initialize a new UpdatePetRequest class.
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{UpdatePetRequest$new(jsonData = NULL, binaryDataN2Information = NULL, ...)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{jsonData}}{jsonData}
|
||||||
|
|
||||||
|
\item{\code{binaryDataN2Information}}{binaryDataN2Information}
|
||||||
|
|
||||||
|
\item{\code{...}}{Other optional arguments.}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-UpdatePetRequest-toJSON"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-UpdatePetRequest-toJSON}{}}}
|
||||||
|
\subsection{Method \code{toJSON()}}{
|
||||||
|
To JSON String
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{UpdatePetRequest$toJSON()}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Returns}{
|
||||||
|
UpdatePetRequest in JSON format
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-UpdatePetRequest-fromJSON"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-UpdatePetRequest-fromJSON}{}}}
|
||||||
|
\subsection{Method \code{fromJSON()}}{
|
||||||
|
Deserialize JSON string into an instance of UpdatePetRequest
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{UpdatePetRequest$fromJSON(input_json)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{input_json}}{the JSON input}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\subsection{Returns}{
|
||||||
|
the instance of UpdatePetRequest
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-UpdatePetRequest-toJSONString"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-UpdatePetRequest-toJSONString}{}}}
|
||||||
|
\subsection{Method \code{toJSONString()}}{
|
||||||
|
To JSON String
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{UpdatePetRequest$toJSONString()}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Returns}{
|
||||||
|
UpdatePetRequest in JSON format
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-UpdatePetRequest-fromJSONString"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-UpdatePetRequest-fromJSONString}{}}}
|
||||||
|
\subsection{Method \code{fromJSONString()}}{
|
||||||
|
Deserialize JSON string into an instance of UpdatePetRequest
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{UpdatePetRequest$fromJSONString(input_json)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{input_json}}{the JSON input}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\subsection{Returns}{
|
||||||
|
the instance of UpdatePetRequest
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-UpdatePetRequest-validateJSON"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-UpdatePetRequest-validateJSON}{}}}
|
||||||
|
\subsection{Method \code{validateJSON()}}{
|
||||||
|
Validate JSON input with respect to UpdatePetRequest and throw an exception if invalid
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{UpdatePetRequest$validateJSON(input)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{input}}{the JSON input}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-UpdatePetRequest-toString"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-UpdatePetRequest-toString}{}}}
|
||||||
|
\subsection{Method \code{toString()}}{
|
||||||
|
To string (JSON format)
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{UpdatePetRequest$toString()}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Returns}{
|
||||||
|
String representation of UpdatePetRequest
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-UpdatePetRequest-clone"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-UpdatePetRequest-clone}{}}}
|
||||||
|
\subsection{Method \code{clone()}}{
|
||||||
|
The objects of this class are cloneable with this method.
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{UpdatePetRequest$clone(deep = FALSE)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{deep}}{Whether to make a deep clone.}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
211
samples/client/petstore/R-httr2-wrapper/man/User.Rd
Normal file
211
samples/client/petstore/R-httr2-wrapper/man/User.Rd
Normal file
@@ -0,0 +1,211 @@
|
|||||||
|
% Generated by roxygen2: do not edit by hand
|
||||||
|
% Please edit documentation in R/user.R
|
||||||
|
\docType{class}
|
||||||
|
\name{User}
|
||||||
|
\alias{User}
|
||||||
|
\title{User}
|
||||||
|
\format{
|
||||||
|
An \code{R6Class} generator object
|
||||||
|
}
|
||||||
|
\description{
|
||||||
|
User Class
|
||||||
|
}
|
||||||
|
\details{
|
||||||
|
OpenAPI Petstore
|
||||||
|
|
||||||
|
This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
}
|
||||||
|
\section{Public fields}{
|
||||||
|
\if{html}{\out{<div class="r6-fields">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{id}}{integer [optional]}
|
||||||
|
|
||||||
|
\item{\code{username}}{character [optional]}
|
||||||
|
|
||||||
|
\item{\code{firstName}}{character [optional]}
|
||||||
|
|
||||||
|
\item{\code{lastName}}{character [optional]}
|
||||||
|
|
||||||
|
\item{\code{email}}{character [optional]}
|
||||||
|
|
||||||
|
\item{\code{password}}{character [optional]}
|
||||||
|
|
||||||
|
\item{\code{phone}}{character [optional]}
|
||||||
|
|
||||||
|
\item{\code{userStatus}}{integer [optional]}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\section{Methods}{
|
||||||
|
\subsection{Public methods}{
|
||||||
|
\itemize{
|
||||||
|
\item \href{#method-User-new}{\code{User$new()}}
|
||||||
|
\item \href{#method-User-toJSON}{\code{User$toJSON()}}
|
||||||
|
\item \href{#method-User-fromJSON}{\code{User$fromJSON()}}
|
||||||
|
\item \href{#method-User-toJSONString}{\code{User$toJSONString()}}
|
||||||
|
\item \href{#method-User-fromJSONString}{\code{User$fromJSONString()}}
|
||||||
|
\item \href{#method-User-validateJSON}{\code{User$validateJSON()}}
|
||||||
|
\item \href{#method-User-toString}{\code{User$toString()}}
|
||||||
|
\item \href{#method-User-clone}{\code{User$clone()}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-User-new"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-User-new}{}}}
|
||||||
|
\subsection{Method \code{new()}}{
|
||||||
|
Initialize a new User class.
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{User$new(
|
||||||
|
id = NULL,
|
||||||
|
username = NULL,
|
||||||
|
firstName = NULL,
|
||||||
|
lastName = NULL,
|
||||||
|
email = NULL,
|
||||||
|
password = NULL,
|
||||||
|
phone = NULL,
|
||||||
|
userStatus = NULL,
|
||||||
|
...
|
||||||
|
)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{id}}{id}
|
||||||
|
|
||||||
|
\item{\code{username}}{username}
|
||||||
|
|
||||||
|
\item{\code{firstName}}{firstName}
|
||||||
|
|
||||||
|
\item{\code{lastName}}{lastName}
|
||||||
|
|
||||||
|
\item{\code{email}}{email}
|
||||||
|
|
||||||
|
\item{\code{password}}{password}
|
||||||
|
|
||||||
|
\item{\code{phone}}{phone}
|
||||||
|
|
||||||
|
\item{\code{userStatus}}{User Status}
|
||||||
|
|
||||||
|
\item{\code{...}}{Other optional arguments.}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-User-toJSON"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-User-toJSON}{}}}
|
||||||
|
\subsection{Method \code{toJSON()}}{
|
||||||
|
To JSON String
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{User$toJSON()}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Returns}{
|
||||||
|
User in JSON format
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-User-fromJSON"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-User-fromJSON}{}}}
|
||||||
|
\subsection{Method \code{fromJSON()}}{
|
||||||
|
Deserialize JSON string into an instance of User
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{User$fromJSON(input_json)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{input_json}}{the JSON input}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\subsection{Returns}{
|
||||||
|
the instance of User
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-User-toJSONString"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-User-toJSONString}{}}}
|
||||||
|
\subsection{Method \code{toJSONString()}}{
|
||||||
|
To JSON String
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{User$toJSONString()}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Returns}{
|
||||||
|
User in JSON format
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-User-fromJSONString"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-User-fromJSONString}{}}}
|
||||||
|
\subsection{Method \code{fromJSONString()}}{
|
||||||
|
Deserialize JSON string into an instance of User
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{User$fromJSONString(input_json)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{input_json}}{the JSON input}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\subsection{Returns}{
|
||||||
|
the instance of User
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-User-validateJSON"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-User-validateJSON}{}}}
|
||||||
|
\subsection{Method \code{validateJSON()}}{
|
||||||
|
Validate JSON input with respect to User and throw an exception if invalid
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{User$validateJSON(input)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{input}}{the JSON input}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-User-toString"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-User-toString}{}}}
|
||||||
|
\subsection{Method \code{toString()}}{
|
||||||
|
To string (JSON format)
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{User$toString()}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Returns}{
|
||||||
|
String representation of User
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-User-clone"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-User-clone}{}}}
|
||||||
|
\subsection{Method \code{clone()}}{
|
||||||
|
The objects of this class are cloneable with this method.
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{User$clone(deep = FALSE)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{deep}}{Whether to make a deep clone.}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
842
samples/client/petstore/R-httr2-wrapper/man/UserApi.Rd
Normal file
842
samples/client/petstore/R-httr2-wrapper/man/UserApi.Rd
Normal file
@@ -0,0 +1,842 @@
|
|||||||
|
% Generated by roxygen2: do not edit by hand
|
||||||
|
% Please edit documentation in R/user_api.R
|
||||||
|
\docType{class}
|
||||||
|
\name{UserApi}
|
||||||
|
\alias{UserApi}
|
||||||
|
\title{User operations}
|
||||||
|
\format{
|
||||||
|
An \code{R6Class} generator object
|
||||||
|
}
|
||||||
|
\description{
|
||||||
|
petstore.User
|
||||||
|
}
|
||||||
|
\details{
|
||||||
|
OpenAPI Petstore
|
||||||
|
|
||||||
|
This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
}
|
||||||
|
\section{Methods}{
|
||||||
|
|
||||||
|
\describe{
|
||||||
|
\strong{ CreateUser } \emph{ Create user }
|
||||||
|
This can only be done by the logged in user.
|
||||||
|
|
||||||
|
\itemize{
|
||||||
|
\item \emph{ @param } user \link{User}
|
||||||
|
|
||||||
|
\item On encountering errors, an error of subclass ApiException will be thrown.
|
||||||
|
|
||||||
|
\item status code : 0 | successful operation
|
||||||
|
|
||||||
|
|
||||||
|
\item response headers :
|
||||||
|
|
||||||
|
\tabular{ll}{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
\strong{ CreateUsersWithArrayInput } \emph{ Creates list of users with given input array }
|
||||||
|
|
||||||
|
|
||||||
|
\itemize{
|
||||||
|
\item \emph{ @param } user list( \link{User} )
|
||||||
|
|
||||||
|
\item On encountering errors, an error of subclass ApiException will be thrown.
|
||||||
|
|
||||||
|
\item status code : 0 | successful operation
|
||||||
|
|
||||||
|
|
||||||
|
\item response headers :
|
||||||
|
|
||||||
|
\tabular{ll}{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
\strong{ CreateUsersWithListInput } \emph{ Creates list of users with given input array }
|
||||||
|
|
||||||
|
|
||||||
|
\itemize{
|
||||||
|
\item \emph{ @param } user list( \link{User} )
|
||||||
|
|
||||||
|
\item On encountering errors, an error of subclass ApiException will be thrown.
|
||||||
|
|
||||||
|
\item status code : 0 | successful operation
|
||||||
|
|
||||||
|
|
||||||
|
\item response headers :
|
||||||
|
|
||||||
|
\tabular{ll}{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
\strong{ DeleteUser } \emph{ Delete user }
|
||||||
|
This can only be done by the logged in user.
|
||||||
|
|
||||||
|
\itemize{
|
||||||
|
\item \emph{ @param } username character
|
||||||
|
|
||||||
|
\item On encountering errors, an error of subclass ApiException will be thrown.
|
||||||
|
|
||||||
|
\item status code : 400 | Invalid username supplied
|
||||||
|
|
||||||
|
|
||||||
|
\item response headers :
|
||||||
|
|
||||||
|
\tabular{ll}{
|
||||||
|
}
|
||||||
|
\item status code : 404 | User not found
|
||||||
|
|
||||||
|
|
||||||
|
\item response headers :
|
||||||
|
|
||||||
|
\tabular{ll}{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
\strong{ GetUserByName } \emph{ Get user by user name }
|
||||||
|
|
||||||
|
|
||||||
|
\itemize{
|
||||||
|
\item \emph{ @param } username character
|
||||||
|
\item \emph{ @returnType } \link{User} \cr
|
||||||
|
|
||||||
|
\item On encountering errors, an error of subclass ApiException will be thrown.
|
||||||
|
|
||||||
|
\item status code : 200 | successful operation
|
||||||
|
|
||||||
|
\item return type : User
|
||||||
|
\item response headers :
|
||||||
|
|
||||||
|
\tabular{ll}{
|
||||||
|
}
|
||||||
|
\item status code : 400 | Invalid username supplied
|
||||||
|
|
||||||
|
|
||||||
|
\item response headers :
|
||||||
|
|
||||||
|
\tabular{ll}{
|
||||||
|
}
|
||||||
|
\item status code : 404 | User not found
|
||||||
|
|
||||||
|
|
||||||
|
\item response headers :
|
||||||
|
|
||||||
|
\tabular{ll}{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
\strong{ LoginUser } \emph{ Logs user into the system }
|
||||||
|
|
||||||
|
|
||||||
|
\itemize{
|
||||||
|
\item \emph{ @param } username character
|
||||||
|
\item \emph{ @param } password character
|
||||||
|
|
||||||
|
\item On encountering errors, an error of subclass ApiException will be thrown.
|
||||||
|
|
||||||
|
\item status code : 200 | successful operation
|
||||||
|
|
||||||
|
\item return type : character
|
||||||
|
\item response headers :
|
||||||
|
|
||||||
|
\tabular{ll}{
|
||||||
|
Set-Cookie \tab Cookie authentication key for use with the `api_key` apiKey authentication. \cr
|
||||||
|
X-Rate-Limit \tab calls per hour allowed by the user \cr
|
||||||
|
X-Expires-After \tab date in UTC when token expires \cr
|
||||||
|
}
|
||||||
|
\item status code : 400 | Invalid username/password supplied
|
||||||
|
|
||||||
|
|
||||||
|
\item response headers :
|
||||||
|
|
||||||
|
\tabular{ll}{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
\strong{ LogoutUser } \emph{ Logs out current logged in user session }
|
||||||
|
|
||||||
|
|
||||||
|
\itemize{
|
||||||
|
|
||||||
|
\item On encountering errors, an error of subclass ApiException will be thrown.
|
||||||
|
|
||||||
|
\item status code : 0 | successful operation
|
||||||
|
|
||||||
|
|
||||||
|
\item response headers :
|
||||||
|
|
||||||
|
\tabular{ll}{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
\strong{ UpdateUser } \emph{ Updated user }
|
||||||
|
This can only be done by the logged in user.
|
||||||
|
|
||||||
|
\itemize{
|
||||||
|
\item \emph{ @param } username character
|
||||||
|
\item \emph{ @param } user \link{User}
|
||||||
|
|
||||||
|
\item On encountering errors, an error of subclass ApiException will be thrown.
|
||||||
|
|
||||||
|
\item status code : 400 | Invalid user supplied
|
||||||
|
|
||||||
|
|
||||||
|
\item response headers :
|
||||||
|
|
||||||
|
\tabular{ll}{
|
||||||
|
}
|
||||||
|
\item status code : 404 | User not found
|
||||||
|
|
||||||
|
|
||||||
|
\item response headers :
|
||||||
|
|
||||||
|
\tabular{ll}{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
\examples{
|
||||||
|
\dontrun{
|
||||||
|
#################### CreateUser ####################
|
||||||
|
|
||||||
|
library(petstore)
|
||||||
|
var.user <- User$new() # User | Created user object
|
||||||
|
|
||||||
|
#Create user
|
||||||
|
api.instance <- UserApi$new()
|
||||||
|
|
||||||
|
#Configure API key authorization: api_key
|
||||||
|
api.instance$api_client$api_keys['api_key'] <- 'TODO_YOUR_API_KEY';
|
||||||
|
|
||||||
|
result <- tryCatch(
|
||||||
|
api.instance$CreateUser(var.user),
|
||||||
|
ApiException = function(ex) ex
|
||||||
|
)
|
||||||
|
# In case of error, print the error object
|
||||||
|
if(!is.null(result$ApiException)) {
|
||||||
|
cat(result$ApiException$toString())
|
||||||
|
} else {
|
||||||
|
# response headers
|
||||||
|
response.headers <- result$response$headers
|
||||||
|
# response status code
|
||||||
|
response.status.code <- result$response$status_code
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#################### CreateUsersWithArrayInput ####################
|
||||||
|
|
||||||
|
library(petstore)
|
||||||
|
var.user <- [User$new()] # array[User] | List of user object
|
||||||
|
|
||||||
|
#Creates list of users with given input array
|
||||||
|
api.instance <- UserApi$new()
|
||||||
|
|
||||||
|
#Configure API key authorization: api_key
|
||||||
|
api.instance$api_client$api_keys['api_key'] <- 'TODO_YOUR_API_KEY';
|
||||||
|
|
||||||
|
result <- tryCatch(
|
||||||
|
api.instance$CreateUsersWithArrayInput(var.user),
|
||||||
|
ApiException = function(ex) ex
|
||||||
|
)
|
||||||
|
# In case of error, print the error object
|
||||||
|
if(!is.null(result$ApiException)) {
|
||||||
|
cat(result$ApiException$toString())
|
||||||
|
} else {
|
||||||
|
# response headers
|
||||||
|
response.headers <- result$response$headers
|
||||||
|
# response status code
|
||||||
|
response.status.code <- result$response$status_code
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#################### CreateUsersWithListInput ####################
|
||||||
|
|
||||||
|
library(petstore)
|
||||||
|
var.user <- [User$new()] # array[User] | List of user object
|
||||||
|
|
||||||
|
#Creates list of users with given input array
|
||||||
|
api.instance <- UserApi$new()
|
||||||
|
|
||||||
|
#Configure API key authorization: api_key
|
||||||
|
api.instance$api_client$api_keys['api_key'] <- 'TODO_YOUR_API_KEY';
|
||||||
|
|
||||||
|
result <- tryCatch(
|
||||||
|
api.instance$CreateUsersWithListInput(var.user),
|
||||||
|
ApiException = function(ex) ex
|
||||||
|
)
|
||||||
|
# In case of error, print the error object
|
||||||
|
if(!is.null(result$ApiException)) {
|
||||||
|
cat(result$ApiException$toString())
|
||||||
|
} else {
|
||||||
|
# response headers
|
||||||
|
response.headers <- result$response$headers
|
||||||
|
# response status code
|
||||||
|
response.status.code <- result$response$status_code
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#################### DeleteUser ####################
|
||||||
|
|
||||||
|
library(petstore)
|
||||||
|
var.username <- 'username_example' # character | The name that needs to be deleted
|
||||||
|
|
||||||
|
#Delete user
|
||||||
|
api.instance <- UserApi$new()
|
||||||
|
|
||||||
|
#Configure API key authorization: api_key
|
||||||
|
api.instance$api_client$api_keys['api_key'] <- 'TODO_YOUR_API_KEY';
|
||||||
|
|
||||||
|
result <- tryCatch(
|
||||||
|
api.instance$DeleteUser(var.username),
|
||||||
|
ApiException = function(ex) ex
|
||||||
|
)
|
||||||
|
# In case of error, print the error object
|
||||||
|
if(!is.null(result$ApiException)) {
|
||||||
|
cat(result$ApiException$toString())
|
||||||
|
} else {
|
||||||
|
# response headers
|
||||||
|
response.headers <- result$response$headers
|
||||||
|
# response status code
|
||||||
|
response.status.code <- result$response$status_code
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#################### GetUserByName ####################
|
||||||
|
|
||||||
|
library(petstore)
|
||||||
|
var.username <- 'username_example' # character | The name that needs to be fetched. Use user1 for testing.
|
||||||
|
|
||||||
|
#Get user by user name
|
||||||
|
api.instance <- UserApi$new()
|
||||||
|
|
||||||
|
result <- tryCatch(
|
||||||
|
api.instance$GetUserByName(var.username),
|
||||||
|
ApiException = function(ex) ex
|
||||||
|
)
|
||||||
|
# In case of error, print the error object
|
||||||
|
if(!is.null(result$ApiException)) {
|
||||||
|
cat(result$ApiException$toString())
|
||||||
|
} else {
|
||||||
|
# deserialized response object
|
||||||
|
response.object <- result$content
|
||||||
|
# response headers
|
||||||
|
response.headers <- result$response$headers
|
||||||
|
# response status code
|
||||||
|
response.status.code <- result$response$status_code
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#################### LoginUser ####################
|
||||||
|
|
||||||
|
library(petstore)
|
||||||
|
var.username <- 'username_example' # character | The user name for login
|
||||||
|
var.password <- 'password_example' # character | The password for login in clear text
|
||||||
|
|
||||||
|
#Logs user into the system
|
||||||
|
api.instance <- UserApi$new()
|
||||||
|
|
||||||
|
result <- tryCatch(
|
||||||
|
api.instance$LoginUser(var.username, var.password),
|
||||||
|
ApiException = function(ex) ex
|
||||||
|
)
|
||||||
|
# In case of error, print the error object
|
||||||
|
if(!is.null(result$ApiException)) {
|
||||||
|
cat(result$ApiException$toString())
|
||||||
|
} else {
|
||||||
|
# deserialized response object
|
||||||
|
response.object <- result$content
|
||||||
|
# response headers
|
||||||
|
response.headers <- result$response$headers
|
||||||
|
# response status code
|
||||||
|
response.status.code <- result$response$status_code
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#################### LogoutUser ####################
|
||||||
|
|
||||||
|
library(petstore)
|
||||||
|
|
||||||
|
#Logs out current logged in user session
|
||||||
|
api.instance <- UserApi$new()
|
||||||
|
|
||||||
|
#Configure API key authorization: api_key
|
||||||
|
api.instance$api_client$api_keys['api_key'] <- 'TODO_YOUR_API_KEY';
|
||||||
|
|
||||||
|
result <- tryCatch(
|
||||||
|
api.instance$LogoutUser(),
|
||||||
|
ApiException = function(ex) ex
|
||||||
|
)
|
||||||
|
# In case of error, print the error object
|
||||||
|
if(!is.null(result$ApiException)) {
|
||||||
|
cat(result$ApiException$toString())
|
||||||
|
} else {
|
||||||
|
# response headers
|
||||||
|
response.headers <- result$response$headers
|
||||||
|
# response status code
|
||||||
|
response.status.code <- result$response$status_code
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#################### UpdateUser ####################
|
||||||
|
|
||||||
|
library(petstore)
|
||||||
|
var.username <- 'username_example' # character | name that need to be deleted
|
||||||
|
var.user <- User$new() # User | Updated user object
|
||||||
|
|
||||||
|
#Updated user
|
||||||
|
api.instance <- UserApi$new()
|
||||||
|
|
||||||
|
#Configure API key authorization: api_key
|
||||||
|
api.instance$api_client$api_keys['api_key'] <- 'TODO_YOUR_API_KEY';
|
||||||
|
|
||||||
|
result <- tryCatch(
|
||||||
|
api.instance$UpdateUser(var.username, var.user),
|
||||||
|
ApiException = function(ex) ex
|
||||||
|
)
|
||||||
|
# In case of error, print the error object
|
||||||
|
if(!is.null(result$ApiException)) {
|
||||||
|
cat(result$ApiException$toString())
|
||||||
|
} else {
|
||||||
|
# response headers
|
||||||
|
response.headers <- result$response$headers
|
||||||
|
# response status code
|
||||||
|
response.status.code <- result$response$status_code
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\section{Public fields}{
|
||||||
|
\if{html}{\out{<div class="r6-fields">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{api_client}}{Handles the client-server communication.}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\section{Methods}{
|
||||||
|
\subsection{Public methods}{
|
||||||
|
\itemize{
|
||||||
|
\item \href{#method-UserApi-new}{\code{UserApi$new()}}
|
||||||
|
\item \href{#method-UserApi-CreateUser}{\code{UserApi$CreateUser()}}
|
||||||
|
\item \href{#method-UserApi-CreateUserWithHttpInfo}{\code{UserApi$CreateUserWithHttpInfo()}}
|
||||||
|
\item \href{#method-UserApi-CreateUsersWithArrayInput}{\code{UserApi$CreateUsersWithArrayInput()}}
|
||||||
|
\item \href{#method-UserApi-CreateUsersWithArrayInputWithHttpInfo}{\code{UserApi$CreateUsersWithArrayInputWithHttpInfo()}}
|
||||||
|
\item \href{#method-UserApi-CreateUsersWithListInput}{\code{UserApi$CreateUsersWithListInput()}}
|
||||||
|
\item \href{#method-UserApi-CreateUsersWithListInputWithHttpInfo}{\code{UserApi$CreateUsersWithListInputWithHttpInfo()}}
|
||||||
|
\item \href{#method-UserApi-DeleteUser}{\code{UserApi$DeleteUser()}}
|
||||||
|
\item \href{#method-UserApi-DeleteUserWithHttpInfo}{\code{UserApi$DeleteUserWithHttpInfo()}}
|
||||||
|
\item \href{#method-UserApi-GetUserByName}{\code{UserApi$GetUserByName()}}
|
||||||
|
\item \href{#method-UserApi-GetUserByNameWithHttpInfo}{\code{UserApi$GetUserByNameWithHttpInfo()}}
|
||||||
|
\item \href{#method-UserApi-LoginUser}{\code{UserApi$LoginUser()}}
|
||||||
|
\item \href{#method-UserApi-LoginUserWithHttpInfo}{\code{UserApi$LoginUserWithHttpInfo()}}
|
||||||
|
\item \href{#method-UserApi-LogoutUser}{\code{UserApi$LogoutUser()}}
|
||||||
|
\item \href{#method-UserApi-LogoutUserWithHttpInfo}{\code{UserApi$LogoutUserWithHttpInfo()}}
|
||||||
|
\item \href{#method-UserApi-UpdateUser}{\code{UserApi$UpdateUser()}}
|
||||||
|
\item \href{#method-UserApi-UpdateUserWithHttpInfo}{\code{UserApi$UpdateUserWithHttpInfo()}}
|
||||||
|
\item \href{#method-UserApi-clone}{\code{UserApi$clone()}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-UserApi-new"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-UserApi-new}{}}}
|
||||||
|
\subsection{Method \code{new()}}{
|
||||||
|
Initialize a new UserApi.
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{UserApi$new(api_client)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{api_client}}{An instance of API client.}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-UserApi-CreateUser"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-UserApi-CreateUser}{}}}
|
||||||
|
\subsection{Method \code{CreateUser()}}{
|
||||||
|
Create user
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{UserApi$CreateUser(user, ...)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{user}}{Created user object}
|
||||||
|
|
||||||
|
\item{\code{...}}{Other optional arguments}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\subsection{Returns}{
|
||||||
|
void
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-UserApi-CreateUserWithHttpInfo"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-UserApi-CreateUserWithHttpInfo}{}}}
|
||||||
|
\subsection{Method \code{CreateUserWithHttpInfo()}}{
|
||||||
|
Create user
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{UserApi$CreateUserWithHttpInfo(user, ...)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{user}}{Created user object}
|
||||||
|
|
||||||
|
\item{\code{...}}{Other optional arguments}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\subsection{Returns}{
|
||||||
|
API response (void) with additional information such as HTTP status code, headers
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-UserApi-CreateUsersWithArrayInput"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-UserApi-CreateUsersWithArrayInput}{}}}
|
||||||
|
\subsection{Method \code{CreateUsersWithArrayInput()}}{
|
||||||
|
Creates list of users with given input array
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{UserApi$CreateUsersWithArrayInput(user, ...)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{user}}{List of user object}
|
||||||
|
|
||||||
|
\item{\code{...}}{Other optional arguments}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\subsection{Returns}{
|
||||||
|
void
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-UserApi-CreateUsersWithArrayInputWithHttpInfo"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-UserApi-CreateUsersWithArrayInputWithHttpInfo}{}}}
|
||||||
|
\subsection{Method \code{CreateUsersWithArrayInputWithHttpInfo()}}{
|
||||||
|
Creates list of users with given input array
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{UserApi$CreateUsersWithArrayInputWithHttpInfo(user, ...)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{user}}{List of user object}
|
||||||
|
|
||||||
|
\item{\code{...}}{Other optional arguments}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\subsection{Returns}{
|
||||||
|
API response (void) with additional information such as HTTP status code, headers
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-UserApi-CreateUsersWithListInput"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-UserApi-CreateUsersWithListInput}{}}}
|
||||||
|
\subsection{Method \code{CreateUsersWithListInput()}}{
|
||||||
|
Creates list of users with given input array
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{UserApi$CreateUsersWithListInput(user, ...)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{user}}{List of user object}
|
||||||
|
|
||||||
|
\item{\code{...}}{Other optional arguments}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\subsection{Returns}{
|
||||||
|
void
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-UserApi-CreateUsersWithListInputWithHttpInfo"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-UserApi-CreateUsersWithListInputWithHttpInfo}{}}}
|
||||||
|
\subsection{Method \code{CreateUsersWithListInputWithHttpInfo()}}{
|
||||||
|
Creates list of users with given input array
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{UserApi$CreateUsersWithListInputWithHttpInfo(user, ...)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{user}}{List of user object}
|
||||||
|
|
||||||
|
\item{\code{...}}{Other optional arguments}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\subsection{Returns}{
|
||||||
|
API response (void) with additional information such as HTTP status code, headers
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-UserApi-DeleteUser"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-UserApi-DeleteUser}{}}}
|
||||||
|
\subsection{Method \code{DeleteUser()}}{
|
||||||
|
Delete user
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{UserApi$DeleteUser(username, ...)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{username}}{The name that needs to be deleted}
|
||||||
|
|
||||||
|
\item{\code{...}}{Other optional arguments}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\subsection{Returns}{
|
||||||
|
void
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-UserApi-DeleteUserWithHttpInfo"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-UserApi-DeleteUserWithHttpInfo}{}}}
|
||||||
|
\subsection{Method \code{DeleteUserWithHttpInfo()}}{
|
||||||
|
Delete user
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{UserApi$DeleteUserWithHttpInfo(username, ...)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{username}}{The name that needs to be deleted}
|
||||||
|
|
||||||
|
\item{\code{...}}{Other optional arguments}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\subsection{Returns}{
|
||||||
|
API response (void) with additional information such as HTTP status code, headers
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-UserApi-GetUserByName"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-UserApi-GetUserByName}{}}}
|
||||||
|
\subsection{Method \code{GetUserByName()}}{
|
||||||
|
Get user by user name
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{UserApi$GetUserByName(username, data_file = NULL, ...)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{username}}{The name that needs to be fetched. Use user1 for testing.}
|
||||||
|
|
||||||
|
\item{\code{data_file}}{(optional) name of the data file to save the result}
|
||||||
|
|
||||||
|
\item{\code{...}}{Other optional arguments}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\subsection{Returns}{
|
||||||
|
User
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-UserApi-GetUserByNameWithHttpInfo"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-UserApi-GetUserByNameWithHttpInfo}{}}}
|
||||||
|
\subsection{Method \code{GetUserByNameWithHttpInfo()}}{
|
||||||
|
Get user by user name
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{UserApi$GetUserByNameWithHttpInfo(username, data_file = NULL, ...)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{username}}{The name that needs to be fetched. Use user1 for testing.}
|
||||||
|
|
||||||
|
\item{\code{data_file}}{(optional) name of the data file to save the result}
|
||||||
|
|
||||||
|
\item{\code{...}}{Other optional arguments}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\subsection{Returns}{
|
||||||
|
API response (User) with additional information such as HTTP status code, headers
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-UserApi-LoginUser"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-UserApi-LoginUser}{}}}
|
||||||
|
\subsection{Method \code{LoginUser()}}{
|
||||||
|
Logs user into the system
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{UserApi$LoginUser(username, password, data_file = NULL, ...)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{username}}{The user name for login}
|
||||||
|
|
||||||
|
\item{\code{password}}{The password for login in clear text}
|
||||||
|
|
||||||
|
\item{\code{data_file}}{(optional) name of the data file to save the result}
|
||||||
|
|
||||||
|
\item{\code{...}}{Other optional arguments}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\subsection{Returns}{
|
||||||
|
character
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-UserApi-LoginUserWithHttpInfo"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-UserApi-LoginUserWithHttpInfo}{}}}
|
||||||
|
\subsection{Method \code{LoginUserWithHttpInfo()}}{
|
||||||
|
Logs user into the system
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{UserApi$LoginUserWithHttpInfo(username, password, data_file = NULL, ...)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{username}}{The user name for login}
|
||||||
|
|
||||||
|
\item{\code{password}}{The password for login in clear text}
|
||||||
|
|
||||||
|
\item{\code{data_file}}{(optional) name of the data file to save the result}
|
||||||
|
|
||||||
|
\item{\code{...}}{Other optional arguments}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\subsection{Returns}{
|
||||||
|
API response (character) with additional information such as HTTP status code, headers
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-UserApi-LogoutUser"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-UserApi-LogoutUser}{}}}
|
||||||
|
\subsection{Method \code{LogoutUser()}}{
|
||||||
|
Logs out current logged in user session
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{UserApi$LogoutUser(...)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{...}}{Other optional arguments}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\subsection{Returns}{
|
||||||
|
void
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-UserApi-LogoutUserWithHttpInfo"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-UserApi-LogoutUserWithHttpInfo}{}}}
|
||||||
|
\subsection{Method \code{LogoutUserWithHttpInfo()}}{
|
||||||
|
Logs out current logged in user session
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{UserApi$LogoutUserWithHttpInfo(...)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{...}}{Other optional arguments}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\subsection{Returns}{
|
||||||
|
API response (void) with additional information such as HTTP status code, headers
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-UserApi-UpdateUser"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-UserApi-UpdateUser}{}}}
|
||||||
|
\subsection{Method \code{UpdateUser()}}{
|
||||||
|
Updated user
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{UserApi$UpdateUser(username, user, ...)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{username}}{name that need to be deleted}
|
||||||
|
|
||||||
|
\item{\code{user}}{Updated user object}
|
||||||
|
|
||||||
|
\item{\code{...}}{Other optional arguments}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\subsection{Returns}{
|
||||||
|
void
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-UserApi-UpdateUserWithHttpInfo"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-UserApi-UpdateUserWithHttpInfo}{}}}
|
||||||
|
\subsection{Method \code{UpdateUserWithHttpInfo()}}{
|
||||||
|
Updated user
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{UserApi$UpdateUserWithHttpInfo(username, user, ...)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{username}}{name that need to be deleted}
|
||||||
|
|
||||||
|
\item{\code{user}}{Updated user object}
|
||||||
|
|
||||||
|
\item{\code{...}}{Other optional arguments}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
\subsection{Returns}{
|
||||||
|
API response (void) with additional information such as HTTP status code, headers
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\if{html}{\out{<hr>}}
|
||||||
|
\if{html}{\out{<a id="method-UserApi-clone"></a>}}
|
||||||
|
\if{latex}{\out{\hypertarget{method-UserApi-clone}{}}}
|
||||||
|
\subsection{Method \code{clone()}}{
|
||||||
|
The objects of this class are cloneable with this method.
|
||||||
|
\subsection{Usage}{
|
||||||
|
\if{html}{\out{<div class="r">}}\preformatted{UserApi$clone(deep = FALSE)}\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subsection{Arguments}{
|
||||||
|
\if{html}{\out{<div class="arguments">}}
|
||||||
|
\describe{
|
||||||
|
\item{\code{deep}}{Whether to make a deep clone.}
|
||||||
|
}
|
||||||
|
\if{html}{\out{</div>}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
46
samples/client/petstore/R-httr2-wrapper/pom.xml
Normal file
46
samples/client/petstore/R-httr2-wrapper/pom.xml
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
<project>
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<groupId>org.openapitools</groupId>
|
||||||
|
<artifactId>RHttr2WrapperClientTests</artifactId>
|
||||||
|
<packaging>pom</packaging>
|
||||||
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
<name>R Httr2 Wrapper Client</name>
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-dependency-plugin</artifactId>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<phase>package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>copy-dependencies</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<outputDirectory>${project.build.directory}</outputDirectory>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.codehaus.mojo</groupId>
|
||||||
|
<artifactId>exec-maven-plugin</artifactId>
|
||||||
|
<version>1.2.1</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>nose-test</id>
|
||||||
|
<phase>integration-test</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>exec</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<executable>bash</executable>
|
||||||
|
<arguments>
|
||||||
|
<argument>build_and_test.bash</argument>
|
||||||
|
</arguments>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
</project>
|
||||||
166
samples/client/petstore/R-httr2-wrapper/test_petstore.R
Normal file
166
samples/client/petstore/R-httr2-wrapper/test_petstore.R
Normal file
@@ -0,0 +1,166 @@
|
|||||||
|
|
||||||
|
install.packages("petstore_1.0.0.tar.gz",repos=NULL, type="source")
|
||||||
|
library(petstore)
|
||||||
|
library(jsonlite)
|
||||||
|
|
||||||
|
api_client <- ApiClient$new()
|
||||||
|
api_client$username <- "username999"
|
||||||
|
api_client$password <- "password888"
|
||||||
|
|
||||||
|
api_wrapper <- petstore_api$new(api_client)
|
||||||
|
# test api_client in pet_api of the wrapper
|
||||||
|
cat(api_wrapper$pet_api$api_client$username)
|
||||||
|
cat(api_wrapper$pet_api$api_client$password)
|
||||||
|
|
||||||
|
#cat(address(api_client))
|
||||||
|
#cat(address(api_wrapper$pet_api$api_client)
|
||||||
|
#cat(address(api_wrapper$api_client$api_client)
|
||||||
|
|
||||||
|
print("DONE")
|
||||||
|
|
||||||
|
var_pet <- Pet$new("name_example", list("photoUrls_example"), 56, Category$new(56, "name_example"), list(Tag$new(56, "name_example")), "available") # Pet | Pet object that needs to be added to the store
|
||||||
|
|
||||||
|
#Add a new pet to the store
|
||||||
|
api_instance <- PetApi$new()
|
||||||
|
# Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
api_instance$api_client$access_token <- 'TODO_YOUR_ACCESS_TOKEN';
|
||||||
|
result <- tryCatch(
|
||||||
|
# to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
||||||
|
# api_instance$AddPet(var_pet, data_file = "result.txt"),
|
||||||
|
api_instance$add_pet(var_pet),
|
||||||
|
ApiException = function(ex) ex
|
||||||
|
)
|
||||||
|
|
||||||
|
var_pet_id <- 56 # integer | ID of pet to return
|
||||||
|
|
||||||
|
pet_response <- api_instance$get_pet_by_id(var_pet_id, data_file = "get_pet_by_id.json")
|
||||||
|
response <- read_json("get_pet_by_id.json")
|
||||||
|
dput(response)
|
||||||
|
#
|
||||||
|
## test streaming
|
||||||
|
#api_instance$get_pet_by_id_streaming(var_pet_id, stream_callback = function(x) { print(x) })
|
||||||
|
|
||||||
|
##Find pet by ID (streaming)
|
||||||
|
#api_instance <- PetApi$new()
|
||||||
|
## Configure API key authorization: api_key
|
||||||
|
#api_instance$api_client$api_keys['api_key'] <- 'TODO_YOUR_API_KEY';
|
||||||
|
#result <- tryCatch(
|
||||||
|
# # to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
||||||
|
# # api_instance$GetPetByIdStreaming(var_pet_id, data_file = "result.txt"),
|
||||||
|
# api_instance$GetPetByIdStreaming(var_pet_id, stream_callback = function(x) { print(x) }),
|
||||||
|
# ApiException = function(ex) ex
|
||||||
|
# )
|
||||||
|
# In case of error, print the error object
|
||||||
|
#if (!is.null(result$ApiException)) {
|
||||||
|
# cat(result$ApiException$toString())
|
||||||
|
#} #else {
|
||||||
|
# # deserialized response object
|
||||||
|
# response.object <- result$content
|
||||||
|
# # response headers
|
||||||
|
# response.headers <- result$response$headers
|
||||||
|
# # response status code
|
||||||
|
# response.status.code <- result$response$status_code
|
||||||
|
#}
|
||||||
|
|
||||||
|
##errorMsg <- "{\"code\":1,\"type\":\"error\",\"message\":\"Pet not found\"}"
|
||||||
|
###errorMsg <- '{"code": 404, "message": "Not found"}'
|
||||||
|
##a <- ModelApiResponse$new()$fromJSONString(errorMsg)
|
||||||
|
##dput(a)
|
||||||
|
##
|
||||||
|
##var_pet_id <- 1231256 # integer | ID of pet to return
|
||||||
|
##
|
||||||
|
###Find pet by ID
|
||||||
|
##api_instance <- PetApi$new()
|
||||||
|
### Configure API key authorization: api_key
|
||||||
|
##api_instance$api_client$api_keys['api_key'] <- 'TODO_YOUR_API_KEY';
|
||||||
|
##result <- tryCatch(
|
||||||
|
## api_instance$GetPetById(var_pet_id),
|
||||||
|
## ApiException = function(ex) ex
|
||||||
|
## )
|
||||||
|
### In case of error, print the error object
|
||||||
|
##if(!is.null(result$ApiException)) {
|
||||||
|
## cat(result$ApiException$toString())
|
||||||
|
##} else {
|
||||||
|
## # deserialized response object
|
||||||
|
## response.object <- result$content
|
||||||
|
## # response headers
|
||||||
|
## response.headers <- result$response$headers
|
||||||
|
## # response status code
|
||||||
|
## response.status.code <- result$response$status_code
|
||||||
|
##}
|
||||||
|
#
|
||||||
|
#json2 <-
|
||||||
|
#'{"name": "pet", "photoUrls" : ["http://a.com", "http://b.com"]}'
|
||||||
|
#
|
||||||
|
#jsonlite::minify(json2)
|
||||||
|
#
|
||||||
|
#pet_api <- PetApi$new()
|
||||||
|
#pet_id <- 123321
|
||||||
|
#pet <- Pet$new("name_test",
|
||||||
|
# photoUrls = list("photo_test", "second test"),
|
||||||
|
# category = Category$new(id = 450, name = "test_cat"),
|
||||||
|
# id = pet_id,
|
||||||
|
# tags = list(
|
||||||
|
# Tag$new(id = 123, name = "tag_test"), Tag$new(id = 456, name = "unknown")
|
||||||
|
# ),
|
||||||
|
# status = "available"
|
||||||
|
#)
|
||||||
|
#
|
||||||
|
##jsonlite::minify(pet$toJSONString())
|
||||||
|
##cat(pet$toJSONString())
|
||||||
|
#toString(pet$toString())
|
||||||
|
#
|
||||||
|
##json <-
|
||||||
|
##'[
|
||||||
|
## {"Name" : "Mario", "Age" : 32, "Occupation" : "Plumber"},
|
||||||
|
## {"Name" : "Peach", "Age" : 21, "Occupation" : "Princess"},
|
||||||
|
## {},
|
||||||
|
## {"Name" : "Bowser", "Occupation" : "Koopa"}
|
||||||
|
##]'
|
||||||
|
##
|
||||||
|
##
|
||||||
|
###Pet$public_methods
|
||||||
|
###Pet$public_methods$fromJSON(json)
|
||||||
|
###Pet$public_methods$toJson()
|
||||||
|
###Pet$public_methods$validateJSON(json2)
|
||||||
|
###Pet$public_methods$validateJson(json)
|
||||||
|
###Pet$my_static_method <- function(x) { x + 2}
|
||||||
|
###Pet$public_methods$my_static_method(1)
|
||||||
|
##
|
||||||
|
# basque_pig_json <-
|
||||||
|
# '{"className2": "BasquePig", "color": "red"}'
|
||||||
|
##
|
||||||
|
## danish_pig_json <-
|
||||||
|
## '{"className2": "DanishPig", "size": 7}'
|
||||||
|
##
|
||||||
|
## wrong_json <-
|
||||||
|
## '[
|
||||||
|
## {"Name" : "Tom", "Age" : 32, "Occupation" : "Consultant"},
|
||||||
|
## {},
|
||||||
|
## {"Name" : "Ada", "Occupation" : "Engineer"}
|
||||||
|
## ]'
|
||||||
|
##
|
||||||
|
## print("==========")
|
||||||
|
# pig <- Pig$new()
|
||||||
|
# basque_pig <- pig$fromJSON(basque_pig_json)
|
||||||
|
## #print(basque_pig$actual_instance$color)
|
||||||
|
## #expect_equal(basque_pig$actual_type, "BasquePig")
|
||||||
|
## pig$fromJSON(danish_pig_json)
|
||||||
|
## #pig$fromJSON(wrong_json)
|
||||||
|
## pig$toJSON()
|
||||||
|
##
|
||||||
|
## #d <- DanishPig$new()
|
||||||
|
## #dp <- d$validateJSON(danish_pig_json)
|
||||||
|
##
|
||||||
|
##
|
||||||
|
#
|
||||||
|
## test nested oneOf
|
||||||
|
#nested_oneof <- NestedOneOf$new()
|
||||||
|
#nested_oneof$nested_pig <- pig
|
||||||
|
#nested_oneof$size <- 15
|
||||||
|
#
|
||||||
|
#cat(nested_oneof$toJSONString())
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user