Skip to content

Commit e1eab83

Browse files
Fix Francesco Faraone feedback
1 parent fe09bd3 commit e1eab83

File tree

3 files changed

+21
-21
lines changed

3 files changed

+21
-21
lines changed

connect/resources/template.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def list(self, product_id):
2525
if not product_id:
2626
raise ValueError('Invalid product Id for list template')
2727
response, _ = self._api.get(
28-
'/public/v1/products/'+product_id+'/templates/',
28+
'/public/v1/products/' + product_id + '/templates/',
2929
params={'scope': 'asset', 'type': 'fulfillment'},
3030
)
3131
response = json.loads(response)

examples/apiary_scenarios/asset_accept_workflow.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,19 +47,19 @@ def dispatch(self, request):
4747
def process_request(self, request):
4848
template_resource = TemplateResource()
4949
for item in request.asset.items:
50-
purchasRequestId = request.id
51-
productId = request.asset.product.id
52-
npm = item.mpn
53-
url = VENDOR_API_URL + "tenant?externalId=" + npm
50+
purchase_request_id = request.id
51+
product_id = request.asset.product.id
52+
mpn = item.mpn
53+
url = VENDOR_API_URL + 'tenant?externalId=' + mpn
5454

5555
response = requests.get(url, data='').json()
5656
if response['status'] == 'ready':
57-
templates = template_resource.list(productId)
57+
templates = template_resource.list(product_id)
5858
for template in templates:
59-
templateId = template['id']
59+
template_id = template['id']
6060
break
61-
body = {"activation_tile": templateId}
62-
self.approve(purchasRequestId, body)
61+
body = {"activation_tile": template_id}
62+
self.approve(purchase_request_id, body)
6363
return response
6464

6565

examples/apiary_scenarios/asset_request_workflow.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -45,36 +45,36 @@ def dispatch(self, request):
4545

4646
def process_request(self, request):
4747
for item in request.asset.items:
48-
npm = item.mpn
48+
mpn = item.mpn
4949
quantity = item.quantity
5050
break
5151

52-
url = VENDOR_API_URL + "tenant?externalId=" + npm
52+
url = VENDOR_API_URL + "tenant?externalId=" + mpn
5353
response = requests.get(url, data='').json()
54-
firstName = request.asset.tiers.customer.contact_info.contact.first_name
55-
lastName = request.asset.tiers.customer.contact_info.contact.last_name
54+
first_name = request.asset.tiers.customer.contact_info.contact.first_name
55+
last_name = request.asset.tiers.customer.contact_info.contact.last_name
5656
address = request.asset.tiers.customer.contact_info.address_line1
57-
postalCode = request.asset.tiers.customer.contact_info.postal_code
58-
accountPhone = request.asset.tiers.customer.contact_info.contact.phone_number.phone_number
57+
postal_code = request.asset.tiers.customer.contact_info.postal_code
58+
account_phone = request.asset.tiers.customer.contact_info.contact.phone_number.phone_number
5959
if response['externalId'] != request.asset.id:
60-
url = VENDOR_API_URL + "tenant"
60+
url = VENDOR_API_URL + 'tenant'
6161
payload = {
6262
'Attributes': {
6363
'product': {
64-
'item': npm,
64+
'item': mpn,
6565
'quantity': quantity
6666
},
6767
'account': {
68-
'accountFirstName': firstName,
69-
'accountLastName': lastName,
68+
'accountFirstName': first_name,
69+
'accountLastName': last_nName,
7070
'accountCompany': request.asset.tiers.customer.name,
7171
'accountAddress': address,
7272
'accountCity': request.asset.tiers.customer.contact_info.city,
7373
'accountState': request.asset.tiers.customer.contact_info.state,
74-
'accountPostalCode': postalCode,
74+
'accountPostalCode': postal_code,
7575
'accountCountry': request.asset.tiers.customer.contact_info.country,
7676
'accountEmail': request.asset.tiers.customer.contact_info.contact.email,
77-
'accountPhone': accountPhone
77+
'accountPhone': account_phone
7878
}
7979
}
8080
}

0 commit comments

Comments
 (0)