# ReportingCloud Ruby SDK # # Official Ruby SDK for the ReportingCloud Web API. Authored, maintained and fully supported # by Text Control GmbH. (http://www.textcontrol.com). # # Go to http://www.reporting.cloud to learn more about ReportingCloud # Go to https://github.com/TextControl/txtextcontrol-reportingcloud-ruby for the # canonical source repository. # # License: https://raw.githubusercontent.com/TextControl/txtextcontrol-reportingcloud-ruby/master/LICENSE.md # # Copyright: © 2019 Text Control GmbH require "uri" require "net/http" require "json" require "ostruct" require "cgi" require 'txtextcontrol/reportingcloud/template' require 'txtextcontrol/reportingcloud/template_info' require 'txtextcontrol/reportingcloud/account_settings' require 'txtextcontrol/reportingcloud/incorrect_word' require 'txtextcontrol/reportingcloud/find_and_replace_body' require 'txtextcontrol/reportingcloud/template_name_validator' require 'txtextcontrol/reportingcloud/template_data_validator' require 'txtextcontrol/reportingcloud/api_key' require 'txtextcontrol/reportingcloud/append_body' require 'core_ext/string' module TXTextControl module ReportingCloud # The main class. # @attr username [String] The user name. # @attr password [String] The password. # @attr base_uri [String] The API base url. Is set to "+https://api.reporting.cloud+" # by default. # @attr api_version [String] The API version. Is set to "+v1+" by default. # @attr read_timeout [Integer] The timeout for HTTP requests in seconds. Is set to # +10+ by default. # @author Thorsten Kummerow (@thomerow) class ReportingCloud attr_accessor :username attr_accessor :password attr_accessor :base_uri attr_accessor :api_version attr_accessor :read_timeout # @param username [String] The user name. # @param password [String] The password. # @param base_url [String] The API base url. Is set to "+https://api.reporting.cloud+" # by default. def initialize(username, password, base_url = nil) base_url ||= DEFAULT_BASE_URI @username = username @password = password @api_version = DEFAULT_VERSION @read_timeout = DEFAULT_TIMEOUT @base_uri = URI.parse(base_url) end # Lists all templates from the template storage. # @return [Array