late-sdk 0.0.856 → 0.0.858

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.
Files changed (95) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +27 -2
  3. data/docs/AdCampaignsApi.md +364 -6
  4. data/docs/{ListAdKeywords200ResponseKeywordsInner.md → AdKeyword.md} +7 -3
  5. data/docs/AdKeywordMetrics.md +30 -0
  6. data/docs/AddAdKeywords201Response.md +18 -0
  7. data/docs/AddAdKeywordsRequest.md +24 -0
  8. data/docs/AddAdKeywordsRequestKeywordsInner.md +20 -0
  9. data/docs/AddAdKeywordsRequestKeywordsInnerAnyOf.md +20 -0
  10. data/docs/ChannelPicker.md +20 -0
  11. data/docs/ChannelPickerChannelsInner.md +24 -0
  12. data/docs/ChannelPickerTeam.md +22 -0
  13. data/docs/ConnectApi.md +78 -0
  14. data/docs/CreatePost200Response.md +22 -0
  15. data/docs/CreatePost200ResponseTiktokInner.md +24 -0
  16. data/docs/CreatePostRequest.md +2 -0
  17. data/docs/CreateStandaloneAdRequest.md +4 -2
  18. data/docs/KeywordEntry.md +49 -0
  19. data/docs/ListAdKeywords200Response.md +1 -1
  20. data/docs/ListCampaignNegativeKeywords200Response.md +18 -0
  21. data/docs/ListCampaignNegativeKeywords200ResponseKeywordsInner.md +22 -0
  22. data/docs/ListSlackChannels200Response.md +49 -0
  23. data/docs/PlatformTarget.md +1 -1
  24. data/docs/Post.md +1 -1
  25. data/docs/PostsApi.md +4 -4
  26. data/docs/RemoveAdKeyword200Response.md +20 -0
  27. data/docs/ReplaceCampaignNegativeKeywords200Response.md +22 -0
  28. data/docs/ReplaceCampaignNegativeKeywordsRequest.md +20 -0
  29. data/docs/StartOAuth.md +20 -0
  30. data/docs/UpdateAdKeyword200Response.md +18 -0
  31. data/docs/{UpdateAdStatusRequest.md → UpdateAdKeywordRequest.md} +2 -2
  32. data/docs/WebhookLog.md +1 -1
  33. data/lib/zernio-sdk/api/ad_campaigns_api.rb +358 -9
  34. data/lib/zernio-sdk/api/connect_api.rb +77 -0
  35. data/lib/zernio-sdk/api/posts_api.rb +4 -4
  36. data/lib/zernio-sdk/models/{list_ad_keywords200_response_keywords_inner.rb → ad_keyword.rb} +28 -8
  37. data/lib/zernio-sdk/models/ad_keyword_metrics.rb +207 -0
  38. data/lib/zernio-sdk/models/add_ad_keywords201_response.rb +149 -0
  39. data/lib/zernio-sdk/models/add_ad_keywords_request.rb +250 -0
  40. data/lib/zernio-sdk/models/add_ad_keywords_request_keywords_inner.rb +103 -0
  41. data/lib/zernio-sdk/models/add_ad_keywords_request_keywords_inner_any_of.rb +225 -0
  42. data/lib/zernio-sdk/models/channel_picker.rb +192 -0
  43. data/lib/zernio-sdk/models/channel_picker_channels_inner.rb +244 -0
  44. data/lib/zernio-sdk/models/channel_picker_team.rb +169 -0
  45. data/lib/zernio-sdk/models/create_post200_response.rb +221 -0
  46. data/lib/zernio-sdk/models/create_post200_response_tiktok_inner.rb +227 -0
  47. data/lib/zernio-sdk/models/create_post_request.rb +13 -1
  48. data/lib/zernio-sdk/models/create_standalone_ad_request.rb +55 -5
  49. data/lib/zernio-sdk/models/keyword_entry.rb +105 -0
  50. data/lib/zernio-sdk/models/list_ad_keywords200_response.rb +1 -1
  51. data/lib/zernio-sdk/models/list_campaign_negative_keywords200_response.rb +149 -0
  52. data/lib/zernio-sdk/models/list_campaign_negative_keywords200_response_keywords_inner.rb +199 -0
  53. data/lib/zernio-sdk/models/list_slack_channels200_response.rb +104 -0
  54. data/lib/zernio-sdk/models/platform_target.rb +1 -1
  55. data/lib/zernio-sdk/models/post.rb +3 -2
  56. data/lib/zernio-sdk/models/remove_ad_keyword200_response.rb +157 -0
  57. data/lib/zernio-sdk/models/replace_campaign_negative_keywords200_response.rb +170 -0
  58. data/lib/zernio-sdk/models/replace_campaign_negative_keywords_request.rb +219 -0
  59. data/lib/zernio-sdk/models/start_o_auth.rb +190 -0
  60. data/lib/zernio-sdk/models/update_ad_keyword200_response.rb +147 -0
  61. data/lib/zernio-sdk/models/{update_ad_status_request.rb → update_ad_keyword_request.rb} +3 -3
  62. data/lib/zernio-sdk/models/webhook_log.rb +1 -1
  63. data/lib/zernio-sdk/version.rb +1 -1
  64. data/lib/zernio-sdk.rb +21 -2
  65. data/openapi.yaml +390 -27
  66. data/spec/api/ad_campaigns_api_spec.rb +64 -1
  67. data/spec/api/connect_api_spec.rb +15 -0
  68. data/spec/api/posts_api_spec.rb +1 -1
  69. data/spec/models/ad_keyword_metrics_spec.rb +72 -0
  70. data/spec/models/{list_ad_keywords200_response_keywords_inner_spec.rb → ad_keyword_spec.rb} +18 -6
  71. data/spec/models/add_ad_keywords201_response_spec.rb +36 -0
  72. data/spec/models/add_ad_keywords_request_keywords_inner_any_of_spec.rb +46 -0
  73. data/spec/models/add_ad_keywords_request_keywords_inner_spec.rb +21 -0
  74. data/spec/models/add_ad_keywords_request_spec.rb +54 -0
  75. data/spec/models/channel_picker_channels_inner_spec.rb +54 -0
  76. data/spec/models/channel_picker_spec.rb +42 -0
  77. data/spec/models/channel_picker_team_spec.rb +48 -0
  78. data/spec/models/create_post200_response_spec.rb +48 -0
  79. data/spec/models/create_post200_response_tiktok_inner_spec.rb +54 -0
  80. data/spec/models/create_post_request_spec.rb +6 -0
  81. data/spec/models/create_standalone_ad_request_spec.rb +6 -0
  82. data/spec/models/keyword_entry_spec.rb +32 -0
  83. data/spec/models/list_campaign_negative_keywords200_response_keywords_inner_spec.rb +52 -0
  84. data/spec/models/list_campaign_negative_keywords200_response_spec.rb +36 -0
  85. data/spec/models/list_slack_channels200_response_spec.rb +32 -0
  86. data/spec/models/post_spec.rb +1 -1
  87. data/spec/models/remove_ad_keyword200_response_spec.rb +42 -0
  88. data/spec/models/replace_campaign_negative_keywords200_response_spec.rb +48 -0
  89. data/spec/models/replace_campaign_negative_keywords_request_spec.rb +46 -0
  90. data/spec/models/start_o_auth_spec.rb +42 -0
  91. data/spec/models/update_ad_keyword200_response_spec.rb +36 -0
  92. data/spec/models/{update_ad_status_request_spec.rb → update_ad_keyword_request_spec.rb} +6 -6
  93. data/zernio-sdk-0.0.858.gem +0 -0
  94. metadata +86 -10
  95. data/zernio-sdk-0.0.856.gem +0 -0
