addConnectionForRelationship without CoreData - restkit

There is an object called Sale that I get from server:
{
"description": "New Sale",
"new_price": 10,
"prev_price": 15,
"product:: "45F83"
}
And there is an object, Product, regarding which the sale exists:
{
"id": "45F83",
"name": "Blue Shirt Plus",
"description": "Bigger Shirt"
}
I do not use CoreData and, therefore, I use RKObjectMapping, which doesn’t have the addConnectionForRelationship method.
Is there a way to make connection from Sale to Product using only a product id as property of Sale to build a relationships without RKEntityMapping?

Related

How to create a Follower following model in GraphQL?

I saw many tutorials/article they have mentioned that following/followers field as an integer in user model in GraphQL schema. I know those are for demo purpose. But I don't know how to save the followers/following users with proper relational model and how unfollow works. I saw Twitter developer site here they mentioned their user model as follows:
{
"id": 6253282,
"id_str": "6253282",
"name": "Twitter API",
"screen_name": "TwitterAPI",
"location": "San Francisco, CA",
"profile_location": null,
"followers_count": 6133636,
"friends_count": 12,
"listed_count": 12936,
"created_at": "Wed May 23 06:01:13 +0000 2007",
"favourites_count": 31,
}
I don't know whether this is their original code or prototype. But I'm confused how they are saving the follower userID.
1. How can we create proper follower/following model in graphQL?
2. Also how to create post likes/dislikes in GraphQL?

Steam game price history using Steam API

I would like to get price history of a specific Steam game.
I know that I can get current price information of a game like this (example with Portal 2):
GET https://store.steampowered.com/api/appdetails?filters=price_overview&appids=620
{
"620": {
"success": true,
"data": {
"price_overview": {
"currency": "USD",
"initial": 999,
"final": 999,
"discount_percent": 0,
"initial_formatted": "",
"final_formatted": "$9.99"
}
}
}
}
And there is https://steamcommunity.com/market/pricehistory to get price history of a specific item of a game.
Is there a way to get price history of a game itself?
There is no price history API directly from Steam.
You need to use third-party providers or record the prices yourself. Isthereanydeal might be helpful.

Google Price Calculator API (GCP)

I am looking to build simple billing app for cloud resources using google price calculator https://cloud.google.com/products/calculator/
Does google provide any API's for interacting with google price calculator?
I tried but couldn't find any!
You can use the Cloud Billing Catalog API, according to the official documentation:
Get a list of all public SKUs within a service including:
Human readable description of the SKU.
Public pricing of the SKU.
Regions where the SKU is available for purchase.
Categorization data about the SKU.
An example:
Request:
GET https://cloudbilling.googleapis.com/v1/services/SERVICE_ID/skus?key=API_KEY
Where SERVICE_ID is the identifier of the parent service.
Response:
{
"skus": [
{
"name": "[SKU_NAME]",
"skuId": "[SKU_ID]",
"description": "[SKU_DESCRIPTION]",
"category": {
"serviceDisplayName": "[SVC_DISPLAY_NAME]",
"resourceFamily": "[FAMILY]",
"resourceGroup": "[GROUP]",
"usageType": "[USAGE]",
},
"serviceRegions": [
"[REGION]"
],
"pricingInfo": [
{
"effectiveTime": "[TIME]",
"summary": "[SUMMARY]",
"pricingExpression": {
"usageUnit": "[UNIT]",
"usageUnitDescription": "[UNIT_DESCRIPTION]",
"displayQuantity": [DISPLAY_QUANTITY],
"tieredRates": [
{
"startUsageAmount": [START_AMOUNT],
"unitPrice": {
"currencyCode": "[CURRENCY_CODE]",
"units": [UNITS],
"nanos": [NANOS],
},
}
],
},
"aggregationInfo": {
"aggregationLevel": enum("[AGGREGATION_LEVEL]"),
"aggregationInterval": enum("[AGGREGATION_INTERVAL]"),
"aggregationCount": [AGGREGATION_COUNT],
},
"currencyConversionRate": [CONVERSION_RATE],
}
],
"serviceProviderName": "[SERVICE_PROVIDER]",
}
]
}
According to your question, you would want to use these response objects:
[UNIT] is the short hand for the unit of usage in which the pricing is specified. For example, usageUnit of GiBy means that usage is specified in "Gibibytes".
[DISPLAY_QUANTITY] is the recommended quantity of units for displaying pricing info. When displaying pricing info, it is recommended to display: (unitPrice * displayQuantity) per displayQuantity usageUnit. This field does not affect the pricing formula and is for display purposes only. For example, if the unitPrice is "0.0001 USD", the usageUnit is "GB" and the displayQuantity is "1000", then the recommended way to display the pricing info is "0.10 USD per 1000 GB".

