=begin #Marketing Events Extension #These APIs allow you to interact with HubSpot's Marketing Events Extension. It allows you to: * Create, Read or update Marketing Event information in HubSpot * Specify whether a HubSpot contact has registered, attended or cancelled a registration to a Marketing Event. * Specify a URL that can be called to get the details of a Marketing Event. The version of the OpenAPI document: v3 Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 =end require 'cgi' module Hubspot module Marketing module Events class MarketingEventsExternalApi attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end # @param external_event_id [String] # @param external_account_id [String] # @param [Hash] opts the optional parameters # @return [nil] def archive(external_event_id, external_account_id, opts = {}) archive_with_http_info(external_event_id, external_account_id, opts) nil end # @param external_event_id [String] # @param external_account_id [String] # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def archive_with_http_info(external_event_id, external_account_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MarketingEventsExternalApi.archive ...' end # verify the required parameter 'external_event_id' is set if @api_client.config.client_side_validation && external_event_id.nil? fail ArgumentError, "Missing the required parameter 'external_event_id' when calling MarketingEventsExternalApi.archive" end # verify the required parameter 'external_account_id' is set if @api_client.config.client_side_validation && external_account_id.nil? fail ArgumentError, "Missing the required parameter 'external_account_id' when calling MarketingEventsExternalApi.archive" end # resource path local_var_path = '/marketing/v3/marketing-events/events/{externalEventId}'.sub('{' + 'externalEventId' + '}', CGI.escape(external_event_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'externalAccountId'] = external_account_id # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['*/*']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || ['oauth2'] new_options = opts.merge( :operation => :"MarketingEventsExternalApi.archive", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: MarketingEventsExternalApi#archive\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # @param batch_input_marketing_event_external_unique_identifier [BatchInputMarketingEventExternalUniqueIdentifier] # @param [Hash] opts the optional parameters # @return [Error] def archive_batch(batch_input_marketing_event_external_unique_identifier, opts = {}) data, _status_code, _headers = archive_batch_with_http_info(batch_input_marketing_event_external_unique_identifier, opts) data end # @param batch_input_marketing_event_external_unique_identifier [BatchInputMarketingEventExternalUniqueIdentifier] # @param [Hash] opts the optional parameters # @return [Array<(Error, Integer, Hash)>] Error data, response status code and response headers def archive_batch_with_http_info(batch_input_marketing_event_external_unique_identifier, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MarketingEventsExternalApi.archive_batch ...' end # verify the required parameter 'batch_input_marketing_event_external_unique_identifier' is set if @api_client.config.client_side_validation && batch_input_marketing_event_external_unique_identifier.nil? fail ArgumentError, "Missing the required parameter 'batch_input_marketing_event_external_unique_identifier' when calling MarketingEventsExternalApi.archive_batch" end # resource path local_var_path = '/marketing/v3/marketing-events/events/delete' # 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(['*/*']) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(batch_input_marketing_event_external_unique_identifier) # return_type return_type = opts[:debug_return_type] || 'Error' # auth_names auth_names = opts[:debug_auth_names] || ['oauth2'] new_options = opts.merge( :operation => :"MarketingEventsExternalApi.archive_batch", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: MarketingEventsExternalApi#archive_batch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # @param external_event_id [String] # @param external_account_id [String] # @param marketing_event_complete_request_params [MarketingEventCompleteRequestParams] # @param [Hash] opts the optional parameters # @return [MarketingEventDefaultResponse] def complete(external_event_id, external_account_id, marketing_event_complete_request_params, opts = {}) data, _status_code, _headers = complete_with_http_info(external_event_id, external_account_id, marketing_event_complete_request_params, opts) data end # @param external_event_id [String] # @param external_account_id [String] # @param marketing_event_complete_request_params [MarketingEventCompleteRequestParams] # @param [Hash] opts the optional parameters # @return [Array<(MarketingEventDefaultResponse, Integer, Hash)>] MarketingEventDefaultResponse data, response status code and response headers def complete_with_http_info(external_event_id, external_account_id, marketing_event_complete_request_params, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MarketingEventsExternalApi.complete ...' end # verify the required parameter 'external_event_id' is set if @api_client.config.client_side_validation && external_event_id.nil? fail ArgumentError, "Missing the required parameter 'external_event_id' when calling MarketingEventsExternalApi.complete" end # verify the required parameter 'external_account_id' is set if @api_client.config.client_side_validation && external_account_id.nil? fail ArgumentError, "Missing the required parameter 'external_account_id' when calling MarketingEventsExternalApi.complete" end # verify the required parameter 'marketing_event_complete_request_params' is set if @api_client.config.client_side_validation && marketing_event_complete_request_params.nil? fail ArgumentError, "Missing the required parameter 'marketing_event_complete_request_params' when calling MarketingEventsExternalApi.complete" end # resource path local_var_path = '/marketing/v3/marketing-events/events/{externalEventId}/complete'.sub('{' + 'externalEventId' + '}', CGI.escape(external_event_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'externalAccountId'] = external_account_id # 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' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(marketing_event_complete_request_params) # return_type return_type = opts[:debug_return_type] || 'MarketingEventDefaultResponse' # auth_names auth_names = opts[:debug_auth_names] || ['oauth2'] new_options = opts.merge( :operation => :"MarketingEventsExternalApi.complete", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: MarketingEventsExternalApi#complete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # @param marketing_event_create_request_params [MarketingEventCreateRequestParams] # @param [Hash] opts the optional parameters # @return [MarketingEventDefaultResponse] def create(marketing_event_create_request_params, opts = {}) data, _status_code, _headers = create_with_http_info(marketing_event_create_request_params, opts) data end # @param marketing_event_create_request_params [MarketingEventCreateRequestParams] # @param [Hash] opts the optional parameters # @return [Array<(MarketingEventDefaultResponse, Integer, Hash)>] MarketingEventDefaultResponse data, response status code and response headers def create_with_http_info(marketing_event_create_request_params, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MarketingEventsExternalApi.create ...' end # verify the required parameter 'marketing_event_create_request_params' is set if @api_client.config.client_side_validation && marketing_event_create_request_params.nil? fail ArgumentError, "Missing the required parameter 'marketing_event_create_request_params' when calling MarketingEventsExternalApi.create" end # resource path local_var_path = '/marketing/v3/marketing-events/events' # 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' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(marketing_event_create_request_params) # return_type return_type = opts[:debug_return_type] || 'MarketingEventDefaultResponse' # auth_names auth_names = opts[:debug_auth_names] || ['oauth2'] new_options = opts.merge( :operation => :"MarketingEventsExternalApi.create", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: MarketingEventsExternalApi#create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # @param external_event_id [String] # @param external_account_id [String] # @param [Hash] opts the optional parameters # @return [MarketingEventDefaultResponse] def do_cancel(external_event_id, external_account_id, opts = {}) data, _status_code, _headers = do_cancel_with_http_info(external_event_id, external_account_id, opts) data end # @param external_event_id [String] # @param external_account_id [String] # @param [Hash] opts the optional parameters # @return [Array<(MarketingEventDefaultResponse, Integer, Hash)>] MarketingEventDefaultResponse data, response status code and response headers def do_cancel_with_http_info(external_event_id, external_account_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MarketingEventsExternalApi.do_cancel ...' end # verify the required parameter 'external_event_id' is set if @api_client.config.client_side_validation && external_event_id.nil? fail ArgumentError, "Missing the required parameter 'external_event_id' when calling MarketingEventsExternalApi.do_cancel" end # verify the required parameter 'external_account_id' is set if @api_client.config.client_side_validation && external_account_id.nil? fail ArgumentError, "Missing the required parameter 'external_account_id' when calling MarketingEventsExternalApi.do_cancel" end # resource path local_var_path = '/marketing/v3/marketing-events/events/{externalEventId}/cancel'.sub('{' + 'externalEventId' + '}', CGI.escape(external_event_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'externalAccountId'] = external_account_id # 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[:debug_body] # return_type return_type = opts[:debug_return_type] || 'MarketingEventDefaultResponse' # auth_names auth_names = opts[:debug_auth_names] || ['oauth2'] new_options = opts.merge( :operation => :"MarketingEventsExternalApi.do_cancel", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: MarketingEventsExternalApi#do_cancel\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # @param external_event_id [String] # @param subscriber_state [String] # @param external_account_id [String] # @param batch_input_marketing_event_email_subscriber [BatchInputMarketingEventEmailSubscriber] # @param [Hash] opts the optional parameters # @return [Error] def do_email_upsert_by_id(external_event_id, subscriber_state, external_account_id, batch_input_marketing_event_email_subscriber, opts = {}) data, _status_code, _headers = do_email_upsert_by_id_with_http_info(external_event_id, subscriber_state, external_account_id, batch_input_marketing_event_email_subscriber, opts) data end # @param external_event_id [String] # @param subscriber_state [String] # @param external_account_id [String] # @param batch_input_marketing_event_email_subscriber [BatchInputMarketingEventEmailSubscriber] # @param [Hash] opts the optional parameters # @return [Array<(Error, Integer, Hash)>] Error data, response status code and response headers def do_email_upsert_by_id_with_http_info(external_event_id, subscriber_state, external_account_id, batch_input_marketing_event_email_subscriber, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MarketingEventsExternalApi.do_email_upsert_by_id ...' end # verify the required parameter 'external_event_id' is set if @api_client.config.client_side_validation && external_event_id.nil? fail ArgumentError, "Missing the required parameter 'external_event_id' when calling MarketingEventsExternalApi.do_email_upsert_by_id" end # verify the required parameter 'subscriber_state' is set if @api_client.config.client_side_validation && subscriber_state.nil? fail ArgumentError, "Missing the required parameter 'subscriber_state' when calling MarketingEventsExternalApi.do_email_upsert_by_id" end # verify the required parameter 'external_account_id' is set if @api_client.config.client_side_validation && external_account_id.nil? fail ArgumentError, "Missing the required parameter 'external_account_id' when calling MarketingEventsExternalApi.do_email_upsert_by_id" end # verify the required parameter 'batch_input_marketing_event_email_subscriber' is set if @api_client.config.client_side_validation && batch_input_marketing_event_email_subscriber.nil? fail ArgumentError, "Missing the required parameter 'batch_input_marketing_event_email_subscriber' when calling MarketingEventsExternalApi.do_email_upsert_by_id" end # resource path local_var_path = '/marketing/v3/marketing-events/events/{externalEventId}/{subscriberState}/email-upsert'.sub('{' + 'externalEventId' + '}', CGI.escape(external_event_id.to_s)).sub('{' + 'subscriberState' + '}', CGI.escape(subscriber_state.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'externalAccountId'] = external_account_id # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['*/*']) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(batch_input_marketing_event_email_subscriber) # return_type return_type = opts[:debug_return_type] || 'Error' # auth_names auth_names = opts[:debug_auth_names] || ['oauth2'] new_options = opts.merge( :operation => :"MarketingEventsExternalApi.do_email_upsert_by_id", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: MarketingEventsExternalApi#do_email_upsert_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # @param batch_input_marketing_event_create_request_params [BatchInputMarketingEventCreateRequestParams] # @param [Hash] opts the optional parameters # @return [BatchResponseMarketingEventPublicDefaultResponse] def do_upsert(batch_input_marketing_event_create_request_params, opts = {}) data, _status_code, _headers = do_upsert_with_http_info(batch_input_marketing_event_create_request_params, opts) data end # @param batch_input_marketing_event_create_request_params [BatchInputMarketingEventCreateRequestParams] # @param [Hash] opts the optional parameters # @return [Array<(BatchResponseMarketingEventPublicDefaultResponse, Integer, Hash)>] BatchResponseMarketingEventPublicDefaultResponse data, response status code and response headers def do_upsert_with_http_info(batch_input_marketing_event_create_request_params, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MarketingEventsExternalApi.do_upsert ...' end # verify the required parameter 'batch_input_marketing_event_create_request_params' is set if @api_client.config.client_side_validation && batch_input_marketing_event_create_request_params.nil? fail ArgumentError, "Missing the required parameter 'batch_input_marketing_event_create_request_params' when calling MarketingEventsExternalApi.do_upsert" end # resource path local_var_path = '/marketing/v3/marketing-events/events/upsert' # 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' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(batch_input_marketing_event_create_request_params) # return_type return_type = opts[:debug_return_type] || 'BatchResponseMarketingEventPublicDefaultResponse' # auth_names auth_names = opts[:debug_auth_names] || ['oauth2'] new_options = opts.merge( :operation => :"MarketingEventsExternalApi.do_upsert", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: MarketingEventsExternalApi#do_upsert\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # @param external_event_id [String] # @param subscriber_state [String] # @param external_account_id [String] # @param batch_input_marketing_event_subscriber [BatchInputMarketingEventSubscriber] # @param [Hash] opts the optional parameters # @return [Error] def do_upsert_by_id(external_event_id, subscriber_state, external_account_id, batch_input_marketing_event_subscriber, opts = {}) data, _status_code, _headers = do_upsert_by_id_with_http_info(external_event_id, subscriber_state, external_account_id, batch_input_marketing_event_subscriber, opts) data end # @param external_event_id [String] # @param subscriber_state [String] # @param external_account_id [String] # @param batch_input_marketing_event_subscriber [BatchInputMarketingEventSubscriber] # @param [Hash] opts the optional parameters # @return [Array<(Error, Integer, Hash)>] Error data, response status code and response headers def do_upsert_by_id_with_http_info(external_event_id, subscriber_state, external_account_id, batch_input_marketing_event_subscriber, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MarketingEventsExternalApi.do_upsert_by_id ...' end # verify the required parameter 'external_event_id' is set if @api_client.config.client_side_validation && external_event_id.nil? fail ArgumentError, "Missing the required parameter 'external_event_id' when calling MarketingEventsExternalApi.do_upsert_by_id" end # verify the required parameter 'subscriber_state' is set if @api_client.config.client_side_validation && subscriber_state.nil? fail ArgumentError, "Missing the required parameter 'subscriber_state' when calling MarketingEventsExternalApi.do_upsert_by_id" end # verify the required parameter 'external_account_id' is set if @api_client.config.client_side_validation && external_account_id.nil? fail ArgumentError, "Missing the required parameter 'external_account_id' when calling MarketingEventsExternalApi.do_upsert_by_id" end # verify the required parameter 'batch_input_marketing_event_subscriber' is set if @api_client.config.client_side_validation && batch_input_marketing_event_subscriber.nil? fail ArgumentError, "Missing the required parameter 'batch_input_marketing_event_subscriber' when calling MarketingEventsExternalApi.do_upsert_by_id" end # resource path local_var_path = '/marketing/v3/marketing-events/events/{externalEventId}/{subscriberState}/upsert'.sub('{' + 'externalEventId' + '}', CGI.escape(external_event_id.to_s)).sub('{' + 'subscriberState' + '}', CGI.escape(subscriber_state.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'externalAccountId'] = external_account_id # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['*/*']) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(batch_input_marketing_event_subscriber) # return_type return_type = opts[:debug_return_type] || 'Error' # auth_names auth_names = opts[:debug_auth_names] || ['oauth2'] new_options = opts.merge( :operation => :"MarketingEventsExternalApi.do_upsert_by_id", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: MarketingEventsExternalApi#do_upsert_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # @param external_event_id [String] # @param external_account_id [String] # @param [Hash] opts the optional parameters # @return [MarketingEventPublicReadResponse] def get_by_id(external_event_id, external_account_id, opts = {}) data, _status_code, _headers = get_by_id_with_http_info(external_event_id, external_account_id, opts) data end # @param external_event_id [String] # @param external_account_id [String] # @param [Hash] opts the optional parameters # @return [Array<(MarketingEventPublicReadResponse, Integer, Hash)>] MarketingEventPublicReadResponse data, response status code and response headers def get_by_id_with_http_info(external_event_id, external_account_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MarketingEventsExternalApi.get_by_id ...' end # verify the required parameter 'external_event_id' is set if @api_client.config.client_side_validation && external_event_id.nil? fail ArgumentError, "Missing the required parameter 'external_event_id' when calling MarketingEventsExternalApi.get_by_id" end # verify the required parameter 'external_account_id' is set if @api_client.config.client_side_validation && external_account_id.nil? fail ArgumentError, "Missing the required parameter 'external_account_id' when calling MarketingEventsExternalApi.get_by_id" end # resource path local_var_path = '/marketing/v3/marketing-events/events/{externalEventId}'.sub('{' + 'externalEventId' + '}', CGI.escape(external_event_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'externalAccountId'] = external_account_id # 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[:debug_body] # return_type return_type = opts[:debug_return_type] || 'MarketingEventPublicReadResponse' # auth_names auth_names = opts[:debug_auth_names] || ['oauth2'] new_options = opts.merge( :operation => :"MarketingEventsExternalApi.get_by_id", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: MarketingEventsExternalApi#get_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # @param external_event_id [String] # @param marketing_event_create_request_params [MarketingEventCreateRequestParams] # @param [Hash] opts the optional parameters # @return [MarketingEventPublicDefaultResponse] def replace(external_event_id, marketing_event_create_request_params, opts = {}) data, _status_code, _headers = replace_with_http_info(external_event_id, marketing_event_create_request_params, opts) data end # @param external_event_id [String] # @param marketing_event_create_request_params [MarketingEventCreateRequestParams] # @param [Hash] opts the optional parameters # @return [Array<(MarketingEventPublicDefaultResponse, Integer, Hash)>] MarketingEventPublicDefaultResponse data, response status code and response headers def replace_with_http_info(external_event_id, marketing_event_create_request_params, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MarketingEventsExternalApi.replace ...' end # verify the required parameter 'external_event_id' is set if @api_client.config.client_side_validation && external_event_id.nil? fail ArgumentError, "Missing the required parameter 'external_event_id' when calling MarketingEventsExternalApi.replace" end # verify the required parameter 'marketing_event_create_request_params' is set if @api_client.config.client_side_validation && marketing_event_create_request_params.nil? fail ArgumentError, "Missing the required parameter 'marketing_event_create_request_params' when calling MarketingEventsExternalApi.replace" end # resource path local_var_path = '/marketing/v3/marketing-events/events/{externalEventId}'.sub('{' + 'externalEventId' + '}', CGI.escape(external_event_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' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(marketing_event_create_request_params) # return_type return_type = opts[:debug_return_type] || 'MarketingEventPublicDefaultResponse' # auth_names auth_names = opts[:debug_auth_names] || ['oauth2'] new_options = opts.merge( :operation => :"MarketingEventsExternalApi.replace", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: MarketingEventsExternalApi#replace\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # @param external_event_id [String] # @param external_account_id [String] # @param marketing_event_update_request_params [MarketingEventUpdateRequestParams] # @param [Hash] opts the optional parameters # @return [MarketingEventPublicDefaultResponse] def update(external_event_id, external_account_id, marketing_event_update_request_params, opts = {}) data, _status_code, _headers = update_with_http_info(external_event_id, external_account_id, marketing_event_update_request_params, opts) data end # @param external_event_id [String] # @param external_account_id [String] # @param marketing_event_update_request_params [MarketingEventUpdateRequestParams] # @param [Hash] opts the optional parameters # @return [Array<(MarketingEventPublicDefaultResponse, Integer, Hash)>] MarketingEventPublicDefaultResponse data, response status code and response headers def update_with_http_info(external_event_id, external_account_id, marketing_event_update_request_params, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MarketingEventsExternalApi.update ...' end # verify the required parameter 'external_event_id' is set if @api_client.config.client_side_validation && external_event_id.nil? fail ArgumentError, "Missing the required parameter 'external_event_id' when calling MarketingEventsExternalApi.update" end # verify the required parameter 'external_account_id' is set if @api_client.config.client_side_validation && external_account_id.nil? fail ArgumentError, "Missing the required parameter 'external_account_id' when calling MarketingEventsExternalApi.update" end # verify the required parameter 'marketing_event_update_request_params' is set if @api_client.config.client_side_validation && marketing_event_update_request_params.nil? fail ArgumentError, "Missing the required parameter 'marketing_event_update_request_params' when calling MarketingEventsExternalApi.update" end # resource path local_var_path = '/marketing/v3/marketing-events/events/{externalEventId}'.sub('{' + 'externalEventId' + '}', CGI.escape(external_event_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'externalAccountId'] = external_account_id # 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' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(marketing_event_update_request_params) # return_type return_type = opts[:debug_return_type] || 'MarketingEventPublicDefaultResponse' # auth_names auth_names = opts[:debug_auth_names] || ['oauth2'] new_options = opts.merge( :operation => :"MarketingEventsExternalApi.update", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: MarketingEventsExternalApi#update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end end end