@@ -1,4 +1,4 @@
1
- # Zernio::UpdateAdStatusRequest
1
+ # Zernio::UpdateAdKeywordRequest
2
2
 
3
3
  ## Properties
4
4
 
@@ -11,7 +11,7 @@
11
11
  ```ruby
12
12
  require 'zernio-sdk'
13
13
 
14
- instance = Zernio::UpdateAdStatusRequest.new(
14
+ instance = Zernio::UpdateAdKeywordRequest.new(
15
15
  status: null
16
16
  )
17
17
  ```
data/docs/WebhookLog.md CHANGED
@@ -7,7 +7,7 @@
7
7
  | **user_id** | **String** | ID of the account owner the webhook belongs to | [optional] |
8
8
  | **webhook_id** | **String** | ID of the webhook configuration that produced this delivery | [optional] |
9
9
  | **webhook_name** | **String** | Name of the webhook configuration at delivery time | [optional] |
10
- | **event_id** | **String** | Stable webhook event ID (correlates to the delivered payload) | [optional] |
10
+ | **event_id** | **String** | Stable webhook event ID: the payload `id`, also sent as the X-Zernio-Event-Id header. Shared by every attempt and redelivery of the same event. | [optional] |
11
11
  | **event** | **String** | Event type that triggered the delivery (e.g. post.published) | [optional] |
12
12
  | **url** | **String** | Destination URL the webhook was delivered to | [optional] |
13
13
  | **status** | **String** | Delivery outcome | [optional] |
@@ -19,6 +19,74 @@ module Zernio
19
19
  def initialize(api_client = ApiClient.default)
20
20
  @api_client = api_client
21
21
  end
