Class: ConstantContactClient::ContactTagsApi
- Inherits:
-
Object
- Object
- ConstantContactClient::ContactTagsApi
- Defined in:
- lib/constant_contact_client/api/contact_tags_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#delete_tag(tag_id, opts = {}) ⇒ DeleteTag202Response
DELETE a Tag Use this method to create an activity used to un-assign a tag from all assigned contacts and delete the tag.
-
#delete_tag_with_http_info(tag_id, opts = {}) ⇒ Array<(DeleteTag202Response, Integer, Hash)>
DELETE a Tag Use this method to create an activity used to un-assign a tag from all assigned contacts and delete the tag.
-
#get_all_tags(opts = {}) ⇒ GetAllTags200Response
GET Details for All Tags Use this endpoint to get details for all tags in your account.
-
#get_all_tags_with_http_info(opts = {}) ⇒ Array<(GetAllTags200Response, Integer, Hash)>
GET Details for All Tags Use this endpoint to get details for all tags in your account.
-
#get_tag(tag_id, opts = {}) ⇒ GetTag200Response
GET Tag Details Use this method to get tag details for a specified ‘tag_id`.
-
#get_tag_with_http_info(tag_id, opts = {}) ⇒ Array<(GetTag200Response, Integer, Hash)>
GET Tag Details Use this method to get tag details for a specified `tag_id`.
-
#initialize(api_client = ApiClient.default) ⇒ ContactTagsApi
constructor
A new instance of ContactTagsApi.
-
#post_tag(post_tag_request, opts = {}) ⇒ GetTag200Response
POST (Create) a Tag Use this method to create a new tag.
-
#post_tag_with_http_info(post_tag_request, opts = {}) ⇒ Array<(GetTag200Response, Integer, Hash)>
POST (Create) a Tag Use this method to create a new tag.
-
#put_tag(tag_id, put_tag_request, opts = {}) ⇒ GetTag200Response
PUT (Update) a Tag Use this method to rename an existing tag to a new unique tag name (‘name`).
-
#put_tag_with_http_info(tag_id, put_tag_request, opts = {}) ⇒ Array<(GetTag200Response, Integer, Hash)>
PUT (Update) a Tag Use this method to rename an existing tag to a new unique tag name (`name`).
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ ContactTagsApi
Returns a new instance of ContactTagsApi.
19 20 21 |
# File 'lib/constant_contact_client/api/contact_tags_api.rb', line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/constant_contact_client/api/contact_tags_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#delete_tag(tag_id, opts = {}) ⇒ DeleteTag202Response
DELETE a Tag Use this method to create an activity used to un-assign a tag from all assigned contacts and delete the tag. This is an asynchronous activity. To view activity details for the delete request, use the href link returned in the response. [Learn more](/api_guide/tags_delete.html).
27 28 29 30 |
# File 'lib/constant_contact_client/api/contact_tags_api.rb', line 27 def delete_tag(tag_id, opts = {}) data, _status_code, _headers = delete_tag_with_http_info(tag_id, opts) data end |
#delete_tag_with_http_info(tag_id, opts = {}) ⇒ Array<(DeleteTag202Response, Integer, Hash)>
DELETE a Tag Use this method to create an activity used to un-assign a tag from all assigned contacts and delete the tag. This is an asynchronous activity. To view activity details for the delete request, use the href link returned in the response. [Learn more](/api_guide/tags_delete.html).
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/constant_contact_client/api/contact_tags_api.rb', line 37 def delete_tag_with_http_info(tag_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ContactTagsApi.delete_tag ...' end # verify the required parameter 'tag_id' is set if @api_client.config.client_side_validation && tag_id.nil? fail ArgumentError, "Missing the required parameter 'tag_id' when calling ContactTagsApi.delete_tag" end # resource path local_var_path = '/contact_tags/{tag_id}'.sub('{' + 'tag_id' + '}', CGI.escape(tag_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'DeleteTag202Response' # auth_names auth_names = opts[:debug_auth_names] || ['oauth2_access_code', 'oauth2_implicit'] = opts.merge( :operation => :"ContactTagsApi.delete_tag", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: ContactTagsApi#delete_tag\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_all_tags(opts = {}) ⇒ GetAllTags200Response
GET Details for All Tags Use this endpoint to get details for all tags in your account. Use the include_count
query parameter to include the total number of contacts assigned each tag. Use the limit
query parameter to limit the number of tag results returned per page. To get the next page of results, copy the cursor={the cursor ID}
from the resulting href link and add it (&
) to the URL. For example: <p>/v3/contact_tags?limit=1&cursor=
</p><p>bGltaXQ9MSZuZXh0PTJjZDgwMjdhLTc4YzAtMTFlOS1iZmQwLWZhMTYzZTZiMDFjMQ=
</p> To learn more, see [Get Tags](/api_guide/tags_get.html).
91 92 93 94 |
# File 'lib/constant_contact_client/api/contact_tags_api.rb', line 91 def (opts = {}) data, _status_code, _headers = (opts) data end |
#get_all_tags_with_http_info(opts = {}) ⇒ Array<(GetAllTags200Response, Integer, Hash)>
GET Details for All Tags Use this endpoint to get details for all tags in your account. Use the <code>include_count</code> query parameter to include the total number of contacts assigned each tag. Use the <code>limit</code> query parameter to limit the number of tag results returned per page. To get the next page of results, copy the <code>cursor=cursor ID</code> from the resulting href link and add it (<code>&</code>) to the URL. For example: <p><code>/v3/contact_tags?limit=1&cursor=</code></p><p><code>bGltaXQ9MSZuZXh0PTJjZDgwMjdhLTc4YzAtMTFlOS1iZmQwLWZhMTYzZTZiMDFjMQ=</code></p> To learn more, see [Get Tags](/api_guide/tags_get.html).
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 |
# File 'lib/constant_contact_client/api/contact_tags_api.rb', line 102 def (opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ContactTagsApi.get_all_tags ...' end # resource path local_var_path = '/contact_tags' # query parameters query_params = opts[:query_params] || {} query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'include_count'] = opts[:'include_count'] if !opts[:'include_count'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'GetAllTags200Response' # auth_names auth_names = opts[:debug_auth_names] || ['oauth2_access_code', 'oauth2_implicit'] = opts.merge( :operation => :"ContactTagsApi.get_all_tags", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: ContactTagsApi#get_all_tags\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_tag(tag_id, opts = {}) ⇒ GetTag200Response
GET Tag Details Use this method to get tag details for a specified ‘tag_id`. Use the `include_count` query parameter to include or exclude the total number of contacts to which this tag is assigned. To learn more, see [Get a Tag’s Details](/api_guide/tags_get_single.html).
154 155 156 157 |
# File 'lib/constant_contact_client/api/contact_tags_api.rb', line 154 def get_tag(tag_id, opts = {}) data, _status_code, _headers = get_tag_with_http_info(tag_id, opts) data end |
#get_tag_with_http_info(tag_id, opts = {}) ⇒ Array<(GetTag200Response, Integer, Hash)>
GET Tag Details Use this method to get tag details for a specified `tag_id`. Use the `include_count` query parameter to include or exclude the total number of contacts to which this tag is assigned. To learn more, see [Get a Tag's Details](/api_guide/tags_get_single.html).
165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 |
# File 'lib/constant_contact_client/api/contact_tags_api.rb', line 165 def get_tag_with_http_info(tag_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ContactTagsApi.get_tag ...' end # verify the required parameter 'tag_id' is set if @api_client.config.client_side_validation && tag_id.nil? fail ArgumentError, "Missing the required parameter 'tag_id' when calling ContactTagsApi.get_tag" end # resource path local_var_path = '/contact_tags/{tag_id}'.sub('{' + 'tag_id' + '}', CGI.escape(tag_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'include_count'] = opts[:'include_count'] if !opts[:'include_count'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'GetTag200Response' # auth_names auth_names = opts[:debug_auth_names] || ['oauth2_access_code', 'oauth2_implicit'] = opts.merge( :operation => :"ContactTagsApi.get_tag", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: ContactTagsApi#get_tag\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#post_tag(post_tag_request, opts = {}) ⇒ GetTag200Response
POST (Create) a Tag Use this method to create a new tag. The tag ‘name` is required and must be unique and can include most common keyboard symbols. Optionally, when creating a new tag you can specify the source (`tag_source`) used to identify the contacts to tag in the request body. [Learn more](/api_guide/tags_create.html).
219 220 221 222 |
# File 'lib/constant_contact_client/api/contact_tags_api.rb', line 219 def post_tag(post_tag_request, opts = {}) data, _status_code, _headers = post_tag_with_http_info(post_tag_request, opts) data end |
#post_tag_with_http_info(post_tag_request, opts = {}) ⇒ Array<(GetTag200Response, Integer, Hash)>
POST (Create) a Tag Use this method to create a new tag. The tag `name` is required and must be unique and can include most common keyboard symbols. Optionally, when creating a new tag you can specify the source (`tag_source`) used to identify the contacts to tag in the request body. [Learn more](/api_guide/tags_create.html).
229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 |
# File 'lib/constant_contact_client/api/contact_tags_api.rb', line 229 def post_tag_with_http_info(post_tag_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ContactTagsApi.post_tag ...' end # verify the required parameter 'post_tag_request' is set if @api_client.config.client_side_validation && post_tag_request.nil? fail ArgumentError, "Missing the required parameter 'post_tag_request' when calling ContactTagsApi.post_tag" end # resource path local_var_path = '/contact_tags' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(post_tag_request) # return_type return_type = opts[:debug_return_type] || 'GetTag200Response' # auth_names auth_names = opts[:debug_auth_names] || ['oauth2_access_code', 'oauth2_implicit'] = opts.merge( :operation => :"ContactTagsApi.post_tag", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: ContactTagsApi#post_tag\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#put_tag(tag_id, put_tag_request, opts = {}) ⇒ GetTag200Response
PUT (Update) a Tag Use this method to rename an existing tag to a new unique tag name (‘name`). The maximum length is 255 characters. The `tag_source` value cannot be updated using this method. You can set the `tag_source` value using the `POST contact_tags method`. [Learn more](/api_guide/tags_update.html)
288 289 290 291 |
# File 'lib/constant_contact_client/api/contact_tags_api.rb', line 288 def put_tag(tag_id, put_tag_request, opts = {}) data, _status_code, _headers = put_tag_with_http_info(tag_id, put_tag_request, opts) data end |
#put_tag_with_http_info(tag_id, put_tag_request, opts = {}) ⇒ Array<(GetTag200Response, Integer, Hash)>
PUT (Update) a Tag Use this method to rename an existing tag to a new unique tag name (`name`). The maximum length is 255 characters. The `tag_source` value cannot be updated using this method. You can set the `tag_source` value using the `POST contact_tags method`. [Learn more](/api_guide/tags_update.html)
299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 |
# File 'lib/constant_contact_client/api/contact_tags_api.rb', line 299 def put_tag_with_http_info(tag_id, put_tag_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ContactTagsApi.put_tag ...' end # verify the required parameter 'tag_id' is set if @api_client.config.client_side_validation && tag_id.nil? fail ArgumentError, "Missing the required parameter 'tag_id' when calling ContactTagsApi.put_tag" end # verify the required parameter 'put_tag_request' is set if @api_client.config.client_side_validation && put_tag_request.nil? fail ArgumentError, "Missing the required parameter 'put_tag_request' when calling ContactTagsApi.put_tag" end # resource path local_var_path = '/contact_tags/{tag_id}'.sub('{' + 'tag_id' + '}', CGI.escape(tag_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(put_tag_request) # return_type return_type = opts[:debug_return_type] || 'GetTag200Response' # auth_names auth_names = opts[:debug_auth_names] || ['oauth2_access_code', 'oauth2_implicit'] = opts.merge( :operation => :"ContactTagsApi.put_tag", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:PUT, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: ContactTagsApi#put_tag\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |