klaviyo-api-sdk 10.0.0 → 11.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -0
- data/README.md +382 -136
- data/klaviyo-api-sdk.gemspec +1 -1
- data/lib/klaviyo-api-sdk/api/accounts_api.rb +2 -2
- data/lib/klaviyo-api-sdk/api/campaigns_api.rb +41 -23
- data/lib/klaviyo-api-sdk/api/catalogs_api.rb +82 -76
- data/lib/klaviyo-api-sdk/api/coupons_api.rb +111 -93
- data/lib/klaviyo-api-sdk/api/data_privacy_api.rb +1 -1
- data/lib/klaviyo-api-sdk/api/events_api.rb +128 -116
- data/lib/klaviyo-api-sdk/api/flows_api.rb +199 -169
- data/lib/klaviyo-api-sdk/api/forms_api.rb +19 -7
- data/lib/klaviyo-api-sdk/api/images_api.rb +5 -5
- data/lib/klaviyo-api-sdk/api/lists_api.rb +391 -337
- data/lib/klaviyo-api-sdk/api/metrics_api.rb +151 -115
- data/lib/klaviyo-api-sdk/api/profiles_api.rb +170 -119
- data/lib/klaviyo-api-sdk/api/reporting_api.rb +49 -7
- data/lib/klaviyo-api-sdk/api/reviews_api.rb +2 -2
- data/lib/klaviyo-api-sdk/api/segments_api.rb +170 -146
- data/lib/klaviyo-api-sdk/api/tags_api.rb +108 -42
- data/lib/klaviyo-api-sdk/api/templates_api.rb +12 -12
- data/lib/klaviyo-api-sdk/api/tracking_settings_api.rb +3 -3
- data/lib/klaviyo-api-sdk/api/webhooks_api.rb +7 -7
- data/lib/klaviyo-api-sdk/api_client.rb +1 -1
- data/lib/klaviyo-api-sdk/configuration.rb +18 -9
- data/lib/klaviyo-api-sdk/models/campaign_send_job_partial_update_query_resource_object_attributes.rb +34 -0
- data/lib/klaviyo-api-sdk/models/device_metadata.rb +2 -2
- data/lib/klaviyo-api-sdk/models/email_unsubscription_parameters.rb +224 -0
- data/lib/klaviyo-api-sdk/models/html_block_data.rb +4 -14
- data/lib/klaviyo-api-sdk/models/profile_subscription_delete_query_resource_object_attributes.rb +14 -5
- data/lib/klaviyo-api-sdk/models/sms_subscription_parameters.rb +13 -4
- data/lib/klaviyo-api-sdk/models/sms_unsubscription_parameters.rb +228 -0
- data/lib/klaviyo-api-sdk/models/template_create_query_resource_object_attributes.rb +1 -1
- data/lib/klaviyo-api-sdk/models/unsubscription_channels.rb +228 -0
- data/lib/klaviyo-api-sdk/models/unsubscription_parameters.rb +259 -0
- data/lib/klaviyo-api-sdk.rb +36 -19
- metadata +6 -2
@@ -76,7 +76,7 @@ module KlaviyoAPI
|
|
76
76
|
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
77
77
|
|
78
78
|
# auth_names
|
79
|
-
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
|
79
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
|
80
80
|
|
81
81
|
new_options = opts.merge(
|
82
82
|
:operation => :"CouponsApi.bulk_create_coupon_codes",
|
@@ -152,7 +152,7 @@ module KlaviyoAPI
|
|
152
152
|
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
153
153
|
|
154
154
|
# auth_names
|
155
|
-
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
|
155
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
|
156
156
|
|
157
157
|
new_options = opts.merge(
|
158
158
|
:operation => :"CouponsApi.create_coupon",
|
@@ -222,7 +222,7 @@ module KlaviyoAPI
|
|
222
222
|
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
223
223
|
|
224
224
|
# auth_names
|
225
|
-
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
|
225
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
|
226
226
|
|
227
227
|
new_options = opts.merge(
|
228
228
|
:operation => :"CouponsApi.create_coupon_code",
|
@@ -287,7 +287,7 @@ module KlaviyoAPI
|
|
287
287
|
return_type = opts[:debug_return_type]
|
288
288
|
|
289
289
|
# auth_names
|
290
|
-
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
|
290
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
|
291
291
|
|
292
292
|
new_options = opts.merge(
|
293
293
|
:operation => :"CouponsApi.delete_coupon",
|
@@ -352,7 +352,7 @@ module KlaviyoAPI
|
|
352
352
|
return_type = opts[:debug_return_type]
|
353
353
|
|
354
354
|
# auth_names
|
355
|
-
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
|
355
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
|
356
356
|
|
357
357
|
new_options = opts.merge(
|
358
358
|
:operation => :"CouponsApi.delete_coupon_code",
|
@@ -427,7 +427,7 @@ module KlaviyoAPI
|
|
427
427
|
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
428
428
|
|
429
429
|
# auth_names
|
430
|
-
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
|
430
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
|
431
431
|
|
432
432
|
new_options = opts.merge(
|
433
433
|
:operation => :"CouponsApi.get_bulk_create_coupon_code_jobs",
|
@@ -519,7 +519,7 @@ module KlaviyoAPI
|
|
519
519
|
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
520
520
|
|
521
521
|
# auth_names
|
522
|
-
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
|
522
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
|
523
523
|
|
524
524
|
new_options = opts.merge(
|
525
525
|
:operation => :"CouponsApi.get_bulk_create_coupon_codes_job",
|
@@ -541,40 +541,41 @@ module KlaviyoAPI
|
|
541
541
|
# alias of `get_bulk_create_coupon_codes_job_with_http_info`
|
542
542
|
alias get_coupon_code_bulk_create_job_with_http_info get_bulk_create_coupon_codes_job_with_http_info
|
543
543
|
|
544
|
-
# Get
|
545
|
-
#
|
546
|
-
# @param id [String] The
|
544
|
+
# Get Coupon
|
545
|
+
# Get a specific coupon with the given coupon ID.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `coupons:read`
|
546
|
+
# @param id [String] The internal id of a Coupon is equivalent to its external id stored within an integration.
|
547
547
|
# @param [Hash] opts the optional parameters
|
548
|
-
# @option opts [String] :
|
548
|
+
# @option opts [Array<String>] :fields_coupon For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets
|
549
549
|
# @return [Hash<String, Object>]
|
550
|
-
def
|
551
|
-
data, _status_code, _headers =
|
550
|
+
def get_coupon(id, opts = {})
|
551
|
+
data, _status_code, _headers = get_coupon_with_http_info(id, opts)
|
552
552
|
data
|
553
553
|
end
|
554
554
|
|
555
|
-
#
|
556
|
-
|
557
|
-
|
558
|
-
# Get Code IDs for Coupon
|
559
|
-
# Gets a list of coupon code relationships associated with the given coupon id<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `coupon-codes:read`
|
560
|
-
# @param id [String] The ID of the coupon to look up the relationship of.
|
555
|
+
# Get Coupon
|
556
|
+
# Get a specific coupon with the given coupon ID.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `coupons:read`
|
557
|
+
# @param id [String] The internal id of a Coupon is equivalent to its external id stored within an integration.
|
561
558
|
# @param [Hash] opts the optional parameters
|
562
|
-
# @option opts [String] :
|
559
|
+
# @option opts [Array<String>] :fields_coupon For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets
|
563
560
|
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
564
|
-
def
|
561
|
+
def get_coupon_with_http_info(id, opts = {})
|
565
562
|
if @api_client.config.debugging
|
566
|
-
@api_client.config.logger.debug 'Calling API: CouponsApi.
|
563
|
+
@api_client.config.logger.debug 'Calling API: CouponsApi.get_coupon ...'
|
567
564
|
end
|
568
565
|
# verify the required parameter 'id' is set
|
569
566
|
if @api_client.config.client_side_validation && id.nil?
|
570
|
-
fail ArgumentError, "Missing the required parameter 'id' when calling CouponsApi.
|
567
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling CouponsApi.get_coupon"
|
568
|
+
end
|
569
|
+
allowable_values = ["external_id", "description"]
|
570
|
+
if @api_client.config.client_side_validation && opts[:'fields_coupon'] && !opts[:'fields_coupon'].all? { |item| allowable_values.include?(item) }
|
571
|
+
fail ArgumentError, "invalid value for \"fields_coupon\", must include one of #{allowable_values}"
|
571
572
|
end
|
572
573
|
# resource path
|
573
|
-
local_var_path = '/api/coupons/{id}
|
574
|
+
local_var_path = '/api/coupons/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
574
575
|
|
575
576
|
# query parameters
|
576
577
|
query_params = opts[:query_params] || {}
|
577
|
-
query_params[:'
|
578
|
+
query_params[:'fields[coupon]'] = @api_client.build_collection_param(opts[:'fields_coupon'], :csv) if !opts[:'fields_coupon'].nil?
|
578
579
|
|
579
580
|
# header parameters
|
580
581
|
header_params = opts[:header_params] || {}
|
@@ -593,10 +594,10 @@ module KlaviyoAPI
|
|
593
594
|
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
594
595
|
|
595
596
|
# auth_names
|
596
|
-
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
|
597
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
|
597
598
|
|
598
599
|
new_options = opts.merge(
|
599
|
-
:operation => :"CouponsApi.
|
600
|
+
:operation => :"CouponsApi.get_coupon",
|
600
601
|
:header_params => header_params,
|
601
602
|
:query_params => query_params,
|
602
603
|
:form_params => form_params,
|
@@ -607,49 +608,60 @@ module KlaviyoAPI
|
|
607
608
|
|
608
609
|
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
609
610
|
if @api_client.config.debugging
|
610
|
-
@api_client.config.logger.debug "API called: CouponsApi#
|
611
|
+
@api_client.config.logger.debug "API called: CouponsApi#get_coupon\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
611
612
|
end
|
612
613
|
return data, status_code, headers
|
613
614
|
end
|
614
615
|
|
615
|
-
#
|
616
|
-
|
617
|
-
|
618
|
-
# Get Coupon
|
619
|
-
# Get a specific coupon with the given coupon ID.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `coupons:read`
|
620
|
-
# @param id [String] The internal id of a Coupon is equivalent to its external id stored within an integration.
|
616
|
+
# Get Coupon Code
|
617
|
+
# Returns a Coupon Code specified by the given identifier.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `coupon-codes:read`
|
618
|
+
# @param id [String] The id of a coupon code is a combination of its unique code and the id of the coupon it is associated with.
|
621
619
|
# @param [Hash] opts the optional parameters
|
620
|
+
# @option opts [Array<String>] :fields_coupon_code For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets
|
622
621
|
# @option opts [Array<String>] :fields_coupon For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets
|
622
|
+
# @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships
|
623
623
|
# @return [Hash<String, Object>]
|
624
|
-
def
|
625
|
-
data, _status_code, _headers =
|
624
|
+
def get_coupon_code(id, opts = {})
|
625
|
+
data, _status_code, _headers = get_coupon_code_with_http_info(id, opts)
|
626
626
|
data
|
627
627
|
end
|
628
628
|
|
629
|
-
# Get Coupon
|
630
|
-
#
|
631
|
-
# @param id [String] The
|
629
|
+
# Get Coupon Code
|
630
|
+
# Returns a Coupon Code specified by the given identifier.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `coupon-codes:read`
|
631
|
+
# @param id [String] The id of a coupon code is a combination of its unique code and the id of the coupon it is associated with.
|
632
632
|
# @param [Hash] opts the optional parameters
|
633
|
+
# @option opts [Array<String>] :fields_coupon_code For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets
|
633
634
|
# @option opts [Array<String>] :fields_coupon For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets
|
635
|
+
# @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships
|
634
636
|
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
635
|
-
def
|
637
|
+
def get_coupon_code_with_http_info(id, opts = {})
|
636
638
|
if @api_client.config.debugging
|
637
|
-
@api_client.config.logger.debug 'Calling API: CouponsApi.
|
639
|
+
@api_client.config.logger.debug 'Calling API: CouponsApi.get_coupon_code ...'
|
638
640
|
end
|
639
641
|
# verify the required parameter 'id' is set
|
640
642
|
if @api_client.config.client_side_validation && id.nil?
|
641
|
-
fail ArgumentError, "Missing the required parameter 'id' when calling CouponsApi.
|
643
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling CouponsApi.get_coupon_code"
|
644
|
+
end
|
645
|
+
allowable_values = ["unique_code", "expires_at", "status"]
|
646
|
+
if @api_client.config.client_side_validation && opts[:'fields_coupon_code'] && !opts[:'fields_coupon_code'].all? { |item| allowable_values.include?(item) }
|
647
|
+
fail ArgumentError, "invalid value for \"fields_coupon_code\", must include one of #{allowable_values}"
|
642
648
|
end
|
643
649
|
allowable_values = ["external_id", "description"]
|
644
650
|
if @api_client.config.client_side_validation && opts[:'fields_coupon'] && !opts[:'fields_coupon'].all? { |item| allowable_values.include?(item) }
|
645
651
|
fail ArgumentError, "invalid value for \"fields_coupon\", must include one of #{allowable_values}"
|
646
652
|
end
|
653
|
+
allowable_values = ["coupon"]
|
654
|
+
if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) }
|
655
|
+
fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}"
|
656
|
+
end
|
647
657
|
# resource path
|
648
|
-
local_var_path = '/api/
|
658
|
+
local_var_path = '/api/coupon-codes/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
649
659
|
|
650
660
|
# query parameters
|
651
661
|
query_params = opts[:query_params] || {}
|
662
|
+
query_params[:'fields[coupon-code]'] = @api_client.build_collection_param(opts[:'fields_coupon_code'], :csv) if !opts[:'fields_coupon_code'].nil?
|
652
663
|
query_params[:'fields[coupon]'] = @api_client.build_collection_param(opts[:'fields_coupon'], :csv) if !opts[:'fields_coupon'].nil?
|
664
|
+
query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil?
|
653
665
|
|
654
666
|
# header parameters
|
655
667
|
header_params = opts[:header_params] || {}
|
@@ -668,10 +680,10 @@ module KlaviyoAPI
|
|
668
680
|
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
669
681
|
|
670
682
|
# auth_names
|
671
|
-
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
|
683
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
|
672
684
|
|
673
685
|
new_options = opts.merge(
|
674
|
-
:operation => :"CouponsApi.
|
686
|
+
:operation => :"CouponsApi.get_coupon_code",
|
675
687
|
:header_params => header_params,
|
676
688
|
:query_params => query_params,
|
677
689
|
:form_params => form_params,
|
@@ -682,60 +694,51 @@ module KlaviyoAPI
|
|
682
694
|
|
683
695
|
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
684
696
|
if @api_client.config.debugging
|
685
|
-
@api_client.config.logger.debug "API called: CouponsApi#
|
697
|
+
@api_client.config.logger.debug "API called: CouponsApi#get_coupon_code\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
686
698
|
end
|
687
699
|
return data, status_code, headers
|
688
700
|
end
|
689
701
|
|
690
|
-
# Get Coupon Code
|
691
|
-
#
|
692
|
-
# @param id [String] The
|
702
|
+
# Get Coupon Code IDs for Coupon
|
703
|
+
# Gets a list of coupon code relationships associated with the given coupon id<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `coupon-codes:read`
|
704
|
+
# @param id [String] The ID of the coupon to look up the relationship of.
|
693
705
|
# @param [Hash] opts the optional parameters
|
694
|
-
# @option opts [
|
695
|
-
# @option opts [Array<String>] :fields_coupon For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets
|
696
|
-
# @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships
|
706
|
+
# @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination
|
697
707
|
# @return [Hash<String, Object>]
|
698
|
-
def
|
699
|
-
data, _status_code, _headers =
|
708
|
+
def get_coupon_code_ids_for_coupon(id, opts = {})
|
709
|
+
data, _status_code, _headers = get_coupon_code_ids_for_coupon_with_http_info(id, opts)
|
700
710
|
data
|
701
711
|
end
|
702
712
|
|
703
|
-
#
|
704
|
-
|
705
|
-
|
713
|
+
# alias of `get_coupon_code_ids_for_coupon`
|
714
|
+
alias get_coupon_code_relationships_coupon get_coupon_code_ids_for_coupon
|
715
|
+
|
716
|
+
# alias of `get_coupon_code_ids_for_coupon`
|
717
|
+
alias get_code_ids_for_coupon get_coupon_code_ids_for_coupon
|
718
|
+
|
719
|
+
# alias of `get_coupon_code_ids_for_coupon`
|
720
|
+
alias get_coupon_relationships_codes get_coupon_code_ids_for_coupon
|
721
|
+
|
722
|
+
# Get Coupon Code IDs for Coupon
|
723
|
+
# Gets a list of coupon code relationships associated with the given coupon id<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `coupon-codes:read`
|
724
|
+
# @param id [String] The ID of the coupon to look up the relationship of.
|
706
725
|
# @param [Hash] opts the optional parameters
|
707
|
-
# @option opts [
|
708
|
-
# @option opts [Array<String>] :fields_coupon For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets
|
709
|
-
# @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships
|
726
|
+
# @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination
|
710
727
|
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
711
|
-
def
|
728
|
+
def get_coupon_code_ids_for_coupon_with_http_info(id, opts = {})
|
712
729
|
if @api_client.config.debugging
|
713
|
-
@api_client.config.logger.debug 'Calling API: CouponsApi.
|
730
|
+
@api_client.config.logger.debug 'Calling API: CouponsApi.get_coupon_code_ids_for_coupon ...'
|
714
731
|
end
|
715
732
|
# verify the required parameter 'id' is set
|
716
733
|
if @api_client.config.client_side_validation && id.nil?
|
717
|
-
fail ArgumentError, "Missing the required parameter 'id' when calling CouponsApi.
|
718
|
-
end
|
719
|
-
allowable_values = ["unique_code", "expires_at", "status"]
|
720
|
-
if @api_client.config.client_side_validation && opts[:'fields_coupon_code'] && !opts[:'fields_coupon_code'].all? { |item| allowable_values.include?(item) }
|
721
|
-
fail ArgumentError, "invalid value for \"fields_coupon_code\", must include one of #{allowable_values}"
|
722
|
-
end
|
723
|
-
allowable_values = ["external_id", "description"]
|
724
|
-
if @api_client.config.client_side_validation && opts[:'fields_coupon'] && !opts[:'fields_coupon'].all? { |item| allowable_values.include?(item) }
|
725
|
-
fail ArgumentError, "invalid value for \"fields_coupon\", must include one of #{allowable_values}"
|
726
|
-
end
|
727
|
-
allowable_values = ["coupon"]
|
728
|
-
if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) }
|
729
|
-
fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}"
|
734
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling CouponsApi.get_coupon_code_ids_for_coupon"
|
730
735
|
end
|
731
736
|
# resource path
|
732
|
-
local_var_path = '/api/
|
737
|
+
local_var_path = '/api/coupons/{id}/relationships/coupon-codes'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
733
738
|
|
734
739
|
# query parameters
|
735
740
|
query_params = opts[:query_params] || {}
|
736
|
-
query_params[:'
|
737
|
-
query_params[:'fields[coupon]'] = @api_client.build_collection_param(opts[:'fields_coupon'], :csv) if !opts[:'fields_coupon'].nil?
|
738
|
-
query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil?
|
741
|
+
query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil?
|
739
742
|
|
740
743
|
# header parameters
|
741
744
|
header_params = opts[:header_params] || {}
|
@@ -754,10 +757,10 @@ module KlaviyoAPI
|
|
754
757
|
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
755
758
|
|
756
759
|
# auth_names
|
757
|
-
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
|
760
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
|
758
761
|
|
759
762
|
new_options = opts.merge(
|
760
|
-
:operation => :"CouponsApi.
|
763
|
+
:operation => :"CouponsApi.get_coupon_code_ids_for_coupon",
|
761
764
|
:header_params => header_params,
|
762
765
|
:query_params => query_params,
|
763
766
|
:form_params => form_params,
|
@@ -768,11 +771,20 @@ module KlaviyoAPI
|
|
768
771
|
|
769
772
|
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
770
773
|
if @api_client.config.debugging
|
771
|
-
@api_client.config.logger.debug "API called: CouponsApi#
|
774
|
+
@api_client.config.logger.debug "API called: CouponsApi#get_coupon_code_ids_for_coupon\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
772
775
|
end
|
773
776
|
return data, status_code, headers
|
774
777
|
end
|
775
778
|
|
779
|
+
# alias of `get_coupon_code_ids_for_coupon_with_http_info`
|
780
|
+
alias get_coupon_code_relationships_coupon_with_http_info get_coupon_code_ids_for_coupon_with_http_info
|
781
|
+
|
782
|
+
# alias of `get_coupon_code_ids_for_coupon_with_http_info`
|
783
|
+
alias get_code_ids_for_coupon_with_http_info get_coupon_code_ids_for_coupon_with_http_info
|
784
|
+
|
785
|
+
# alias of `get_coupon_code_ids_for_coupon_with_http_info`
|
786
|
+
alias get_coupon_relationships_codes_with_http_info get_coupon_code_ids_for_coupon_with_http_info
|
787
|
+
|
776
788
|
# Get Coupon Codes
|
777
789
|
# Gets a list of coupon codes associated with a coupon/coupons or a profile/profiles. A coupon/coupons or a profile/profiles must be provided as required filter params.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `coupon-codes:read`
|
778
790
|
# @param [Hash] opts the optional parameters
|
@@ -840,7 +852,7 @@ module KlaviyoAPI
|
|
840
852
|
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
841
853
|
|
842
854
|
# auth_names
|
843
|
-
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
|
855
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
|
844
856
|
|
845
857
|
new_options = opts.merge(
|
846
858
|
:operation => :"CouponsApi.get_coupon_codes",
|
@@ -859,7 +871,7 @@ module KlaviyoAPI
|
|
859
871
|
return data, status_code, headers
|
860
872
|
end
|
861
873
|
|
862
|
-
# Get Coupon Codes
|
874
|
+
# Get Coupon Codes for Coupon
|
863
875
|
# Gets a list of coupon codes associated with the given coupon id<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `coupon-codes:read`
|
864
876
|
# @param id [String]
|
865
877
|
# @param [Hash] opts the optional parameters
|
@@ -875,7 +887,10 @@ module KlaviyoAPI
|
|
875
887
|
# alias of `get_coupon_codes_for_coupon`
|
876
888
|
alias get_coupon_coupon_codes get_coupon_codes_for_coupon
|
877
889
|
|
878
|
-
#
|
890
|
+
# alias of `get_coupon_codes_for_coupon`
|
891
|
+
alias get_codes_for_coupon get_coupon_codes_for_coupon
|
892
|
+
|
893
|
+
# Get Coupon Codes for Coupon
|
879
894
|
# Gets a list of coupon codes associated with the given coupon id<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `coupon-codes:read`
|
880
895
|
# @param id [String]
|
881
896
|
# @param [Hash] opts the optional parameters
|
@@ -921,7 +936,7 @@ module KlaviyoAPI
|
|
921
936
|
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
922
937
|
|
923
938
|
# auth_names
|
924
|
-
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
|
939
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
|
925
940
|
|
926
941
|
new_options = opts.merge(
|
927
942
|
:operation => :"CouponsApi.get_coupon_codes_for_coupon",
|
@@ -943,6 +958,9 @@ module KlaviyoAPI
|
|
943
958
|
# alias of `get_coupon_codes_for_coupon_with_http_info`
|
944
959
|
alias get_coupon_coupon_codes_with_http_info get_coupon_codes_for_coupon_with_http_info
|
945
960
|
|
961
|
+
# alias of `get_coupon_codes_for_coupon_with_http_info`
|
962
|
+
alias get_codes_for_coupon_with_http_info get_coupon_codes_for_coupon_with_http_info
|
963
|
+
|
946
964
|
# Get Coupon For Coupon Code
|
947
965
|
# Get the coupon associated with a given coupon code ID.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `coupons:read`
|
948
966
|
# @param id [String] The ID of the coupon to look up the relationship of.
|
@@ -999,7 +1017,7 @@ module KlaviyoAPI
|
|
999
1017
|
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
1000
1018
|
|
1001
1019
|
# auth_names
|
1002
|
-
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
|
1020
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
|
1003
1021
|
|
1004
1022
|
new_options = opts.merge(
|
1005
1023
|
:operation => :"CouponsApi.get_coupon_for_coupon_code",
|
@@ -1023,7 +1041,7 @@ module KlaviyoAPI
|
|
1023
1041
|
|
1024
1042
|
# Get Coupon ID for Coupon Code
|
1025
1043
|
# Gets the coupon relationship associated with the given coupon code id<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `coupons:read`
|
1026
|
-
# @param id [String] The ID of the coupon
|
1044
|
+
# @param id [String] The ID of the coupon to look up the relationship of.
|
1027
1045
|
# @param [Hash] opts the optional parameters
|
1028
1046
|
# @return [Hash<String, Object>]
|
1029
1047
|
def get_coupon_id_for_coupon_code(id, opts = {})
|
@@ -1036,7 +1054,7 @@ module KlaviyoAPI
|
|
1036
1054
|
|
1037
1055
|
# Get Coupon ID for Coupon Code
|
1038
1056
|
# Gets the coupon relationship associated with the given coupon code id<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `coupons:read`
|
1039
|
-
# @param id [String] The ID of the coupon
|
1057
|
+
# @param id [String] The ID of the coupon to look up the relationship of.
|
1040
1058
|
# @param [Hash] opts the optional parameters
|
1041
1059
|
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
1042
1060
|
def get_coupon_id_for_coupon_code_with_http_info(id, opts = {})
|
@@ -1070,7 +1088,7 @@ module KlaviyoAPI
|
|
1070
1088
|
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
1071
1089
|
|
1072
1090
|
# auth_names
|
1073
|
-
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
|
1091
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
|
1074
1092
|
|
1075
1093
|
new_options = opts.merge(
|
1076
1094
|
:operation => :"CouponsApi.get_coupon_id_for_coupon_code",
|
@@ -1142,7 +1160,7 @@ module KlaviyoAPI
|
|
1142
1160
|
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
1143
1161
|
|
1144
1162
|
# auth_names
|
1145
|
-
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
|
1163
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
|
1146
1164
|
|
1147
1165
|
new_options = opts.merge(
|
1148
1166
|
:operation => :"CouponsApi.get_coupons",
|
@@ -1218,7 +1236,7 @@ module KlaviyoAPI
|
|
1218
1236
|
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
1219
1237
|
|
1220
1238
|
# auth_names
|
1221
|
-
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
|
1239
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
|
1222
1240
|
|
1223
1241
|
new_options = opts.merge(
|
1224
1242
|
:operation => :"CouponsApi.update_coupon",
|
@@ -1294,7 +1312,7 @@ module KlaviyoAPI
|
|
1294
1312
|
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
1295
1313
|
|
1296
1314
|
# auth_names
|
1297
|
-
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
|
1315
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
|
1298
1316
|
|
1299
1317
|
new_options = opts.merge(
|
1300
1318
|
:operation => :"CouponsApi.update_coupon_code",
|
@@ -73,7 +73,7 @@ module KlaviyoAPI
|
|
73
73
|
return_type = opts[:debug_return_type]
|
74
74
|
|
75
75
|
# auth_names
|
76
|
-
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
|
76
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
|
77
77
|
|
78
78
|
new_options = opts.merge(
|
79
79
|
:operation => :"DataPrivacyApi.request_profile_deletion",
|