22
+ # Add Search keywords to an ad group
23
+ # Adds one or more keyword criteria to an existing Google Search ad group, without touching the keywords already there (unlike the whole-set diff on `PUT /v1/ads/{adId}`, `keywords`/`negativeKeywords` in `platformSpecificData`, which replaces the set). Set `negative: true` to add ad-group-level negatives instead of positive keywords.
24
+ # @param add_ad_keywords_request [AddAdKeywordsRequest]
25
+ # @param [Hash] opts the optional parameters
26
+ # @return [AddAdKeywords201Response]
27
+ def add_ad_keywords(add_ad_keywords_request, opts = {})
28
+ data, _status_code, _headers = add_ad_keywords_with_http_info(add_ad_keywords_request, opts)
29
+ data
30
+ end
31
+
32
+ # Add Search keywords to an ad group
33
+ # Adds one or more keyword criteria to an existing Google Search ad group, without touching the keywords already there (unlike the whole-set diff on `PUT /v1/ads/{adId}`, `keywords`/`negativeKeywords` in `platformSpecificData`, which replaces the set). Set `negative: true` to add ad-group-level negatives instead of positive keywords.
34
+ # @param add_ad_keywords_request [AddAdKeywordsRequest]
35
+ # @param [Hash] opts the optional parameters
36
+ # @return [Array<(AddAdKeywords201Response, Integer, Hash)>] AddAdKeywords201Response data, response status code and response headers
37
+ def add_ad_keywords_with_http_info(add_ad_keywords_request, opts = {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug 'Calling API: AdCampaignsApi.add_ad_keywords ...'
40
+ end
41
+ # verify the required parameter 'add_ad_keywords_request' is set
42
+ if @api_client.config.client_side_validation && add_ad_keywords_request.nil?
43
+ fail ArgumentError, "Missing the required parameter 'add_ad_keywords_request' when calling AdCampaignsApi.add_ad_keywords"
44
+ end
45
+ # resource path
46
+ local_var_path = '/v1/ads/keywords'
47
+
48
+ # query parameters
49
+ query_params = opts[:query_params] || {}
50
+
51
+ # header parameters
52
+ header_params = opts[:header_params] || {}
53
+ # HTTP header 'Accept' (if needed)
54
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
55
+ # HTTP header 'Content-Type'
56
+ content_type = @api_client.select_header_content_type(['application/json'])
57
+ if !content_type.nil?
58
+ header_params['Content-Type'] = content_type
59
+ end
60
+
61
+ # form parameters
62
+ form_params = opts[:form_params] || {}
63
+
64
+ # http body (model)
65
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(add_ad_keywords_request)
66
+
67
+ # return_type
68
+ return_type = opts[:debug_return_type] || 'AddAdKeywords201Response'
69
+
70
+ # auth_names
71
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
72
+
73
+ new_options = opts.merge(
74
+ :operation => :"AdCampaignsApi.add_ad_keywords",
75
+ :header_params => header_params,
76
+ :query_params => query_params,
77
+ :form_params => form_params,
78
+ :body => post_body,
79
+ :auth_names => auth_names,
80
+ :return_type => return_type
81
+ )
82
+
83
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
84
+ if @api_client.config.debugging
85
+ @api_client.config.logger.debug "API called: AdCampaignsApi#add_ad_keywords\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
86
+ end
87
+ return data, status_code, headers
88
+ end
89
+
22
90
  # Attach extension assets to a Google Search campaign
23
91
  # Attach sitelinks, callouts and/or structured snippets to an already-existing Google Search campaign — the same builders POST /v1/ads/create uses, but without rebuilding the hierarchy. At least one of sitelinks, callouts or structuredSnippets is required. Google-only. Other platforms have no equivalent extension surface and return 501. Approval status is Google-async; poll `asset.policy_summary` after review. Assets stay in the account library even if the campaign is later deleted.
24
92
  # @param campaign_id [String] Numeric Google platform campaign id.
@@ -1547,6 +1615,213 @@ module Zernio
1547
1615
  return data, status_code, headers
1548
1616
  end
1549
1617
 
1618
+ # List campaign-level negative keywords
1619
+ # Returns the campaign-level negative keywords (`campaign_criterion.negative`), distinct from the ad-group-level negatives under `GET /v1/ads/keywords`. Read live from Google on every call (not synced to Postgres), and gated by the shared Google Ads operations budget like every other on-demand Google surface. The platform is always discovered from the campaign itself; a non-Google campaign returns 501 rather than 404, whether or not `platform` was passed.
1620
+ # @param campaign_id [String] Platform campaign ID
1621
+ # @param [Hash] opts the optional parameters
1622
+ # @option opts [String] :platform Optional and NOT authoritative: the resolved campaign&#39;s own platform decides 200 vs 501, never this hint.
1623
+ # @return [ListCampaignNegativeKeywords200Response]
1624
+ def list_campaign_negative_keywords(campaign_id, opts = {})
1625
+ data, _status_code, _headers = list_campaign_negative_keywords_with_http_info(campaign_id, opts)
1626
+ data
1627
+ end
1628
+
1629
+ # List campaign-level negative keywords
1630
+ # Returns the campaign-level negative keywords (&#x60;campaign_criterion.negative&#x60;), distinct from the ad-group-level negatives under &#x60;GET /v1/ads/keywords&#x60;. Read live from Google on every call (not synced to Postgres), and gated by the shared Google Ads operations budget like every other on-demand Google surface. The platform is always discovered from the campaign itself; a non-Google campaign returns 501 rather than 404, whether or not &#x60;platform&#x60; was passed.
1631
+ # @param campaign_id [String] Platform campaign ID
1632
+ # @param [Hash] opts the optional parameters
1633
+ # @option opts [String] :platform Optional and NOT authoritative: the resolved campaign&#39;s own platform decides 200 vs 501, never this hint.
1634
+ # @return [Array<(ListCampaignNegativeKeywords200Response, Integer, Hash)>] ListCampaignNegativeKeywords200Response data, response status code and response headers
1635
+ def list_campaign_negative_keywords_with_http_info(campaign_id, opts = {})
1636
+ if @api_client.config.debugging
1637
+ @api_client.config.logger.debug 'Calling API: AdCampaignsApi.list_campaign_negative_keywords ...'
1638
+ end
1639
+ # verify the required parameter 'campaign_id' is set
1640
+ if @api_client.config.client_side_validation && campaign_id.nil?
1641
+ fail ArgumentError, "Missing the required parameter 'campaign_id' when calling AdCampaignsApi.list_campaign_negative_keywords"
1642
+ end
1643
+ allowable_values = ["facebook", "instagram", "tiktok", "linkedin", "pinterest", "google", "twitter", "openai"]
1644
+ if @api_client.config.client_side_validation && opts[:'platform'] && !allowable_values.include?(opts[:'platform'])
1645
+ fail ArgumentError, "invalid value for \"platform\", must be one of #{allowable_values}"
1646
+ end
1647
+ # resource path
1648
+ local_var_path = '/v1/ads/campaigns/{campaignId}/negative-keywords'.sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s))
1649
+
1650
+ # query parameters
1651
+ query_params = opts[:query_params] || {}
1652
+ query_params[:'platform'] = opts[:'platform'] if !opts[:'platform'].nil?
1653
+
1654
+ # header parameters
1655
+ header_params = opts[:header_params] || {}
1656
+ # HTTP header 'Accept' (if needed)
1657
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1658
+
1659
+ # form parameters
1660
+ form_params = opts[:form_params] || {}
1661
+
1662
+ # http body (model)
1663
+ post_body = opts[:debug_body]
1664
+
1665
+ # return_type
1666
+ return_type = opts[:debug_return_type] || 'ListCampaignNegativeKeywords200Response'
1667
+
1668
+ # auth_names
1669
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
1670
+
1671
+ new_options = opts.merge(
1672
+ :operation => :"AdCampaignsApi.list_campaign_negative_keywords",
1673
+ :header_params => header_params,
1674
+ :query_params => query_params,
1675
+ :form_params => form_params,
1676
+ :body => post_body,
1677
+ :auth_names => auth_names,
1678
+ :return_type => return_type
1679
+ )
1680
+
1681
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1682
+ if @api_client.config.debugging
1683
+ @api_client.config.logger.debug "API called: AdCampaignsApi#list_campaign_negative_keywords\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1684
+ end
1685
+ return data, status_code, headers
1686
+ end
1687
+
1688
+ # Remove a Search keyword
1689
+ # Removes one keyword criterion (positive or negative) from its ad group (M.140).
1690
+ # @param keyword_id [String] Zernio keyword ID (not the Google criterion ID)
1691
+ # @param [Hash] opts the optional parameters
1692
+ # @return [RemoveAdKeyword200Response]
1693
+ def remove_ad_keyword(keyword_id, opts = {})
1694
+ data, _status_code, _headers = remove_ad_keyword_with_http_info(keyword_id, opts)
1695
+ data
1696
+ end
1697
+
1698
+ # Remove a Search keyword
1699
+ # Removes one keyword criterion (positive or negative) from its ad group (M.140).
1700
+ # @param keyword_id [String] Zernio keyword ID (not the Google criterion ID)
1701
+ # @param [Hash] opts the optional parameters
1702
+ # @return [Array<(RemoveAdKeyword200Response, Integer, Hash)>] RemoveAdKeyword200Response data, response status code and response headers
1703
+ def remove_ad_keyword_with_http_info(keyword_id, opts = {})
1704
+ if @api_client.config.debugging
1705
+ @api_client.config.logger.debug 'Calling API: AdCampaignsApi.remove_ad_keyword ...'
1706
+ end
1707
+ # verify the required parameter 'keyword_id' is set
1708
+ if @api_client.config.client_side_validation && keyword_id.nil?
1709
+ fail ArgumentError, "Missing the required parameter 'keyword_id' when calling AdCampaignsApi.remove_ad_keyword"
1710
+ end
1711
+ # resource path
1712
+ local_var_path = '/v1/ads/keywords/{keywordId}'.sub('{' + 'keywordId' + '}', CGI.escape(keyword_id.to_s))
1713
+
1714
+ # query parameters
1715
+ query_params = opts[:query_params] || {}
1716
+
1717
+ # header parameters
1718
+ header_params = opts[:header_params] || {}
1719
+ # HTTP header 'Accept' (if needed)
1720
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1721
+
1722
+ # form parameters
1723
+ form_params = opts[:form_params] || {}
1724
+
1725
+ # http body (model)
1726
+ post_body = opts[:debug_body]
1727
+
1728
+ # return_type
1729
+ return_type = opts[:debug_return_type] || 'RemoveAdKeyword200Response'
1730
+
1731
+ # auth_names
1732
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
1733
+
1734
+ new_options = opts.merge(
1735
+ :operation => :"AdCampaignsApi.remove_ad_keyword",
1736
+ :header_params => header_params,
1737
+ :query_params => query_params,
1738
+ :form_params => form_params,
1739
+ :body => post_body,
1740
+ :auth_names => auth_names,
1741
+ :return_type => return_type
1742
+ )
1743
+
1744
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
1745
+ if @api_client.config.debugging
1746
+ @api_client.config.logger.debug "API called: AdCampaignsApi#remove_ad_keyword\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1747
+ end
1748
+ return data, status_code, headers
1749
+ end
1750
+
1751
+ # Replace campaign-level negative keywords
1752
+ # Replaces the FULL set of campaign-level negative keywords (C.270): the desired list is diffed against what Google already has, and the difference is applied as one `create`/`remove` mutate. Send an empty array to clear every campaign negative. The platform is always discovered from the campaign itself; a non-Google campaign returns 501 rather than 404, whether or not `platform` was sent.
1753
+ # @param campaign_id [String] Platform campaign ID
1754
+ # @param replace_campaign_negative_keywords_request [ReplaceCampaignNegativeKeywordsRequest]
1755
+ # @param [Hash] opts the optional parameters
1756
+ # @return [ReplaceCampaignNegativeKeywords200Response]
1757
+ def replace_campaign_negative_keywords(campaign_id, replace_campaign_negative_keywords_request, opts = {})
1758
+ data, _status_code, _headers = replace_campaign_negative_keywords_with_http_info(campaign_id, replace_campaign_negative_keywords_request, opts)
1759
+ data
1760
+ end
1761
+
1762
+ # Replace campaign-level negative keywords
1763
+ # Replaces the FULL set of campaign-level negative keywords (C.270): the desired list is diffed against what Google already has, and the difference is applied as one &#x60;create&#x60;/&#x60;remove&#x60; mutate. Send an empty array to clear every campaign negative. The platform is always discovered from the campaign itself; a non-Google campaign returns 501 rather than 404, whether or not &#x60;platform&#x60; was sent.
1764
+ # @param campaign_id [String] Platform campaign ID
1765
+ # @param replace_campaign_negative_keywords_request [ReplaceCampaignNegativeKeywordsRequest]
1766
+ # @param [Hash] opts the optional parameters
1767
+ # @return [Array<(ReplaceCampaignNegativeKeywords200Response, Integer, Hash)>] ReplaceCampaignNegativeKeywords200Response data, response status code and response headers
1768
+ def replace_campaign_negative_keywords_with_http_info(campaign_id, replace_campaign_negative_keywords_request, opts = {})
1769
+ if @api_client.config.debugging
1770
+ @api_client.config.logger.debug 'Calling API: AdCampaignsApi.replace_campaign_negative_keywords ...'
1771
+ end
1772
+ # verify the required parameter 'campaign_id' is set
1773
+ if @api_client.config.client_side_validation && campaign_id.nil?
1774
+ fail ArgumentError, "Missing the required parameter 'campaign_id' when calling AdCampaignsApi.replace_campaign_negative_keywords"
1775
+ end
1776
+ # verify the required parameter 'replace_campaign_negative_keywords_request' is set
1777
+ if @api_client.config.client_side_validation && replace_campaign_negative_keywords_request.nil?
1778
+ fail ArgumentError, "Missing the required parameter 'replace_campaign_negative_keywords_request' when calling AdCampaignsApi.replace_campaign_negative_keywords"
1779
+ end
1780
+ # resource path
1781
+ local_var_path = '/v1/ads/campaigns/{campaignId}/negative-keywords'.sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s))
1782
+
1783
+ # query parameters
1784
+ query_params = opts[:query_params] || {}
1785
+
1786
+ # header parameters
1787
+ header_params = opts[:header_params] || {}
1788
+ # HTTP header 'Accept' (if needed)
1789
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1790
+ # HTTP header 'Content-Type'
1791
+ content_type = @api_client.select_header_content_type(['application/json'])
1792
+ if !content_type.nil?
1793
+ header_params['Content-Type'] = content_type
1794
+ end
1795
+
1796
+ # form parameters
1797
+ form_params = opts[:form_params] || {}
1798
+
1799
+ # http body (model)
1800
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(replace_campaign_negative_keywords_request)
1801
+
1802
+ # return_type
1803
+ return_type = opts[:debug_return_type] || 'ReplaceCampaignNegativeKeywords200Response'
1804
+
1805
+ # auth_names
1806
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
1807
+
1808
+ new_options = opts.merge(
1809
+ :operation => :"AdCampaignsApi.replace_campaign_negative_keywords",
1810
+ :header_params => header_params,
1811
+ :query_params => query_params,
1812
+ :form_params => form_params,
1813
+ :body => post_body,
1814
+ :auth_names => auth_names,
1815
+ :return_type => return_type
1816
+ )
1817
+
1818
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
1819
+ if @api_client.config.debugging
1820
+ @api_client.config.logger.debug "API called: AdCampaignsApi#replace_campaign_negative_keywords\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1821
+ end
1822
+ return data, status_code, headers
1823
+ end
1824
+
1550
1825
  # Update ad
