Skip to content

Commit

Permalink
Merge pull request #91 from CyberSource/nov-22-release
Browse files Browse the repository at this point in the history
November-22 release updates
  • Loading branch information
gaubansa authored Dec 12, 2022
2 parents 3b6f3a9 + 54d62dc commit a087afe
Show file tree
Hide file tree
Showing 73 changed files with 4,749 additions and 364 deletions.
14 changes: 13 additions & 1 deletion CyberSource/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,18 @@
from .models.generate_public_key_request import GeneratePublicKeyRequest
from .models.generate_unified_checkout_capture_context_request import GenerateUnifiedCheckoutCaptureContextRequest
from .models.increment_auth_request import IncrementAuthRequest
from .models.inline_response_200 import InlineResponse200
from .models.inline_response_200_keys import InlineResponse200Keys
from .models.inline_response_400 import InlineResponse400
from .models.inline_response_400_1 import InlineResponse4001
from .models.inline_response_400_1_fields import InlineResponse4001Fields
from .models.inline_response_400_2 import InlineResponse4002
from .models.inline_response_400_3 import InlineResponse4003
from .models.inline_response_400_3_details import InlineResponse4003Details
from .models.inline_response_400_4 import InlineResponse4004
from .models.inline_response_400_4_details import InlineResponse4004Details
from .models.inline_response_400_details import InlineResponse400Details
from .models.inline_response_400_errors import InlineResponse400Errors
from .models.inline_response_500 import InlineResponse500
from .models.inline_response_502 import InlineResponse502
from .models.inline_response_default import InlineResponseDefault
from .models.inline_response_default__links import InlineResponseDefaultLinks
Expand Down Expand Up @@ -725,7 +729,11 @@
from .models.ums_v1_users_get200_response_contact_information import UmsV1UsersGet200ResponseContactInformation
from .models.ums_v1_users_get200_response_organization_information import UmsV1UsersGet200ResponseOrganizationInformation
from .models.ums_v1_users_get200_response_users import UmsV1UsersGet200ResponseUsers
from .models.update_asym_keys_request import UpdateAsymKeysRequest
from .models.update_invoice_request import UpdateInvoiceRequest
from .models.update_pgp_keys_request import UpdatePGPKeysRequest
from .models.update_pgp_keys_request_1 import UpdatePGPKeysRequest1
from .models.update_password_keys_request import UpdatePasswordKeysRequest
from .models.upv1capturecontexts_capture_mandate import Upv1capturecontextsCaptureMandate
from .models.upv1capturecontexts_checkout_api_initialization import Upv1capturecontextsCheckoutApiInitialization
from .models.upv1capturecontexts_order_information import Upv1capturecontextsOrderInformation
Expand Down Expand Up @@ -792,6 +800,10 @@
from .apis.invoice_settings_api import InvoiceSettingsApi
from .apis.invoices_api import InvoicesApi
from .apis.key_generation_api import KeyGenerationApi
from .apis.keymanagement_api import KeymanagementApi
from .apis.keymanagementpassword_api import KeymanagementpasswordApi
from .apis.keymanagementpgp_api import KeymanagementpgpApi
from .apis.keymanagementscmp_api import KeymanagementscmpApi
from .apis.net_fundings_api import NetFundingsApi
from .apis.notification_of_changes_api import NotificationOfChangesApi
from .apis.payer_authentication_api import PayerAuthenticationApi
Expand Down
4 changes: 4 additions & 0 deletions CyberSource/apis/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
from .invoice_settings_api import InvoiceSettingsApi
from .invoices_api import InvoicesApi
from .key_generation_api import KeyGenerationApi
from .keymanagement_api import KeymanagementApi
from .keymanagementpassword_api import KeymanagementpasswordApi
from .keymanagementpgp_api import KeymanagementpgpApi
from .keymanagementscmp_api import KeymanagementscmpApi
from .net_fundings_api import NetFundingsApi
from .notification_of_changes_api import NotificationOfChangesApi
from .payer_authentication_api import PayerAuthenticationApi
Expand Down
121 changes: 121 additions & 0 deletions CyberSource/apis/asymmetric_key_management_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,3 +382,124 @@ def get_p12_key_details_with_http_info(self, key_id, **kwargs):
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)

def update_asym_key(self, key_id, update_asym_keys_request, **kwargs):
"""
Activate or De-activate Asymmetric Key
Activate or De-activate Asymmetric Key
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.update_asym_key(key_id, update_asym_keys_request, callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param str key_id: Key ID. (required)
:param UpdateAsymKeysRequest update_asym_keys_request: (required)
:return: object
If the method is called asynchronously,
returns the request thread.
"""

