# DaDaPush Public API
#
# DaDaPush: Real-time Notifications App Send real-time notifications through our API without coding and maintaining your own app for iOS or Android devices.
#
# The version of the OpenAPI document: v1
# Contact: contacts@dadapush.com
# Generated by: https://openapi-generator.tech
#' ApiClient Class
#'
#' Generic API client for OpenAPI client library builds.
#' OpenAPI generic API client. This client handles the client-
#' server communication, and is invariant across implementations. Specifics of
#' the methods and models for each application are generated from the OpenAPI Generator
#' templates.
#'
#' NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
#' Ref: https://openapi-generator.tech
#' Do not edit the class manually.
#'
#' @field basePath
#' @field userAgent
#' @field defaultHeaders
#' @field username
#' @field password
#' @field apiKeys
#' @field accessToken
#' @importFrom httr
#' @export
ApiClient <- R6::R6Class(
'ApiClient',
public = list(
# base path of all requests
basePath = "https://www.dadapush.com",
# user agent in the HTTP request
userAgent = "OpenAPI-Generator/1.0.0/r",
# default headers in the HTTP request
defaultHeaders = NULL,
# username (HTTP basic authentication)
username = NULL,
# password (HTTP basic authentication)
password = NULL,
# API keys
apiKeys = NULL,
# Access token
accessToken = NULL,
# constructor
initialize = function(basePath=NULL, userAgent=NULL, defaultHeaders=NULL, username=NULL, password=NULL, apiKeys=NULL, accessToken=NULL){
if (!is.null(basePath)) {
self$basePath <- basePath
}
if (!is.null(defaultHeaders)) {
self$defaultHeaders <- defaultHeaders
}
if (!is.null(username)) {
self$username <- username
}
if (!is.null(password)) {
self$password <- password
}
if (!is.null(accessToken)) {
self$accessToken <- accessToken
}
if (!is.null(apiKeys)) {
self$apiKeys <- apiKeys
} else {
self$apiKeys <- list()
}
if (!is.null(userAgent)) {
self$`userAgent` <- userAgent
}
},
CallApi = function(url, method, queryParams, headerParams, body, ...){
headers <- httr::add_headers(c(headerParams, self$defaultHeaders))
if (method == "GET") {
httr::GET(url, queryParams, headers, ...)
} else if (method == "POST") {
httr::POST(url, query = queryParams, headers, body = body, httr::content_type("application/json"), ...)
} else if (method == "PUT") {
httr::PUT(url, query = queryParams, headers, body = body, httr::content_type("application/json"), ...)
} else if (method == "PATCH") {
httr::PATCH(url, query = queryParams, headers, body = body, httr::content_type("application/json"), ...)
} else if (method == "HEAD") {
httr::HEAD(url, query = queryParams, headers, ...)
} else if (method == "DELETE") {
httr::DELETE(url, query = queryParams, headers, ...)
} else {
stop("http method must be `GET`, `HEAD`, `OPTIONS`, `POST`, `PATCH`, `PUT` or `DELETE`.")
}
}
)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.