class Bfwd::CouponsApi

Attributes

api_client[RW]

Public Class Methods

new(api_client = ApiClient.default) click to toggle source
# File lib/bf_ruby2/api/coupons_api.rb, line 19
def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Public Instance Methods

create_coupon(code, opts = {}) click to toggle source

Create a coupon. {"nickname":"Create a new coupon","request":"createCouponRequest.html","response":"createCouponResponse.html"} @param code The coupon object to be created. @param [Hash] opts the optional parameters @return [CouponPagedMetadata]

# File lib/bf_ruby2/api/coupons_api.rb, line 28
def create_coupon(code, opts = {})
  data, _status_code, _headers = create_coupon_with_http_info(code, opts)
  return data
end
create_coupon_unique_codes(code, opts = {}) click to toggle source

Create a list of unique coupon codes that can be applied to a subscription. { "nickname":"Create unique coupon codes","request":"createUniqueCodesRequest.html","response":"createUniqueCodesResponse.html"} @param code The coupon code to use in the generation of the unique codes. @param [Hash] opts the optional parameters @option opts [CouponUniqueCodesRequest] :request The request object that specifies the number of codes to be created. @return [CouponUniqueCodesResponsePagedMetadata]

# File lib/bf_ruby2/api/coupons_api.rb, line 84
def create_coupon_unique_codes(code, opts = {})
  data, _status_code, _headers = create_coupon_unique_codes_with_http_info(code, opts)
  return data
end
create_coupon_unique_codes_with_http_info(code, opts = {}) click to toggle source

Create a list of unique coupon codes that can be applied to a subscription. { "nickname&quot;:&quot;Create unique coupon codes&quot;,&quot;request&quot;:&quot;createUniqueCodesRequest.html&quot;,&quot;response&quot;:&quot;createUniqueCodesResponse.html&quot;} @param code The coupon code to use in the generation of the unique codes. @param [Hash] opts the optional parameters @option opts [CouponUniqueCodesRequest] :request The request object that specifies the number of codes to be created. @return [Array<(CouponUniqueCodesResponsePagedMetadata, Fixnum, Hash)>] CouponUniqueCodesResponsePagedMetadata data, response status code and response headers

# File lib/bf_ruby2/api/coupons_api.rb, line 95
def create_coupon_unique_codes_with_http_info(code, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: CouponsApi.create_coupon_unique_codes ..."
  end
  # verify the required parameter 'code' is set
  if @api_client.config.client_side_validation && code.nil?
    fail ArgumentError, "Missing the required parameter 'code' when calling CouponsApi.create_coupon_unique_codes"
  end
  # resource path
  local_var_path = "/coupons/{code}/codes".sub('{' + 'code' + '}', code.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json; charset=utf-8'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json; charset=utf-8'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(opts[:'request'])
  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'CouponUniqueCodesResponsePagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CouponsApi#create_coupon_unique_codes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
create_coupon_with_http_info(code, opts = {}) click to toggle source

Create a coupon. {&quot;nickname&quot;:&quot;Create a new coupon&quot;,&quot;request&quot;:&quot;createCouponRequest.html&quot;,&quot;response&quot;:&quot;createCouponResponse.html&quot;} @param code The coupon object to be created. @param [Hash] opts the optional parameters @return [Array<(CouponPagedMetadata, Fixnum, Hash)>] CouponPagedMetadata data, response status code and response headers

# File lib/bf_ruby2/api/coupons_api.rb, line 38
def create_coupon_with_http_info(code, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: CouponsApi.create_coupon ..."
  end
  # verify the required parameter 'code' is set
  if @api_client.config.client_side_validation && code.nil?
    fail ArgumentError, "Missing the required parameter 'code' when calling CouponsApi.create_coupon"
  end
  # resource path
  local_var_path = "/coupons"

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json; charset=utf-8'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json; charset=utf-8'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(code)
  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'CouponPagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CouponsApi#create_coupon\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_all_coupons(opts = {}) click to toggle source

Returns a collection of all coupons. By default 10 values are returned. Records are returned in natural order. { "nickname":"Retrieve all coupons","response":"getCouponAll.html"} @param [Hash] opts the optional parameters @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls. @option opts [Integer] :offset The offset from the first subscription to return. (default to 0) @option opts [Integer] :records The maximum number of subscriptions to return. (default to 10) @option opts [String] :order_by Specify a field used to order the result set. (default to created) @option opts [String] :order Ihe direction of any ordering, either ASC or DESC. (default to DESC) @option opts [BOOLEAN] :include_retired Whether retired subscriptions should be returned. (default to false) @return [CouponPagedMetadata]

# File lib/bf_ruby2/api/coupons_api.rb, line 145
def get_all_coupons(opts = {})
  data, _status_code, _headers = get_all_coupons_with_http_info(opts)
  return data
end
get_all_coupons_with_http_info(opts = {}) click to toggle source

Returns a collection of all coupons. By default 10 values are returned. Records are returned in natural order. { "nickname&quot;:&quot;Retrieve all coupons&quot;,&quot;response&quot;:&quot;getCouponAll.html&quot;} @param [Hash] opts the optional parameters @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls. @option opts [Integer] :offset The offset from the first subscription to return. @option opts [Integer] :records The maximum number of subscriptions to return. @option opts [String] :order_by Specify a field used to order the result set. @option opts [String] :order Ihe direction of any ordering, either ASC or DESC. @option opts [BOOLEAN] :include_retired Whether retired subscriptions should be returned. @return [Array<(CouponPagedMetadata, Fixnum, Hash)>] CouponPagedMetadata data, response status code and response headers

# File lib/bf_ruby2/api/coupons_api.rb, line 160
def get_all_coupons_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: CouponsApi.get_all_coupons ..."
  end
  if @api_client.config.client_side_validation && opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order'])
    fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC'
  end
  # resource path
  local_var_path = "/coupons"

  # query parameters
  query_params = {}
  query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'records'] = opts[:'records'] if !opts[:'records'].nil?
  query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?
  query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
  query_params[:'include_retired'] = opts[:'include_retired'] if !opts[:'include_retired'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json; charset=utf-8'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'CouponPagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CouponsApi#get_all_coupons\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_applied_coupons(code, opts = {}) click to toggle source

Returns a list of unique coupons which have been applied. { "nickname":"Retrieve used unique coupons","response":"getAppliedCodesForCode.html"} @param code The base code to use in the generation of the unique codes. @param [Hash] opts the optional parameters @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls. @option opts [Integer] :offset The offset from the first subscription to return. (default to 0) @option opts [Integer] :records The maximum number of subscriptions to return. (default to 10) @option opts [String] :order_by Specify a field used to order the result set. (default to created) @option opts [String] :order Ihe direction of any ordering, either ASC or DESC. (default to DESC) @option opts [BOOLEAN] :include_retired Whether retired subscriptions should be returned. (default to false) @return [CouponPagedMetadata]

# File lib/bf_ruby2/api/coupons_api.rb, line 214
def get_applied_coupons(code, opts = {})
  data, _status_code, _headers = get_applied_coupons_with_http_info(code, opts)
  return data
end
get_applied_coupons_with_http_info(code, opts = {}) click to toggle source

Returns a list of unique coupons which have been applied. { "nickname&quot;:&quot;Retrieve used unique coupons&quot;,&quot;response&quot;:&quot;getAppliedCodesForCode.html&quot;} @param code The base code to use in the generation of the unique codes. @param [Hash] opts the optional parameters @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls. @option opts [Integer] :offset The offset from the first subscription to return. @option opts [Integer] :records The maximum number of subscriptions to return. @option opts [String] :order_by Specify a field used to order the result set. @option opts [String] :order Ihe direction of any ordering, either ASC or DESC. @option opts [BOOLEAN] :include_retired Whether retired subscriptions should be returned. @return [Array<(CouponPagedMetadata, Fixnum, Hash)>] CouponPagedMetadata data, response status code and response headers

# File lib/bf_ruby2/api/coupons_api.rb, line 230
def get_applied_coupons_with_http_info(code, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: CouponsApi.get_applied_coupons ..."
  end
  # verify the required parameter 'code' is set
  if @api_client.config.client_side_validation && code.nil?
    fail ArgumentError, "Missing the required parameter 'code' when calling CouponsApi.get_applied_coupons"
  end
  if @api_client.config.client_side_validation && opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order'])
    fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC'
  end
  # resource path
  local_var_path = "/coupons/{code}/applied".sub('{' + 'code' + '}', code.to_s)

  # query parameters
  query_params = {}
  query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'records'] = opts[:'records'] if !opts[:'records'].nil?
  query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?
  query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
  query_params[:'include_retired'] = opts[:'include_retired'] if !opts[:'include_retired'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json; charset=utf-8'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['text/plain'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'CouponPagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CouponsApi#get_applied_coupons\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_available_coupon_codes_for_code(code, opts = {}) click to toggle source

Returns a list of available unique coupon codes for the specified parent coupon code that can be applied to a subscription. { "nickname":"Retrieve unused unique coupons","response":"getAvailableCodesForCode.html"} @param code The base code to use in the generation of the unique codes. @param [Hash] opts the optional parameters @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls. @option opts [Integer] :offset The offset from the first subscription to return. (default to 0) @option opts [Integer] :records The maximum number of subscriptions to return. (default to 10) @option opts [String] :order_by Specify a field used to order the result set. (default to created) @option opts [String] :order Ihe direction of any ordering, either ASC or DESC. (default to DESC) @option opts [BOOLEAN] :include_retired Whether retired subscriptions should be returned. (default to false) @return [CouponUniqueCodesResponsePagedMetadata]

# File lib/bf_ruby2/api/coupons_api.rb, line 290
def get_available_coupon_codes_for_code(code, opts = {})
  data, _status_code, _headers = get_available_coupon_codes_for_code_with_http_info(code, opts)
  return data
end
get_available_coupon_codes_for_code_with_http_info(code, opts = {}) click to toggle source

Returns a list of available unique coupon codes for the specified parent coupon code that can be applied to a subscription. { "nickname&quot;:&quot;Retrieve unused unique coupons&quot;,&quot;response&quot;:&quot;getAvailableCodesForCode.html&quot;} @param code The base code to use in the generation of the unique codes. @param [Hash] opts the optional parameters @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls. @option opts [Integer] :offset The offset from the first subscription to return. @option opts [Integer] :records The maximum number of subscriptions to return. @option opts [String] :order_by Specify a field used to order the result set. @option opts [String] :order Ihe direction of any ordering, either ASC or DESC. @option opts [BOOLEAN] :include_retired Whether retired subscriptions should be returned. @return [Array<(CouponUniqueCodesResponsePagedMetadata, Fixnum, Hash)>] CouponUniqueCodesResponsePagedMetadata data, response status code and response headers

# File lib/bf_ruby2/api/coupons_api.rb, line 306
def get_available_coupon_codes_for_code_with_http_info(code, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: CouponsApi.get_available_coupon_codes_for_code ..."
  end
  # verify the required parameter 'code' is set
  if @api_client.config.client_side_validation && code.nil?
    fail ArgumentError, "Missing the required parameter 'code' when calling CouponsApi.get_available_coupon_codes_for_code"
  end
  if @api_client.config.client_side_validation && opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order'])
    fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC'
  end
  # resource path
  local_var_path = "/coupons/{code}/codes".sub('{' + 'code' + '}', code.to_s)

  # query parameters
  query_params = {}
  query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'records'] = opts[:'records'] if !opts[:'records'].nil?
  query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?
  query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
  query_params[:'include_retired'] = opts[:'include_retired'] if !opts[:'include_retired'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json; charset=utf-8'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['text/plain'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'CouponUniqueCodesResponsePagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CouponsApi#get_available_coupon_codes_for_code\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_coupon_code(code, opts = {}) click to toggle source

Returns the coupon for the specified code that can be applied to a subscription. { "nickname":"Retrieve coupon","response":"getCouponByCode.html"} @param code The parent coupon code to use in the generation of the unique codes. @param [Hash] opts the optional parameters @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls. @return [CouponUniqueCodesResponsePagedMetadata]

# File lib/bf_ruby2/api/coupons_api.rb, line 361
def get_coupon_code(code, opts = {})
  data, _status_code, _headers = get_coupon_code_with_http_info(code, opts)
  return data
end
get_coupon_code_with_http_info(code, opts = {}) click to toggle source

Returns the coupon for the specified code that can be applied to a subscription. { "nickname&quot;:&quot;Retrieve coupon&quot;,&quot;response&quot;:&quot;getCouponByCode.html&quot;} @param code The parent coupon code to use in the generation of the unique codes. @param [Hash] opts the optional parameters @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls. @return [Array<(CouponUniqueCodesResponsePagedMetadata, Fixnum, Hash)>] CouponUniqueCodesResponsePagedMetadata data, response status code and response headers

# File lib/bf_ruby2/api/coupons_api.rb, line 372
def get_coupon_code_with_http_info(code, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: CouponsApi.get_coupon_code ..."
  end
  # verify the required parameter 'code' is set
  if @api_client.config.client_side_validation && code.nil?
    fail ArgumentError, "Missing the required parameter 'code' when calling CouponsApi.get_coupon_code"
  end
  # resource path
  local_var_path = "/coupons/{code}".sub('{' + 'code' + '}', code.to_s)

  # query parameters
  query_params = {}
  query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json; charset=utf-8'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['text/plain'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'CouponUniqueCodesResponsePagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CouponsApi#get_coupon_code\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_subscription_applications_of_coupons(code, opts = {}) click to toggle source

Retrieves a collection of the coupons by this coupon code which have been applied. { "nickname":"Retrieve subscriptions to which the given coupon code has been applied.","response":"getSubscriptionApplications.html"} @param code Base code of the coupon. @param [Hash] opts the optional parameters @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls. @option opts [Integer] :offset The offset from the first subscription to return. (default to 0) @option opts [Integer] :records The maximum number of subscriptions to return. (default to 10) @option opts [String] :order_by Specify a field used to order the result set. (default to created) @option opts [String] :order Ihe direction of any ordering, either ASC or DESC. (default to DESC) @option opts [BOOLEAN] :include_retired Whether retired subscriptions should be returned. (default to false) @return [SubscriptionPagedMetadata]

# File lib/bf_ruby2/api/coupons_api.rb, line 424
def get_subscription_applications_of_coupons(code, opts = {})
  data, _status_code, _headers = get_subscription_applications_of_coupons_with_http_info(code, opts)
  return data
end
get_subscription_applications_of_coupons_with_http_info(code, opts = {}) click to toggle source

Retrieves a collection of the coupons by this coupon code which have been applied. { "nickname&quot;:&quot;Retrieve subscriptions to which the given coupon code has been applied.&quot;,&quot;response&quot;:&quot;getSubscriptionApplications.html&quot;} @param code Base code of the coupon. @param [Hash] opts the optional parameters @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls. @option opts [Integer] :offset The offset from the first subscription to return. @option opts [Integer] :records The maximum number of subscriptions to return. @option opts [String] :order_by Specify a field used to order the result set. @option opts [String] :order Ihe direction of any ordering, either ASC or DESC. @option opts [BOOLEAN] :include_retired Whether retired subscriptions should be returned. @return [Array<(SubscriptionPagedMetadata, Fixnum, Hash)>] SubscriptionPagedMetadata data, response status code and response headers

# File lib/bf_ruby2/api/coupons_api.rb, line 440
def get_subscription_applications_of_coupons_with_http_info(code, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: CouponsApi.get_subscription_applications_of_coupons ..."
  end
  # verify the required parameter 'code' is set
  if @api_client.config.client_side_validation && code.nil?
    fail ArgumentError, "Missing the required parameter 'code' when calling CouponsApi.get_subscription_applications_of_coupons"
  end
  if @api_client.config.client_side_validation && opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order'])
    fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC'
  end
  # resource path
  local_var_path = "/coupons/{code}/subscriptions".sub('{' + 'code' + '}', code.to_s)

  # query parameters
  query_params = {}
  query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'records'] = opts[:'records'] if !opts[:'records'].nil?
  query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?
  query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
  query_params[:'include_retired'] = opts[:'include_retired'] if !opts[:'include_retired'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json; charset=utf-8'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['text/plain'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'SubscriptionPagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CouponsApi#get_subscription_applications_of_coupons\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
retire_coupon(code, organizations, opts = {}) click to toggle source

<p>This method has 2 main behaviours depending on what is passed in. If the parent coupon code, for example SUMMER, is given no new coupons can be issued or claimed from this code. Deleting will result in the deleted property being set to true.</p><p>If a unique coupon code, for example SUMMER-AGH8, is given this will stop the coupon from being applied to the subscription from that point onwards. When a coupon is deleted the validUntil property is set which is the date/time it stopped applying to the target.</p> { "nickname":"Retire coupon","response":"retireCoupon.html"} @param code ID of the coupon to remove. @param organizations A list of organization-IDs used to restrict the scope of API calls. @param [Hash] opts the optional parameters @return [CouponPagedMetadata]

# File lib/bf_ruby2/api/coupons_api.rb, line 495
def retire_coupon(code, organizations, opts = {})
  data, _status_code, _headers = retire_coupon_with_http_info(code, organizations, opts)
  return data
end
retire_coupon_with_http_info(code, organizations, opts = {}) click to toggle source

&lt;p&gt;This method has 2 main behaviours depending on what is passed in. If the parent coupon code, for example SUMMER, is given no new coupons can be issued or claimed from this code. Deleting will result in the deleted property being set to true.&lt;/p&gt;&lt;p&gt;If a unique coupon code, for example SUMMER-AGH8, is given this will stop the coupon from being applied to the subscription from that point onwards. When a coupon is deleted the validUntil property is set which is the date/time it stopped applying to the target.&lt;/p&gt; { "nickname&quot;:&quot;Retire coupon&quot;,&quot;response&quot;:&quot;retireCoupon.html&quot;} @param code ID of the coupon to remove. @param organizations A list of organization-IDs used to restrict the scope of API calls. @param [Hash] opts the optional parameters @return [Array<(CouponPagedMetadata, Fixnum, Hash)>] CouponPagedMetadata data, response status code and response headers

# File lib/bf_ruby2/api/coupons_api.rb, line 506
def retire_coupon_with_http_info(code, organizations, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: CouponsApi.retire_coupon ..."
  end
  # verify the required parameter 'code' is set
  if @api_client.config.client_side_validation && code.nil?
    fail ArgumentError, "Missing the required parameter 'code' when calling CouponsApi.retire_coupon"
  end
  # verify the required parameter 'organizations' is set
  if @api_client.config.client_side_validation && organizations.nil?
    fail ArgumentError, "Missing the required parameter 'organizations' when calling CouponsApi.retire_coupon"
  end
  # resource path
  local_var_path = "/coupons/{code}".sub('{' + 'code' + '}', code.to_s)

  # query parameters
  query_params = {}
  query_params[:'organizations'] = @api_client.build_collection_param(organizations, :multi)

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json; charset=utf-8'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['text/plain'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'CouponPagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CouponsApi#retire_coupon\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end