def post_by_legalEntityId(legalEntityId,legalEntityAgreementCreateRequest): legalEntityAgreementCreateRequest.set_sdkVersion(SdkVersion.RELEASE) legalEntityAgreementCreateRequest.set_language(SdkVersion.LANGUAGE) stringIO = StringIO() legalEntityAgreementCreateRequest.export(stringIO, 0, pretty_print=False) request = stringIO.getvalue() request = request.replace("tns:", "") request = request.replace(":tns", "") if my_schema.is_valid(request): url_suffix = (SERVICE_ROUTE1 + legalEntityId + SERVICE_ROUTE2).encode('utf-8') return communication.http_post_request(url_suffix, request.encode('utf-8')) else: raise utils.PayfacSchemaError("Input is not compatible with schema")
def put_by_legalEntityId(legalEntityId, legalEntityUpdateRequest): url_suffix = (SERVICE_ROUTE + "/" + legalEntityId).encode('utf-8') stringIO = StringIO() legalEntityUpdateRequest.export(stringIO, 0) request = stringIO.getvalue() request = request.replace("tns:", "") request = request.replace(":tns", "") if my_schema.is_valid(request): request = request.replace("tns:", "") request = request.replace(":tns", "") return communication.http_put_request(url_suffix, request.encode('utf-8')) else: raise utils.PayfacSchemaError("Input is not compatible with schema")