Class: AmazonAds::MarketingStream

Inherits:
API
  • Object
show all
Defined in:
lib/amazon_ads/apis/marketing_stream.rb

Overview

Amazon Marketing Stream

Constant Summary

Constants inherited from API

API::ENDPOINTS

Instance Attribute Summary

Attributes inherited from API

#access_token, #account_id, #profile_id, #region, #retries

Instance Method Summary collapse

Methods inherited from API

#endpoint, #http, #initialize

Constructor Details

This class inherits a constructor from AmazonAds::API

Instance Method Details

#create_dsp_stream_subscription(client_request_token:, data_set_id:, destination: nil, destination_arn: nil, notes: nil) ⇒ Object

Create a new subscription Note: trailing slash in request uri is not allowed

Signature:

  • (client_request_token: String, data_set_id: String, ?destination: untyped?, ?destination_arn: String?, ?notes: String?) -> HTTP::Response

RBS:

  • client_request_token: String -- Unique value supplied by the caller used to track identical API requests. Should request be re-tried, the caller should supply the same value. We recommend using GUID.

  • data_set_id: String -- Identifier of data set, callers can be subscribed to. Please refer to https://advertising.amazon.com/API/docs/en-us/amazon-marketing-stream/data-guide for the list of all data sets.

  • destination_arn: String -- AWS ARN of the destination endpoint associated with the subscription. Supported destination types: - SQS

  • notes: String -- Additional details associated with the subscription



12
13
14
# File 'lib/amazon_ads/apis/marketing_stream.rb', line 12

def create_dsp_stream_subscription(client_request_token:, data_set_id:, destination: nil, destination_arn: nil, notes: nil)
  request(:post, "/dsp/streams/subscriptions", json: { "clientRequestToken" => client_request_token, "dataSetId" => data_set_id, "destination" => destination, "destinationArn" => destination_arn, "notes" => notes }.compact, headers: { "Content-Type" => "application/vnd.amazonmarketingstreamsubscriptions.v1+json", "Accept" => "application/vnd.amazonmarketingstreamsubscriptions.v1+json" })
end

#create_stream_subscription(client_request_token:, data_set_id:, destination: nil, destination_arn: nil, notes: nil) ⇒ Object

Create a new subscription Note: trailing slash in request uri is not allowed

Signature:

  • (client_request_token: String, data_set_id: String, ?destination: untyped?, ?destination_arn: String?, ?notes: String?) -> HTTP::Response

RBS:

  • client_request_token: String -- Unique value supplied by the caller used to track identical API requests. Should request be re-tried, the caller should supply the same value. We recommend using GUID.

  • data_set_id: String -- Identifier of data set, callers can be subscribed to. Please refer to https://advertising.amazon.com/API/docs/en-us/amazon-marketing-stream/data-guide for the list of all data sets.

  • destination_arn: String -- AWS ARN of the destination endpoint associated with the subscription. Supported destination types: - SQS

  • notes: String -- Additional details associated with the subscription



22
23
24
# File 'lib/amazon_ads/apis/marketing_stream.rb', line 22

def create_stream_subscription(client_request_token:, data_set_id:, destination: nil, destination_arn: nil, notes: nil)
  request(:post, "/streams/subscriptions", json: { "clientRequestToken" => client_request_token, "dataSetId" => data_set_id, "destination" => destination, "destinationArn" => destination_arn, "notes" => notes }.compact, headers: { "Content-Type" => "application/vnd.amazonmarketingstreamsubscriptions.v1+json", "Accept" => "application/vnd.amazonmarketingstreamsubscriptions.v1+json" })
end

#get_dsp_stream_subscription(subscription_id) ⇒ Object

Fetch a specific subscription by Id Note: trailing slash in request uri is not allowed

Signature:

  • (String) -> HTTP::Response

RBS:

  • subscription_id: String -- Unique subscription identifier



29
30
31
# File 'lib/amazon_ads/apis/marketing_stream.rb', line 29

def get_dsp_stream_subscription(subscription_id)
  request(:get, "/dsp/streams/subscriptions/#{subscription_id}")
end

#get_stream_subscription(subscription_id) ⇒ Object

Fetch a specific subscription by Id Note: trailing slash in request uri is not allowed

Signature:

  • (String) -> HTTP::Response

RBS:

  • subscription_id: String -- Unique subscription identifier



36
37
38
# File 'lib/amazon_ads/apis/marketing_stream.rb', line 36

def get_stream_subscription(subscription_id)
  request(:get, "/streams/subscriptions/#{subscription_id}")
end

#list_dsp_stream_subscriptions(max_results: nil, starting_token: nil) ⇒ Object

List subscriptions Note: trailing slash in request uri is not allowed

Signature:

  • (?max_results: Numeric?, ?starting_token: String?) -> HTTP::Response

RBS:

  • max_results: Numeric -- desired number of entries in the response, defaults to maximum value

  • starting_token: String -- Token which can be used to get the next page of results, if more entries exist



44
45
46
# File 'lib/amazon_ads/apis/marketing_stream.rb', line 44

def list_dsp_stream_subscriptions(max_results: nil, starting_token: nil)
  request(:get, "/dsp/streams/subscriptions", params: { "maxResults" => max_results, "startingToken" => starting_token }.compact)
end

#list_stream_subscriptions(max_results: nil, starting_token: nil) ⇒ Object

List subscriptions Note: trailing slash in request uri is not allowed

Signature:

  • (?max_results: Numeric?, ?starting_token: String?) -> HTTP::Response

RBS:

  • max_results: Numeric -- desired number of entries in the response, defaults to maximum value

  • starting_token: String -- Token which can be used to get the next page of results, if more entries exist



52
53
54
# File 'lib/amazon_ads/apis/marketing_stream.rb', line 52

def list_stream_subscriptions(max_results: nil, starting_token: nil)
  request(:get, "/streams/subscriptions", params: { "maxResults" => max_results, "startingToken" => starting_token }.compact)
end

#update_dsp_stream_subscription(subscription_id, notes: nil, status: nil) ⇒ Object

Update an existing subscription Note: trailing slash in request uri is not allowed

Signature:

  • (String, ?notes: String?, ?status: untyped?) -> HTTP::Response

RBS:

  • subscription_id: String -- Unique subscription identifier

  • notes: String -- Additional details associated with the subscription



60
61
62
# File 'lib/amazon_ads/apis/marketing_stream.rb', line 60

def update_dsp_stream_subscription(subscription_id, notes: nil, status: nil)
  request(:put, "/dsp/streams/subscriptions/#{subscription_id}", json: { "notes" => notes, "status" => status }.compact, headers: { "Content-Type" => "application/vnd.amazonmarketingstreamsubscriptions.v1+json", "Accept" => "application/vnd.amazonmarketingstreamsubscriptions.v1+json" })
end

#update_stream_subscription(subscription_id, notes: nil, status: nil) ⇒ Object

Update an existing subscription Note: trailing slash in request uri is not allowed

Signature:

  • (String, ?notes: String?, ?status: untyped?) -> HTTP::Response

RBS:

  • subscription_id: String -- Unique subscription identifier

  • notes: String -- Additional details associated with the subscription



68
69
70
# File 'lib/amazon_ads/apis/marketing_stream.rb', line 68

def update_stream_subscription(subscription_id, notes: nil, status: nil)
  request(:put, "/streams/subscriptions/#{subscription_id}", json: { "notes" => notes, "status" => status }.compact, headers: { "Content-Type" => "application/vnd.amazonmarketingstreamsubscriptions.v1+json", "Accept" => "application/vnd.amazonmarketingstreamsubscriptions.v1+json" })
end