=begin #Subskribe API #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: 1.0.0 Generated by: https://github.com/swagger-api/swagger-codegen.git Swagger Codegen version: 2.4.41 =end require 'uri' module SubskribeDevClient class EntitiesApi attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end # Create an entity # Create an entity. On success return the created entity. # @param [Hash] opts the optional parameters # @option opts [EntityJson] :body entity # @return [nil] def create(opts = {}) create_with_http_info(opts) nil end # Create an entity # Create an entity. On success return the created entity. # @param [Hash] opts the optional parameters # @option opts [EntityJson] :body entity # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def create_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EntitiesApi.create ...' end # resource path local_var_path = '/entities' # query parameters query_params = {} # header parameters 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 = {} # http body (model) post_body = @api_client.object_to_http_body(opts[:'body']) auth_names = ['ApiKeyAuth'] 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) if @api_client.config.debugging @api_client.config.logger.debug "API called: EntitiesApi#create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Delete entity # Delete the entity if there is no data associated with it. # @param id entity id # @param [Hash] opts the optional parameters # @return [nil] def delete_entity(id, opts = {}) delete_entity_with_http_info(id, opts) nil end # Delete entity # Delete the entity if there is no data associated with it. # @param id entity id # @param [Hash] opts the optional parameters # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def delete_entity_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EntitiesApi.delete_entity ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling EntitiesApi.delete_entity" end # resource path local_var_path = '/entities/{id}'.sub('{' + 'id' + '}', id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['ApiKeyAuth'] 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) if @api_client.config.debugging @api_client.config.logger.debug "API called: EntitiesApi#delete_entity\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Gets entities # Gets all entities # @param [Hash] opts the optional parameters # @return [Array] def get_entities(opts = {}) data, _status_code, _headers = get_entities_with_http_info(opts) data end # Gets entities # Gets all entities # @param [Hash] opts the optional parameters # @return [Array<(Array, Fixnum, Hash)>] Array data, response status code and response headers def get_entities_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EntitiesApi.get_entities ...' end # resource path local_var_path = '/entities' # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['ApiKeyAuth'] 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 => 'Array') if @api_client.config.debugging @api_client.config.logger.debug "API called: EntitiesApi#get_entities\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Gets entity details # Gets the entity details of the specified entity id # @param id entity id # @param [Hash] opts the optional parameters # @return [Entity] def get_entity_by_id(id, opts = {}) data, _status_code, _headers = get_entity_by_id_with_http_info(id, opts) data end # Gets entity details # Gets the entity details of the specified entity id # @param id entity id # @param [Hash] opts the optional parameters # @return [Array<(Entity, Fixnum, Hash)>] Entity data, response status code and response headers def get_entity_by_id_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EntitiesApi.get_entity_by_id ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling EntitiesApi.get_entity_by_id" end # resource path local_var_path = '/entities/{id}'.sub('{' + 'id' + '}', id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['ApiKeyAuth'] 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 => 'Entity') if @api_client.config.debugging @api_client.config.logger.debug "API called: EntitiesApi#get_entity_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get entity logo # Get the current logo stored for the given entity # @param entity_id # @param [Hash] opts the optional parameters # @return [nil] def get_logo(entity_id, opts = {}) get_logo_with_http_info(entity_id, opts) nil end # Get entity logo # Get the current logo stored for the given entity # @param entity_id # @param [Hash] opts the optional parameters # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def get_logo_with_http_info(entity_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EntitiesApi.get_logo ...' end # verify the required parameter 'entity_id' is set if @api_client.config.client_side_validation && entity_id.nil? fail ArgumentError, "Missing the required parameter 'entity_id' when calling EntitiesApi.get_logo" end # resource path local_var_path = '/entities/logo/{entityId}'.sub('{' + 'entityId' + '}', entity_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['image/png', 'application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['ApiKeyAuth'] 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) if @api_client.config.debugging @api_client.config.logger.debug "API called: EntitiesApi#get_logo\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update order entity # Move order to a target entity # @param [Hash] opts the optional parameters # @option opts [String] :target_entity_id # @option opts [String] :order_id # @return [nil] def order_entity_migration(opts = {}) order_entity_migration_with_http_info(opts) nil end # Update order entity # Move order to a target entity # @param [Hash] opts the optional parameters # @option opts [String] :target_entity_id # @option opts [String] :order_id # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def order_entity_migration_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EntitiesApi.order_entity_migration ...' end # resource path local_var_path = '/entities/migrate/order' # query parameters query_params = {} query_params[:'targetEntityId'] = opts[:'target_entity_id'] if !opts[:'target_entity_id'].nil? query_params[:'orderId'] = opts[:'order_id'] if !opts[:'order_id'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['ApiKeyAuth'] 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) if @api_client.config.debugging @api_client.config.logger.debug "API called: EntitiesApi#order_entity_migration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Move subscription to a target entity # Move subscription and associated transactions to a target entity # @param [Hash] opts the optional parameters # @option opts [String] :target_entity_id # @option opts [String] :subscription_id # @return [nil] def subscription_entity_migration(opts = {}) subscription_entity_migration_with_http_info(opts) nil end # Move subscription to a target entity # Move subscription and associated transactions to a target entity # @param [Hash] opts the optional parameters # @option opts [String] :target_entity_id # @option opts [String] :subscription_id # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def subscription_entity_migration_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EntitiesApi.subscription_entity_migration ...' end # resource path local_var_path = '/entities/migrate/subscription' # query parameters query_params = {} query_params[:'targetEntityId'] = opts[:'target_entity_id'] if !opts[:'target_entity_id'].nil? query_params[:'subscriptionId'] = opts[:'subscription_id'] if !opts[:'subscription_id'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['ApiKeyAuth'] 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) if @api_client.config.debugging @api_client.config.logger.debug "API called: EntitiesApi#subscription_entity_migration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end