Can luis recognize city and country depending on build in geography intend?

Currently training my LUIS application.
LUIS is connected with bing. LUIS has a lot of build in intents.
So, my question is:
Does the build in geography intent recognize city or country is my input and get the entity about?
For example:
forecast about georgia -- this is country
forecast about munchen -- this is city
Yes, you can differentiate between cities, countries, or points of interest using the entity type:
{ "type": "builtin.geography.city", "entity": "paris" }
{ "type": "builtin.geography.country", "entity": "australia" }
{ "type": "builtin.geography.pointOfInterest", "entity": "sahara desert" }

Paypal REST API - Description/Item name missing

I am using paypal ruby sdk in order to process credit cards via rest api. Everything is working fine from perspective of credit card processing. Credit cards are processed properly without any kind of issues.
Unfortunately, when i preform the csv export of transactions on the sandbox (or live) merchant paypal account, the "Item Title" field is not populated and also I cannot see that description field is used anywhere.
Request to the paypal:
Request[post]: https://api.sandbox.paypal.com/v1/payments/payment
Request.body={
"intent":"sale",
"payer":{
"payment_method":"credit_card",
"funding_instruments":[{
"credit_card":{
"number":"xxxxxxxxxxxxxxxx",
"type":"visa",
"expire_month":10,
"expire_year":2020,
"first_name":"First Name",
"last_name":"Last Name"
}
}]
},
"transactions":[{
"amount":{
"currency":"USD",
"total":"1"
},
"description":"This is item description",
"item_list":{
"items":[{
"quantity":"1",
"name":"This is item description",
"price":"1",
"currency":"USD",
"sku":"This is item description"
}]
}
}]
}
Within the successful paypal response I am getting all of these data back including the fields populated with "This is item description".
My question is, which parameter we need to provide for this api call in order to populate "Item Title" field within transactions csv export?
What is the purpose of "description" field within this api request and where this field is used on paypal side (showed) after we process payment with credit card?
EDITED
Tried with PHP SDK as well (just to be sure that this is not an issue with specific SDK). At the end it seems that question is "Is there a field to be used as part of REST API which corresponds to 'Item Title' column within paypal export?"
Indeed answer from pp_pduan answers on initial bounty question (related with specific report). I am adding an update related with this specific report and other reports as well.
For credit card processing you can use following API's on paypal side:
Rest API
DoDirect Payment Api (Pro 3.0)
Payflow Gateway Api (Pro 1.5-2.0)
As per my discussion with paypal side and quite a detailed research, it is not possible to populate Item Name for some of the reports using REST API.
For credit card processing (in order to avoid issues in general with reporting systems) I suggest to go with DoDirect Payment Api if you have Pro accounts. Seems that this specific API is "older" then REST API credit card processing hence it is more stable and do not have any kind of issues with reporting system.
Having in mind that DoDirect Payment Api have weird documentation (at least for me this is not covered properly) I suggest to check following php repository with working solution (examples).
Try put a sample request payload like this,
{
"intent": "sale",
"payer": {
"payment_method": "paypal"
},
"redirect_urls": {
"return_url": "http://localhost:80/getpaypal",
"cancel_url": "http://localhost:80/cancel"
},
"transactions": [
{
"description": "Transaction Desc Text",
"amount": {
"total":"80",
"currency":"USD"
},
"item_list": {
"items": [
{
"name": "Test Ticket 1",
"currency": "USD",
"quantity": "1",
"sku": "55a460ff65f13",
"price": "10"
},
{
"name": "Test Ticket 2",
"currency": "USD",
"quantity": "2",
"sku": "55a460ff66c7a",
"price": "20"
},
{
"name": "Test Ticket 3",
"currency": "USD",
"quantity": "3",
"sku": "55a460ff66ce2",
"price": "10"
}
]
},
"invoice_number": "55a460ff696br"
}
]
}
And when you download transaction history (csv) from your PayPal profile,
If you've ticked the option "Include Shopping Cart details",
the "name" field under each item object will display in the "Item Title" col; and the description field in transaction object will be in that col as well
If you leave the option of "Include Shopping Cart details", the transaction will be a single record in the csv without the cart item rows, and you'll only see ""description": "Transaction Desc Text"," (description field in transaction object) in the Item Title col

Resources