if self.api_client.mconfig.log_config.enable_log:
self.logger.info("CALL TO METHOD `update_asym_key` STARTED")

kwargs['_return_http_data_only'] = True
if kwargs.get('callback'):
return self.update_asym_key_with_http_info(key_id, update_asym_keys_request, **kwargs)
else:
(data) = self.update_asym_key_with_http_info(key_id, update_asym_keys_request, **kwargs)
return data

def update_asym_key_with_http_info(self, key_id, update_asym_keys_request, **kwargs):
"""
Activate or De-activate Asymmetric Key
Activate or De-activate Asymmetric Key
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.update_asym_key_with_http_info(key_id, update_asym_keys_request, callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param str key_id: Key ID. (required)
:param UpdateAsymKeysRequest update_asym_keys_request: (required)
:return: object
If the method is called asynchronously,
returns the request thread.
"""

all_params = ['key_id', 'update_asym_keys_request']
all_params.append('callback')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')

params = locals()
for key, val in iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method update_asym_key" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'key_id' is set
if ('key_id' not in params) or (params['key_id'] is None):
if self.api_client.mconfig.log_config.enable_log:
self.logger.error("InvalidArgumentException : Missing the required parameter `key_id` when calling `update_asym_key`")
raise ValueError("Missing the required parameter `key_id` when calling `update_asym_key`")
# verify the required parameter 'update_asym_keys_request' is set
if ('update_asym_keys_request' not in params) or (params['update_asym_keys_request'] is None):
if self.api_client.mconfig.log_config.enable_log:
self.logger.error("InvalidArgumentException : Missing the required parameter `update_asym_keys_request` when calling `update_asym_key`")
raise ValueError("Missing the required parameter `update_asym_keys_request` when calling `update_asym_key`")


collection_formats = {}

path_params = {}
if 'key_id' in params:
path_params['keyId'] = params['key_id']

query_params = []

header_params = {}

form_params = []
local_var_files = {}

body_params = None
if 'update_asym_keys_request' in params:
body_params = params['update_asym_keys_request']
# HTTP header `Accept`
header_params['Accept'] = self.api_client.\
select_header_accept(['application/hal+json;charset=utf-8'])

# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.\
select_header_content_type(['application/json;charset=utf-8'])

# Authentication setting
auth_settings = []

