=begin #Sematext Cloud API #API Explorer provides access and documentation for Sematext REST API. The REST API requires the API Key to be sent as part of `Authorization` header. E.g.: `Authorization : apiKey e5f18450-205a-48eb-8589-7d49edaea813`. OpenAPI spec version: v3 Generated by: https://github.com/swagger-api/swagger-codegen.git Swagger Codegen version: 3.0.34 =end module SematextCloud class SubscriptionsApi attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end # Create App subscription # @param body subscription # @param app_id appId # @param [Hash] opts the optional parameters # @return [SubscriptionResponse] def create_for_app_using_post(body, app_id, opts = {}) data, _status_code, _headers = create_for_app_using_post_with_http_info(body, app_id, opts) data end # Create App subscription # @param body subscription # @param app_id appId # @param [Hash] opts the optional parameters # @return [Array<(SubscriptionResponse, Integer, Hash)>] SubscriptionResponse data, response status code and response headers def create_for_app_using_post_with_http_info(body, app_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SubscriptionsApi.create_for_app_using_post ...' end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling SubscriptionsApi.create_for_app_using_post" end # verify the required parameter 'app_id' is set if @api_client.config.client_side_validation && app_id.nil? fail ArgumentError, "Missing the required parameter 'app_id' when calling SubscriptionsApi.create_for_app_using_post" end # resource path local_var_path = '/users-web/api/v3/apps/{appId}/subscription'.sub('{' + 'appId' + '}', app_id.to_s) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(body) return_type = opts[:return_type] || 'SubscriptionResponse' auth_names = opts[:auth_names] || ['api_key'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type) if @api_client.config.debugging @api_client.config.logger.debug "API called: SubscriptionsApi#create_for_app_using_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Create dashboard subscription # @param body subscription # @param dash_id dashId # @param [Hash] opts the optional parameters # @return [SubscriptionResponse] def create_for_dash_using_post1(body, dash_id, opts = {}) data, _status_code, _headers = create_for_dash_using_post1_with_http_info(body, dash_id, opts) data end # Create dashboard subscription # @param body subscription # @param dash_id dashId # @param [Hash] opts the optional parameters # @return [Array<(SubscriptionResponse, Integer, Hash)>] SubscriptionResponse data, response status code and response headers def create_for_dash_using_post1_with_http_info(body, dash_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SubscriptionsApi.create_for_dash_using_post1 ...' end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling SubscriptionsApi.create_for_dash_using_post1" end # verify the required parameter 'dash_id' is set if @api_client.config.client_side_validation && dash_id.nil? fail ArgumentError, "Missing the required parameter 'dash_id' when calling SubscriptionsApi.create_for_dash_using_post1" end # resource path local_var_path = '/users-web/api/v3/dashboards/{dashId}/subscription'.sub('{' + 'dashId' + '}', dash_id.to_s) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(body) return_type = opts[:return_type] || 'SubscriptionResponse' auth_names = opts[:auth_names] || ['api_key'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type) if @api_client.config.debugging @api_client.config.logger.debug "API called: SubscriptionsApi#create_for_dash_using_post1\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Delete subscription # @param updateable_subscription_id updateableSubscriptionId # @param [Hash] opts the optional parameters # @return [GenericMapBasedApiResponse] def delete_using_delete3(updateable_subscription_id, opts = {}) data, _status_code, _headers = delete_using_delete3_with_http_info(updateable_subscription_id, opts) data end # Delete subscription # @param updateable_subscription_id updateableSubscriptionId # @param [Hash] opts the optional parameters # @return [Array<(GenericMapBasedApiResponse, Integer, Hash)>] GenericMapBasedApiResponse data, response status code and response headers def delete_using_delete3_with_http_info(updateable_subscription_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SubscriptionsApi.delete_using_delete3 ...' end # verify the required parameter 'updateable_subscription_id' is set if @api_client.config.client_side_validation && updateable_subscription_id.nil? fail ArgumentError, "Missing the required parameter 'updateable_subscription_id' when calling SubscriptionsApi.delete_using_delete3" end # resource path local_var_path = '/users-web/api/v3/subscriptions/{updateableSubscriptionId}'.sub('{' + 'updateableSubscriptionId' + '}', updateable_subscription_id.to_s) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] return_type = opts[:return_type] || 'GenericMapBasedApiResponse' auth_names = opts[:auth_names] || ['api_key'] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type) if @api_client.config.debugging @api_client.config.logger.debug "API called: SubscriptionsApi#delete_using_delete3\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get subscriptions for an App # @param app_id appId # @param [Hash] opts the optional parameters # @return [SubscriptionsResponse] def list_using_get2(app_id, opts = {}) data, _status_code, _headers = list_using_get2_with_http_info(app_id, opts) data end # Get subscriptions for an App # @param app_id appId # @param [Hash] opts the optional parameters # @return [Array<(SubscriptionsResponse, Integer, Hash)>] SubscriptionsResponse data, response status code and response headers def list_using_get2_with_http_info(app_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SubscriptionsApi.list_using_get2 ...' end # verify the required parameter 'app_id' is set if @api_client.config.client_side_validation && app_id.nil? fail ArgumentError, "Missing the required parameter 'app_id' when calling SubscriptionsApi.list_using_get2" end # resource path local_var_path = '/users-web/api/v3/apps/{appId}/subscriptions'.sub('{' + 'appId' + '}', app_id.to_s) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] return_type = opts[:return_type] || 'SubscriptionsResponse' auth_names = opts[:auth_names] || ['api_key'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type) if @api_client.config.debugging @api_client.config.logger.debug "API called: SubscriptionsApi#list_using_get2\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get current account's subscriptions # @param [Hash] opts the optional parameters # @return [SubscriptionsResponse] def list_using_get5(opts = {}) data, _status_code, _headers = list_using_get5_with_http_info(opts) data end # Get current account's subscriptions # @param [Hash] opts the optional parameters # @return [Array<(SubscriptionsResponse, Integer, Hash)>] SubscriptionsResponse data, response status code and response headers def list_using_get5_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SubscriptionsApi.list_using_get5 ...' end # resource path local_var_path = '/users-web/api/v3/subscriptions' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] return_type = opts[:return_type] || 'SubscriptionsResponse' auth_names = opts[:auth_names] || ['api_key'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type) if @api_client.config.debugging @api_client.config.logger.debug "API called: SubscriptionsApi#list_using_get5\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Email an App report # @param body emailDto # @param app_id appId # @param [Hash] opts the optional parameters # @return [MailReportResponse] def send_app_report_using_post1(body, app_id, opts = {}) data, _status_code, _headers = send_app_report_using_post1_with_http_info(body, app_id, opts) data end # Email an App report # @param body emailDto # @param app_id appId # @param [Hash] opts the optional parameters # @return [Array<(MailReportResponse, Integer, Hash)>] MailReportResponse data, response status code and response headers def send_app_report_using_post1_with_http_info(body, app_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SubscriptionsApi.send_app_report_using_post1 ...' end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling SubscriptionsApi.send_app_report_using_post1" end # verify the required parameter 'app_id' is set if @api_client.config.client_side_validation && app_id.nil? fail ArgumentError, "Missing the required parameter 'app_id' when calling SubscriptionsApi.send_app_report_using_post1" end # resource path local_var_path = '/users-web/api/v3/apps/{appId}/report/send'.sub('{' + 'appId' + '}', app_id.to_s) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(body) return_type = opts[:return_type] || 'MailReportResponse' auth_names = opts[:auth_names] || ['api_key'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type) if @api_client.config.debugging @api_client.config.logger.debug "API called: SubscriptionsApi#send_app_report_using_post1\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Email a dashboard report # @param body emailDto # @param dash_id dashId # @param [Hash] opts the optional parameters # @return [MailReportResponse] def send_dash_report_using_post1(body, dash_id, opts = {}) data, _status_code, _headers = send_dash_report_using_post1_with_http_info(body, dash_id, opts) data end # Email a dashboard report # @param body emailDto # @param dash_id dashId # @param [Hash] opts the optional parameters # @return [Array<(MailReportResponse, Integer, Hash)>] MailReportResponse data, response status code and response headers def send_dash_report_using_post1_with_http_info(body, dash_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SubscriptionsApi.send_dash_report_using_post1 ...' end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling SubscriptionsApi.send_dash_report_using_post1" end # verify the required parameter 'dash_id' is set if @api_client.config.client_side_validation && dash_id.nil? fail ArgumentError, "Missing the required parameter 'dash_id' when calling SubscriptionsApi.send_dash_report_using_post1" end # resource path local_var_path = '/users-web/api/v3/dashboards/{dashId}/report/send'.sub('{' + 'dashId' + '}', dash_id.to_s) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(body) return_type = opts[:return_type] || 'MailReportResponse' auth_names = opts[:auth_names] || ['api_key'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type) if @api_client.config.debugging @api_client.config.logger.debug "API called: SubscriptionsApi#send_dash_report_using_post1\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Toggle subscription status # @param body dto # @param updateable_subscription_id updateableSubscriptionId # @param [Hash] opts the optional parameters # @return [SubscriptionResponse] def toggle_enabled_using_put(body, updateable_subscription_id, opts = {}) data, _status_code, _headers = toggle_enabled_using_put_with_http_info(body, updateable_subscription_id, opts) data end # Toggle subscription status # @param body dto # @param updateable_subscription_id updateableSubscriptionId # @param [Hash] opts the optional parameters # @return [Array<(SubscriptionResponse, Integer, Hash)>] SubscriptionResponse data, response status code and response headers def toggle_enabled_using_put_with_http_info(body, updateable_subscription_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SubscriptionsApi.toggle_enabled_using_put ...' end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling SubscriptionsApi.toggle_enabled_using_put" end # verify the required parameter 'updateable_subscription_id' is set if @api_client.config.client_side_validation && updateable_subscription_id.nil? fail ArgumentError, "Missing the required parameter 'updateable_subscription_id' when calling SubscriptionsApi.toggle_enabled_using_put" end # resource path local_var_path = '/users-web/api/v3/subscriptions/{updateableSubscriptionId}'.sub('{' + 'updateableSubscriptionId' + '}', updateable_subscription_id.to_s) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(body) return_type = opts[:return_type] || 'SubscriptionResponse' auth_names = opts[:auth_names] || ['api_key'] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type) if @api_client.config.debugging @api_client.config.logger.debug "API called: SubscriptionsApi#toggle_enabled_using_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update App subscription # @param body subscription # @param app_id appId # @param [Hash] opts the optional parameters # @return [SubscriptionResponse] def update_for_app_using_put1(body, app_id, opts = {}) data, _status_code, _headers = update_for_app_using_put1_with_http_info(body, app_id, opts) data end # Update App subscription # @param body subscription # @param app_id appId # @param [Hash] opts the optional parameters # @return [Array<(SubscriptionResponse, Integer, Hash)>] SubscriptionResponse data, response status code and response headers def update_for_app_using_put1_with_http_info(body, app_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SubscriptionsApi.update_for_app_using_put1 ...' end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling SubscriptionsApi.update_for_app_using_put1" end # verify the required parameter 'app_id' is set if @api_client.config.client_side_validation && app_id.nil? fail ArgumentError, "Missing the required parameter 'app_id' when calling SubscriptionsApi.update_for_app_using_put1" end # resource path local_var_path = '/users-web/api/v3/apps/{appId}/subscription'.sub('{' + 'appId' + '}', app_id.to_s) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(body) return_type = opts[:return_type] || 'SubscriptionResponse' auth_names = opts[:auth_names] || ['api_key'] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type) if @api_client.config.debugging @api_client.config.logger.debug "API called: SubscriptionsApi#update_for_app_using_put1\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update dashboard subscription # @param body subscription # @param dash_id dashId # @param [Hash] opts the optional parameters # @return [SubscriptionResponse] def update_for_dash_using_put(body, dash_id, opts = {}) data, _status_code, _headers = update_for_dash_using_put_with_http_info(body, dash_id, opts) data end # Update dashboard subscription # @param body subscription # @param dash_id dashId # @param [Hash] opts the optional parameters # @return [Array<(SubscriptionResponse, Integer, Hash)>] SubscriptionResponse data, response status code and response headers def update_for_dash_using_put_with_http_info(body, dash_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SubscriptionsApi.update_for_dash_using_put ...' end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling SubscriptionsApi.update_for_dash_using_put" end # verify the required parameter 'dash_id' is set if @api_client.config.client_side_validation && dash_id.nil? fail ArgumentError, "Missing the required parameter 'dash_id' when calling SubscriptionsApi.update_for_dash_using_put" end # resource path local_var_path = '/users-web/api/v3/dashboards/{dashId}/subscription'.sub('{' + 'dashId' + '}', dash_id.to_s) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(body) return_type = opts[:return_type] || 'SubscriptionResponse' auth_names = opts[:auth_names] || ['api_key'] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type) if @api_client.config.debugging @api_client.config.logger.debug "API called: SubscriptionsApi#update_for_dash_using_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end