1551
1826
  # Patch one or more fields on an ad. Status, budget, targeting, and creative changes are propagated to the platform. Per-platform support: - **Meta** (Facebook + Instagram): all fields supported. - **TikTok**: status, budget, targeting (via `/v2/adgroup/update/`), and creative (via `/v2/ad/update/` patch-style — `headline` is ignored, `body` becomes `ad_text`). - **Google**: status, budget, and KEYWORD edits via `targeting.keywords` / `targeting.negativeKeywords` — each list you send becomes the FULL new set of its kind on the ad group (criteria not in the list are removed); a kind left out is untouched. Any other `targeting` field returns 400: Google cannot mutate broad targeting post-create without recreating the campaign. `creative` returns 501. - **LinkedIn**: status, budget, targeting (geo countries only, applied to the LinkedIn Campaign via PARTIAL_UPDATE), and creative (uploads new media, creates a replacement inline creative on the same campaign, pauses the old one). - **Pinterest / X / OpenAI Ads**: status + budget only. Sending `targeting` or `creative` returns 501 with code `unsupported_platform_operation`. OpenAI Ads budget is lifetime-only (see `budget.type` below).
1552
1827
  # @param ad_id [String]
@@ -1769,6 +2044,80 @@ module Zernio
1769
2044
  return data, status_code, headers
