Class: Hubspot::Cms::Performance::DefaultApi

Inherits:
Object
  • Object
show all
Defined in:
lib/hubspot/codegen/cms/performance/api/default_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ DefaultApi

Returns a new instance of DefaultApi.



21
22
23
# File 'lib/hubspot/codegen/cms/performance/api/default_api.rb', line 21

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

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



19
20
21
# File 'lib/hubspot/codegen/cms/performance/api/default_api.rb', line 19

def api_client
  @api_client
end

Instance Method Details

#get_page(opts = {}) ⇒ PublicPerformanceResponse

View your website’s performance. Returns time series data website performance data for the given domain and/or path.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :domain (String)

    The domain to search return data for.

  • :path (String)

    The url path of the domain to return data for.

  • :pad (Boolean)

    Specifies whether the time series data should have empty intervals if performance data is not present to create a continuous set.

  • :sum (Boolean)

    Specifies whether the time series data should be summated for the given period. Defaults to false.

  • :period (String)

    A relative period to return time series data for. This value is ignored if start and/or end are provided. Valid periods: [15m, 30m, 1h, 4h, 12h, 1d, 1w]

  • :interval (String)

    The time series interval to group data by. Valid intervals: [1m, 5m, 15m, 30m, 1h, 4h, 12h, 1d, 1w]

  • :start (Integer)

    A timestamp in milliseconds that indicates the start of the time period.

  • :_end (Integer)

    A timestamp in milliseconds that indicates the end of the time period.

Returns:



36
37
38
39
# File 'lib/hubspot/codegen/cms/performance/api/default_api.rb', line 36

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

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

View your website&#39;s performance. Returns time series data website performance data for the given domain and/or path.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :domain (String)

    The domain to search return data for.

  • :path (String)

    The url path of the domain to return data for.

  • :pad (Boolean)

    Specifies whether the time series data should have empty intervals if performance data is not present to create a continuous set.

  • :sum (Boolean)

    Specifies whether the time series data should be summated for the given period. Defaults to false.

  • :period (String)

    A relative period to return time series data for. This value is ignored if start and/or end are provided. Valid periods: [15m, 30m, 1h, 4h, 12h, 1d, 1w]

  • :interval (String)

    The time series interval to group data by. Valid intervals: [1m, 5m, 15m, 30m, 1h, 4h, 12h, 1d, 1w]

  • :start (Integer)

    A timestamp in milliseconds that indicates the start of the time period.

  • :_end (Integer)

    A timestamp in milliseconds that indicates the end of the time period.

Returns:

  • (Array<(PublicPerformanceResponse, Integer, Hash)>)

    PublicPerformanceResponse data, response status code and response headers



53
54
55
56
57
58
59
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
# File 'lib/hubspot/codegen/cms/performance/api/default_api.rb', line 53

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

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'domain'] = opts[:'domain'] if !opts[:'domain'].nil?
  query_params[:'path'] = opts[:'path'] if !opts[:'path'].nil?
  query_params[:'pad'] = opts[:'pad'] if !opts[:'pad'].nil?
  query_params[:'sum'] = opts[:'sum'] if !opts[:'sum'].nil?
  query_params[:'period'] = opts[:'period'] if !opts[:'period'].nil?
  query_params[:'interval'] = opts[:'interval'] if !opts[:'interval'].nil?
  query_params[:'start'] = opts[:'start'] if !opts[:'start'].nil?
  query_params[:'end'] = opts[:'_end'] if !opts[:'_end'].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[:body] 

  # return_type
  return_type = opts[:return_type] || 'PublicPerformanceResponse' 

  # auth_names
  auth_names = opts[:auth_names] || ['hapikey']

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

#get_uptime(opts = {}) ⇒ PublicPerformanceResponse

View your website’s uptime. Returns uptime time series website performance data for the given domain.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :domain (String)

    The domain to search return data for.

  • :path (String)
  • :pad (Boolean)

    Specifies whether the time series data should have empty intervals if performance data is not present to create a continuous set.

  • :sum (Boolean)

    Specifies whether the time series data should be summated for the given period. Defaults to false.

  • :period (String)

    A relative period to return time series data for. This value is ignored if start and/or end are provided. Valid periods: [15m, 30m, 1h, 4h, 12h, 1d, 1w]

  • :interval (String)

    The time series interval to group data by. Valid intervals: [1m, 5m, 15m, 30m, 1h, 4h, 12h, 1d, 1w]

  • :start (Integer)

    A timestamp in milliseconds that indicates the start of the time period.

  • :_end (Integer)

    A timestamp in milliseconds that indicates the end of the time period.

Returns:



116
117
118
119
# File 'lib/hubspot/codegen/cms/performance/api/default_api.rb', line 116

def get_uptime(opts = {})
  data, _status_code, _headers = get_uptime_with_http_info(opts)
  data
end

#get_uptime_with_http_info(opts = {}) ⇒ Array<(PublicPerformanceResponse, Integer, Hash)>

View your website&#39;s uptime. Returns uptime time series website performance data for the given domain.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :domain (String)

    The domain to search return data for.

  • :path (String)
  • :pad (Boolean)

    Specifies whether the time series data should have empty intervals if performance data is not present to create a continuous set.

  • :sum (Boolean)

    Specifies whether the time series data should be summated for the given period. Defaults to false.

  • :period (String)

    A relative period to return time series data for. This value is ignored if start and/or end are provided. Valid periods: [15m, 30m, 1h, 4h, 12h, 1d, 1w]

  • :interval (String)

    The time series interval to group data by. Valid intervals: [1m, 5m, 15m, 30m, 1h, 4h, 12h, 1d, 1w]

  • :start (Integer)

    A timestamp in milliseconds that indicates the start of the time period.

  • :_end (Integer)

    A timestamp in milliseconds that indicates the end of the time period.

Returns:

  • (Array<(PublicPerformanceResponse, Integer, Hash)>)

    PublicPerformanceResponse data, response status code and response headers



133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
# File 'lib/hubspot/codegen/cms/performance/api/default_api.rb', line 133

def get_uptime_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.get_uptime ...'
  end
  # resource path
  local_var_path = '/cms/v3/performance/uptime'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'domain'] = opts[:'domain'] if !opts[:'domain'].nil?
  query_params[:'path'] = opts[:'path'] if !opts[:'path'].nil?
  query_params[:'pad'] = opts[:'pad'] if !opts[:'pad'].nil?
  query_params[:'sum'] = opts[:'sum'] if !opts[:'sum'].nil?
  query_params[:'period'] = opts[:'period'] if !opts[:'period'].nil?
  query_params[:'interval'] = opts[:'interval'] if !opts[:'interval'].nil?
  query_params[:'start'] = opts[:'start'] if !opts[:'start'].nil?
  query_params[:'end'] = opts[:'_end'] if !opts[:'_end'].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[:body] 

  # return_type
  return_type = opts[:return_type] || 'PublicPerformanceResponse' 

  # auth_names
  auth_names = opts[:auth_names] || ['hapikey']

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