Class: HubSpotSDK::Resources::Marketing::Transactional::SmtpTokens
- Inherits:
-
Object
- Object
- HubSpotSDK::Resources::Marketing::Transactional::SmtpTokens
- Defined in:
- lib/hubspot_sdk/resources/marketing/transactional/smtp_tokens.rb
Instance Method Summary collapse
-
#create(campaign_name:, create_contact:, request_options: {}) ⇒ HubSpotSDK::Models::Marketing::SmtpAPITokenView
Create a SMTP API token.
-
#delete(token_id, request_options: {}) ⇒ nil
Delete a single token by ID.
-
#get(token_id, request_options: {}) ⇒ HubSpotSDK::Models::Marketing::SmtpAPITokenView
Query a single token by ID.
-
#initialize(client:) ⇒ SmtpTokens
constructor
private
A new instance of SmtpTokens.
-
#list(after: nil, campaign_name: nil, email_campaign_id: nil, limit: nil, request_options: {}) ⇒ HubSpotSDK::Internal::Page<HubSpotSDK::Models::Marketing::SmtpAPITokenView>
Some parameter documentations has been truncated, see Models::Marketing::Transactional::SmtpTokenListParams for more details.
-
#reset_password(token_id, request_options: {}) ⇒ HubSpotSDK::Models::Marketing::SmtpAPITokenView
Allows the creation of a replacement password for a given token.
Constructor Details
#initialize(client:) ⇒ SmtpTokens
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of SmtpTokens.
131 132 133 |
# File 'lib/hubspot_sdk/resources/marketing/transactional/smtp_tokens.rb', line 131 def initialize(client:) @client = client end |
Instance Method Details
#create(campaign_name:, create_contact:, request_options: {}) ⇒ HubSpotSDK::Models::Marketing::SmtpAPITokenView
Create a SMTP API token.
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/hubspot_sdk/resources/marketing/transactional/smtp_tokens.rb', line 21 def create(params) parsed, = HubSpotSDK::Marketing::Transactional::SmtpTokenCreateParams.dump_request(params) @client.request( method: :post, path: "marketing/transactional/2026-03/smtp-tokens", body: parsed, model: HubSpotSDK::Marketing::SmtpAPITokenView, options: ) end |
#delete(token_id, request_options: {}) ⇒ nil
Delete a single token by ID.
80 81 82 83 84 85 86 87 |
# File 'lib/hubspot_sdk/resources/marketing/transactional/smtp_tokens.rb', line 80 def delete(token_id, params = {}) @client.request( method: :delete, path: ["marketing/transactional/2026-03/smtp-tokens/%1$s", token_id], model: NilClass, options: params[:request_options] ) end |
#get(token_id, request_options: {}) ⇒ HubSpotSDK::Models::Marketing::SmtpAPITokenView
Query a single token by ID.
99 100 101 102 103 104 105 106 |
# File 'lib/hubspot_sdk/resources/marketing/transactional/smtp_tokens.rb', line 99 def get(token_id, params = {}) @client.request( method: :get, path: ["marketing/transactional/2026-03/smtp-tokens/%1$s", token_id], model: HubSpotSDK::Marketing::SmtpAPITokenView, options: params[:request_options] ) end |
#list(after: nil, campaign_name: nil, email_campaign_id: nil, limit: nil, request_options: {}) ⇒ HubSpotSDK::Internal::Page<HubSpotSDK::Models::Marketing::SmtpAPITokenView>
Some parameter documentations has been truncated, see Models::Marketing::Transactional::SmtpTokenListParams for more details.
Query multiple SMTP API tokens by campaign name or a single token by emailCampaignId.
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/hubspot_sdk/resources/marketing/transactional/smtp_tokens.rb', line 54 def list(params = {}) parsed, = HubSpotSDK::Marketing::Transactional::SmtpTokenListParams.dump_request(params) query = HubSpotSDK::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "marketing/transactional/2026-03/smtp-tokens", query: query.transform_keys( campaign_name: "campaignName", email_campaign_id: "emailCampaignId" ), page: HubSpotSDK::Internal::Page, model: HubSpotSDK::Marketing::SmtpAPITokenView, options: ) end |
#reset_password(token_id, request_options: {}) ⇒ HubSpotSDK::Models::Marketing::SmtpAPITokenView
Allows the creation of a replacement password for a given token. Once the password is successfully reset, the old password for the token will be invalid.
119 120 121 122 123 124 125 126 |
# File 'lib/hubspot_sdk/resources/marketing/transactional/smtp_tokens.rb', line 119 def reset_password(token_id, params = {}) @client.request( method: :post, path: ["marketing/transactional/2026-03/smtp-tokens/%1$s/password-reset", token_id], model: HubSpotSDK::Marketing::SmtpAPITokenView, options: params[:request_options] ) end |