Class: Hubspot::Events::EventsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/hubspot/codegen/events/api/events_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ EventsApi

Returns a new instance of EventsApi.



20
21
22
# File 'lib/hubspot/codegen/events/api/events_api.rb', line 20

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



18
19
20
# File 'lib/hubspot/codegen/events/api/events_api.rb', line 18

def api_client
  @api_client
end

Instance Method Details

#get_page(opts = {}) ⇒ CollectionResponseExternalUnifiedEvent

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :object_type (String)
  • :event_type (String)
  • :occurred_after (Time)
  • :occurred_before (Time)
  • :object_id (Integer)
  • :index_table_name (String)
  • :index_specific_metadata (String)
  • :after (String)

    The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results.

  • :before (String)
  • :limit (Integer)

    The maximum number of results to display per page.

  • :sort (Array<String>)
  • :object_property_propname (Object)
  • :property_propname (Object)
  • :id (Array<String>)

Returns:



39
40
41
42
# File 'lib/hubspot/codegen/events/api/events_api.rb', line 39

def get_page(opts = {})
  data, _status_code, _headers = get_page_with_http_info(opts)
  data
end

#get_page_with_http_info(opts = {}) ⇒ Array<(CollectionResponseExternalUnifiedEvent, Integer, Hash)>

Returns CollectionResponseExternalUnifiedEvent data, response status code and response headers.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :object_type (String)
  • :event_type (String)
  • :occurred_after (Time)
  • :occurred_before (Time)
  • :object_id (Integer)
  • :index_table_name (String)
  • :index_specific_metadata (String)
  • :after (String)

    The paging cursor token of the last successfully read resource will be returned as the &#x60;paging.next.after&#x60; JSON property of a paged response containing more results.

  • :before (String)
  • :limit (Integer)

    The maximum number of results to display per page.

  • :sort (Array<String>)
  • :object_property_propname (Object)
  • :property_propname (Object)
  • :id (Array<String>)

Returns:



60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# File 'lib/hubspot/codegen/events/api/events_api.rb', line 60

def get_page_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EventsApi.get_page ...'
  end
  # resource path
  local_var_path = '/events/v3/events/'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'objectType'] = opts[:'object_type'] if !opts[:'object_type'].nil?
  query_params[:'eventType'] = opts[:'event_type'] if !opts[:'event_type'].nil?
  query_params[:'occurredAfter'] = opts[:'occurred_after'] if !opts[:'occurred_after'].nil?
  query_params[:'occurredBefore'] = opts[:'occurred_before'] if !opts[:'occurred_before'].nil?
  query_params[:'objectId'] = opts[:'object_id'] if !opts[:'object_id'].nil?
  query_params[:'indexTableName'] = opts[:'index_table_name'] if !opts[:'index_table_name'].nil?
  query_params[:'indexSpecificMetadata'] = opts[:'index_specific_metadata'] if !opts[:'index_specific_metadata'].nil?
  query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
  query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'sort'] = @api_client.build_collection_param(opts[:'sort'], :multi) if !opts[:'sort'].nil?
  query_params[:'objectProperty.{propname}'] = opts[:'object_property_propname'] if !opts[:'object_property_propname'].nil?
  query_params[:'property.{propname}'] = opts[:'property_propname'] if !opts[:'property_propname'].nil?
  query_params[:'id'] = @api_client.build_collection_param(opts[:'id'], :multi) if !opts[:'id'].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] || 'CollectionResponseExternalUnifiedEvent'

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

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