class Notifo::UserApi
Attributes
Public Class Methods
# File lib/notifo/api/user_api.rb, line 16 def initialize(api_client = ApiClient.default) @api_client = api_client end
Public Instance Methods
Deletes a user subscription. User Id and App Id are resolved using the API token. @param topic The topic path. @param [Hash] opts the optional parameters @return [nil]
# File lib/notifo/api/user_api.rb, line 24 def user_delete_subscription(topic, opts = {}) user_delete_subscription_with_http_info(topic, opts) nil end
Deletes a user subscription. User Id and App Id are resolved using the API token. @param topic The topic path. @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
# File lib/notifo/api/user_api.rb, line 34 def user_delete_subscription_with_http_info(topic, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: UserApi.user_delete_subscription ...' end # verify the required parameter 'topic' is set if @api_client.config.client_side_validation && topic.nil? fail ArgumentError, "Missing the required parameter 'topic' when calling UserApi.user_delete_subscription" end # resource path local_var_path = '/api/me/subscriptions/{topic}'.sub('{' + 'topic' + '}', topic.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] auth_names = opts[:auth_names] || [] 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: UserApi#user_delete_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Gets a user subscription. User Id and App Id are resolved using the API token. @param topic The topic path. @param [Hash] opts the optional parameters @return [SubscriptionDto]
# File lib/notifo/api/user_api.rb, line 80 def user_get_subscription(topic, opts = {}) data, _status_code, _headers = user_get_subscription_with_http_info(topic, opts) data end
Gets a user subscription. User Id and App Id are resolved using the API token. @param topic The topic path. @param [Hash] opts the optional parameters @return [Array<(SubscriptionDto
, Integer, Hash)>] SubscriptionDto
data, response status code and response headers
# File lib/notifo/api/user_api.rb, line 90 def user_get_subscription_with_http_info(topic, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: UserApi.user_get_subscription ...' end # verify the required parameter 'topic' is set if @api_client.config.client_side_validation && topic.nil? fail ArgumentError, "Missing the required parameter 'topic' when calling UserApi.user_get_subscription" end # resource path local_var_path = '/api/me/subscriptions/{topic}'.sub('{' + 'topic' + '}', topic.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] || 'SubscriptionDto' auth_names = opts[:auth_names] || [] 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: UserApi#user_get_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Get the current user. @param [Hash] opts the optional parameters @return [ProfileDto]
# File lib/notifo/api/user_api.rb, line 134 def user_get_user(opts = {}) data, _status_code, _headers = user_get_user_with_http_info(opts) data end
Get the current user. @param [Hash] opts the optional parameters @return [Array<(ProfileDto
, Integer, Hash)>] ProfileDto
data, response status code and response headers
# File lib/notifo/api/user_api.rb, line 142 def user_get_user_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: UserApi.user_get_user ...' end # resource path local_var_path = '/api/me' # 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] || 'ProfileDto' auth_names = opts[:auth_names] || [] 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: UserApi#user_get_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Creates a user subscription. User Id and App Id are resolved using the API token. @param body The subscription settings. @param [Hash] opts the optional parameters @return [nil]
# File lib/notifo/api/user_api.rb, line 184 def user_post_subscription(body, opts = {}) user_post_subscription_with_http_info(body, opts) nil end
Creates a user subscription. User Id and App Id are resolved using the API token. @param body The subscription settings. @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
# File lib/notifo/api/user_api.rb, line 194 def user_post_subscription_with_http_info(body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: UserApi.user_post_subscription ...' 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 UserApi.user_post_subscription" end # resource path local_var_path = '/api/me/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']) # 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] auth_names = opts[:auth_names] || [] 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: UserApi#user_post_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Update the user. @param body The upsert request. @param [Hash] opts the optional parameters @return [ProfileDto]
# File lib/notifo/api/user_api.rb, line 241 def user_post_user(body, opts = {}) data, _status_code, _headers = user_post_user_with_http_info(body, opts) data end
Update the user. @param body The upsert request. @param [Hash] opts the optional parameters @return [Array<(ProfileDto
, Integer, Hash)>] ProfileDto
data, response status code and response headers
# File lib/notifo/api/user_api.rb, line 250 def user_post_user_with_http_info(body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: UserApi.user_post_user ...' 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 UserApi.user_post_user" end # resource path local_var_path = '/api/me' # 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] || 'ProfileDto' auth_names = opts[:auth_names] || [] 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: UserApi#user_post_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end