# NamSor API v2
#
# NamSor API v2 : enpoints to process personal names (gender, cultural origin or ethnicity) in all alphabets or languages. Use GET methods for small tests, but prefer POST methods for higher throughput (batch processing of up to 100 names at a time). Need something you can't find here? We have many more features coming soon. Let us know, we'll do our best to add it!
#
# The version of the OpenAPI document: 2.0.10
# Contact: contact@namsor.com
# Generated by: https://openapi-generator.tech
#' @docType class
#' @title Admin operations
#' @description namsor.Admin
#' @format An \code{R6Class} generator object
#' @field apiClient Handles the client-server communication.
#'
#' @section Methods:
#' \describe{
#' \strong{ AddCredits } \emph{ Add usage credits to an API Key. }
#'
#'
#' \itemize{
#' \item \emph{ @param } api.key character
#' \item \emph{ @param } usage.credits integer
#' \item \emph{ @param } user.message character
#' \item \emph{ @returnType } \link{SystemMetricsOut} \cr
#'
#'
#' \item status code : 200 | Estimate new after applying credits.
#'
#' \item return type : SystemMetricsOut
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 401 | Missing or incorrect API Key
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ Anonymize } \emph{ Activate/deactivate anonymization for a source. }
#'
#'
#' \itemize{
#' \item \emph{ @param } source character
#' \item \emph{ @param } anonymized character
#'
#'
#' \item status code : 200 | Anonymization of a source.
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 401 | Missing or incorrect API Key
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ ApiStatus } \emph{ Prints the current status of the classifiers. }
#'
#'
#' \itemize{
#' \item \emph{ @returnType } \link{APIPlansOut} \cr
#'
#'
#' \item status code : 200 | Available classifiers and status
#'
#' \item return type : APIPlansOut
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 401 | Missing or incorrect token
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ ApiUsage } \emph{ Print current API usage. }
#'
#'
#' \itemize{
#' \item \emph{ @returnType } \link{APIPeriodUsageOut} \cr
#'
#'
#' \item status code : 200 | Print current API usage.
#'
#' \item return type : APIPeriodUsageOut
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 401 | Missing or incorrect API Key
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ ApiUsageHistory } \emph{ Print historical API usage. }
#'
#'
#' \itemize{
#' \item \emph{ @returnType } \link{APIPeriodUsageOut} \cr
#'
#'
#' \item status code : 200 | Print historical API usage.
#'
#' \item return type : APIPeriodUsageOut
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 401 | Missing or incorrect API Key
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ ApiUsageHistoryAggregate } \emph{ Print historical API usage (in an aggregated view, by service, by day/hour/min). }
#'
#'
#' \itemize{
#' \item \emph{ @returnType } \link{APIPeriodUsageOut} \cr
#'
#'
#' \item status code : 200 | Print historical API usage.
#'
#' \item return type : APIPeriodUsageOut
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 401 | Missing or incorrect API Key
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ AvailablePlans } \emph{ List all available plans in the default currency (usd). }
#'
#'
#' \itemize{
#' \item \emph{ @returnType } \link{APIPlansOut} \cr
#'
#'
#' \item status code : 200 | Available plans
#'
#' \item return type : APIPlansOut
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 401 | Missing or incorrect token
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ AvailablePlans1 } \emph{ List all available plans in the user's preferred currency. }
#'
#'
#' \itemize{
#' \item \emph{ @param } token character
#' \item \emph{ @returnType } \link{APIPlansOut} \cr
#'
#'
#' \item status code : 200 | Available plans
#'
#' \item return type : APIPlansOut
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 401 | Missing or incorrect token
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ AvailableServices } \emph{ List of API services and usage cost in Units (default is 1=ONE Unit). }
#'
#'
#' \itemize{
#' \item \emph{ @returnType } \link{APIPlansOut} \cr
#'
#'
#' \item status code : 200 | Available services
#'
#' \item return type : APIPlansOut
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 401 | Missing or incorrect token
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ BillingCurrencies } \emph{ List possible currency options for billing (USD, EUR, GBP, ...) }
#'
#'
#' \itemize{
#' \item \emph{ @returnType } \link{CurrenciesOut} \cr
#'
#'
#' \item status code : 200 | The supported billing currencies.
#'
#' \item return type : CurrenciesOut
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 401 | Missing or incorrect token
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ BillingHistory } \emph{ Read the history billing information (invoices paid via Stripe or manually). }
#'
#'
#' \itemize{
#' \item \emph{ @param } token character
#' \item \emph{ @returnType } \link{BillingHistoryOut} \cr
#'
#'
#' \item status code : 200 | The billing history
#'
#' \item return type : BillingHistoryOut
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 401 | Missing or incorrect token
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ BillingInfo } \emph{ Read the billing information (company name, address, phone, vat ID) }
#'
#'
#' \itemize{
#' \item \emph{ @param } token character
#' \item \emph{ @returnType } \link{BillingInfoInOut} \cr
#'
#'
#' \item status code : 200 | The current billing info
#'
#' \item return type : BillingInfoInOut
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 401 | Missing or incorrect token
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ Charge } \emph{ Create a Stripe Customer, based on a payment card token (from secure StripeJS) and email. }
#'
#'
#' \itemize{
#' \item \emph{ @param } inline.object \link{InlineObject}
#' \item \emph{ @returnType } \link{APIKeyOut} \cr
#'
#'
#' \item status code : 200 | A stripe customerID
#'
#' \item return type : APIKeyOut
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 401 | Missing or incorrect email or payment token
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ CorporateKey } \emph{ Setting an API Key to a corporate status. }
#'
#'
#' \itemize{
#' \item \emph{ @param } api.key character
#' \item \emph{ @param } corporate character
#'
#'
#' \item status code : 200 | API Key set to a corporate status.
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 401 | Missing or incorrect API Key
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ DebugLevel } \emph{ Update debug level for a classifier }
#'
#'
#' \itemize{
#' \item \emph{ @param } logger character
#' \item \emph{ @param } level character
#'
#'
#' \item status code : 401 | Missing or incorrect API Key
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ Flush } \emph{ Flush counters. }
#'
#'
#' \itemize{
#'
#'
#' \item status code : 200 | Flush API Key caches.
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 401 | Missing or incorrect API Key
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ InvalidateCache } \emph{ Invalidate system caches. }
#'
#'
#' \itemize{
#'
#'
#' \item status code : 200 | Clear caches.
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 401 | Missing or incorrect API Key
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ Learnable } \emph{ Activate/deactivate learning from a source. }
#'
#'
#' \itemize{
#' \item \emph{ @param } source character
#' \item \emph{ @param } learnable character
#'
#'
#' \item status code : 200 | Vetting of a source.
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 401 | Missing or incorrect API Key
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ NamsorCounter } \emph{ Get the overall API counter }
#'
#'
#' \itemize{
#' \item \emph{ @returnType } \link{SoftwareVersionOut} \cr
#'
#'
#' \item status code : 200 | The overall API counter
#'
#' \item return type : SoftwareVersionOut
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 401 | Missing or incorrect token
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ PaymentInfo } \emph{ Get the Stripe payment information associated with the current google auth session token. }
#'
#'
#' \itemize{
#' \item \emph{ @param } token character
#' \item \emph{ @returnType } \link{APIKeyOut} \cr
#'
#'
#' \item status code : 200 | An session token
#'
#' \item return type : APIKeyOut
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 401 | Missing or incorrect token
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ ProcureKey } \emph{ Procure an API Key (sent via Email), based on an auth token. Keep your API Key secret. }
#'
#'
#' \itemize{
#' \item \emph{ @param } token character
#' \item \emph{ @returnType } \link{APIKeyOut} \cr
#'
#'
#' \item status code : 200 | An API Key
#'
#' \item return type : APIKeyOut
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 401 | Missing or incorrect token
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ RedeployUI } \emph{ Redeploy UI from current dev branch. }
#'
#'
#' \itemize{
#'
#'
#' \item status code : 200 | Redeploy UI from DEV.
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 401 | Missing or incorrect API Key
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ RedeployUI1 } \emph{ Redeploy UI from current dev branch. }
#'
#'
#' \itemize{
#' \item \emph{ @param } live character
#'
#'
#' \item status code : 200 | Redeploy UI from DEV.
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 401 | Missing or incorrect API Key
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ RemoveUserAccount } \emph{ Remove the user account. }
#'
#'
#' \itemize{
#' \item \emph{ @param } token character
#' \item \emph{ @returnType } \link{APIPlanSubscriptionOut} \cr
#'
#'
#' \item status code : 200 | An API subscription
#'
#' \item return type : APIPlanSubscriptionOut
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 401 | Missing or incorrect token
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ RemoveUserAccountOnBehalf } \emph{ Remove (on behalf) a user account. }
#'
#'
#' \itemize{
#' \item \emph{ @param } api.key character
#' \item \emph{ @returnType } \link{APIPlanSubscriptionOut} \cr
#'
#'
#' \item status code : 200 | An API subscription
#'
#' \item return type : APIPlanSubscriptionOut
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 401 | Missing or incorrect token
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ Shutdown } \emph{ Stop learning and shutdown system. }
#'
#'
#' \itemize{
#'
#'
#' \item status code : 200 | Shutdown AI.
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 401 | Missing or incorrect API Key
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ SoftwareVersion } \emph{ Get the current software version }
#'
#'
#' \itemize{
#' \item \emph{ @returnType } \link{SoftwareVersionOut} \cr
#'
#'
#' \item status code : 200 | The current software version
#'
#' \item return type : SoftwareVersionOut
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 401 | Missing or incorrect token
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ SourceStats } \emph{ Print basic source statistics. }
#'
#'
#' \itemize{
#' \item \emph{ @param } source character
#' \item \emph{ @returnType } \link{SystemMetricsOut} \cr
#'
#'
#' \item status code : 200 | Current system status.
#'
#' \item return type : SystemMetricsOut
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 401 | Missing or incorrect API Key
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ Stats } \emph{ Print basic system statistics. }
#'
#'
#' \itemize{
#' \item \emph{ @returnType } \link{SystemMetricsOut} \cr
#'
#'
#' \item status code : 200 | Current system status.
#'
#' \item return type : SystemMetricsOut
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 401 | Missing or incorrect API Key
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ StripeConnect } \emph{ Connects a Stripe Account. }
#'
#'
#' \itemize{
#' \item \emph{ @param } scope character
#' \item \emph{ @param } code character
#' \item \emph{ @param } error character
#' \item \emph{ @param } error.description character
#'
#'
#' \item status code : 401 | Missing or incorrect email or payment token
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ SubscribePlan } \emph{ Subscribe to a give API plan, using the user's preferred or default currency. }
#'
#'
#' \itemize{
#' \item \emph{ @param } plan.name character
#' \item \emph{ @param } token character
#' \item \emph{ @returnType } \link{APIPlanSubscriptionOut} \cr
#'
#'
#' \item status code : 200 | An API subscription
#'
#' \item return type : APIPlanSubscriptionOut
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 401 | Missing or incorrect token
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ SubscribePlanOnBehalf } \emph{ Subscribe to a give API plan, using the user's preferred or default currency (admin only). }
#'
#'
#' \itemize{
#' \item \emph{ @param } plan.name character
#' \item \emph{ @param } api.key character
#' \item \emph{ @returnType } \link{APIPlanSubscriptionOut} \cr
#'
#'
#' \item status code : 200 | An API subscription
#'
#' \item return type : APIPlanSubscriptionOut
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 401 | Missing or incorrect token
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ TaxonomyClasses } \emph{ Print the taxonomy classes valid for the given classifier. }
#'
#'
#' \itemize{
#' \item \emph{ @param } classifier.name character
#' \item \emph{ @returnType } \link{APIPlansOut} \cr
#'
#'
#' \item status code : 200 | Available plans
#'
#' \item return type : APIPlansOut
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 401 | Missing or incorrect token
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ UpdateBillingInfo } \emph{ Sets or update the billing information (company name, address, phone, vat ID) }
#'
#'
#' \itemize{
#' \item \emph{ @param } token character
#' \item \emph{ @param } billing.info.in.out \link{BillingInfoInOut}
#' \item \emph{ @returnType } \link{BillingInfoInOut} \cr
#'
#'
#' \item status code : 200 | The updated billing info
#'
#' \item return type : BillingInfoInOut
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 401 | Missing or incorrect token
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ UpdateLimit } \emph{ Modifies the hard/soft limit on the API plan's overages (default is 0$ soft limit). }
#'
#'
#' \itemize{
#' \item \emph{ @param } usage.limit integer
#' \item \emph{ @param } hard.or.soft character
#' \item \emph{ @param } token character
#' \item \emph{ @returnType } \link{APIPeriodUsageOut} \cr
#'
#'
#' \item status code : 200 | An API subscription
#'
#' \item return type : APIPeriodUsageOut
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 401 | Missing or incorrect token
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ UpdatePaymentDefault } \emph{ Update the default Stripe card associated with the current google auth session token. }
#'
#'
#' \itemize{
#' \item \emph{ @param } defaut.source.id character
#' \item \emph{ @param } token character
#' \item \emph{ @returnType } \link{APIKeyOut} \cr
#'
#'
#' \item status code : 200 | An session token
#'
#' \item return type : APIKeyOut
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 401 | Missing or incorrect token
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ UserInfo } \emph{ Get the user profile associated with the current google auth session token. }
#'
#'
#' \itemize{
#' \item \emph{ @param } token character
#' \item \emph{ @returnType } \link{APIKeyOut} \cr
#'
#'
#' \item status code : 200 | An session token
#'
#' \item return type : APIKeyOut
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 401 | Missing or incorrect token
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ VerifyEmail } \emph{ Verifies an email, based on token sent to that email }
#'
#'
#' \itemize{
#' \item \emph{ @param } email.token character
#' \item \emph{ @returnType } \link{APIKeyOut} \cr
#'
#'
#' \item status code : 200 | An API Key
#'
#' \item return type : APIKeyOut
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 401 | Missing or incorrect token
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ VerifyRemoveEmail } \emph{ Verifies an email, based on token sent to that email }
#'
#'
#' \itemize{
#' \item \emph{ @param } email.token character
#' \item \emph{ @returnType } \link{APIKeyOut} \cr
#'
#'
#' \item status code : 200 | An API Key
#'
#' \item return type : APIKeyOut
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 401 | Missing or incorrect token
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ Vet } \emph{ Vetting of a source. }
#'
#'
#' \itemize{
#' \item \emph{ @param } source character
#' \item \emph{ @param } vetted character
#'
#'
#' \item status code : 200 | Vetting of a source.
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 401 | Missing or incorrect API Key
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' }
#'
#'
#' @examples
#' \dontrun{
#' #################### AddCredits ####################
#'
#' library(namsor)
#' var.api.key <- 'api.key_example' # character |
#' var.usage.credits <- 56 # integer |
#' var.user.message <- 'user.message_example' # character |
#'
#' #Add usage credits to an API Key.
#' api.instance <- AdminApi$new()
#'
#' #Configure API key authorization: api_key
#' api.instance$apiClient$apiKeys['X-API-KEY'] <- 'TODO_YOUR_API_KEY';
#'
#' result <- api.instance$AddCredits(var.api.key, var.usage.credits, var.user.message)
#'
#'
#' #################### Anonymize ####################
#'
#' library(namsor)
#' var.source <- 'source_example' # character |
#' var.anonymized <- 'anonymized_example' # character |
#'
#' #Activate/deactivate anonymization for a source.
#' api.instance <- AdminApi$new()
#'
#' #Configure API key authorization: api_key
#' api.instance$apiClient$apiKeys['X-API-KEY'] <- 'TODO_YOUR_API_KEY';
#'
#' result <- api.instance$Anonymize(var.source, var.anonymized)
#'
#'
#' #################### ApiStatus ####################
#'
#' library(namsor)
#'
#' #Prints the current status of the classifiers.
#' api.instance <- AdminApi$new()
#'
#' #Configure API key authorization: api_key
#' api.instance$apiClient$apiKeys['X-API-KEY'] <- 'TODO_YOUR_API_KEY';
#'
#' result <- api.instance$ApiStatus()
#'
#'
#' #################### ApiUsage ####################
#'
#' library(namsor)
#'
#' #Print current API usage.
#' api.instance <- AdminApi$new()
#'
#' #Configure API key authorization: api_key
#' api.instance$apiClient$apiKeys['X-API-KEY'] <- 'TODO_YOUR_API_KEY';
#'
#' result <- api.instance$ApiUsage()
#'
#'
#' #################### ApiUsageHistory ####################
#'
#' library(namsor)
#'
#' #Print historical API usage.
#' api.instance <- AdminApi$new()
#'
#' #Configure API key authorization: api_key
#' api.instance$apiClient$apiKeys['X-API-KEY'] <- 'TODO_YOUR_API_KEY';
#'
#' result <- api.instance$ApiUsageHistory()
#'
#'
#' #################### ApiUsageHistoryAggregate ####################
#'
#' library(namsor)
#'
#' #Print historical API usage (in an aggregated view, by service, by day/hour/min).
#' api.instance <- AdminApi$new()
#'
#' #Configure API key authorization: api_key
#' api.instance$apiClient$apiKeys['X-API-KEY'] <- 'TODO_YOUR_API_KEY';
#'
#' result <- api.instance$ApiUsageHistoryAggregate()
#'
#'
#' #################### AvailablePlans ####################
#'
#' library(namsor)
#'
#' #List all available plans in the default currency (usd).
#' api.instance <- AdminApi$new()
#'
#' #Configure API key authorization: api_key
#' api.instance$apiClient$apiKeys['X-API-KEY'] <- 'TODO_YOUR_API_KEY';
#'
#' result <- api.instance$AvailablePlans()
#'
#'
#' #################### AvailablePlans1 ####################
#'
#' library(namsor)
#' var.token <- 'token_example' # character |
#'
#' #List all available plans in the user's preferred currency.
#' api.instance <- AdminApi$new()
#'
#' #Configure API key authorization: api_key
#' api.instance$apiClient$apiKeys['X-API-KEY'] <- 'TODO_YOUR_API_KEY';
#'
#' result <- api.instance$AvailablePlans1(var.token)
#'
#'
#' #################### AvailableServices ####################
#'
#' library(namsor)
#'
#' #List of API services and usage cost in Units (default is 1=ONE Unit).
#' api.instance <- AdminApi$new()
#'
#' #Configure API key authorization: api_key
#' api.instance$apiClient$apiKeys['X-API-KEY'] <- 'TODO_YOUR_API_KEY';
#'
#' result <- api.instance$AvailableServices()
#'
#'
#' #################### BillingCurrencies ####################
#'
#' library(namsor)
#'
#' #List possible currency options for billing (USD, EUR, GBP, ...)
#' api.instance <- AdminApi$new()
#'
#' #Configure API key authorization: api_key
#' api.instance$apiClient$apiKeys['X-API-KEY'] <- 'TODO_YOUR_API_KEY';
#'
#' result <- api.instance$BillingCurrencies()
#'
#'
#' #################### BillingHistory ####################
#'
#' library(namsor)
#' var.token <- 'token_example' # character |
#'
#' #Read the history billing information (invoices paid via Stripe or manually).
#' api.instance <- AdminApi$new()
#'
#' #Configure API key authorization: api_key
#' api.instance$apiClient$apiKeys['X-API-KEY'] <- 'TODO_YOUR_API_KEY';
#'
#' result <- api.instance$BillingHistory(var.token)
#'
#'
#' #################### BillingInfo ####################
#'
#' library(namsor)
#' var.token <- 'token_example' # character |
#'
#' #Read the billing information (company name, address, phone, vat ID)
#' api.instance <- AdminApi$new()
#'
#' #Configure API key authorization: api_key
#' api.instance$apiClient$apiKeys['X-API-KEY'] <- 'TODO_YOUR_API_KEY';
#'
#' result <- api.instance$BillingInfo(var.token)
#'
#'
#' #################### Charge ####################
#'
#' library(namsor)
#' var.inline.object <- InlineObject$new() # InlineObject |
#'
#' #Create a Stripe Customer, based on a payment card token (from secure StripeJS) and email.
#' api.instance <- AdminApi$new()
#'
#' #Configure API key authorization: api_key
#' api.instance$apiClient$apiKeys['X-API-KEY'] <- 'TODO_YOUR_API_KEY';
#'
#' result <- api.instance$Charge(inline.object=var.inline.object)
#'
#'
#' #################### CorporateKey ####################
#'
#' library(namsor)
#' var.api.key <- 'api.key_example' # character |
#' var.corporate <- 'corporate_example' # character |
#'
#' #Setting an API Key to a corporate status.
#' api.instance <- AdminApi$new()
#'
#' #Configure API key authorization: api_key
#' api.instance$apiClient$apiKeys['X-API-KEY'] <- 'TODO_YOUR_API_KEY';
#'
#' result <- api.instance$CorporateKey(var.api.key, var.corporate)
#'
#'
#' #################### DebugLevel ####################
#'
#' library(namsor)
#' var.logger <- 'logger_example' # character |
#' var.level <- 'level_example' # character |
#'
#' #Update debug level for a classifier
#' api.instance <- AdminApi$new()
#'
#' #Configure API key authorization: api_key
#' api.instance$apiClient$apiKeys['X-API-KEY'] <- 'TODO_YOUR_API_KEY';
#'
#' result <- api.instance$DebugLevel(var.logger, var.level)
#'
#'
#' #################### Flush ####################
#'
#' library(namsor)
#'
#' #Flush counters.
#' api.instance <- AdminApi$new()
#'
#' #Configure API key authorization: api_key
#' api.instance$apiClient$apiKeys['X-API-KEY'] <- 'TODO_YOUR_API_KEY';
#'
#' result <- api.instance$Flush()
#'
#'
#' #################### InvalidateCache ####################
#'
#' library(namsor)
#'
#' #Invalidate system caches.
#' api.instance <- AdminApi$new()
#'
#' #Configure API key authorization: api_key
#' api.instance$apiClient$apiKeys['X-API-KEY'] <- 'TODO_YOUR_API_KEY';
#'
#' result <- api.instance$InvalidateCache()
#'
#'
#' #################### Learnable ####################
#'
#' library(namsor)
#' var.source <- 'source_example' # character |
#' var.learnable <- 'learnable_example' # character |
#'
#' #Activate/deactivate learning from a source.
#' api.instance <- AdminApi$new()
#'
#' #Configure API key authorization: api_key
#' api.instance$apiClient$apiKeys['X-API-KEY'] <- 'TODO_YOUR_API_KEY';
#'
#' result <- api.instance$Learnable(var.source, var.learnable)
#'
#'
#' #################### NamsorCounter ####################
#'
#' library(namsor)
#'
#' #Get the overall API counter
#' api.instance <- AdminApi$new()
#'
#' #Configure API key authorization: api_key
#' api.instance$apiClient$apiKeys['X-API-KEY'] <- 'TODO_YOUR_API_KEY';
#'
#' result <- api.instance$NamsorCounter()
#'
#'
#' #################### PaymentInfo ####################
#'
#' library(namsor)
#' var.token <- 'token_example' # character |
#'
#' #Get the Stripe payment information associated with the current google auth session token.
#' api.instance <- AdminApi$new()
#'
#' #Configure API key authorization: api_key
#' api.instance$apiClient$apiKeys['X-API-KEY'] <- 'TODO_YOUR_API_KEY';
#'
#' result <- api.instance$PaymentInfo(var.token)
#'
#'
#' #################### ProcureKey ####################
#'
#' library(namsor)
#' var.token <- 'token_example' # character |
#'
#' #Procure an API Key (sent via Email), based on an auth token. Keep your API Key secret.
#' api.instance <- AdminApi$new()
#'
#' #Configure API key authorization: api_key
#' api.instance$apiClient$apiKeys['X-API-KEY'] <- 'TODO_YOUR_API_KEY';
#'
#' result <- api.instance$ProcureKey(var.token)
#'
#'
#' #################### RedeployUI ####################
#'
#' library(namsor)
#'
#' #Redeploy UI from current dev branch.
#' api.instance <- AdminApi$new()
#'
#' #Configure API key authorization: api_key
#' api.instance$apiClient$apiKeys['X-API-KEY'] <- 'TODO_YOUR_API_KEY';
#'
#' result <- api.instance$RedeployUI()
#'
#'
#' #################### RedeployUI1 ####################
#'
#' library(namsor)
#' var.live <- 'live_example' # character |
#'
#' #Redeploy UI from current dev branch.
#' api.instance <- AdminApi$new()
#'
#' #Configure API key authorization: api_key
#' api.instance$apiClient$apiKeys['X-API-KEY'] <- 'TODO_YOUR_API_KEY';
#'
#' result <- api.instance$RedeployUI1(var.live)
#'
#'
#' #################### RemoveUserAccount ####################
#'
#' library(namsor)
#' var.token <- 'token_example' # character |
#'
#' #Remove the user account.
#' api.instance <- AdminApi$new()
#'
#' #Configure API key authorization: api_key
#' api.instance$apiClient$apiKeys['X-API-KEY'] <- 'TODO_YOUR_API_KEY';
#'
#' result <- api.instance$RemoveUserAccount(var.token)
#'
#'
#' #################### RemoveUserAccountOnBehalf ####################
#'
#' library(namsor)
#' var.api.key <- 'api.key_example' # character |
#'
#' #Remove (on behalf) a user account.
#' api.instance <- AdminApi$new()
#'
#' #Configure API key authorization: api_key
#' api.instance$apiClient$apiKeys['X-API-KEY'] <- 'TODO_YOUR_API_KEY';
#'
#' result <- api.instance$RemoveUserAccountOnBehalf(var.api.key)
#'
#'
#' #################### Shutdown ####################
#'
#' library(namsor)
#'
#' #Stop learning and shutdown system.
#' api.instance <- AdminApi$new()
#'
#' #Configure API key authorization: api_key
#' api.instance$apiClient$apiKeys['X-API-KEY'] <- 'TODO_YOUR_API_KEY';
#'
#' result <- api.instance$Shutdown()
#'
#'
#' #################### SoftwareVersion ####################
#'
#' library(namsor)
#'
#' #Get the current software version
#' api.instance <- AdminApi$new()
#'
#' #Configure API key authorization: api_key
#' api.instance$apiClient$apiKeys['X-API-KEY'] <- 'TODO_YOUR_API_KEY';
#'
#' result <- api.instance$SoftwareVersion()
#'
#'
#' #################### SourceStats ####################
#'
#' library(namsor)
#' var.source <- 'source_example' # character |
#'
#' #Print basic source statistics.
#' api.instance <- AdminApi$new()
#'
#' #Configure API key authorization: api_key
#' api.instance$apiClient$apiKeys['X-API-KEY'] <- 'TODO_YOUR_API_KEY';
#'
#' result <- api.instance$SourceStats(var.source)
#'
#'
#' #################### Stats ####################
#'
#' library(namsor)
#'
#' #Print basic system statistics.
#' api.instance <- AdminApi$new()
#'
#' #Configure API key authorization: api_key
#' api.instance$apiClient$apiKeys['X-API-KEY'] <- 'TODO_YOUR_API_KEY';
#'
#' result <- api.instance$Stats()
#'
#'
#' #################### StripeConnect ####################
#'
#' library(namsor)
#' var.scope <- 'scope_example' # character |
#' var.code <- 'code_example' # character |
#' var.error <- 'error_example' # character |
#' var.error.description <- 'error.description_example' # character |
#'
#' #Connects a Stripe Account.
#' api.instance <- AdminApi$new()
#'
#' #Configure API key authorization: api_key
#' api.instance$apiClient$apiKeys['X-API-KEY'] <- 'TODO_YOUR_API_KEY';
#'
#' result <- api.instance$StripeConnect(scope=var.scope, code=var.code, error=var.error, error.description=var.error.description)
#'
#'
#' #################### SubscribePlan ####################
#'
#' library(namsor)
#' var.plan.name <- 'plan.name_example' # character |
#' var.token <- 'token_example' # character |
#'
#' #Subscribe to a give API plan, using the user's preferred or default currency.
#' api.instance <- AdminApi$new()
#'
#' #Configure API key authorization: api_key
#' api.instance$apiClient$apiKeys['X-API-KEY'] <- 'TODO_YOUR_API_KEY';
#'
#' result <- api.instance$SubscribePlan(var.plan.name, var.token)
#'
#'
#' #################### SubscribePlanOnBehalf ####################
#'
#' library(namsor)
#' var.plan.name <- 'plan.name_example' # character |
#' var.api.key <- 'api.key_example' # character |
#'
#' #Subscribe to a give API plan, using the user's preferred or default currency (admin only).
#' api.instance <- AdminApi$new()
#'
#' #Configure API key authorization: api_key
#' api.instance$apiClient$apiKeys['X-API-KEY'] <- 'TODO_YOUR_API_KEY';
#'
#' result <- api.instance$SubscribePlanOnBehalf(var.plan.name, var.api.key)
#'
#'
#' #################### TaxonomyClasses ####################
#'
#' library(namsor)
#' var.classifier.name <- 'classifier.name_example' # character |
#'
#' #Print the taxonomy classes valid for the given classifier.
#' api.instance <- AdminApi$new()
#'
#' #Configure API key authorization: api_key
#' api.instance$apiClient$apiKeys['X-API-KEY'] <- 'TODO_YOUR_API_KEY';
#'
#' result <- api.instance$TaxonomyClasses(var.classifier.name)
#'
#'
#' #################### UpdateBillingInfo ####################
#'
#' library(namsor)
#' var.token <- 'token_example' # character |
#' var.billing.info.in.out <- BillingInfoInOut$new() # BillingInfoInOut |
#'
#' #Sets or update the billing information (company name, address, phone, vat ID)
#' api.instance <- AdminApi$new()
#'
#' #Configure API key authorization: api_key
#' api.instance$apiClient$apiKeys['X-API-KEY'] <- 'TODO_YOUR_API_KEY';
#'
#' result <- api.instance$UpdateBillingInfo(var.token, billing.info.in.out=var.billing.info.in.out)
#'
#'
#' #################### UpdateLimit ####################
#'
#' library(namsor)
#' var.usage.limit <- 56 # integer |
#' var.hard.or.soft <- 'hard.or.soft_example' # character |
#' var.token <- 'token_example' # character |
#'
#' #Modifies the hard/soft limit on the API plan's overages (default is 0$ soft limit).
#' api.instance <- AdminApi$new()
#'
#' #Configure API key authorization: api_key
#' api.instance$apiClient$apiKeys['X-API-KEY'] <- 'TODO_YOUR_API_KEY';
#'
#' result <- api.instance$UpdateLimit(var.usage.limit, var.hard.or.soft, var.token)
#'
#'
#' #################### UpdatePaymentDefault ####################
#'
#' library(namsor)
#' var.defaut.source.id <- 'defaut.source.id_example' # character |
#' var.token <- 'token_example' # character |
#'
#' #Update the default Stripe card associated with the current google auth session token.
#' api.instance <- AdminApi$new()
#'
#' #Configure API key authorization: api_key
#' api.instance$apiClient$apiKeys['X-API-KEY'] <- 'TODO_YOUR_API_KEY';
#'
#' result <- api.instance$UpdatePaymentDefault(var.defaut.source.id, var.token)
#'
#'
#' #################### UserInfo ####################
#'
#' library(namsor)
#' var.token <- 'token_example' # character |
#'
#' #Get the user profile associated with the current google auth session token.
#' api.instance <- AdminApi$new()
#'
#' #Configure API key authorization: api_key
#' api.instance$apiClient$apiKeys['X-API-KEY'] <- 'TODO_YOUR_API_KEY';
#'
#' result <- api.instance$UserInfo(var.token)
#'
#'
#' #################### VerifyEmail ####################
#'
#' library(namsor)
#' var.email.token <- 'email.token_example' # character |
#'
#' #Verifies an email, based on token sent to that email
#' api.instance <- AdminApi$new()
#'
#' #Configure API key authorization: api_key
#' api.instance$apiClient$apiKeys['X-API-KEY'] <- 'TODO_YOUR_API_KEY';
#'
#' result <- api.instance$VerifyEmail(var.email.token)
#'
#'
#' #################### VerifyRemoveEmail ####################
#'
#' library(namsor)
#' var.email.token <- 'email.token_example' # character |
#'
#' #Verifies an email, based on token sent to that email
#' api.instance <- AdminApi$new()
#'
#' #Configure API key authorization: api_key
#' api.instance$apiClient$apiKeys['X-API-KEY'] <- 'TODO_YOUR_API_KEY';
#'
#' result <- api.instance$VerifyRemoveEmail(var.email.token)
#'
#'
#' #################### Vet ####################
#'
#' library(namsor)
#' var.source <- 'source_example' # character |
#' var.vetted <- 'vetted_example' # character |
#'
#' #Vetting of a source.
#' api.instance <- AdminApi$new()
#'
#' #Configure API key authorization: api_key
#' api.instance$apiClient$apiKeys['X-API-KEY'] <- 'TODO_YOUR_API_KEY';
#'
#' result <- api.instance$Vet(var.source, var.vetted)
#'
#'
#' }
#' @importFrom R6 R6Class
#' @importFrom base64enc base64encode
#' @export
AdminApi <- R6::R6Class(
'AdminApi',
public = list(
apiClient = NULL,
initialize = function(apiClient){
if (!missing(apiClient)) {
self$apiClient <- apiClient
}
else {
self$apiClient <- ApiClient$new()
}
},
AddCredits = function(api.key, usage.credits, user.message, ...){
apiResponse <- self$AddCreditsWithHttpInfo(api.key, usage.credits, user.message, ...)
resp <- apiResponse$response
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
apiResponse$content
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
apiResponse
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
apiResponse
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
apiResponse
}
},
AddCreditsWithHttpInfo = function(api.key, usage.credits, user.message, ...){
args <- list(...)
queryParams <- list()
headerParams <- c()
if (missing(`api.key`)) {
stop("Missing required parameter `api.key`.")
}
if (missing(`usage.credits`)) {
stop("Missing required parameter `usage.credits`.")
}
if (missing(`user.message`)) {
stop("Missing required parameter `user.message`.")
}
urlPath <- "/api2/json/addCredits/{apiKey}/{usageCredits}/{userMessage}"
if (!missing(`api.key`)) {
urlPath <- gsub(paste0("\\{", "apiKey", "\\}"), URLencode(as.character(`api.key`), reserved = TRUE), urlPath)
}
if (!missing(`usage.credits`)) {
urlPath <- gsub(paste0("\\{", "usageCredits", "\\}"), URLencode(as.character(`usage.credits`), reserved = TRUE), urlPath)
}
if (!missing(`user.message`)) {
urlPath <- gsub(paste0("\\{", "userMessage", "\\}"), URLencode(as.character(`user.message`), reserved = TRUE), urlPath)
}
# API key authentication
if ("X-API-KEY" %in% names(self$apiClient$apiKeys) && nchar(self$apiClient$apiKeys["X-API-KEY"]) > 0) {
headerParams['X-API-KEY'] <- paste(unlist(self$apiClient$apiKeys["X-API-KEY"]), collapse='')
}
resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
method = "GET",
queryParams = queryParams,
headerParams = headerParams,
body = body,
...)
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
deserializedRespObj <- tryCatch(
self$apiClient$deserialize(resp, "SystemMetricsOut", loadNamespace("namsor")),
error = function(e){
stop("Failed to deserialize response")
}
)
ApiResponse$new(deserializedRespObj, resp)
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
ApiResponse$new("API client error", resp)
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
ApiResponse$new("API server error", resp)
}
},
Anonymize = function(source, anonymized, ...){
apiResponse <- self$AnonymizeWithHttpInfo(source, anonymized, ...)
resp <- apiResponse$response
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
apiResponse$content
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
apiResponse
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
apiResponse
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
apiResponse
}
},
AnonymizeWithHttpInfo = function(source, anonymized, ...){
args <- list(...)
queryParams <- list()
headerParams <- c()
if (missing(`source`)) {
stop("Missing required parameter `source`.")
}
if (missing(`anonymized`)) {
stop("Missing required parameter `anonymized`.")
}
urlPath <- "/api2/json/anonymize/{source}/{anonymized}"
if (!missing(`source`)) {
urlPath <- gsub(paste0("\\{", "source", "\\}"), URLencode(as.character(`source`), reserved = TRUE), urlPath)
}
if (!missing(`anonymized`)) {
urlPath <- gsub(paste0("\\{", "anonymized", "\\}"), URLencode(as.character(`anonymized`), reserved = TRUE), urlPath)
}
# API key authentication
if ("X-API-KEY" %in% names(self$apiClient$apiKeys) && nchar(self$apiClient$apiKeys["X-API-KEY"]) > 0) {
headerParams['X-API-KEY'] <- paste(unlist(self$apiClient$apiKeys["X-API-KEY"]), collapse='')
}
resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
method = "GET",
queryParams = queryParams,
headerParams = headerParams,
body = body,
...)
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
ApiResponse$new(NULL, resp)
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
ApiResponse$new("API client error", resp)
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
ApiResponse$new("API server error", resp)
}
},
ApiStatus = function(...){
apiResponse <- self$ApiStatusWithHttpInfo(...)
resp <- apiResponse$response
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
apiResponse$content
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
apiResponse
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
apiResponse
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
apiResponse
}
},
ApiStatusWithHttpInfo = function(...){
args <- list(...)
queryParams <- list()
headerParams <- c()
urlPath <- "/api2/json/apiStatus"
# API key authentication
if ("X-API-KEY" %in% names(self$apiClient$apiKeys) && nchar(self$apiClient$apiKeys["X-API-KEY"]) > 0) {
headerParams['X-API-KEY'] <- paste(unlist(self$apiClient$apiKeys["X-API-KEY"]), collapse='')
}
resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
method = "GET",
queryParams = queryParams,
headerParams = headerParams,
body = body,
...)
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
deserializedRespObj <- tryCatch(
self$apiClient$deserialize(resp, "APIPlansOut", loadNamespace("namsor")),
error = function(e){
stop("Failed to deserialize response")
}
)
ApiResponse$new(deserializedRespObj, resp)
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
ApiResponse$new("API client error", resp)
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
ApiResponse$new("API server error", resp)
}
},
ApiUsage = function(...){
apiResponse <- self$ApiUsageWithHttpInfo(...)
resp <- apiResponse$response
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
apiResponse$content
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
apiResponse
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
apiResponse
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
apiResponse
}
},
ApiUsageWithHttpInfo = function(...){
args <- list(...)
queryParams <- list()
headerParams <- c()
urlPath <- "/api2/json/apiUsage"
# API key authentication
if ("X-API-KEY" %in% names(self$apiClient$apiKeys) && nchar(self$apiClient$apiKeys["X-API-KEY"]) > 0) {
headerParams['X-API-KEY'] <- paste(unlist(self$apiClient$apiKeys["X-API-KEY"]), collapse='')
}
resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
method = "GET",
queryParams = queryParams,
headerParams = headerParams,
body = body,
...)
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
deserializedRespObj <- tryCatch(
self$apiClient$deserialize(resp, "APIPeriodUsageOut", loadNamespace("namsor")),
error = function(e){
stop("Failed to deserialize response")
}
)
ApiResponse$new(deserializedRespObj, resp)
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
ApiResponse$new("API client error", resp)
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
ApiResponse$new("API server error", resp)
}
},
ApiUsageHistory = function(...){
apiResponse <- self$ApiUsageHistoryWithHttpInfo(...)
resp <- apiResponse$response
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
apiResponse$content
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
apiResponse
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
apiResponse
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
apiResponse
}
},
ApiUsageHistoryWithHttpInfo = function(...){
args <- list(...)
queryParams <- list()
headerParams <- c()
urlPath <- "/api2/json/apiUsageHistory"
# API key authentication
if ("X-API-KEY" %in% names(self$apiClient$apiKeys) && nchar(self$apiClient$apiKeys["X-API-KEY"]) > 0) {
headerParams['X-API-KEY'] <- paste(unlist(self$apiClient$apiKeys["X-API-KEY"]), collapse='')
}
resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
method = "GET",
queryParams = queryParams,
headerParams = headerParams,
body = body,
...)
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
deserializedRespObj <- tryCatch(
self$apiClient$deserialize(resp, "APIPeriodUsageOut", loadNamespace("namsor")),
error = function(e){
stop("Failed to deserialize response")
}
)
ApiResponse$new(deserializedRespObj, resp)
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
ApiResponse$new("API client error", resp)
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
ApiResponse$new("API server error", resp)
}
},
ApiUsageHistoryAggregate = function(...){
apiResponse <- self$ApiUsageHistoryAggregateWithHttpInfo(...)
resp <- apiResponse$response
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
apiResponse$content
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
apiResponse
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
apiResponse
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
apiResponse
}
},
ApiUsageHistoryAggregateWithHttpInfo = function(...){
args <- list(...)
queryParams <- list()
headerParams <- c()
urlPath <- "/api2/json/apiUsageHistoryAggregate"
# API key authentication
if ("X-API-KEY" %in% names(self$apiClient$apiKeys) && nchar(self$apiClient$apiKeys["X-API-KEY"]) > 0) {
headerParams['X-API-KEY'] <- paste(unlist(self$apiClient$apiKeys["X-API-KEY"]), collapse='')
}
resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
method = "GET",
queryParams = queryParams,
headerParams = headerParams,
body = body,
...)
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
deserializedRespObj <- tryCatch(
self$apiClient$deserialize(resp, "APIPeriodUsageOut", loadNamespace("namsor")),
error = function(e){
stop("Failed to deserialize response")
}
)
ApiResponse$new(deserializedRespObj, resp)
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
ApiResponse$new("API client error", resp)
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
ApiResponse$new("API server error", resp)
}
},
AvailablePlans = function(...){
apiResponse <- self$AvailablePlansWithHttpInfo(...)
resp <- apiResponse$response
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
apiResponse$content
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
apiResponse
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
apiResponse
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
apiResponse
}
},
AvailablePlansWithHttpInfo = function(...){
args <- list(...)
queryParams <- list()
headerParams <- c()
urlPath <- "/api2/json/availablePlans"
# API key authentication
if ("X-API-KEY" %in% names(self$apiClient$apiKeys) && nchar(self$apiClient$apiKeys["X-API-KEY"]) > 0) {
headerParams['X-API-KEY'] <- paste(unlist(self$apiClient$apiKeys["X-API-KEY"]), collapse='')
}
resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
method = "GET",
queryParams = queryParams,
headerParams = headerParams,
body = body,
...)
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
deserializedRespObj <- tryCatch(
self$apiClient$deserialize(resp, "APIPlansOut", loadNamespace("namsor")),
error = function(e){
stop("Failed to deserialize response")
}
)
ApiResponse$new(deserializedRespObj, resp)
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
ApiResponse$new("API client error", resp)
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
ApiResponse$new("API server error", resp)
}
},
AvailablePlans1 = function(token, ...){
apiResponse <- self$AvailablePlans1WithHttpInfo(token, ...)
resp <- apiResponse$response
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
apiResponse$content
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
apiResponse
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
apiResponse
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
apiResponse
}
},
AvailablePlans1WithHttpInfo = function(token, ...){
args <- list(...)
queryParams <- list()
headerParams <- c()
if (missing(`token`)) {
stop("Missing required parameter `token`.")
}
urlPath <- "/api2/json/availablePlans/{token}"
if (!missing(`token`)) {
urlPath <- gsub(paste0("\\{", "token", "\\}"), URLencode(as.character(`token`), reserved = TRUE), urlPath)
}
# API key authentication
if ("X-API-KEY" %in% names(self$apiClient$apiKeys) && nchar(self$apiClient$apiKeys["X-API-KEY"]) > 0) {
headerParams['X-API-KEY'] <- paste(unlist(self$apiClient$apiKeys["X-API-KEY"]), collapse='')
}
resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
method = "GET",
queryParams = queryParams,
headerParams = headerParams,
body = body,
...)
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
deserializedRespObj <- tryCatch(
self$apiClient$deserialize(resp, "APIPlansOut", loadNamespace("namsor")),
error = function(e){
stop("Failed to deserialize response")
}
)
ApiResponse$new(deserializedRespObj, resp)
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
ApiResponse$new("API client error", resp)
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
ApiResponse$new("API server error", resp)
}
},
AvailableServices = function(...){
apiResponse <- self$AvailableServicesWithHttpInfo(...)
resp <- apiResponse$response
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
apiResponse$content
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
apiResponse
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
apiResponse
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
apiResponse
}
},
AvailableServicesWithHttpInfo = function(...){
args <- list(...)
queryParams <- list()
headerParams <- c()
urlPath <- "/api2/json/apiServices"
# API key authentication
if ("X-API-KEY" %in% names(self$apiClient$apiKeys) && nchar(self$apiClient$apiKeys["X-API-KEY"]) > 0) {
headerParams['X-API-KEY'] <- paste(unlist(self$apiClient$apiKeys["X-API-KEY"]), collapse='')
}
resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
method = "GET",
queryParams = queryParams,
headerParams = headerParams,
body = body,
...)
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
deserializedRespObj <- tryCatch(
self$apiClient$deserialize(resp, "APIPlansOut", loadNamespace("namsor")),
error = function(e){
stop("Failed to deserialize response")
}
)
ApiResponse$new(deserializedRespObj, resp)
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
ApiResponse$new("API client error", resp)
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
ApiResponse$new("API server error", resp)
}
},
BillingCurrencies = function(...){
apiResponse <- self$BillingCurrenciesWithHttpInfo(...)
resp <- apiResponse$response
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
apiResponse$content
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
apiResponse
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
apiResponse
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
apiResponse
}
},
BillingCurrenciesWithHttpInfo = function(...){
args <- list(...)
queryParams <- list()
headerParams <- c()
urlPath <- "/api2/json/billingCurrencies"
# API key authentication
if ("X-API-KEY" %in% names(self$apiClient$apiKeys) && nchar(self$apiClient$apiKeys["X-API-KEY"]) > 0) {
headerParams['X-API-KEY'] <- paste(unlist(self$apiClient$apiKeys["X-API-KEY"]), collapse='')
}
resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
method = "GET",
queryParams = queryParams,
headerParams = headerParams,
body = body,
...)
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
deserializedRespObj <- tryCatch(
self$apiClient$deserialize(resp, "CurrenciesOut", loadNamespace("namsor")),
error = function(e){
stop("Failed to deserialize response")
}
)
ApiResponse$new(deserializedRespObj, resp)
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
ApiResponse$new("API client error", resp)
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
ApiResponse$new("API server error", resp)
}
},
BillingHistory = function(token, ...){
apiResponse <- self$BillingHistoryWithHttpInfo(token, ...)
resp <- apiResponse$response
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
apiResponse$content
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
apiResponse
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
apiResponse
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
apiResponse
}
},
BillingHistoryWithHttpInfo = function(token, ...){
args <- list(...)
queryParams <- list()
headerParams <- c()
if (missing(`token`)) {
stop("Missing required parameter `token`.")
}
urlPath <- "/api2/json/billingHistory/{token}"
if (!missing(`token`)) {
urlPath <- gsub(paste0("\\{", "token", "\\}"), URLencode(as.character(`token`), reserved = TRUE), urlPath)
}
# API key authentication
if ("X-API-KEY" %in% names(self$apiClient$apiKeys) && nchar(self$apiClient$apiKeys["X-API-KEY"]) > 0) {
headerParams['X-API-KEY'] <- paste(unlist(self$apiClient$apiKeys["X-API-KEY"]), collapse='')
}
resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
method = "GET",
queryParams = queryParams,
headerParams = headerParams,
body = body,
...)
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
deserializedRespObj <- tryCatch(
self$apiClient$deserialize(resp, "BillingHistoryOut", loadNamespace("namsor")),
error = function(e){
stop("Failed to deserialize response")
}
)
ApiResponse$new(deserializedRespObj, resp)
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
ApiResponse$new("API client error", resp)
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
ApiResponse$new("API server error", resp)
}
},
BillingInfo = function(token, ...){
apiResponse <- self$BillingInfoWithHttpInfo(token, ...)
resp <- apiResponse$response
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
apiResponse$content
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
apiResponse
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
apiResponse
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
apiResponse
}
},
BillingInfoWithHttpInfo = function(token, ...){
args <- list(...)
queryParams <- list()
headerParams <- c()
if (missing(`token`)) {
stop("Missing required parameter `token`.")
}
urlPath <- "/api2/json/billingInfo/{token}"
if (!missing(`token`)) {
urlPath <- gsub(paste0("\\{", "token", "\\}"), URLencode(as.character(`token`), reserved = TRUE), urlPath)
}
# API key authentication
if ("X-API-KEY" %in% names(self$apiClient$apiKeys) && nchar(self$apiClient$apiKeys["X-API-KEY"]) > 0) {
headerParams['X-API-KEY'] <- paste(unlist(self$apiClient$apiKeys["X-API-KEY"]), collapse='')
}
resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
method = "GET",
queryParams = queryParams,
headerParams = headerParams,
body = body,
...)
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
deserializedRespObj <- tryCatch(
self$apiClient$deserialize(resp, "BillingInfoInOut", loadNamespace("namsor")),
error = function(e){
stop("Failed to deserialize response")
}
)
ApiResponse$new(deserializedRespObj, resp)
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
ApiResponse$new("API client error", resp)
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
ApiResponse$new("API server error", resp)
}
},
Charge = function(inline.object=NULL, ...){
apiResponse <- self$ChargeWithHttpInfo(inline.object, ...)
resp <- apiResponse$response
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
apiResponse$content
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
apiResponse
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
apiResponse
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
apiResponse
}
},
ChargeWithHttpInfo = function(inline.object=NULL, ...){
args <- list(...)
queryParams <- list()
headerParams <- c()
if (!missing(`inline.object`)) {
body <- `inline.object`$toJSONString()
} else {
body <- NULL
}
urlPath <- "/api2/json/charge"
# API key authentication
if ("X-API-KEY" %in% names(self$apiClient$apiKeys) && nchar(self$apiClient$apiKeys["X-API-KEY"]) > 0) {
headerParams['X-API-KEY'] <- paste(unlist(self$apiClient$apiKeys["X-API-KEY"]), collapse='')
}
resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
method = "POST",
queryParams = queryParams,
headerParams = headerParams,
body = body,
...)
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
deserializedRespObj <- tryCatch(
self$apiClient$deserialize(resp, "APIKeyOut", loadNamespace("namsor")),
error = function(e){
stop("Failed to deserialize response")
}
)
ApiResponse$new(deserializedRespObj, resp)
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
ApiResponse$new("API client error", resp)
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
ApiResponse$new("API server error", resp)
}
},
CorporateKey = function(api.key, corporate, ...){
apiResponse <- self$CorporateKeyWithHttpInfo(api.key, corporate, ...)
resp <- apiResponse$response
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
apiResponse$content
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
apiResponse
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
apiResponse
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
apiResponse
}
},
CorporateKeyWithHttpInfo = function(api.key, corporate, ...){
args <- list(...)
queryParams <- list()
headerParams <- c()
if (missing(`api.key`)) {
stop("Missing required parameter `api.key`.")
}
if (missing(`corporate`)) {
stop("Missing required parameter `corporate`.")
}
urlPath <- "/api2/json/corporateKey/{apiKey}/{corporate}"
if (!missing(`api.key`)) {
urlPath <- gsub(paste0("\\{", "apiKey", "\\}"), URLencode(as.character(`api.key`), reserved = TRUE), urlPath)
}
if (!missing(`corporate`)) {
urlPath <- gsub(paste0("\\{", "corporate", "\\}"), URLencode(as.character(`corporate`), reserved = TRUE), urlPath)
}
# API key authentication
if ("X-API-KEY" %in% names(self$apiClient$apiKeys) && nchar(self$apiClient$apiKeys["X-API-KEY"]) > 0) {
headerParams['X-API-KEY'] <- paste(unlist(self$apiClient$apiKeys["X-API-KEY"]), collapse='')
}
resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
method = "GET",
queryParams = queryParams,
headerParams = headerParams,
body = body,
...)
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
ApiResponse$new(NULL, resp)
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
ApiResponse$new("API client error", resp)
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
ApiResponse$new("API server error", resp)
}
},
DebugLevel = function(logger, level, ...){
apiResponse <- self$DebugLevelWithHttpInfo(logger, level, ...)
resp <- apiResponse$response
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
apiResponse$content
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
apiResponse
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
apiResponse
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
apiResponse
}
},
DebugLevelWithHttpInfo = function(logger, level, ...){
args <- list(...)
queryParams <- list()
headerParams <- c()
if (missing(`logger`)) {
stop("Missing required parameter `logger`.")
}
if (missing(`level`)) {
stop("Missing required parameter `level`.")
}
urlPath <- "/api2/json/debugLevel/{logger}/{level}"
if (!missing(`logger`)) {
urlPath <- gsub(paste0("\\{", "logger", "\\}"), URLencode(as.character(`logger`), reserved = TRUE), urlPath)
}
if (!missing(`level`)) {
urlPath <- gsub(paste0("\\{", "level", "\\}"), URLencode(as.character(`level`), reserved = TRUE), urlPath)
}
# API key authentication
if ("X-API-KEY" %in% names(self$apiClient$apiKeys) && nchar(self$apiClient$apiKeys["X-API-KEY"]) > 0) {
headerParams['X-API-KEY'] <- paste(unlist(self$apiClient$apiKeys["X-API-KEY"]), collapse='')
}
resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
method = "GET",
queryParams = queryParams,
headerParams = headerParams,
body = body,
...)
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
ApiResponse$new(NULL, resp)
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
ApiResponse$new("API client error", resp)
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
ApiResponse$new("API server error", resp)
}
},
Flush = function(...){
apiResponse <- self$FlushWithHttpInfo(...)
resp <- apiResponse$response
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
apiResponse$content
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
apiResponse
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
apiResponse
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
apiResponse
}
},
FlushWithHttpInfo = function(...){
args <- list(...)
queryParams <- list()
headerParams <- c()
urlPath <- "/api2/json/flush"
# API key authentication
if ("X-API-KEY" %in% names(self$apiClient$apiKeys) && nchar(self$apiClient$apiKeys["X-API-KEY"]) > 0) {
headerParams['X-API-KEY'] <- paste(unlist(self$apiClient$apiKeys["X-API-KEY"]), collapse='')
}
resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
method = "GET",
queryParams = queryParams,
headerParams = headerParams,
body = body,
...)
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
ApiResponse$new(NULL, resp)
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
ApiResponse$new("API client error", resp)
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
ApiResponse$new("API server error", resp)
}
},
InvalidateCache = function(...){
apiResponse <- self$InvalidateCacheWithHttpInfo(...)
resp <- apiResponse$response
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
apiResponse$content
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
apiResponse
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
apiResponse
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
apiResponse
}
},
InvalidateCacheWithHttpInfo = function(...){
args <- list(...)
queryParams <- list()
headerParams <- c()
urlPath <- "/api2/json/invalidateCache"
# API key authentication
if ("X-API-KEY" %in% names(self$apiClient$apiKeys) && nchar(self$apiClient$apiKeys["X-API-KEY"]) > 0) {
headerParams['X-API-KEY'] <- paste(unlist(self$apiClient$apiKeys["X-API-KEY"]), collapse='')
}
resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
method = "GET",
queryParams = queryParams,
headerParams = headerParams,
body = body,
...)
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
ApiResponse$new(NULL, resp)
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
ApiResponse$new("API client error", resp)
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
ApiResponse$new("API server error", resp)
}
},
Learnable = function(source, learnable, ...){
apiResponse <- self$LearnableWithHttpInfo(source, learnable, ...)
resp <- apiResponse$response
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
apiResponse$content
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
apiResponse
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
apiResponse
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
apiResponse
}
},
LearnableWithHttpInfo = function(source, learnable, ...){
args <- list(...)
queryParams <- list()
headerParams <- c()
if (missing(`source`)) {
stop("Missing required parameter `source`.")
}
if (missing(`learnable`)) {
stop("Missing required parameter `learnable`.")
}
urlPath <- "/api2/json/learnable/{source}/{learnable}"
if (!missing(`source`)) {
urlPath <- gsub(paste0("\\{", "source", "\\}"), URLencode(as.character(`source`), reserved = TRUE), urlPath)
}
if (!missing(`learnable`)) {
urlPath <- gsub(paste0("\\{", "learnable", "\\}"), URLencode(as.character(`learnable`), reserved = TRUE), urlPath)
}
# API key authentication
if ("X-API-KEY" %in% names(self$apiClient$apiKeys) && nchar(self$apiClient$apiKeys["X-API-KEY"]) > 0) {
headerParams['X-API-KEY'] <- paste(unlist(self$apiClient$apiKeys["X-API-KEY"]), collapse='')
}
resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
method = "GET",
queryParams = queryParams,
headerParams = headerParams,
body = body,
...)
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
ApiResponse$new(NULL, resp)
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
ApiResponse$new("API client error", resp)
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
ApiResponse$new("API server error", resp)
}
},
NamsorCounter = function(...){
apiResponse <- self$NamsorCounterWithHttpInfo(...)
resp <- apiResponse$response
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
apiResponse$content
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
apiResponse
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
apiResponse
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
apiResponse
}
},
NamsorCounterWithHttpInfo = function(...){
args <- list(...)
queryParams <- list()
headerParams <- c()
urlPath <- "/api2/json/namsorCounter"
# API key authentication
if ("X-API-KEY" %in% names(self$apiClient$apiKeys) && nchar(self$apiClient$apiKeys["X-API-KEY"]) > 0) {
headerParams['X-API-KEY'] <- paste(unlist(self$apiClient$apiKeys["X-API-KEY"]), collapse='')
}
resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
method = "GET",
queryParams = queryParams,
headerParams = headerParams,
body = body,
...)
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
deserializedRespObj <- tryCatch(
self$apiClient$deserialize(resp, "SoftwareVersionOut", loadNamespace("namsor")),
error = function(e){
stop("Failed to deserialize response")
}
)
ApiResponse$new(deserializedRespObj, resp)
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
ApiResponse$new("API client error", resp)
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
ApiResponse$new("API server error", resp)
}
},
PaymentInfo = function(token, ...){
apiResponse <- self$PaymentInfoWithHttpInfo(token, ...)
resp <- apiResponse$response
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
apiResponse$content
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
apiResponse
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
apiResponse
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
apiResponse
}
},
PaymentInfoWithHttpInfo = function(token, ...){
args <- list(...)
queryParams <- list()
headerParams <- c()
if (missing(`token`)) {
stop("Missing required parameter `token`.")
}
urlPath <- "/api2/json/paymentInfo/{token}"
if (!missing(`token`)) {
urlPath <- gsub(paste0("\\{", "token", "\\}"), URLencode(as.character(`token`), reserved = TRUE), urlPath)
}
# API key authentication
if ("X-API-KEY" %in% names(self$apiClient$apiKeys) && nchar(self$apiClient$apiKeys["X-API-KEY"]) > 0) {
headerParams['X-API-KEY'] <- paste(unlist(self$apiClient$apiKeys["X-API-KEY"]), collapse='')
}
resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
method = "GET",
queryParams = queryParams,
headerParams = headerParams,
body = body,
...)
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
deserializedRespObj <- tryCatch(
self$apiClient$deserialize(resp, "APIKeyOut", loadNamespace("namsor")),
error = function(e){
stop("Failed to deserialize response")
}
)
ApiResponse$new(deserializedRespObj, resp)
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
ApiResponse$new("API client error", resp)
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
ApiResponse$new("API server error", resp)
}
},
ProcureKey = function(token, ...){
apiResponse <- self$ProcureKeyWithHttpInfo(token, ...)
resp <- apiResponse$response
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
apiResponse$content
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
apiResponse
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
apiResponse
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
apiResponse
}
},
ProcureKeyWithHttpInfo = function(token, ...){
args <- list(...)
queryParams <- list()
headerParams <- c()
if (missing(`token`)) {
stop("Missing required parameter `token`.")
}
urlPath <- "/api2/json/procureKey/{token}"
if (!missing(`token`)) {
urlPath <- gsub(paste0("\\{", "token", "\\}"), URLencode(as.character(`token`), reserved = TRUE), urlPath)
}
# API key authentication
if ("X-API-KEY" %in% names(self$apiClient$apiKeys) && nchar(self$apiClient$apiKeys["X-API-KEY"]) > 0) {
headerParams['X-API-KEY'] <- paste(unlist(self$apiClient$apiKeys["X-API-KEY"]), collapse='')
}
resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
method = "GET",
queryParams = queryParams,
headerParams = headerParams,
body = body,
...)
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
deserializedRespObj <- tryCatch(
self$apiClient$deserialize(resp, "APIKeyOut", loadNamespace("namsor")),
error = function(e){
stop("Failed to deserialize response")
}
)
ApiResponse$new(deserializedRespObj, resp)
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
ApiResponse$new("API client error", resp)
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
ApiResponse$new("API server error", resp)
}
},
RedeployUI = function(...){
apiResponse <- self$RedeployUIWithHttpInfo(...)
resp <- apiResponse$response
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
apiResponse$content
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
apiResponse
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
apiResponse
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
apiResponse
}
},
RedeployUIWithHttpInfo = function(...){
args <- list(...)
queryParams <- list()
headerParams <- c()
urlPath <- "/api2/json/redeployUI"
# API key authentication
if ("X-API-KEY" %in% names(self$apiClient$apiKeys) && nchar(self$apiClient$apiKeys["X-API-KEY"]) > 0) {
headerParams['X-API-KEY'] <- paste(unlist(self$apiClient$apiKeys["X-API-KEY"]), collapse='')
}
resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
method = "GET",
queryParams = queryParams,
headerParams = headerParams,
body = body,
...)
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
ApiResponse$new(NULL, resp)
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
ApiResponse$new("API client error", resp)
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
ApiResponse$new("API server error", resp)
}
},
RedeployUI1 = function(live, ...){
apiResponse <- self$RedeployUI1WithHttpInfo(live, ...)
resp <- apiResponse$response
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
apiResponse$content
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
apiResponse
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
apiResponse
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
apiResponse
}
},
RedeployUI1WithHttpInfo = function(live, ...){
args <- list(...)
queryParams <- list()
headerParams <- c()
if (missing(`live`)) {
stop("Missing required parameter `live`.")
}
urlPath <- "/api2/json/redeployUI/{live}"
if (!missing(`live`)) {
urlPath <- gsub(paste0("\\{", "live", "\\}"), URLencode(as.character(`live`), reserved = TRUE), urlPath)
}
# API key authentication
if ("X-API-KEY" %in% names(self$apiClient$apiKeys) && nchar(self$apiClient$apiKeys["X-API-KEY"]) > 0) {
headerParams['X-API-KEY'] <- paste(unlist(self$apiClient$apiKeys["X-API-KEY"]), collapse='')
}
resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
method = "GET",
queryParams = queryParams,
headerParams = headerParams,
body = body,
...)
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
ApiResponse$new(NULL, resp)
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
ApiResponse$new("API client error", resp)
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
ApiResponse$new("API server error", resp)
}
},
RemoveUserAccount = function(token, ...){
apiResponse <- self$RemoveUserAccountWithHttpInfo(token, ...)
resp <- apiResponse$response
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
apiResponse$content
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
apiResponse
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
apiResponse
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
apiResponse
}
},
RemoveUserAccountWithHttpInfo = function(token, ...){
args <- list(...)
queryParams <- list()
headerParams <- c()
if (missing(`token`)) {
stop("Missing required parameter `token`.")
}
urlPath <- "/api2/json/removeUserAccount/{token}"
if (!missing(`token`)) {
urlPath <- gsub(paste0("\\{", "token", "\\}"), URLencode(as.character(`token`), reserved = TRUE), urlPath)
}
# API key authentication
if ("X-API-KEY" %in% names(self$apiClient$apiKeys) && nchar(self$apiClient$apiKeys["X-API-KEY"]) > 0) {
headerParams['X-API-KEY'] <- paste(unlist(self$apiClient$apiKeys["X-API-KEY"]), collapse='')
}
resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
method = "GET",
queryParams = queryParams,
headerParams = headerParams,
body = body,
...)
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
deserializedRespObj <- tryCatch(
self$apiClient$deserialize(resp, "APIPlanSubscriptionOut", loadNamespace("namsor")),
error = function(e){
stop("Failed to deserialize response")
}
)
ApiResponse$new(deserializedRespObj, resp)
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
ApiResponse$new("API client error", resp)
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
ApiResponse$new("API server error", resp)
}
},
RemoveUserAccountOnBehalf = function(api.key, ...){
apiResponse <- self$RemoveUserAccountOnBehalfWithHttpInfo(api.key, ...)
resp <- apiResponse$response
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
apiResponse$content
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
apiResponse
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
apiResponse
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
apiResponse
}
},
RemoveUserAccountOnBehalfWithHttpInfo = function(api.key, ...){
args <- list(...)
queryParams <- list()
headerParams <- c()
if (missing(`api.key`)) {
stop("Missing required parameter `api.key`.")
}
urlPath <- "/api2/json/removeUserAccountOnBehalf/{apiKey}"
if (!missing(`api.key`)) {
urlPath <- gsub(paste0("\\{", "apiKey", "\\}"), URLencode(as.character(`api.key`), reserved = TRUE), urlPath)
}
# API key authentication
if ("X-API-KEY" %in% names(self$apiClient$apiKeys) && nchar(self$apiClient$apiKeys["X-API-KEY"]) > 0) {
headerParams['X-API-KEY'] <- paste(unlist(self$apiClient$apiKeys["X-API-KEY"]), collapse='')
}
resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
method = "GET",
queryParams = queryParams,
headerParams = headerParams,
body = body,
...)
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
deserializedRespObj <- tryCatch(
self$apiClient$deserialize(resp, "APIPlanSubscriptionOut", loadNamespace("namsor")),
error = function(e){
stop("Failed to deserialize response")
}
)
ApiResponse$new(deserializedRespObj, resp)
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
ApiResponse$new("API client error", resp)
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
ApiResponse$new("API server error", resp)
}
},
Shutdown = function(...){
apiResponse <- self$ShutdownWithHttpInfo(...)
resp <- apiResponse$response
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
apiResponse$content
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
apiResponse
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
apiResponse
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
apiResponse
}
},
ShutdownWithHttpInfo = function(...){
args <- list(...)
queryParams <- list()
headerParams <- c()
urlPath <- "/api2/json/shutdown"
# API key authentication
if ("X-API-KEY" %in% names(self$apiClient$apiKeys) && nchar(self$apiClient$apiKeys["X-API-KEY"]) > 0) {
headerParams['X-API-KEY'] <- paste(unlist(self$apiClient$apiKeys["X-API-KEY"]), collapse='')
}
resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
method = "GET",
queryParams = queryParams,
headerParams = headerParams,
body = body,
...)
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
ApiResponse$new(NULL, resp)
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
ApiResponse$new("API client error", resp)
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
ApiResponse$new("API server error", resp)
}
},
SoftwareVersion = function(...){
apiResponse <- self$SoftwareVersionWithHttpInfo(...)
resp <- apiResponse$response
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
apiResponse$content
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
apiResponse
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
apiResponse
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
apiResponse
}
},
SoftwareVersionWithHttpInfo = function(...){
args <- list(...)
queryParams <- list()
headerParams <- c()
urlPath <- "/api2/json/softwareVersion"
# API key authentication
if ("X-API-KEY" %in% names(self$apiClient$apiKeys) && nchar(self$apiClient$apiKeys["X-API-KEY"]) > 0) {
headerParams['X-API-KEY'] <- paste(unlist(self$apiClient$apiKeys["X-API-KEY"]), collapse='')
}
resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
method = "GET",
queryParams = queryParams,
headerParams = headerParams,
body = body,
...)
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
deserializedRespObj <- tryCatch(
self$apiClient$deserialize(resp, "SoftwareVersionOut", loadNamespace("namsor")),
error = function(e){
stop("Failed to deserialize response")
}
)
ApiResponse$new(deserializedRespObj, resp)
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
ApiResponse$new("API client error", resp)
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
ApiResponse$new("API server error", resp)
}
},
SourceStats = function(source, ...){
apiResponse <- self$SourceStatsWithHttpInfo(source, ...)
resp <- apiResponse$response
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
apiResponse$content
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
apiResponse
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
apiResponse
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
apiResponse
}
},
SourceStatsWithHttpInfo = function(source, ...){
args <- list(...)
queryParams <- list()
headerParams <- c()
if (missing(`source`)) {
stop("Missing required parameter `source`.")
}
urlPath <- "/api2/json/sourceStats/{source}"
if (!missing(`source`)) {
urlPath <- gsub(paste0("\\{", "source", "\\}"), URLencode(as.character(`source`), reserved = TRUE), urlPath)
}
# API key authentication
if ("X-API-KEY" %in% names(self$apiClient$apiKeys) && nchar(self$apiClient$apiKeys["X-API-KEY"]) > 0) {
headerParams['X-API-KEY'] <- paste(unlist(self$apiClient$apiKeys["X-API-KEY"]), collapse='')
}
resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
method = "GET",
queryParams = queryParams,
headerParams = headerParams,
body = body,
...)
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
deserializedRespObj <- tryCatch(
self$apiClient$deserialize(resp, "SystemMetricsOut", loadNamespace("namsor")),
error = function(e){
stop("Failed to deserialize response")
}
)
ApiResponse$new(deserializedRespObj, resp)
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
ApiResponse$new("API client error", resp)
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
ApiResponse$new("API server error", resp)
}
},
Stats = function(...){
apiResponse <- self$StatsWithHttpInfo(...)
resp <- apiResponse$response
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
apiResponse$content
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
apiResponse
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
apiResponse
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
apiResponse
}
},
StatsWithHttpInfo = function(...){
args <- list(...)
queryParams <- list()
headerParams <- c()
urlPath <- "/api2/json/stats"
# API key authentication
if ("X-API-KEY" %in% names(self$apiClient$apiKeys) && nchar(self$apiClient$apiKeys["X-API-KEY"]) > 0) {
headerParams['X-API-KEY'] <- paste(unlist(self$apiClient$apiKeys["X-API-KEY"]), collapse='')
}
resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
method = "GET",
queryParams = queryParams,
headerParams = headerParams,
body = body,
...)
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
deserializedRespObj <- tryCatch(
self$apiClient$deserialize(resp, "SystemMetricsOut", loadNamespace("namsor")),
error = function(e){
stop("Failed to deserialize response")
}
)
ApiResponse$new(deserializedRespObj, resp)
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
ApiResponse$new("API client error", resp)
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
ApiResponse$new("API server error", resp)
}
},
StripeConnect = function(scope=NULL, code=NULL, error=NULL, error.description=NULL, ...){
apiResponse <- self$StripeConnectWithHttpInfo(scope, code, error, error.description, ...)
resp <- apiResponse$response
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
apiResponse$content
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
apiResponse
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
apiResponse
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
apiResponse
}
},
StripeConnectWithHttpInfo = function(scope=NULL, code=NULL, error=NULL, error.description=NULL, ...){
args <- list(...)
queryParams <- list()
headerParams <- c()
queryParams['scope'] <- scope
queryParams['code'] <- code
queryParams['error'] <- error
queryParams['error_description'] <- error.description
urlPath <- "/api2/json/stripeConnect"
# API key authentication
if ("X-API-KEY" %in% names(self$apiClient$apiKeys) && nchar(self$apiClient$apiKeys["X-API-KEY"]) > 0) {
headerParams['X-API-KEY'] <- paste(unlist(self$apiClient$apiKeys["X-API-KEY"]), collapse='')
}
resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
method = "GET",
queryParams = queryParams,
headerParams = headerParams,
body = body,
...)
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
ApiResponse$new(NULL, resp)
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
ApiResponse$new("API client error", resp)
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
ApiResponse$new("API server error", resp)
}
},
SubscribePlan = function(plan.name, token, ...){
apiResponse <- self$SubscribePlanWithHttpInfo(plan.name, token, ...)
resp <- apiResponse$response
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
apiResponse$content
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
apiResponse
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
apiResponse
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
apiResponse
}
},
SubscribePlanWithHttpInfo = function(plan.name, token, ...){
args <- list(...)
queryParams <- list()
headerParams <- c()
if (missing(`plan.name`)) {
stop("Missing required parameter `plan.name`.")
}
if (missing(`token`)) {
stop("Missing required parameter `token`.")
}
urlPath <- "/api2/json/subscribePlan/{planName}/{token}"
if (!missing(`plan.name`)) {
urlPath <- gsub(paste0("\\{", "planName", "\\}"), URLencode(as.character(`plan.name`), reserved = TRUE), urlPath)
}
if (!missing(`token`)) {
urlPath <- gsub(paste0("\\{", "token", "\\}"), URLencode(as.character(`token`), reserved = TRUE), urlPath)
}
# API key authentication
if ("X-API-KEY" %in% names(self$apiClient$apiKeys) && nchar(self$apiClient$apiKeys["X-API-KEY"]) > 0) {
headerParams['X-API-KEY'] <- paste(unlist(self$apiClient$apiKeys["X-API-KEY"]), collapse='')
}
resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
method = "GET",
queryParams = queryParams,
headerParams = headerParams,
body = body,
...)
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
deserializedRespObj <- tryCatch(
self$apiClient$deserialize(resp, "APIPlanSubscriptionOut", loadNamespace("namsor")),
error = function(e){
stop("Failed to deserialize response")
}
)
ApiResponse$new(deserializedRespObj, resp)
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
ApiResponse$new("API client error", resp)
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
ApiResponse$new("API server error", resp)
}
},
SubscribePlanOnBehalf = function(plan.name, api.key, ...){
apiResponse <- self$SubscribePlanOnBehalfWithHttpInfo(plan.name, api.key, ...)
resp <- apiResponse$response
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
apiResponse$content
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
apiResponse
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
apiResponse
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
apiResponse
}
},
SubscribePlanOnBehalfWithHttpInfo = function(plan.name, api.key, ...){
args <- list(...)
queryParams <- list()
headerParams <- c()
if (missing(`plan.name`)) {
stop("Missing required parameter `plan.name`.")
}
if (missing(`api.key`)) {
stop("Missing required parameter `api.key`.")
}
urlPath <- "/api2/json/subscribePlanOnBehalf/{planName}/{apiKey}"
if (!missing(`plan.name`)) {
urlPath <- gsub(paste0("\\{", "planName", "\\}"), URLencode(as.character(`plan.name`), reserved = TRUE), urlPath)
}
if (!missing(`api.key`)) {
urlPath <- gsub(paste0("\\{", "apiKey", "\\}"), URLencode(as.character(`api.key`), reserved = TRUE), urlPath)
}
# API key authentication
if ("X-API-KEY" %in% names(self$apiClient$apiKeys) && nchar(self$apiClient$apiKeys["X-API-KEY"]) > 0) {
headerParams['X-API-KEY'] <- paste(unlist(self$apiClient$apiKeys["X-API-KEY"]), collapse='')
}
resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
method = "GET",
queryParams = queryParams,
headerParams = headerParams,
body = body,
...)
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
deserializedRespObj <- tryCatch(
self$apiClient$deserialize(resp, "APIPlanSubscriptionOut", loadNamespace("namsor")),
error = function(e){
stop("Failed to deserialize response")
}
)
ApiResponse$new(deserializedRespObj, resp)
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
ApiResponse$new("API client error", resp)
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
ApiResponse$new("API server error", resp)
}
},
TaxonomyClasses = function(classifier.name, ...){
apiResponse <- self$TaxonomyClassesWithHttpInfo(classifier.name, ...)
resp <- apiResponse$response
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
apiResponse$content
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
apiResponse
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
apiResponse
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
apiResponse
}
},
TaxonomyClassesWithHttpInfo = function(classifier.name, ...){
args <- list(...)
queryParams <- list()
headerParams <- c()
if (missing(`classifier.name`)) {
stop("Missing required parameter `classifier.name`.")
}
urlPath <- "/api2/json/taxonomyClasses/{classifierName}"
if (!missing(`classifier.name`)) {
urlPath <- gsub(paste0("\\{", "classifierName", "\\}"), URLencode(as.character(`classifier.name`), reserved = TRUE), urlPath)
}
# API key authentication
if ("X-API-KEY" %in% names(self$apiClient$apiKeys) && nchar(self$apiClient$apiKeys["X-API-KEY"]) > 0) {
headerParams['X-API-KEY'] <- paste(unlist(self$apiClient$apiKeys["X-API-KEY"]), collapse='')
}
resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
method = "GET",
queryParams = queryParams,
headerParams = headerParams,
body = body,
...)
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
deserializedRespObj <- tryCatch(
self$apiClient$deserialize(resp, "APIPlansOut", loadNamespace("namsor")),
error = function(e){
stop("Failed to deserialize response")
}
)
ApiResponse$new(deserializedRespObj, resp)
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
ApiResponse$new("API client error", resp)
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
ApiResponse$new("API server error", resp)
}
},
UpdateBillingInfo = function(token, billing.info.in.out=NULL, ...){
apiResponse <- self$UpdateBillingInfoWithHttpInfo(token, billing.info.in.out, ...)
resp <- apiResponse$response
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
apiResponse$content
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
apiResponse
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
apiResponse
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
apiResponse
}
},
UpdateBillingInfoWithHttpInfo = function(token, billing.info.in.out=NULL, ...){
args <- list(...)
queryParams <- list()
headerParams <- c()
if (missing(`token`)) {
stop("Missing required parameter `token`.")
}
if (!missing(`billing.info.in.out`)) {
body <- `billing.info.in.out`$toJSONString()
} else {
body <- NULL
}
urlPath <- "/api2/json/updateBillingInfo/{token}"
if (!missing(`token`)) {
urlPath <- gsub(paste0("\\{", "token", "\\}"), URLencode(as.character(`token`), reserved = TRUE), urlPath)
}
# API key authentication
if ("X-API-KEY" %in% names(self$apiClient$apiKeys) && nchar(self$apiClient$apiKeys["X-API-KEY"]) > 0) {
headerParams['X-API-KEY'] <- paste(unlist(self$apiClient$apiKeys["X-API-KEY"]), collapse='')
}
resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
method = "POST",
queryParams = queryParams,
headerParams = headerParams,
body = body,
...)
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
deserializedRespObj <- tryCatch(
self$apiClient$deserialize(resp, "BillingInfoInOut", loadNamespace("namsor")),
error = function(e){
stop("Failed to deserialize response")
}
)
ApiResponse$new(deserializedRespObj, resp)
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
ApiResponse$new("API client error", resp)
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
ApiResponse$new("API server error", resp)
}
},
UpdateLimit = function(usage.limit, hard.or.soft, token, ...){
apiResponse <- self$UpdateLimitWithHttpInfo(usage.limit, hard.or.soft, token, ...)
resp <- apiResponse$response
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
apiResponse$content
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
apiResponse
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
apiResponse
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
apiResponse
}
},
UpdateLimitWithHttpInfo = function(usage.limit, hard.or.soft, token, ...){
args <- list(...)
queryParams <- list()
headerParams <- c()
if (missing(`usage.limit`)) {
stop("Missing required parameter `usage.limit`.")
}
if (missing(`hard.or.soft`)) {
stop("Missing required parameter `hard.or.soft`.")
}
if (missing(`token`)) {
stop("Missing required parameter `token`.")
}
urlPath <- "/api2/json/updateLimit/{usageLimit}/{hardOrSoft}/{token}"
if (!missing(`usage.limit`)) {
urlPath <- gsub(paste0("\\{", "usageLimit", "\\}"), URLencode(as.character(`usage.limit`), reserved = TRUE), urlPath)
}
if (!missing(`hard.or.soft`)) {
urlPath <- gsub(paste0("\\{", "hardOrSoft", "\\}"), URLencode(as.character(`hard.or.soft`), reserved = TRUE), urlPath)
}
if (!missing(`token`)) {
urlPath <- gsub(paste0("\\{", "token", "\\}"), URLencode(as.character(`token`), reserved = TRUE), urlPath)
}
# API key authentication
if ("X-API-KEY" %in% names(self$apiClient$apiKeys) && nchar(self$apiClient$apiKeys["X-API-KEY"]) > 0) {
headerParams['X-API-KEY'] <- paste(unlist(self$apiClient$apiKeys["X-API-KEY"]), collapse='')
}
resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
method = "GET",
queryParams = queryParams,
headerParams = headerParams,
body = body,
...)
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
deserializedRespObj <- tryCatch(
self$apiClient$deserialize(resp, "APIPeriodUsageOut", loadNamespace("namsor")),
error = function(e){
stop("Failed to deserialize response")
}
)
ApiResponse$new(deserializedRespObj, resp)
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
ApiResponse$new("API client error", resp)
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
ApiResponse$new("API server error", resp)
}
},
UpdatePaymentDefault = function(defaut.source.id, token, ...){
apiResponse <- self$UpdatePaymentDefaultWithHttpInfo(defaut.source.id, token, ...)
resp <- apiResponse$response
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
apiResponse$content
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
apiResponse
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
apiResponse
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
apiResponse
}
},
UpdatePaymentDefaultWithHttpInfo = function(defaut.source.id, token, ...){
args <- list(...)
queryParams <- list()
headerParams <- c()
if (missing(`defaut.source.id`)) {
stop("Missing required parameter `defaut.source.id`.")
}
if (missing(`token`)) {
stop("Missing required parameter `token`.")
}
urlPath <- "/api2/json/updatePaymentDefault/{defautSourceId}/{token}"
if (!missing(`defaut.source.id`)) {
urlPath <- gsub(paste0("\\{", "defautSourceId", "\\}"), URLencode(as.character(`defaut.source.id`), reserved = TRUE), urlPath)
}
if (!missing(`token`)) {
urlPath <- gsub(paste0("\\{", "token", "\\}"), URLencode(as.character(`token`), reserved = TRUE), urlPath)
}
# API key authentication
if ("X-API-KEY" %in% names(self$apiClient$apiKeys) && nchar(self$apiClient$apiKeys["X-API-KEY"]) > 0) {
headerParams['X-API-KEY'] <- paste(unlist(self$apiClient$apiKeys["X-API-KEY"]), collapse='')
}
resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
method = "GET",
queryParams = queryParams,
headerParams = headerParams,
body = body,
...)
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
deserializedRespObj <- tryCatch(
self$apiClient$deserialize(resp, "APIKeyOut", loadNamespace("namsor")),
error = function(e){
stop("Failed to deserialize response")
}
)
ApiResponse$new(deserializedRespObj, resp)
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
ApiResponse$new("API client error", resp)
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
ApiResponse$new("API server error", resp)
}
},
UserInfo = function(token, ...){
apiResponse <- self$UserInfoWithHttpInfo(token, ...)
resp <- apiResponse$response
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
apiResponse$content
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
apiResponse
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
apiResponse
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
apiResponse
}
},
UserInfoWithHttpInfo = function(token, ...){
args <- list(...)
queryParams <- list()
headerParams <- c()
if (missing(`token`)) {
stop("Missing required parameter `token`.")
}
urlPath <- "/api2/json/userInfo/{token}"
if (!missing(`token`)) {
urlPath <- gsub(paste0("\\{", "token", "\\}"), URLencode(as.character(`token`), reserved = TRUE), urlPath)
}
# API key authentication
if ("X-API-KEY" %in% names(self$apiClient$apiKeys) && nchar(self$apiClient$apiKeys["X-API-KEY"]) > 0) {
headerParams['X-API-KEY'] <- paste(unlist(self$apiClient$apiKeys["X-API-KEY"]), collapse='')
}
resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
method = "GET",
queryParams = queryParams,
headerParams = headerParams,
body = body,
...)
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
deserializedRespObj <- tryCatch(
self$apiClient$deserialize(resp, "APIKeyOut", loadNamespace("namsor")),
error = function(e){
stop("Failed to deserialize response")
}
)
ApiResponse$new(deserializedRespObj, resp)
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
ApiResponse$new("API client error", resp)
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
ApiResponse$new("API server error", resp)
}
},
VerifyEmail = function(email.token, ...){
apiResponse <- self$VerifyEmailWithHttpInfo(email.token, ...)
resp <- apiResponse$response
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
apiResponse$content
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
apiResponse
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
apiResponse
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
apiResponse
}
},
VerifyEmailWithHttpInfo = function(email.token, ...){
args <- list(...)
queryParams <- list()
headerParams <- c()
if (missing(`email.token`)) {
stop("Missing required parameter `email.token`.")
}
urlPath <- "/api2/json/verifyEmail/{emailToken}"
if (!missing(`email.token`)) {
urlPath <- gsub(paste0("\\{", "emailToken", "\\}"), URLencode(as.character(`email.token`), reserved = TRUE), urlPath)
}
# API key authentication
if ("X-API-KEY" %in% names(self$apiClient$apiKeys) && nchar(self$apiClient$apiKeys["X-API-KEY"]) > 0) {
headerParams['X-API-KEY'] <- paste(unlist(self$apiClient$apiKeys["X-API-KEY"]), collapse='')
}
resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
method = "GET",
queryParams = queryParams,
headerParams = headerParams,
body = body,
...)
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
deserializedRespObj <- tryCatch(
self$apiClient$deserialize(resp, "APIKeyOut", loadNamespace("namsor")),
error = function(e){
stop("Failed to deserialize response")
}
)
ApiResponse$new(deserializedRespObj, resp)
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
ApiResponse$new("API client error", resp)
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
ApiResponse$new("API server error", resp)
}
},
VerifyRemoveEmail = function(email.token, ...){
apiResponse <- self$VerifyRemoveEmailWithHttpInfo(email.token, ...)
resp <- apiResponse$response
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
apiResponse$content
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
apiResponse
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
apiResponse
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
apiResponse
}
},
VerifyRemoveEmailWithHttpInfo = function(email.token, ...){
args <- list(...)
queryParams <- list()
headerParams <- c()
if (missing(`email.token`)) {
stop("Missing required parameter `email.token`.")
}
urlPath <- "/api2/json/verifyRemoveEmail/{emailToken}"
if (!missing(`email.token`)) {
urlPath <- gsub(paste0("\\{", "emailToken", "\\}"), URLencode(as.character(`email.token`), reserved = TRUE), urlPath)
}
# API key authentication
if ("X-API-KEY" %in% names(self$apiClient$apiKeys) && nchar(self$apiClient$apiKeys["X-API-KEY"]) > 0) {
headerParams['X-API-KEY'] <- paste(unlist(self$apiClient$apiKeys["X-API-KEY"]), collapse='')
}
resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
method = "GET",
queryParams = queryParams,
headerParams = headerParams,
body = body,
...)
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
deserializedRespObj <- tryCatch(
self$apiClient$deserialize(resp, "APIKeyOut", loadNamespace("namsor")),
error = function(e){
stop("Failed to deserialize response")
}
)
ApiResponse$new(deserializedRespObj, resp)
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
ApiResponse$new("API client error", resp)
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
ApiResponse$new("API server error", resp)
}
},
Vet = function(source, vetted, ...){
apiResponse <- self$VetWithHttpInfo(source, vetted, ...)
resp <- apiResponse$response
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
apiResponse$content
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
apiResponse
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
apiResponse
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
apiResponse
}
},
VetWithHttpInfo = function(source, vetted, ...){
args <- list(...)
queryParams <- list()
headerParams <- c()
if (missing(`source`)) {
stop("Missing required parameter `source`.")
}
if (missing(`vetted`)) {
stop("Missing required parameter `vetted`.")
}
urlPath <- "/api2/json/vetting/{source}/{vetted}"
if (!missing(`source`)) {
urlPath <- gsub(paste0("\\{", "source", "\\}"), URLencode(as.character(`source`), reserved = TRUE), urlPath)
}
if (!missing(`vetted`)) {
urlPath <- gsub(paste0("\\{", "vetted", "\\}"), URLencode(as.character(`vetted`), reserved = TRUE), urlPath)
}
# API key authentication
if ("X-API-KEY" %in% names(self$apiClient$apiKeys) && nchar(self$apiClient$apiKeys["X-API-KEY"]) > 0) {
headerParams['X-API-KEY'] <- paste(unlist(self$apiClient$apiKeys["X-API-KEY"]), collapse='')
}
resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
method = "GET",
queryParams = queryParams,
headerParams = headerParams,
body = body,
...)
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
ApiResponse$new(NULL, resp)
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
ApiResponse$new("API client error", resp)
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
ApiResponse$new("API server error", resp)
}
}
)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.