1770
2045
  end
1771
2046
 
2047
+ # Pause or enable a Search keyword
2048
+ # Changes `ad_group_criterion.status` for one keyword criterion (M.140). Negative keywords have no status on Google and cannot be paused or enabled.
2049
+ # @param keyword_id [String] Zernio keyword ID (not the Google criterion ID)
2050
+ # @param update_ad_keyword_request [UpdateAdKeywordRequest]
2051
+ # @param [Hash] opts the optional parameters
2052
+ # @return [UpdateAdKeyword200Response]
2053
+ def update_ad_keyword(keyword_id, update_ad_keyword_request, opts = {})
2054
+ data, _status_code, _headers = update_ad_keyword_with_http_info(keyword_id, update_ad_keyword_request, opts)
2055
+ data
2056
+ end
2057
+
2058
+ # Pause or enable a Search keyword
2059
+ # Changes &#x60;ad_group_criterion.status&#x60; for one keyword criterion (M.140). Negative keywords have no status on Google and cannot be paused or enabled.
2060
+ # @param keyword_id [String] Zernio keyword ID (not the Google criterion ID)
2061
+ # @param update_ad_keyword_request [UpdateAdKeywordRequest]
2062
+ # @param [Hash] opts the optional parameters
2063
+ # @return [Array<(UpdateAdKeyword200Response, Integer, Hash)>] UpdateAdKeyword200Response data, response status code and response headers
2064
+ def update_ad_keyword_with_http_info(keyword_id, update_ad_keyword_request, opts = {})
2065
+ if @api_client.config.debugging
2066
+ @api_client.config.logger.debug 'Calling API: AdCampaignsApi.update_ad_keyword ...'
2067
+ end
2068
+ # verify the required parameter 'keyword_id' is set
2069
+ if @api_client.config.client_side_validation && keyword_id.nil?
2070
+ fail ArgumentError, "Missing the required parameter 'keyword_id' when calling AdCampaignsApi.update_ad_keyword"
2071
+ end
2072
+ # verify the required parameter 'update_ad_keyword_request' is set
2073
+ if @api_client.config.client_side_validation && update_ad_keyword_request.nil?
2074
+ fail ArgumentError, "Missing the required parameter 'update_ad_keyword_request' when calling AdCampaignsApi.update_ad_keyword"
2075
+ end
2076
+ # resource path
2077
+ local_var_path = '/v1/ads/keywords/{keywordId}'.sub('{' + 'keywordId' + '}', CGI.escape(keyword_id.to_s))
2078
+
2079
+ # query parameters
2080
+ query_params = opts[:query_params] || {}
2081
+
2082
+ # header parameters
2083
+ header_params = opts[:header_params] || {}
2084
+ # HTTP header 'Accept' (if needed)
2085
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
2086
+ # HTTP header 'Content-Type'
2087
+ content_type = @api_client.select_header_content_type(['application/json'])
2088
+ if !content_type.nil?
2089
+ header_params['Content-Type'] = content_type
2090
+ end
2091
+
2092
+ # form parameters
2093
+ form_params = opts[:form_params] || {}
2094
+
2095
+ # http body (model)
2096
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(update_ad_keyword_request)
2097
+
2098
+ # return_type
2099
+ return_type = opts[:debug_return_type] || 'UpdateAdKeyword200Response'
2100
+
2101
+ # auth_names
2102
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
2103
+
2104
+ new_options = opts.merge(
2105
+ :operation => :"AdCampaignsApi.update_ad_keyword",
2106
+ :header_params => header_params,
2107
+ :query_params => query_params,
2108
+ :form_params => form_params,
2109
+ :body => post_body,
2110
+ :auth_names => auth_names,
2111
+ :return_type => return_type
2112
+ )
2113
+
2114
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
2115
+ if @api_client.config.debugging
2116
+ @api_client.config.logger.debug "API called: AdCampaignsApi#update_ad_keyword\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2117
+ end
2118
+ return data, status_code, headers
2119
+ end
2120
+
1772
2121
  # Update an ad set