return self.api_client.call_api(f'/kms/v2/keys-asym/{key_id}', 'PATCH',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='object',
auth_settings=auth_settings,
callback=params.get('callback'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
194 changes: 194 additions & 0 deletions CyberSource/apis/keymanagement_api.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
# coding: utf-8

"""
CyberSource Merged Spec
All CyberSource API specs merged together. These are available at https://developer.cybersource.com/api/reference/api-reference.html
OpenAPI spec version: 0.0.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


from __future__ import absolute_import

import sys
import os
import re

# python 2 and python 3 compatibility library
from six import iteritems

from ..configuration import Configuration
from ..api_client import ApiClient
import CyberSource.logging.log_factory as LogFactory


class KeymanagementApi(object):
"""
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
Ref: https://github.com/swagger-api/swagger-codegen
"""

def __init__(self, merchant_config, api_client=None):
config = Configuration()
if api_client:
self.api_client = api_client
else:
if not config.api_client:
config.api_client = ApiClient()
self.api_client = config.api_client
self.api_client.set_configuration(merchant_config)
self.logger = LogFactory.setup_logger(self.__class__.__name__, self.api_client.mconfig.log_config)



def search_keys(self, **kwargs):
"""
Search Keys
Search one or more Keys
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.search_keys(callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param int offset: This allows you to specify the page offset from the resulting list resultset you want the records to be returned
:param int limit: This allows you to specify the total number of records to be returned off the resulting list resultset
:param str sort: This allows you to specify a comma separated list of fields in the order which the resulting list resultset must be sorted.
:param list[str] organization_ids: List of Orgaization Ids to search. The maximum size of the organization Ids list is 1. The maximum length of Organization Id is 30.
:param list[str] key_ids: List of Key Ids to search. The maximum size of the Key Ids list is 1
:param list[str] key_types: Key Type, Possible values - certificate, password, pgp and scmp_api. When Key Type is provided atleast one more filter needs to be provided
:param datetime expiration_start_date: Expiry Filter Start Date. When Expiration Date filter is provided, atleast one more filter needs to be provided
:param datetime expiration_end_date: Expiry Filter End Date. When Expiration Date filter is provided, atleast one more filter needs to be provided
:return: InlineResponse200
If the method is called asynchronously,
returns the request thread.
"""

if self.api_client.mconfig.log_config.enable_log:
self.logger.info("CALL TO METHOD `search_keys` STARTED")

kwargs['_return_http_data_only'] = True
if kwargs.get('callback'):
return self.search_keys_with_http_info(**kwargs)
else:
(data) = self.search_keys_with_http_info(**kwargs)
return data

def search_keys_with_http_info(self, **kwargs):
"""
Search Keys
Search one or more Keys
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.search_keys_with_http_info(callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param int offset: This allows you to specify the page offset from the resulting list resultset you want the records to be returned
:param int limit: This allows you to specify the total number of records to be returned off the resulting list resultset
:param str sort: This allows you to specify a comma separated list of fields in the order which the resulting list resultset must be sorted.
:param list[str] organization_ids: List of Orgaization Ids to search. The maximum size of the organization Ids list is 1. The maximum length of Organization Id is 30.
:param list[str] key_ids: List of Key Ids to search. The maximum size of the Key Ids list is 1
:param list[str] key_types: Key Type, Possible values - certificate, password, pgp and scmp_api. When Key Type is provided atleast one more filter needs to be provided
:param datetime expiration_start_date: Expiry Filter Start Date. When Expiration Date filter is provided, atleast one more filter needs to be provided
:param datetime expiration_end_date: Expiry Filter End Date. When Expiration Date filter is provided, atleast one more filter needs to be provided
:return: InlineResponse200
If the method is called asynchronously,
returns the request thread.
"""

all_params = ['offset', 'limit', 'sort', 'organization_ids', 'key_ids', 'key_types', 'expiration_start_date', 'expiration_end_date']
all_params.append('callback')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')

params = locals()
for key, val in iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method search_keys" % key
)
params[key] = val
del params['kwargs']

if 'expiration_start_date' in params and not re.search('yyyy-mm-dd', params['expiration_start_date']):
if self.api_client.mconfig.log_config.enable_log:
self.logger.error("InvalidArgumentException : Invalid value for parameter `expiration_start_date` when calling `search_keys`, must conform to the pattern `/yyyy-mm-dd/`")
raise ValueError("Invalid value for parameter `expiration_start_date` when calling `search_keys`, must conform to the pattern `/yyyy-mm-dd/`")
if 'expiration_end_date' in params and not re.search('yyyy-mm-dd', params['expiration_end_date']):
if self.api_client.mconfig.log_config.enable_log:
self.logger.error("InvalidArgumentException : Invalid value for parameter `expiration_end_date` when calling `search_keys`, must conform to the pattern `/yyyy-mm-dd/`")
raise ValueError("Invalid value for parameter `expiration_end_date` when calling `search_keys`, must conform to the pattern `/yyyy-mm-dd/`")

collection_formats = {}

path_params = {}

query_params = []
if 'offset' in params:
query_params.append(('offset', params['offset']))
if 'limit' in params:
query_params.append(('limit', params['limit']))
if 'sort' in params:
query_params.append(('sort', params['sort']))
if 'organization_ids' in params:
query_params.append(('organizationIds', params['organization_ids']))
collection_formats['organizationIds'] = 'csv'
if 'key_ids' in params:
query_params.append(('keyIds', params['key_ids']))
collection_formats['keyIds'] = 'csv'
if 'key_types' in params:
query_params.append(('keyTypes', params['key_types']))
collection_formats['keyTypes'] = 'csv'
if 'expiration_start_date' in params:
query_params.append(('expirationStartDate', params['expiration_start_date']))
if 'expiration_end_date' in params:
query_params.append(('expirationEndDate', params['expiration_end_date']))

header_params = {}

form_params = []
local_var_files = {}

body_params = None
if 'GET' in ('POST'):
body_params = '{}'
# HTTP header `Accept`
header_params['Accept'] = self.api_client.\
select_header_accept(['application/hal+json;charset=utf-8'])

# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.\
select_header_content_type(['application/json;charset=utf-8'])

# Authentication setting
auth_settings = []

return self.api_client.call_api(f'/kms/v2/keys', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='InlineResponse200',
auth_settings=auth_settings,
callback=params.get('callback'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
Loading

0 comments on commit a087afe

Please sign in to comment.