late-sdk 0.0.856 → 0.0.857
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/README.md +19 -2
- data/docs/AdCampaignsApi.md +364 -6
- data/docs/{ListAdKeywords200ResponseKeywordsInner.md → AdKeyword.md} +7 -3
- data/docs/AdKeywordMetrics.md +30 -0
- data/docs/AddAdKeywords201Response.md +18 -0
- data/docs/AddAdKeywordsRequest.md +24 -0
- data/docs/AddAdKeywordsRequestKeywordsInner.md +20 -0
- data/docs/AddAdKeywordsRequestKeywordsInnerAnyOf.md +20 -0
- data/docs/CreateStandaloneAdRequest.md +4 -2
- data/docs/KeywordEntry.md +49 -0
- data/docs/ListAdKeywords200Response.md +1 -1
- data/docs/ListCampaignNegativeKeywords200Response.md +18 -0
- data/docs/ListCampaignNegativeKeywords200ResponseKeywordsInner.md +22 -0
- data/docs/RemoveAdKeyword200Response.md +20 -0
- data/docs/ReplaceCampaignNegativeKeywords200Response.md +22 -0
- data/docs/ReplaceCampaignNegativeKeywordsRequest.md +20 -0
- data/docs/UpdateAdKeyword200Response.md +18 -0
- data/docs/{UpdateAdStatusRequest.md → UpdateAdKeywordRequest.md} +2 -2
- data/lib/zernio-sdk/api/ad_campaigns_api.rb +358 -9
- data/lib/zernio-sdk/models/{list_ad_keywords200_response_keywords_inner.rb → ad_keyword.rb} +28 -8
- data/lib/zernio-sdk/models/ad_keyword_metrics.rb +207 -0
- data/lib/zernio-sdk/models/add_ad_keywords201_response.rb +149 -0
- data/lib/zernio-sdk/models/add_ad_keywords_request.rb +250 -0
- data/lib/zernio-sdk/models/add_ad_keywords_request_keywords_inner.rb +103 -0
- data/lib/zernio-sdk/models/add_ad_keywords_request_keywords_inner_any_of.rb +225 -0
- data/lib/zernio-sdk/models/create_standalone_ad_request.rb +55 -5
- data/lib/zernio-sdk/models/keyword_entry.rb +105 -0
- data/lib/zernio-sdk/models/list_ad_keywords200_response.rb +1 -1
- data/lib/zernio-sdk/models/list_campaign_negative_keywords200_response.rb +149 -0
- data/lib/zernio-sdk/models/list_campaign_negative_keywords200_response_keywords_inner.rb +199 -0
- data/lib/zernio-sdk/models/remove_ad_keyword200_response.rb +157 -0
- data/lib/zernio-sdk/models/replace_campaign_negative_keywords200_response.rb +170 -0
- data/lib/zernio-sdk/models/replace_campaign_negative_keywords_request.rb +219 -0
- data/lib/zernio-sdk/models/update_ad_keyword200_response.rb +147 -0
- data/lib/zernio-sdk/models/{update_ad_status_request.rb → update_ad_keyword_request.rb} +3 -3
- data/lib/zernio-sdk/version.rb +1 -1
- data/lib/zernio-sdk.rb +14 -2
- data/openapi.yaml +257 -21
- data/spec/api/ad_campaigns_api_spec.rb +64 -1
- data/spec/models/ad_keyword_metrics_spec.rb +72 -0
- data/spec/models/{list_ad_keywords200_response_keywords_inner_spec.rb → ad_keyword_spec.rb} +18 -6
- data/spec/models/add_ad_keywords201_response_spec.rb +36 -0
- data/spec/models/add_ad_keywords_request_keywords_inner_any_of_spec.rb +46 -0
- data/spec/models/add_ad_keywords_request_keywords_inner_spec.rb +21 -0
- data/spec/models/add_ad_keywords_request_spec.rb +54 -0
- data/spec/models/create_standalone_ad_request_spec.rb +6 -0
- data/spec/models/keyword_entry_spec.rb +32 -0
- data/spec/models/list_campaign_negative_keywords200_response_keywords_inner_spec.rb +52 -0
- data/spec/models/list_campaign_negative_keywords200_response_spec.rb +36 -0
- data/spec/models/remove_ad_keyword200_response_spec.rb +42 -0
- data/spec/models/replace_campaign_negative_keywords200_response_spec.rb +48 -0
- data/spec/models/replace_campaign_negative_keywords_request_spec.rb +46 -0
- data/spec/models/update_ad_keyword200_response_spec.rb +36 -0
- data/spec/models/{update_ad_status_request_spec.rb → update_ad_keyword_request_spec.rb} +6 -6
- data/zernio-sdk-0.0.857.gem +0 -0
- metadata +58 -10
- data/zernio-sdk-0.0.856.gem +0 -0
|
@@ -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'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 (`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.
|
|
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'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 `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.
|
|
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 `ad_group_criterion.status` 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 `_id` (hex), Meta `platformAdId` (numeric), or one of the creative's effective story/media IDs.
|
|
1923
|
-
# @param
|
|
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,
|
|
1927
|
-
data, _status_code, _headers = update_ad_status_with_http_info(ad_id,
|
|
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 `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.
|
|
1933
2282
|
# @param ad_id [String] Zernio `_id` (hex), Meta `platformAdId` (numeric), or one of the creative's effective story/media IDs.
|
|
1934
|
-
# @param
|
|
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,
|
|
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 '
|
|
1946
|
-
if @api_client.config.client_side_validation &&
|
|
1947
|
-
fail ArgumentError, "Missing the required parameter '
|
|
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(
|
|
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'
|
|
@@ -14,7 +14,7 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module Zernio
|
|
17
|
-
class
|
|
17
|
+
class AdKeyword < ApiModelBase
|
|
18
18
|
attr_accessor :id
|
|
19
19
|
|
|
20
20
|
# Social account ID owning the sync
|
|
@@ -48,8 +48,13 @@ module Zernio
|
|
|
48
48
|
|
|
49
49
|
attr_accessor :negative
|
|
50
50
|
|
|
51
|
+
# Google Quality Score, 1-10. Null when unrated.
|
|
52
|
+
attr_accessor :quality_score
|
|
53
|
+
|
|
51
54
|
attr_accessor :synced_at
|
|
52
55
|
|
|
56
|
+
attr_accessor :metrics
|
|
57
|
+
|
|
53
58
|
class EnumAttributeValidator
|
|
54
59
|
attr_reader :datatype
|
|
55
60
|
attr_reader :allowable_values
|
|
@@ -90,7 +95,9 @@ module Zernio
|
|
|
90
95
|
:'match_type' => :'matchType',
|
|
91
96
|
:'status' => :'status',
|
|
92
97
|
:'negative' => :'negative',
|
|
93
|
-
:'
|
|
98
|
+
:'quality_score' => :'qualityScore',
|
|
99
|
+
:'synced_at' => :'syncedAt',
|
|
100
|
+
:'metrics' => :'metrics'
|
|
94
101
|
}
|
|
95
102
|
end
|
|
96
103
|
|
|
@@ -122,7 +129,9 @@ module Zernio
|
|
|
122
129
|
:'match_type' => :'String',
|
|
123
130
|
:'status' => :'String',
|
|
124
131
|
:'negative' => :'Boolean',
|
|
125
|
-
:'
|
|
132
|
+
:'quality_score' => :'Integer',
|
|
133
|
+
:'synced_at' => :'Time',
|
|
134
|
+
:'metrics' => :'AdKeywordMetrics'
|
|
126
135
|
}
|
|
127
136
|
end
|
|
128
137
|
|
|
@@ -133,7 +142,8 @@ module Zernio
|
|
|
133
142
|
:'campaign_status',
|
|
134
143
|
:'ad_set_name',
|
|
135
144
|
:'ad_set_status',
|
|
136
|
-
:'
|
|
145
|
+
:'quality_score',
|
|
146
|
+
:'synced_at',
|
|
137
147
|
])
|
|
138
148
|
end
|
|
139
149
|
|
|
@@ -141,14 +151,14 @@ module Zernio
|
|
|
141
151
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
142
152
|
def initialize(attributes = {})
|
|
143
153
|
if (!attributes.is_a?(Hash))
|
|
144
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::
|
|
154
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::AdKeyword` initialize method"
|
|
145
155
|
end
|
|
146
156
|
|
|
147
157
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
148
158
|
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
149
159
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
150
160
|
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
151
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::
|
|
161
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::AdKeyword`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
152
162
|
end
|
|
153
163
|
h[k.to_sym] = v
|
|
154
164
|
}
|
|
@@ -213,9 +223,17 @@ module Zernio
|
|
|
213
223
|
self.negative = attributes[:'negative']
|
|
214
224
|
end
|
|
215
225
|
|
|
226
|
+
if attributes.key?(:'quality_score')
|
|
227
|
+
self.quality_score = attributes[:'quality_score']
|
|
228
|
+
end
|
|
229
|
+
|
|
216
230
|
if attributes.key?(:'synced_at')
|
|
217
231
|
self.synced_at = attributes[:'synced_at']
|
|
218
232
|
end
|
|
233
|
+
|
|
234
|
+
if attributes.key?(:'metrics')
|
|
235
|
+
self.metrics = attributes[:'metrics']
|
|
236
|
+
end
|
|
219
237
|
end
|
|
220
238
|
|
|
221
239
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -289,7 +307,9 @@ module Zernio
|
|
|
289
307
|
match_type == o.match_type &&
|
|
290
308
|
status == o.status &&
|
|
291
309
|
negative == o.negative &&
|
|
292
|
-
|
|
310
|
+
quality_score == o.quality_score &&
|
|
311
|
+
synced_at == o.synced_at &&
|
|
312
|
+
metrics == o.metrics
|
|
293
313
|
end
|
|
294
314
|
|
|
295
315
|
# @see the `==` method
|
|
@@ -301,7 +321,7 @@ module Zernio
|
|
|
301
321
|
# Calculates hash code according to all attributes.
|
|
302
322
|
# @return [Integer] Hash code
|
|
303
323
|
def hash
|
|
304
|
-
[id, account_id, profile_id, platform, ad_account_id, campaign_id, campaign_name, campaign_status, ad_set_id, ad_set_name, ad_set_status, keyword, match_type, status, negative, synced_at].hash
|
|
324
|
+
[id, account_id, profile_id, platform, ad_account_id, campaign_id, campaign_name, campaign_status, ad_set_id, ad_set_name, ad_set_status, keyword, match_type, status, negative, quality_score, synced_at, metrics].hash
|
|
305
325
|
end
|
|
306
326
|
|
|
307
327
|
# Builds the object from hash
|