Class: Hubspot::Crm::Timeline::TokensApi
- Inherits:
-
Object
- Object
- Hubspot::Crm::Timeline::TokensApi
- Defined in:
- lib/hubspot/codegen/crm/timeline/api/tokens_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#archive_event_template_token(event_template_id, token_name, app_id, opts = {}) ⇒ nil
Removes a token from the event template This will remove the token from an existing template.
-
#archive_event_template_token_with_http_info(event_template_id, token_name, app_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Removes a token from the event template This will remove the token from an existing template.
-
#create_event_template_token(event_template_id, app_id, opts = {}) ⇒ TimelineEventTemplateToken
Adds a token to an existing event template Once you’ve defined an event template, it’s likely that you’ll want to define tokens for it as well.
-
#create_event_template_token_with_http_info(event_template_id, app_id, opts = {}) ⇒ Array<(TimelineEventTemplateToken, Integer, Hash)>
Adds a token to an existing event template Once you've defined an event template, it's likely that you'll want to define tokens for it as well.
-
#initialize(api_client = ApiClient.default) ⇒ TokensApi
constructor
A new instance of TokensApi.
-
#update_event_template_token(event_template_id, token_name, app_id, opts = {}) ⇒ TimelineEventTemplateToken
Updates an existing token on an event template This will update the existing token on an event template.
-
#update_event_template_token_with_http_info(event_template_id, token_name, app_id, opts = {}) ⇒ Array<(TimelineEventTemplateToken, Integer, Hash)>
Updates an existing token on an event template This will update the existing token on an event template.
Constructor Details
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
19 20 21 |
# File 'lib/hubspot/codegen/crm/timeline/api/tokens_api.rb', line 19 def api_client @api_client end |
Instance Method Details
#archive_event_template_token(event_template_id, token_name, app_id, opts = {}) ⇒ nil
Removes a token from the event template This will remove the token from an existing template. Existing events and CRM objects will still retain the token and its mapped object properties, but new ones will not. The timeline will still display this property for older CRM objects if it’s still referenced in the template ‘Markdown`. New events will not. Any lists or reports referencing deleted tokens will no longer return new contacts, but old ones will still exist in the lists.
31 32 33 34 |
# File 'lib/hubspot/codegen/crm/timeline/api/tokens_api.rb', line 31 def archive_event_template_token(event_template_id, token_name, app_id, opts = {}) archive_event_template_token_with_http_info(event_template_id, token_name, app_id, opts) nil end |
#archive_event_template_token_with_http_info(event_template_id, token_name, app_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Removes a token from the event template This will remove the token from an existing template. Existing events and CRM objects will still retain the token and its mapped object properties, but new ones will not. The timeline will still display this property for older CRM objects if it's still referenced in the template `Markdown`. New events will not. Any lists or reports referencing deleted tokens will no longer return new contacts, but old ones will still exist in the lists.
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 |
# File 'lib/hubspot/codegen/crm/timeline/api/tokens_api.rb', line 43 def archive_event_template_token_with_http_info(event_template_id, token_name, app_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TokensApi.archive_event_template_token ...' end # verify the required parameter 'event_template_id' is set if @api_client.config.client_side_validation && event_template_id.nil? fail ArgumentError, "Missing the required parameter 'event_template_id' when calling TokensApi.archive_event_template_token" end # verify the required parameter 'token_name' is set if @api_client.config.client_side_validation && token_name.nil? fail ArgumentError, "Missing the required parameter 'token_name' when calling TokensApi.archive_event_template_token" end # verify the required parameter 'app_id' is set if @api_client.config.client_side_validation && app_id.nil? fail ArgumentError, "Missing the required parameter 'app_id' when calling TokensApi.archive_event_template_token" end # resource path local_var_path = '/crm/v3/timeline/{appId}/event-templates/{eventTemplateId}/tokens/{tokenName}'.sub('{' + 'eventTemplateId' + '}', CGI.escape(event_template_id.to_s)).sub('{' + 'tokenName' + '}', CGI.escape(token_name.to_s)).sub('{' + 'appId' + '}', CGI.escape(app_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(['*/*']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] # auth_names auth_names = opts[:auth_names] || ['hapikey', 'oauth2'] = opts.merge( :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: TokensApi#archive_event_template_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#create_event_template_token(event_template_id, app_id, opts = {}) ⇒ TimelineEventTemplateToken
Adds a token to an existing event template Once you’ve defined an event template, it’s likely that you’ll want to define tokens for it as well. You can do this on the event template itself or update individual tokens here. Event type tokens allow you to attach custom data to events displayed in a timeline or used for list segmentation. You can also use ‘objectPropertyName` to associate any CRM object properties. This will allow you to fully build out CRM objects. Token names should be unique across the template.
105 106 107 108 |
# File 'lib/hubspot/codegen/crm/timeline/api/tokens_api.rb', line 105 def create_event_template_token(event_template_id, app_id, opts = {}) data, _status_code, _headers = create_event_template_token_with_http_info(event_template_id, app_id, opts) data end |
#create_event_template_token_with_http_info(event_template_id, app_id, opts = {}) ⇒ Array<(TimelineEventTemplateToken, Integer, Hash)>
Adds a token to an existing event template Once you've defined an event template, it's likely that you'll want to define tokens for it as well. You can do this on the event template itself or update individual tokens here. Event type tokens allow you to attach custom data to events displayed in a timeline or used for list segmentation. You can also use `objectPropertyName` to associate any CRM object properties. This will allow you to fully build out CRM objects. Token names should be unique across the template.
117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 |
# File 'lib/hubspot/codegen/crm/timeline/api/tokens_api.rb', line 117 def create_event_template_token_with_http_info(event_template_id, app_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TokensApi.create_event_template_token ...' end # verify the required parameter 'event_template_id' is set if @api_client.config.client_side_validation && event_template_id.nil? fail ArgumentError, "Missing the required parameter 'event_template_id' when calling TokensApi.create_event_template_token" end # verify the required parameter 'app_id' is set if @api_client.config.client_side_validation && app_id.nil? fail ArgumentError, "Missing the required parameter 'app_id' when calling TokensApi.create_event_template_token" end # resource path local_var_path = '/crm/v3/timeline/{appId}/event-templates/{eventTemplateId}/tokens'.sub('{' + 'eventTemplateId' + '}', CGI.escape(event_template_id.to_s)).sub('{' + 'appId' + '}', CGI.escape(app_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' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(opts[:'timeline_event_template_token']) # return_type return_type = opts[:return_type] || 'TimelineEventTemplateToken' # auth_names auth_names = opts[:auth_names] || ['hapikey', 'oauth2'] = opts.merge( :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: TokensApi#create_event_template_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#update_event_template_token(event_template_id, token_name, app_id, opts = {}) ⇒ TimelineEventTemplateToken
Updates an existing token on an event template This will update the existing token on an event template. Name and type can’t be changed on existing tokens.
178 179 180 181 |
# File 'lib/hubspot/codegen/crm/timeline/api/tokens_api.rb', line 178 def update_event_template_token(event_template_id, token_name, app_id, opts = {}) data, _status_code, _headers = update_event_template_token_with_http_info(event_template_id, token_name, app_id, opts) data end |
#update_event_template_token_with_http_info(event_template_id, token_name, app_id, opts = {}) ⇒ Array<(TimelineEventTemplateToken, Integer, Hash)>
Updates an existing token on an event template This will update the existing token on an event template. Name and type can't be changed on existing tokens.
191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 |
# File 'lib/hubspot/codegen/crm/timeline/api/tokens_api.rb', line 191 def update_event_template_token_with_http_info(event_template_id, token_name, app_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TokensApi.update_event_template_token ...' end # verify the required parameter 'event_template_id' is set if @api_client.config.client_side_validation && event_template_id.nil? fail ArgumentError, "Missing the required parameter 'event_template_id' when calling TokensApi.update_event_template_token" end # verify the required parameter 'token_name' is set if @api_client.config.client_side_validation && token_name.nil? fail ArgumentError, "Missing the required parameter 'token_name' when calling TokensApi.update_event_template_token" end # verify the required parameter 'app_id' is set if @api_client.config.client_side_validation && app_id.nil? fail ArgumentError, "Missing the required parameter 'app_id' when calling TokensApi.update_event_template_token" end # resource path local_var_path = '/crm/v3/timeline/{appId}/event-templates/{eventTemplateId}/tokens/{tokenName}'.sub('{' + 'eventTemplateId' + '}', CGI.escape(event_template_id.to_s)).sub('{' + 'tokenName' + '}', CGI.escape(token_name.to_s)).sub('{' + 'appId' + '}', CGI.escape(app_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' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(opts[:'timeline_event_template_token_update_request']) # return_type return_type = opts[:return_type] || 'TimelineEventTemplateToken' # auth_names auth_names = opts[:auth_names] || ['hapikey', 'oauth2'] = opts.merge( :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: TokensApi#update_event_template_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |