Class: KlaviyoBeta::OnsiteApi
- Inherits:
-
Object
- Object
- KlaviyoBeta::OnsiteApi
- Defined in:
- lib/klaviyo_sdk_beta/api/onsite_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#create_onsite_event(company_id, event_create_query, opts = {}) ⇒ nil
Create Onsite Event Create Event object (replaces /track)
*Rate limits*:
Burst: `350/s`
Steady: `3500/m`. -
#create_onsite_event_with_http_info(company_id, event_create_query, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Create Onsite Event Create Event object (replaces /track)<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m`.
-
#create_onsite_profile(company_id, onsite_profile_create_query, opts = {}) ⇒ nil
Create Onsite Profile Create/Update Profiles objects (replaces /identify)
*Rate limits*:
Burst: `350/s`
Steady: `3500/m`. -
#create_onsite_profile_with_http_info(company_id, onsite_profile_create_query, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Create Onsite Profile Create/Update Profiles objects (replaces /identify)<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m`.
-
#create_onsite_subscription(company_id, onsite_subscription_create_query, opts = {}) ⇒ nil
Create Onsite Subscription Create a new subscription for the given list
*Rate limits*:
Burst: `100/s`
Steady: `100/m`. -
#create_onsite_subscription_with_http_info(company_id, onsite_subscription_create_query, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Create Onsite Subscription Create a new subscription for the given list<br><br>*Rate limits*:<br>Burst: `100/s`<br>Steady: `100/m`.
-
#initialize(api_client = ApiClient.default) ⇒ OnsiteApi
constructor
A new instance of OnsiteApi.
Constructor Details
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/klaviyo_sdk_beta/api/onsite_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#create_onsite_event(company_id, event_create_query, opts = {}) ⇒ nil
Create Onsite Event Create Event object (replaces /track)
*Rate limits*:
Burst: `350/s`
Steady: `3500/m`
28 29 30 31 |
# File 'lib/klaviyo_sdk_beta/api/onsite_api.rb', line 28 def create_onsite_event(company_id, event_create_query, opts = {}) create_onsite_event_with_http_info(company_id, event_create_query, opts) nil end |
#create_onsite_event_with_http_info(company_id, event_create_query, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Create Onsite Event Create Event object (replaces /track)<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m`
39 40 41 42 43 44 45 46 47 48 49 50 51 52 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 |
# File 'lib/klaviyo_sdk_beta/api/onsite_api.rb', line 39 def create_onsite_event_with_http_info(company_id, event_create_query, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: OnsiteApi.create_onsite_event ...' end # verify the required parameter 'company_id' is set if @api_client.config.client_side_validation && company_id.nil? fail ArgumentError, "Missing the required parameter 'company_id' when calling OnsiteApi.create_onsite_event" end # verify the required parameter 'event_create_query' is set if @api_client.config.client_side_validation && event_create_query.nil? fail ArgumentError, "Missing the required parameter 'event_create_query' when calling OnsiteApi.create_onsite_event" end # resource path local_var_path = '/onsite/v1/events/' # query parameters query_params = opts[:query_params] || {} query_params[:'company_id'] = company_id # header parameters header_params = opts[:header_params] || {} # klaviyo api revision header_params['revision'] = ENV['API_REVISION'] || "2023-05-25.pre" # 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(event_create_query) # return_type return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || [] = opts.merge( :operation => :"OnsiteApi.create_onsite_event", :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: OnsiteApi#create_onsite_event\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#create_onsite_profile(company_id, onsite_profile_create_query, opts = {}) ⇒ nil
Create Onsite Profile Create/Update Profiles objects (replaces /identify)
*Rate limits*:
Burst: `350/s`
Steady: `3500/m`
105 106 107 108 |
# File 'lib/klaviyo_sdk_beta/api/onsite_api.rb', line 105 def create_onsite_profile(company_id, onsite_profile_create_query, opts = {}) create_onsite_profile_with_http_info(company_id, onsite_profile_create_query, opts) nil end |
#create_onsite_profile_with_http_info(company_id, onsite_profile_create_query, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Create Onsite Profile Create/Update Profiles objects (replaces /identify)<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m`
116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 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 |
# File 'lib/klaviyo_sdk_beta/api/onsite_api.rb', line 116 def create_onsite_profile_with_http_info(company_id, onsite_profile_create_query, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: OnsiteApi.create_onsite_profile ...' end # verify the required parameter 'company_id' is set if @api_client.config.client_side_validation && company_id.nil? fail ArgumentError, "Missing the required parameter 'company_id' when calling OnsiteApi.create_onsite_profile" end # verify the required parameter 'onsite_profile_create_query' is set if @api_client.config.client_side_validation && onsite_profile_create_query.nil? fail ArgumentError, "Missing the required parameter 'onsite_profile_create_query' when calling OnsiteApi.create_onsite_profile" end # resource path local_var_path = '/onsite/v1/profiles/' # query parameters query_params = opts[:query_params] || {} query_params[:'company_id'] = company_id # header parameters header_params = opts[:header_params] || {} # klaviyo api revision header_params['revision'] = ENV['API_REVISION'] || "2023-05-25.pre" # 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(onsite_profile_create_query) # return_type return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || [] = opts.merge( :operation => :"OnsiteApi.create_onsite_profile", :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: OnsiteApi#create_onsite_profile\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#create_onsite_subscription(company_id, onsite_subscription_create_query, opts = {}) ⇒ nil
Create Onsite Subscription Create a new subscription for the given list
*Rate limits*:
Burst: `100/s`
Steady: `100/m`
182 183 184 185 |
# File 'lib/klaviyo_sdk_beta/api/onsite_api.rb', line 182 def create_onsite_subscription(company_id, onsite_subscription_create_query, opts = {}) create_onsite_subscription_with_http_info(company_id, onsite_subscription_create_query, opts) nil end |
#create_onsite_subscription_with_http_info(company_id, onsite_subscription_create_query, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Create Onsite Subscription Create a new subscription for the given list<br><br>*Rate limits*:<br>Burst: `100/s`<br>Steady: `100/m`
193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 |
# File 'lib/klaviyo_sdk_beta/api/onsite_api.rb', line 193 def create_onsite_subscription_with_http_info(company_id, onsite_subscription_create_query, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: OnsiteApi.create_onsite_subscription ...' end # verify the required parameter 'company_id' is set if @api_client.config.client_side_validation && company_id.nil? fail ArgumentError, "Missing the required parameter 'company_id' when calling OnsiteApi.create_onsite_subscription" end # verify the required parameter 'onsite_subscription_create_query' is set if @api_client.config.client_side_validation && onsite_subscription_create_query.nil? fail ArgumentError, "Missing the required parameter 'onsite_subscription_create_query' when calling OnsiteApi.create_onsite_subscription" end # resource path local_var_path = '/onsite/v1/subscriptions/' # query parameters query_params = opts[:query_params] || {} query_params[:'company_id'] = company_id # header parameters header_params = opts[:header_params] || {} # klaviyo api revision header_params['revision'] = ENV['API_REVISION'] || "2023-05-25.pre" # 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(onsite_subscription_create_query) # return_type return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || [] = opts.merge( :operation => :"OnsiteApi.create_onsite_subscription", :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: OnsiteApi#create_onsite_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |