|
| 1 | +# coding: utf-8 |
| 2 | + |
| 3 | +""" |
| 4 | + CyberSource Flex API |
| 5 | +
|
| 6 | + Simple PAN tokenization service |
| 7 | +
|
| 8 | + OpenAPI spec version: 0.0.1 |
| 9 | + |
| 10 | + Generated by: https://github.com/swagger-api/swagger-codegen.git |
| 11 | +""" |
| 12 | + |
| 13 | + |
| 14 | +from __future__ import absolute_import |
| 15 | + |
| 16 | +import sys |
| 17 | +import os |
| 18 | +import re |
| 19 | + |
| 20 | +# python 2 and python 3 compatibility library |
| 21 | +from six import iteritems |
| 22 | + |
| 23 | +from ..configuration import Configuration |
| 24 | +from ..api_client import ApiClient |
| 25 | + |
| 26 | + |
| 27 | +class ConversionDetailsApi(object): |
| 28 | + """ |
| 29 | + NOTE: This class is auto generated by the swagger code generator program. |
| 30 | + Do not edit the class manually. |
| 31 | + Ref: https://github.com/swagger-api/swagger-codegen |
| 32 | + """ |
| 33 | + |
| 34 | + def __init__(self, merchant_config, api_client=None): |
| 35 | + config = Configuration() |
| 36 | + if api_client: |
| 37 | + self.api_client = api_client |
| 38 | + else: |
| 39 | + if not config.api_client: |
| 40 | + config.api_client = ApiClient() |
| 41 | + self.api_client = config.api_client |
| 42 | + self.api_client.set_configuration(merchant_config) |
| 43 | + |
| 44 | + |
| 45 | + def get_conversion_detail(self, start_time, end_time, **kwargs): |
| 46 | + """ |
| 47 | + Get conversion detail transactions |
| 48 | + Get conversion detail of transactions for a merchant. |
| 49 | + This method makes a synchronous HTTP request by default. To make an |
| 50 | + asynchronous HTTP request, please define a `callback` function |
| 51 | + to be invoked when receiving the response. |
| 52 | + >>> def callback_function(response): |
| 53 | + >>> pprint(response) |
| 54 | + >>> |
| 55 | + >>> thread = api.get_conversion_detail(start_time, end_time, callback=callback_function) |
| 56 | +
|
| 57 | + :param callback function: The callback function |
| 58 | + for asynchronous request. (optional) |
| 59 | + :param datetime start_time: Valid report Start Time in **ISO 8601 format** Please refer the following link to know more about ISO 8601 format. - https://xml2rfc.tools.ietf.org/public/rfc/html/rfc3339.html#anchor14 **Example date format:** - yyyy-MM-dd'T'HH:mm:ssXXX (required) |
| 60 | + :param datetime end_time: Valid report End Time in **ISO 8601 format** Please refer the following link to know more about ISO 8601 format. - https://xml2rfc.tools.ietf.org/public/rfc/html/rfc3339.html#anchor14 **Example date format:** - yyyy-MM-dd'T'HH:mm:ssXXX (required) |
| 61 | + :param str organization_id: Valid Cybersource Organization Id |
| 62 | + :return: ReportingV3ConversionDetailsGet200Response |
| 63 | + If the method is called asynchronously, |
| 64 | + returns the request thread. |
| 65 | + """ |
| 66 | + kwargs['_return_http_data_only'] = True |
| 67 | + if kwargs.get('callback'): |
| 68 | + return self.get_conversion_detail_with_http_info(start_time, end_time, **kwargs) |
| 69 | + else: |
| 70 | + (data) = self.get_conversion_detail_with_http_info(start_time, end_time, **kwargs) |
| 71 | + return data |
| 72 | + |
| 73 | + def get_conversion_detail_with_http_info(self, start_time, end_time, **kwargs): |
| 74 | + """ |
| 75 | + Get conversion detail transactions |
| 76 | + Get conversion detail of transactions for a merchant. |
| 77 | + This method makes a synchronous HTTP request by default. To make an |
| 78 | + asynchronous HTTP request, please define a `callback` function |
| 79 | + to be invoked when receiving the response. |
| 80 | + >>> def callback_function(response): |
| 81 | + >>> pprint(response) |
| 82 | + >>> |
| 83 | + >>> thread = api.get_conversion_detail_with_http_info(start_time, end_time, callback=callback_function) |
| 84 | +
|
| 85 | + :param callback function: The callback function |
| 86 | + for asynchronous request. (optional) |
| 87 | + :param datetime start_time: Valid report Start Time in **ISO 8601 format** Please refer the following link to know more about ISO 8601 format. - https://xml2rfc.tools.ietf.org/public/rfc/html/rfc3339.html#anchor14 **Example date format:** - yyyy-MM-dd'T'HH:mm:ssXXX (required) |
| 88 | + :param datetime end_time: Valid report End Time in **ISO 8601 format** Please refer the following link to know more about ISO 8601 format. - https://xml2rfc.tools.ietf.org/public/rfc/html/rfc3339.html#anchor14 **Example date format:** - yyyy-MM-dd'T'HH:mm:ssXXX (required) |
| 89 | + :param str organization_id: Valid Cybersource Organization Id |
| 90 | + :return: ReportingV3ConversionDetailsGet200Response |
| 91 | + If the method is called asynchronously, |
| 92 | + returns the request thread. |
| 93 | + """ |
| 94 | + |
| 95 | + all_params = ['start_time', 'end_time', 'organization_id'] |
| 96 | + all_params.append('callback') |
| 97 | + all_params.append('_return_http_data_only') |
| 98 | + all_params.append('_preload_content') |
| 99 | + all_params.append('_request_timeout') |
| 100 | + |
| 101 | + params = locals() |
| 102 | + for key, val in iteritems(params['kwargs']): |
| 103 | + if key not in all_params: |
| 104 | + raise TypeError( |
| 105 | + "Got an unexpected keyword argument '%s'" |
| 106 | + " to method get_conversion_detail" % key |
| 107 | + ) |
| 108 | + params[key] = val |
| 109 | + del params['kwargs'] |
| 110 | + # verify the required parameter 'start_time' is set |
| 111 | + if ('start_time' not in params) or (params['start_time'] is None): |
| 112 | + raise ValueError("Missing the required parameter `start_time` when calling `get_conversion_detail`") |
| 113 | + # verify the required parameter 'end_time' is set |
| 114 | + if ('end_time' not in params) or (params['end_time'] is None): |
| 115 | + raise ValueError("Missing the required parameter `end_time` when calling `get_conversion_detail`") |
| 116 | + |
| 117 | + if 'organization_id' in params and len(params['organization_id']) > 32: |
| 118 | + raise ValueError("Invalid value for parameter `organization_id` when calling `get_conversion_detail`, length must be less than or equal to `32`") |
| 119 | + if 'organization_id' in params and len(params['organization_id']) < 1: |
| 120 | + raise ValueError("Invalid value for parameter `organization_id` when calling `get_conversion_detail`, length must be greater than or equal to `1`") |
| 121 | + if 'organization_id' in params and not re.search('[a-zA-Z0-9-_]+', params['organization_id']): |
| 122 | + raise ValueError("Invalid value for parameter `organization_id` when calling `get_conversion_detail`, must conform to the pattern `/[a-zA-Z0-9-_]+/`") |
| 123 | + |
| 124 | + collection_formats = {} |
| 125 | + |
| 126 | + path_params = {} |
| 127 | + |
| 128 | + query_params = [] |
| 129 | + if 'start_time' in params: |
| 130 | + query_params.append(('startTime', params['start_time'])) |
| 131 | + if 'end_time' in params: |
| 132 | + query_params.append(('endTime', params['end_time'])) |
| 133 | + if 'organization_id' in params: |
| 134 | + query_params.append(('organizationId', params['organization_id'])) |
| 135 | + |
| 136 | + header_params = {} |
| 137 | + |
| 138 | + form_params = [] |
| 139 | + local_var_files = {} |
| 140 | + |
| 141 | + body_params = None |
| 142 | + # HTTP header `Accept` |
| 143 | + header_params['Accept'] = self.api_client.\ |
| 144 | + select_header_accept(['application/hal+json']) |
| 145 | + |
| 146 | + # HTTP header `Content-Type` |
| 147 | + header_params['Content-Type'] = self.api_client.\ |
| 148 | + select_header_content_type(['application/json;charset=utf-8']) |
| 149 | + |
| 150 | + # Authentication setting |
| 151 | + auth_settings = [] |
| 152 | + |
| 153 | + return self.api_client.call_api('/reporting/v3/conversion-details', 'GET', |
| 154 | + path_params, |
| 155 | + query_params, |
| 156 | + header_params, |
| 157 | + body=body_params, |
| 158 | + post_params=form_params, |
| 159 | + files=local_var_files, |
| 160 | + response_type='ReportingV3ConversionDetailsGet200Response', |
| 161 | + auth_settings=auth_settings, |
| 162 | + callback=params.get('callback'), |
| 163 | + _return_http_data_only=params.get('_return_http_data_only'), |
| 164 | + _preload_content=params.get('_preload_content', True), |
| 165 | + _request_timeout=params.get('_request_timeout'), |
| 166 | + collection_formats=collection_formats) |
0 commit comments