1773
2122
  # Ad-set-level writes. Use this for ABO budget updates, ad-set-scoped pause/resume, bid-strategy edits, Meta value-rule-set attach/detach, and Meta-only post-launch delivery settings via `platformSpecificData`. At least one updatable field is required. Value rule sets (Meta only, see `/v1/ads/value-rule-sets`): - ATTACH or REPLACE: send `valueRuleSetId`. Attachment is driven by the id's presence, so `valueRulesApplied: true` is optional. Sending a different id replaces the previous association; there is no separate replace call. - DETACH: send `valueRulesApplied: false` and OMIT `valueRuleSetId`. - Sending `valueRulesApplied: false` TOGETHER with `valueRuleSetId` returns 400 `mutually_exclusive_fields`. This is deliberate: Meta attaches the rule set whenever `value_rule_set_id` is present, even with `value_rules_applied` false, so echoing stored state while asking to detach would silently keep the bid adjustments live. - Eligibility: only ad sets on `LOWEST_COST_WITHOUT_CAP` or `COST_CAP`. Meta rejects the rest server-side. - Read back with `GET /v1/ads/ad-sets/{adSetId}?fields=value_rule_set_id`. Meta does not document `value_rules_applied` as a readable ad-set field, so the boolean cannot be read back. Bid strategy compatibility (per Meta's spec): - `LOWEST_COST_WITHOUT_CAP`: no `bidAmount`, no `roasAverageFloor`. - `LOWEST_COST_WITH_BID_CAP` / `COST_CAP`: `bidAmount` REQUIRED (whole currency units). - `LOWEST_COST_WITH_MIN_ROAS`: `roasAverageFloor` REQUIRED (decimal multiplier, e.g. 2.0 = 2.0x ROAS). - Meta only: send `bidAmount` WITHOUT `bidStrategy` to change the cap amount on an ad set under a COST_CAP / LOWEST_COST_WITH_BID_CAP parent campaign, leaving the strategy itself (inherited from the campaign) untouched. `roasAverageFloor` without `bidStrategy` is rejected (it has no meaning outside LOWEST_COST_WITH_MIN_ROAS). Delivery settings are validated by Meta against the campaign objective; incompatible combinations (e.g. a billingEvent the optimization goal doesn't allow) surface as 400s from Meta. When updating `budget` on an ABO campaign: if the parent campaign is CBO, the response is 409 with code BUDGET_LEVEL_MISMATCH — route to PUT /v1/ads/campaigns/{campaignId} instead.
1774
2123
  # @param ad_set_id [String] Platform ad set ID
@@ -1920,21 +2269,21 @@ module Zernio
1920
2269
  # Pause or resume a single ad
1921
2270
  # Ad-scoped pause/resume — touches ONLY this ad, never its parent ad set or campaign (so sibling ads keep running). Thin wrapper over the `status` field of PUT /v1/ads/{adId}, for callers that want a URL symmetric to /v1/ads/campaigns/{campaignId}/status and /v1/ads/ad-sets/{adSetId}/status. `{adId}` accepts the same identifier dialects as GET/PUT /v1/ads/{adId} (Zernio hex `_id`, Meta numeric `platformAdId`, or the creative's effective story/media IDs). `platform` is inferred from the ad, so it's not required in the body. Ads in terminal statuses (rejected, completed, cancelled) and no-op flips (already in the target state) are skipped.
1922
2271
  # @param ad_id [String] Zernio &#x60;_id&#x60; (hex), Meta &#x60;platformAdId&#x60; (numeric), or one of the creative&#39;s effective story/media IDs.
1923
- # @param update_ad_status_request [UpdateAdStatusRequest]
2272
+ # @param update_ad_keyword_request [UpdateAdKeywordRequest]
1924
2273
  # @param [Hash] opts the optional parameters
1925
2274
  # @return [UpdateAdStatus200Response]
1926
- def update_ad_status(ad_id, update_ad_status_request, opts = {})
1927
- data, _status_code, _headers = update_ad_status_with_http_info(ad_id, update_ad_status_request, opts)
2275
+ def update_ad_status(ad_id, update_ad_keyword_request, opts = {})
2276
+ data, _status_code, _headers = update_ad_status_with_http_info(ad_id, update_ad_keyword_request, opts)
1928
2277
  data
1929
2278
  end
1930
2279
 
1931
2280
  # Pause or resume a single ad
1932
2281
  # Ad-scoped pause/resume — touches ONLY this ad, never its parent ad set or campaign (so sibling ads keep running). Thin wrapper over the &#x60;status&#x60; field of PUT /v1/ads/{adId}, for callers that want a URL symmetric to /v1/ads/campaigns/{campaignId}/status and /v1/ads/ad-sets/{adSetId}/status. &#x60;{adId}&#x60; accepts the same identifier dialects as GET/PUT /v1/ads/{adId} (Zernio hex &#x60;_id&#x60;, Meta numeric &#x60;platformAdId&#x60;, or the creative&#39;s effective story/media IDs). &#x60;platform&#x60; is inferred from the ad, so it&#39;s not required in the body. Ads in terminal statuses (rejected, completed, cancelled) and no-op flips (already in the target state) are skipped.
1933
2282
  # @param ad_id [String] Zernio &#x60;_id&#x60; (hex), Meta &#x60;platformAdId&#x60; (numeric), or one of the creative&#39;s effective story/media IDs.
