=begin
#Marketing Events

#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)

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 RetrieveParticipantStateApi
        attr_accessor :api_client

        def initialize(api_client = ApiClient.default)
          @api_client = api_client
        end
        # Read participations breakdown by Contact identifier
        # Read Contact's participations by identifier - email or internal id.
        # @param contact_identifier [String] The identifier of the Contact. It may be email or internal id.
        # @param [Hash] opts the optional parameters
        # @option opts [String] :state The participation state value. It may be REGISTERED, CANCELLED, ATTENDED, NO_SHOW
        # @option opts [Integer] :limit The limit for response size. The default value is 10, the max number is 100 (default to 10)
        # @option opts [String] :after The cursor indicating the position of the last retrieved item.
        # @return [CollectionResponseWithTotalParticipationBreakdownForwardPaging]
        def get_participations_breakdown_by_contact_id(contact_identifier, opts = {})
          data, _status_code, _headers = get_participations_breakdown_by_contact_id_with_http_info(contact_identifier, opts)
          data
        end

        # Read participations breakdown by Contact identifier
        # Read Contact&#39;s participations by identifier - email or internal id.
        # @param contact_identifier [String] The identifier of the Contact. It may be email or internal id.
        # @param [Hash] opts the optional parameters
        # @option opts [String] :state The participation state value. It may be REGISTERED, CANCELLED, ATTENDED, NO_SHOW
        # @option opts [Integer] :limit The limit for response size. The default value is 10, the max number is 100 (default to 10)
        # @option opts [String] :after The cursor indicating the position of the last retrieved item.
        # @return [Array<(CollectionResponseWithTotalParticipationBreakdownForwardPaging, Integer, Hash)>] CollectionResponseWithTotalParticipationBreakdownForwardPaging data, response status code and response headers
        def get_participations_breakdown_by_contact_id_with_http_info(contact_identifier, opts = {})
          if @api_client.config.debugging
            @api_client.config.logger.debug 'Calling API: RetrieveParticipantStateApi.get_participations_breakdown_by_contact_id ...'
          end
          # verify the required parameter 'contact_identifier' is set
          if @api_client.config.client_side_validation && contact_identifier.nil?
            fail ArgumentError, "Missing the required parameter 'contact_identifier' when calling RetrieveParticipantStateApi.get_participations_breakdown_by_contact_id"
          end
          # resource path
          local_var_path = '/marketing/v3/marketing-events/participations/contacts/{contactIdentifier}/breakdown'.sub('{' + 'contactIdentifier' + '}', CGI.escape(contact_identifier.to_s))

          # query parameters
          query_params = opts[:query_params] || {}
          query_params[:'state'] = opts[:'state'] if !opts[:'state'].nil?
          query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
          query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?

          # 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] || 'CollectionResponseWithTotalParticipationBreakdownForwardPaging'

          # auth_names
          auth_names = opts[:debug_auth_names] || ['oauth2']

          new_options = opts.merge(
            :operation => :"RetrieveParticipantStateApi.get_participations_breakdown_by_contact_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: RetrieveParticipantStateApi#get_participations_breakdown_by_contact_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
          end
          return data, status_code, headers
        end

        # Read participations breakdown by Marketing Event external identifier
        # Read Marketing event's participations breakdown with optional filters by externalAccountId and externalEventId pair.
        # @param external_account_id [String] The accountId that is associated with this marketing event in the external event application.
        # @param external_event_id [String] The id of the marketing event in the external event application.
        # @param [Hash] opts the optional parameters
        # @option opts [String] :contact_identifier The identifier of the Contact. It may be email or internal id.
        # @option opts [String] :state The participation state value. It may be REGISTERED, CANCELLED, ATTENDED, NO_SHOW
        # @option opts [Integer] :limit The limit for response size. The default value is 10, the max number is 100 (default to 10)
        # @option opts [String] :after The cursor indicating the position of the last retrieved item.
        # @return [CollectionResponseWithTotalParticipationBreakdownForwardPaging]
        def get_participations_breakdown_by_external_event_id(external_account_id, external_event_id, opts = {})
          data, _status_code, _headers = get_participations_breakdown_by_external_event_id_with_http_info(external_account_id, external_event_id, opts)
          data
        end

        # Read participations breakdown by Marketing Event external identifier
        # Read Marketing event&#39;s participations breakdown with optional filters by externalAccountId and externalEventId pair.
        # @param external_account_id [String] The accountId that is associated with this marketing event in the external event application.
        # @param external_event_id [String] The id of the marketing event in the external event application.
        # @param [Hash] opts the optional parameters
        # @option opts [String] :contact_identifier The identifier of the Contact. It may be email or internal id.
        # @option opts [String] :state The participation state value. It may be REGISTERED, CANCELLED, ATTENDED, NO_SHOW
        # @option opts [Integer] :limit The limit for response size. The default value is 10, the max number is 100 (default to 10)
        # @option opts [String] :after The cursor indicating the position of the last retrieved item.
        # @return [Array<(CollectionResponseWithTotalParticipationBreakdownForwardPaging, Integer, Hash)>] CollectionResponseWithTotalParticipationBreakdownForwardPaging data, response status code and response headers
        def get_participations_breakdown_by_external_event_id_with_http_info(external_account_id, external_event_id, opts = {})
          if @api_client.config.debugging
            @api_client.config.logger.debug 'Calling API: RetrieveParticipantStateApi.get_participations_breakdown_by_external_event_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 RetrieveParticipantStateApi.get_participations_breakdown_by_external_event_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 RetrieveParticipantStateApi.get_participations_breakdown_by_external_event_id"
          end
          # resource path
          local_var_path = '/marketing/v3/marketing-events/participations/{externalAccountId}/{externalEventId}/breakdown'.sub('{' + 'externalAccountId' + '}', CGI.escape(external_account_id.to_s)).sub('{' + 'externalEventId' + '}', CGI.escape(external_event_id.to_s))

          # query parameters
          query_params = opts[:query_params] || {}
          query_params[:'contactIdentifier'] = opts[:'contact_identifier'] if !opts[:'contact_identifier'].nil?
          query_params[:'state'] = opts[:'state'] if !opts[:'state'].nil?
          query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
          query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?

          # 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] || 'CollectionResponseWithTotalParticipationBreakdownForwardPaging'

          # auth_names
          auth_names = opts[:debug_auth_names] || ['oauth2']

          new_options = opts.merge(
            :operation => :"RetrieveParticipantStateApi.get_participations_breakdown_by_external_event_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: RetrieveParticipantStateApi#get_participations_breakdown_by_external_event_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
          end
          return data, status_code, headers
        end

        # Read participations breakdown by Marketing Event internal identifier
        # Read Marketing event's participations breakdown with optional filters by internal identifier marketingEventId.
        # @param marketing_event_id [Integer] The internal id of the marketing event in HubSpot.
        # @param [Hash] opts the optional parameters
        # @option opts [String] :contact_identifier The identifier of the Contact. It may be email or internal id.
        # @option opts [String] :state The participation state value. It may be REGISTERED, CANCELLED, ATTENDED, NO_SHOW
        # @option opts [Integer] :limit The limit for response size. The default value is 10, the max number is 100 (default to 10)
        # @option opts [String] :after The cursor indicating the position of the last retrieved item.
        # @return [CollectionResponseWithTotalParticipationBreakdownForwardPaging]
        def get_participations_breakdown_by_marketing_event_id(marketing_event_id, opts = {})
          data, _status_code, _headers = get_participations_breakdown_by_marketing_event_id_with_http_info(marketing_event_id, opts)
          data
        end

        # Read participations breakdown by Marketing Event internal identifier
        # Read Marketing event&#39;s participations breakdown with optional filters by internal identifier marketingEventId.
        # @param marketing_event_id [Integer] The internal id of the marketing event in HubSpot.
        # @param [Hash] opts the optional parameters
        # @option opts [String] :contact_identifier The identifier of the Contact. It may be email or internal id.
        # @option opts [String] :state The participation state value. It may be REGISTERED, CANCELLED, ATTENDED, NO_SHOW
        # @option opts [Integer] :limit The limit for response size. The default value is 10, the max number is 100 (default to 10)
        # @option opts [String] :after The cursor indicating the position of the last retrieved item.
        # @return [Array<(CollectionResponseWithTotalParticipationBreakdownForwardPaging, Integer, Hash)>] CollectionResponseWithTotalParticipationBreakdownForwardPaging data, response status code and response headers
        def get_participations_breakdown_by_marketing_event_id_with_http_info(marketing_event_id, opts = {})
          if @api_client.config.debugging
            @api_client.config.logger.debug 'Calling API: RetrieveParticipantStateApi.get_participations_breakdown_by_marketing_event_id ...'
          end
          # verify the required parameter 'marketing_event_id' is set
          if @api_client.config.client_side_validation && marketing_event_id.nil?
            fail ArgumentError, "Missing the required parameter 'marketing_event_id' when calling RetrieveParticipantStateApi.get_participations_breakdown_by_marketing_event_id"
          end
          # resource path
          local_var_path = '/marketing/v3/marketing-events/participations/{marketingEventId}/breakdown'.sub('{' + 'marketingEventId' + '}', CGI.escape(marketing_event_id.to_s))

          # query parameters
          query_params = opts[:query_params] || {}
          query_params[:'contactIdentifier'] = opts[:'contact_identifier'] if !opts[:'contact_identifier'].nil?
          query_params[:'state'] = opts[:'state'] if !opts[:'state'].nil?
          query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
          query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?

          # 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] || 'CollectionResponseWithTotalParticipationBreakdownForwardPaging'

          # auth_names
          auth_names = opts[:debug_auth_names] || ['oauth2']

          new_options = opts.merge(
            :operation => :"RetrieveParticipantStateApi.get_participations_breakdown_by_marketing_event_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: RetrieveParticipantStateApi#get_participations_breakdown_by_marketing_event_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
          end
          return data, status_code, headers
        end

        # Read participations counters by Marketing Event external identifier
        # Read Marketing event's participations counters by externalAccountId and externalEventId pair.
        # @param external_account_id [String] The accountId that is associated with this marketing event in the external event application.
        # @param external_event_id [String] The id of the marketing event in the external event application.
        # @param [Hash] opts the optional parameters
        # @return [AttendanceCounters]
        def get_participations_counters_by_event_external_id(external_account_id, external_event_id, opts = {})
          data, _status_code, _headers = get_participations_counters_by_event_external_id_with_http_info(external_account_id, external_event_id, opts)
          data
        end

        # Read participations counters by Marketing Event external identifier
        # Read Marketing event&#39;s participations counters by externalAccountId and externalEventId pair.
        # @param external_account_id [String] The accountId that is associated with this marketing event in the external event application.
        # @param external_event_id [String] The id of the marketing event in the external event application.
        # @param [Hash] opts the optional parameters
        # @return [Array<(AttendanceCounters, Integer, Hash)>] AttendanceCounters data, response status code and response headers
        def get_participations_counters_by_event_external_id_with_http_info(external_account_id, external_event_id, opts = {})
          if @api_client.config.debugging
            @api_client.config.logger.debug 'Calling API: RetrieveParticipantStateApi.get_participations_counters_by_event_external_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 RetrieveParticipantStateApi.get_participations_counters_by_event_external_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 RetrieveParticipantStateApi.get_participations_counters_by_event_external_id"
          end
          # resource path
          local_var_path = '/marketing/v3/marketing-events/participations/{externalAccountId}/{externalEventId}'.sub('{' + 'externalAccountId' + '}', CGI.escape(external_account_id.to_s)).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', '*/*'])

          # form parameters
          form_params = opts[:form_params] || {}

          # http body (model)
          post_body = opts[:debug_body]

          # return_type
          return_type = opts[:debug_return_type] || 'AttendanceCounters'

          # auth_names
          auth_names = opts[:debug_auth_names] || ['oauth2']

          new_options = opts.merge(
            :operation => :"RetrieveParticipantStateApi.get_participations_counters_by_event_external_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: RetrieveParticipantStateApi#get_participations_counters_by_event_external_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
          end
          return data, status_code, headers
        end

        # Read participations counters by Marketing Event internal identifier
        # Read Marketing event's participations counters by internal identifier marketingEventId.
        # @param marketing_event_id [Integer] The internal id of the marketing event in HubSpot.
        # @param [Hash] opts the optional parameters
        # @return [AttendanceCounters]
        def get_participations_counters_by_marketing_event_id(marketing_event_id, opts = {})
          data, _status_code, _headers = get_participations_counters_by_marketing_event_id_with_http_info(marketing_event_id, opts)
          data
        end

        # Read participations counters by Marketing Event internal identifier
        # Read Marketing event&#39;s participations counters by internal identifier marketingEventId.
        # @param marketing_event_id [Integer] The internal id of the marketing event in HubSpot.
        # @param [Hash] opts the optional parameters
        # @return [Array<(AttendanceCounters, Integer, Hash)>] AttendanceCounters data, response status code and response headers
        def get_participations_counters_by_marketing_event_id_with_http_info(marketing_event_id, opts = {})
          if @api_client.config.debugging
            @api_client.config.logger.debug 'Calling API: RetrieveParticipantStateApi.get_participations_counters_by_marketing_event_id ...'
          end
          # verify the required parameter 'marketing_event_id' is set
          if @api_client.config.client_side_validation && marketing_event_id.nil?
            fail ArgumentError, "Missing the required parameter 'marketing_event_id' when calling RetrieveParticipantStateApi.get_participations_counters_by_marketing_event_id"
          end
          # resource path
          local_var_path = '/marketing/v3/marketing-events/participations/{marketingEventId}'.sub('{' + 'marketingEventId' + '}', CGI.escape(marketing_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', '*/*'])

          # form parameters
          form_params = opts[:form_params] || {}

          # http body (model)
          post_body = opts[:debug_body]

          # return_type
          return_type = opts[:debug_return_type] || 'AttendanceCounters'

          # auth_names
          auth_names = opts[:debug_auth_names] || ['oauth2']

          new_options = opts.merge(
            :operation => :"RetrieveParticipantStateApi.get_participations_counters_by_marketing_event_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: RetrieveParticipantStateApi#get_participations_counters_by_marketing_event_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
          end
          return data, status_code, headers
        end
      end
    end
  end
end
