lib/square/api/subscriptions_api.rb
# Lists all events for a specific subscription.
# In the current implementation, only `START_SUBSCRIPTION` and
# `STOP_SUBSCRIPTION` (when the subscription was canceled) events are
# returned.
# @param [String] subscription_id Required parameter: The ID of the
# subscription to retrieve the events for.
# @param [String] cursor Optional parameter: When the total number of
# resulting subscription events exceeds the limit of a paged response, 
# specify the cursor returned from a preceding response here to fetch the
# next set of results. If the cursor is unset, the response contains the
# last page of the results.  For more information, see
# [Pagination](https://developer.squareup.com/docs/working-with-apis/paginat
# ion).
# @param [Integer] limit Optional parameter: The upper limit on the number
# of subscription events to return in a paged response.
# @return [ListSubscriptionEventsResponse Hash] response from the API call
Lists all events for a specific subscription.
In the current implementation, only `START_SUBSCRIPTION` and
`STOP_SUBSCRIPTION` (when the subscription was canceled) events are
returned.
Lists all events for a specific subscription . In the current implementation only ` START_SUBSCRIPTION ` and ` STOP_SUBSCRIPTION ` ( when the subscription was canceled ) events are returned .
def list_subscription_events(subscription_id:,
                                 cursor: nil,
                                 limit: nil)
      _query_builder = config.get_base_uri
      _query_builder << '/v2/subscriptions/{subscription_id}/events'
      _query_builder = APIHelper.append_url_with_template_parameters(
        _query_builder,
        'subscription_id' => { 'value' => subscription_id, 'encode' => true }
      )
      _query_builder = APIHelper.append_url_with_query_parameters(
        _query_builder,
        'cursor' => cursor,
        'limit' => limit
      )
      _query_url = APIHelper.clean_url _query_builder
      _headers = {
        'accept' => 'application/json'
      }
      _request = config.http_client.get(
        _query_url,
        headers: _headers
      )
      OAuth2.apply(config, _request)
      _response = execute_request(_request)
      decoded = APIHelper.json_deserialize(_response.raw_body)
      _errors = APIHelper.map_response(decoded, ['errors'])
      ApiResponse.new(
        _response, data: decoded, errors: _errors
      )
    end
def list_subscription_events ( subscription_id : , cursor : nil , limit : nil ) _query_builder = config . get_base_uri _query_builder << '/v2/subscriptions/{subscription_id}/events' _query_builder = APIHelper . append_url_with_template_parameters ( _query_builder , 'subscription_id' => { 'value' => subscription_id , 'encode' => true } ) _query_builder = APIHelper . append_url_with_query_parameters ( _query_builder , 'cursor' => cursor , 'limit' => limit ) _query_url = APIHelper . clean_url _query_builder _headers = { 'accept' => 'application/json' } _request = config . http_client . get ( _query_url , headers : _headers ) OAuth2 . apply ( config , _request ) _response = execute_request ( _request ) decoded = APIHelper . json_deserialize ( _response . raw_body ) _errors = APIHelper . map_response ( decoded , [ 'errors' ] ) ApiResponse . new ( _response , data : decoded , errors : _errors ) end
Lists all events for a specific subscription.
Lists all events for a specific subscription .
# Prepare query url. # Prepare headers. # Prepare and execute HttpRequest. # Return appropriate response type.
response from the API call
response from the API call
ListSubscriptionEventsResponse Hash
subscription_id
<not_specific>
cursor
<not_specific>
limit
<not_specific>
<not_specific>
limit Optional parameter: The upper limit on the number of subscription events to return in a paged response.
limit Optional parameter : The upper limit on the number of subscription events to return in a paged response .