1934
- # @param update_ad_status_request [UpdateAdStatusRequest]
2283
+ # @param update_ad_keyword_request [UpdateAdKeywordRequest]
1935
2284
  # @param [Hash] opts the optional parameters
1936
2285
  # @return [Array<(UpdateAdStatus200Response, Integer, Hash)>] UpdateAdStatus200Response data, response status code and response headers
1937
- def update_ad_status_with_http_info(ad_id, update_ad_status_request, opts = {})
2286
+ def update_ad_status_with_http_info(ad_id, update_ad_keyword_request, opts = {})
1938
2287
  if @api_client.config.debugging
1939
2288
  @api_client.config.logger.debug 'Calling API: AdCampaignsApi.update_ad_status ...'
1940
2289
  end
@@ -1942,9 +2291,9 @@ module Zernio
1942
2291
  if @api_client.config.client_side_validation && ad_id.nil?
1943
2292
  fail ArgumentError, "Missing the required parameter 'ad_id' when calling AdCampaignsApi.update_ad_status"
1944
2293
  end
1945
- # verify the required parameter 'update_ad_status_request' is set
1946
- if @api_client.config.client_side_validation && update_ad_status_request.nil?
1947
- fail ArgumentError, "Missing the required parameter 'update_ad_status_request' when calling AdCampaignsApi.update_ad_status"
2294
+ # verify the required parameter 'update_ad_keyword_request' is set
2295
+ if @api_client.config.client_side_validation && update_ad_keyword_request.nil?
2296
+ fail ArgumentError, "Missing the required parameter 'update_ad_keyword_request' when calling AdCampaignsApi.update_ad_status"
1948
2297
  end
1949
2298
  # resource path
1950
2299
  local_var_path = '/v1/ads/{adId}/status'.sub('{' + 'adId' + '}', CGI.escape(ad_id.to_s))
@@ -1966,7 +2315,7 @@ module Zernio
1966
2315
  form_params = opts[:form_params] || {}
1967
2316
 
1968
2317
  # http body (model)
1969
- post_body = opts[:debug_body] || @api_client.object_to_http_body(update_ad_status_request)
2318
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(update_ad_keyword_request)
1970
2319
 
1971
2320
  # return_type
1972
2321
  return_type = opts[:debug_return_type] || 'UpdateAdStatus200Response'
@@ -2370,6 +2370,83 @@ module Zernio
2370
2370
  return data, status_code, headers
2371
2371
  end
2372
2372
 
2373
+ # List Slack channels for the channel picker
2374
+ # Serves the channel picker of the Slack connect flow. Slack's OAuth installs the bot into a workspace, not a channel, so after the redirect the caller lists the workspace's channels here and finalizes one with `POST /v1/connect/slack`. Served by a dedicated route that shadows `GET /v1/connect/{platform}` for `slack`. Send exactly one of `pendingDataToken` (first connect: the nonce from the OAuth redirect, bound to the same `profileId`) or `accountId` (add another channel to a workspace already connected: the existing Slack account's workspace token is reused, no re-OAuth). With neither, the endpoint behaves like `GET /v1/connect/{platform}` and returns `authUrl` and `state` to start the OAuth flow. Channels are read live from Slack (`conversations.list`, public and private, archived excluded, up to 2,000). `isMember` says whether the Zernio bot is already in the channel: a public channel is joined automatically on finalize, a private one must be invited (`/invite @Zernio`) first.
2375
+ # @param profile_id [String] Zernio profile the channel account will belong to. Must match the profile the OAuth flow was started on when &#x60;pendingDataToken&#x60; is used.
2376
+ # @param [Hash] opts the optional parameters
2377
+ # @option opts [String] :pending_data_token Nonce from the OAuth redirect (first connect).
2378
+ # @option opts [String] :account_id Existing active Slack account (yours or a team member&#39;s) whose workspace token is reused.
2379
+ # @option opts [String] :redirect_url Start-OAuth mode only: where to send the user after the connect completes. &#x60;redirectUrl&#x60; is accepted as an alias.
2380
+ # @return [ListSlackChannels200Response]
2381
+ def list_slack_channels(profile_id, opts = {})
2382
+ data, _status_code, _headers = list_slack_channels_with_http_info(profile_id, opts)
2383
+ data
2384
+ end
2385
+
2386
+ # List Slack channels for the channel picker
2387
+ # Serves the channel picker of the Slack connect flow. Slack&#39;s OAuth installs the bot into a workspace, not a channel, so after the redirect the caller lists the workspace&#39;s channels here and finalizes one with &#x60;POST /v1/connect/slack&#x60;. Served by a dedicated route that shadows &#x60;GET /v1/connect/{platform}&#x60; for &#x60;slack&#x60;. Send exactly one of &#x60;pendingDataToken&#x60; (first connect: the nonce from the OAuth redirect, bound to the same &#x60;profileId&#x60;) or &#x60;accountId&#x60; (add another channel to a workspace already connected: the existing Slack account&#39;s workspace token is reused, no re-OAuth). With neither, the endpoint behaves like &#x60;GET /v1/connect/{platform}&#x60; and returns &#x60;authUrl&#x60; and &#x60;state&#x60; to start the OAuth flow. Channels are read live from Slack (&#x60;conversations.list&#x60;, public and private, archived excluded, up to 2,000). &#x60;isMember&#x60; says whether the Zernio bot is already in the channel: a public channel is joined automatically on finalize, a private one must be invited (&#x60;/invite @Zernio&#x60;) first.
2388
+ # @param profile_id [String] Zernio profile the channel account will belong to. Must match the profile the OAuth flow was started on when &#x60;pendingDataToken&#x60; is used.
2389
+ # @param [Hash] opts the optional parameters
2390
+ # @option opts [String] :pending_data_token Nonce from the OAuth redirect (first connect).
2391
+ # @option opts [String] :account_id Existing active Slack account (yours or a team member&#39;s) whose workspace token is reused.
2392
+ # @option opts [String] :redirect_url Start-OAuth mode only: where to send the user after the connect completes. &#x60;redirectUrl&#x60; is accepted as an alias.
2393
+ # @return [Array<(ListSlackChannels200Response, Integer, Hash)>] ListSlackChannels200Response data, response status code and response headers
2394
+ def list_slack_channels_with_http_info(profile_id, opts = {})
2395
+ if @api_client.config.debugging
2396
+ @api_client.config.logger.debug 'Calling API: ConnectApi.list_slack_channels ...'
2397
+ end
2398
+ # verify the required parameter 'profile_id' is set
2399
+ if @api_client.config.client_side_validation && profile_id.nil?
2400
+ fail ArgumentError, "Missing the required parameter 'profile_id' when calling ConnectApi.list_slack_channels"
2401
+ end
2402
+ if @api_client.config.client_side_validation && !opts[:'pending_data_token'].nil? && opts[:'pending_data_token'].to_s.length < 16
2403
+ fail ArgumentError, 'invalid value for "opts[:"pending_data_token"]" when calling ConnectApi.list_slack_channels, the character length must be greater than or equal to 16.'
2404
+ end
2405
+
2406
+ # resource path
2407
+ local_var_path = '/v1/connect/slack'
2408
+
2409
+ # query parameters
2410
+ query_params = opts[:query_params] || {}
2411
+ query_params[:'profileId'] = profile_id
2412
+ query_params[:'pendingDataToken'] = opts[:'pending_data_token'] if !opts[:'pending_data_token'].nil?
2413
+ query_params[:'accountId'] = opts[:'account_id'] if !opts[:'account_id'].nil?
2414
+ query_params[:'redirect_url'] = opts[:'redirect_url'] if !opts[:'redirect_url'].nil?
2415
+
2416
+ # header parameters
2417
+ header_params = opts[:header_params] || {}
2418
+ # HTTP header 'Accept' (if needed)
2419
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
2420
+
2421
+ # form parameters
2422
+ form_params = opts[:form_params] || {}
2423
+
2424
+ # http body (model)
2425
+ post_body = opts[:debug_body]
2426
+
2427
+ # return_type
2428
+ return_type = opts[:debug_return_type] || 'ListSlackChannels200Response'
2429
+
2430
+ # auth_names
2431
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
2432
+
2433
+ new_options = opts.merge(
2434
+ :operation => :"ConnectApi.list_slack_channels",
2435
+ :header_params => header_params,
2436
+ :query_params => query_params,
2437
+ :form_params => form_params,
2438
+ :body => post_body,
2439
+ :auth_names => auth_names,
2440
+ :return_type => return_type
2441
+ )
2442
+
2443
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
2444
+ if @api_client.config.debugging
2445
+ @api_client.config.logger.debug "API called: ConnectApi#list_slack_channels\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2446
+ end
2447
+ return data, status_code, headers
2448
+ end
2449
+
2373
2450
  # List Snapchat profiles
2374
2451
  # For headless flows. Returns Snapchat Public Profiles the user can post to. Use X-Connect-Token from the redirect URL.
2375
2452
  # @param x_connect_token [String] Short-lived connect token from the OAuth redirect
@@ -92,7 +92,7 @@ module Zernio
92
92
  # @param create_post_request [CreatePostRequest]
93
93
  # @param [Hash] opts the optional parameters
94
94
  # @option opts [String] :x_request_id Optional client-generated request identifier for safe retry (idempotency). When two requests carry the same value, the second is treated as a retry of the first and returns the original post (HTTP 200) instead of creating a duplicate. Window is ~5 minutes from the first request. Generate a UUID per logical call. SDKs do this automatically; HTTP clients should set it themselves or omit it. See the operation description for the full idempotency contract.
95
- # @return [PostCreateResponse]
95
+ # @return [CreatePost200Response]
96
96
  def create_post(create_post_request, opts = {})
97
97
  data, _status_code, _headers = create_post_with_http_info(create_post_request, opts)
98
98
  data
@@ -103,7 +103,7 @@ module Zernio
103
103
  # @param create_post_request [CreatePostRequest]
104
104
  # @param [Hash] opts the optional parameters
105
105
  # @option opts [String] :x_request_id Optional client-generated request identifier for safe retry (idempotency). When two requests carry the same value, the second is treated as a retry of the first and returns the original post (HTTP 200) instead of creating a duplicate. Window is ~5 minutes from the first request. Generate a UUID per logical call. SDKs do this automatically; HTTP clients should set it themselves or omit it. See the operation description for the full idempotency contract.
106
- # @return [Array<(PostCreateResponse, Integer, Hash)>] PostCreateResponse data, response status code and response headers
106
+ # @return [Array<(CreatePost200Response, Integer, Hash)>] CreatePost200Response data, response status code and response headers
107
107
  def create_post_with_http_info(create_post_request, opts = {})
108
108
  if @api_client.config.debugging
109
109
  @api_client.config.logger.debug 'Calling API: PostsApi.create_post ...'
@@ -136,7 +136,7 @@ module Zernio
136
136
  post_body = opts[:debug_body] || @api_client.object_to_http_body(create_post_request)
137
137
 
138
138
  # return_type
139
- return_type = opts[:debug_return_type] || 'PostCreateResponse'
139
+ return_type = opts[:debug_return_type] || 'CreatePost200Response'
140
140
 
141
141
  # auth_names
142
142
  auth_names = opts[:debug_auth_names] || ['bearerAuth']
@@ -417,7 +417,7 @@ module Zernio
417
417
  if @api_client.config.client_side_validation && opts[:'source'] && !allowable_values.include?(opts[:'source'])
418
418
  fail ArgumentError, "invalid value for \"source\", must be one of #{allowable_values}"
419
419
  end
420
- allowable_values = ["draft", "scheduled", "published", "failed"]
420
+ allowable_values = ["draft", "scheduled", "publishing", "published", "partial", "failed", "cancelled"]
421
421
  if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status'])
422
422
  fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}"
423
423
  end