Google task api due field - google-tasks-api

I am using google task list api and getting list from server. I created three task with different due time and date. I am getting date for every task but getting same due time. Can you please elaborate why this is happening?
Output:
{
"kind": "tasks#tasks",
"etag": "*********",
"items": [
{
"kind": "tasks#task",
"id": "******",
"etag": "******",
"title": "Task 2",
"updated": "2021-01-29T14:40:36.000Z",
"selfLink": "******",
"position": "00000000000000000001",
"status": "needsAction",
"due": "2021-01-30T00:00:00.000Z"
},
{
"kind": "tasks#task",
"id": "*********",
"etag": "*******",
"title": "Task 4",
"updated": "2021-01-29T13:18:51.000Z",
"selfLink": "*******",
"position": "00000000000000000000",
"status": "needsAction",
"due": "2021-01-30T00:00:00.000Z"
},
{
"kind": "tasks#task",
"id": "***********",
"etag": "*************",
"title": "Task 1",
"updated": "2021-01-29T13:08:39.000Z",
"selfLink": "*******",
"position": "00000000000000000002",
"status": "needsAction",
"due": "2021-01-29T00:00:00.000Z"
}
]
}

Based on the Resource:tasks,
Field: due
Due date of the task (as a RFC 3339 timestamp). Optional. The due date only records date information; the time portion of the timestamp is discarded when setting the due date. It isn't possible to read or write the time that a task is due via the API.

Google api can only read date not time for due field.
This line is from their official documentation Tasks API . tasks
Blockquote
"due": "A String", # Due date of the task (as a RFC 3339 timestamp). Optional. The due date only records date information; the time portion of the timestamp is discarded when setting the due date. It isn't possible to read or write the time that a task is due via the API.

Related

Sonarqube REST API : What is the structure of "metrics" in "GET api/measures/component" WS

In the response example from the web api documentation, I can see metric "ncloc" should be like this in the JSON web response :
"measures": [
{
"metric": "ncloc",
"value": "114",
"periods": [
{
"index": 1,
"value": "3"
}
]
},
But it's not, there is no "periods" for this metric in my response :
"measures":[
{
"metric": "ncloc",
"value": "2943"
},
There are "periods" for some other metrics though, and in this case, there is no metric value, only a value for each period (and there are never multiple periods, only one corresponding to the "new code" period).
So here are my questions about this :
How can I know which structure to expect for a metric ? what would be the metric where "periods" would have a list of periods and not just one corresponding to "new code" ?
I don't think there are multiple periods. API documentation for my version (8.9) only states period, which probably stands for Leak Period as the New Code used to be called. I assume that general value is for overall value and period value is for the new code. Some measures may not make sense or be counted for overall or new code, so I would not make assumptions on whether there will be a metric value for the period or general.
Edit:
The following is the 8.9 documentation:
GET api/measures/component
SINCE 5.4
Return component with specified measures.
Requires the following permission: 'Browse' on the project of specified component.
Parameters
Parameter
Required?
Since
Description
Example value
additionalFields
optional
Comma-separated list of additional fields that can be returned in the response.
Possible values: metrics, period, periods Example value: period,metrics
branch
optional
6.6
Branch key. Not available in the community edition.
Example value: feature/my_branch
component
required
Component key
Example value: my_project
metricKeys
required
Comma-separated list of metric keys
Example value: ncloc,complexity,violations
pullRequest
optional
7.1
Pull request id. Not available in the community edition.
Example value: 5461
Response Example
{
"component": {
"key": "MY_PROJECT:ElementImpl.java",
"name": "ElementImpl.java",
"qualifier": "FIL",
"language": "java",
"path": "src/main/java/com/sonarsource/markdown/impl/ElementImpl.java",
"measures": [
{
"metric": "complexity",
"value": "12",
"period": {
"value": "2",
"bestValue": false
}
},
{
"metric": "new_violations",
"period": {
"value": "25",
"bestValue": false
}
},
{
"metric": "ncloc",
"value": "114",
"period": {
"value": "3",
"bestValue": false
}
}
]
},
"metrics": [
{
"key": "complexity",
"name": "Complexity",
"description": "Cyclomatic complexity",
"domain": "Complexity",
"type": "INT",
"higherValuesAreBetter": false,
"qualitative": false,
"hidden": false,
"custom": false
},
{
"key": "ncloc",
"name": "Lines of code",
"description": "Non Commenting Lines of Code",
"domain": "Size",
"type": "INT",
"higherValuesAreBetter": false,
"qualitative": false,
"hidden": false,
"custom": false
},
{
"key": "new_violations",
"name": "New issues",
"description": "New Issues",
"domain": "Issues",
"type": "INT",
"higherValuesAreBetter": false,
"qualitative": true,
"hidden": false,
"custom": false
}
],
"period": {
"mode": "previous_version",
"date": "2016-01-11T10:49:50+0100",
"parameter": "1.0-SNAPSHOT"
}
}
Changelog
Version
Change
8.8
deprecated response field 'id' has been removed.
8.8
deprecated response field 'refId' has been removed.
8.1
the response field periods under measures field is deprecated. Use period instead.
8.1
the response field periods is deprecated. Use period instead.
7.6
The use of module keys in parameter 'component' is deprecated
6.6
the response field 'id' is deprecated. Use 'key' instead.
6.6
the response field 'refId' is deprecated. Use 'refKey' instead.

Google Actions Builder Many Slot Required

Hello guys i need some help/understand how required slot filling works.
Looking inside the documentation:
https://developers.google.com/assistant/conversational/scenes
I would be able to add as many as much required slots but when I try to test it in Google Actions Builder Simulator (Test) I'm getting this error when I fill only one slot:
{
"insertId": "---",
"jsonPayload": {
"timestamp": "2021-06-22T11:46:48.872626Z",
"endConversation": {},
"status": {
"message": "There is no prompt message nor helper instruction in the response.",
"code": 13
},
"executionState": {
"sessionParameters": {},
"currentSceneId": "Success",
"slots": {
"status": "COLLECTING",
"slots": {
"goal": {
"status": "FILLED",
"mode": "REQUIRED",
"updated": true,
"value": "goal1"
},
"level": {
"status": "EMPTY",
"mode": "REQUIRED"
}
}
}
}
},
"resource": {
"type": "assistant_action",
"labels": {
"project_id": "---",
"version_id": "",
"action_id": "---"
}
},
"timestamp": "2021-06-22T11:46:48.872626Z",
"severity": "CRITICAL",
"labels": {
"channel": "preview"
},
"logName": "---",
"trace": "---",
"receiveTimestamp": "2021-06-22T11:46:48.912102599Z"
}
For some context I'm using two required slot filling:
You can include as many required slots as you like. Once all required slots are filled, scene.slots.status will be set to "FINAL", and the pre-populated condition will be met.
For each slot you can mark it as required by selecting This slot is required. If you need access to the value, you can write it to a session parameter by selecting Customize slot value writeback and providing a name for the session parameter key.
The error you are receiving says "There is no prompt message nor helper instruction in the response.".
When configuring each slot, you can add a customized prompt (dependent on slot type) for when you first prompt the user to fill the slot. If this isn't configured, you will receive the above error message.
To add a prompt, under the slot configuration, select Send prompt and add what you want to say to the user.
For example:
candidates:
- first_simple:
variants:
- speech: What is your favorite number?

Is there a possibility to have another timestamp as dimension in Druid?

Is it possible to have Druid datasource with 2 (or multiple) timestmaps in it?
I know that Druid is time-based DB and I have no problem with the concept but I'd like to add another dimension with which I can work as with timestamp
e.g. User retention: Metric surely is specified to a certain date, but I also need to create cohorts based on users date of registration and rollup those dates maybe to a weeks, months or filter to only a certain time periods....
If the functionality is not supported, are there any plug-ins? Any dirty solutions?
Although I'd rather wait for official implementation for timestamp dimensions full support in druid to be made, I've found a 'dirty' hack which I've been looking for.
DataSource Schema
First things first, I wanted to know, how much users logged in for each day, with being able to aggregate by date/month/year cohorts
here's the data schema I used:
"dataSchema": {
"dataSource": "ds1",
"parser": {
"parseSpec": {
"format": "json",
"timestampSpec": {
"column": "timestamp",
"format": "iso"
},
"dimensionsSpec": {
"dimensions": [
"user_id",
"platform",
"register_time"
],
"dimensionExclusions": [],
"spatialDimensions": []
}
}
},
"metricsSpec": [
{ "type" : "hyperUnique", "name" : "users", "fieldName" : "user_id" }
],
"granularitySpec": {
"type": "uniform",
"segmentGranularity": "HOUR",
"queryGranularity": "DAY",
"intervals": ["2015-01-01/2017-01-01"]
}
},
so the sample data should look something like (each record is login event):
{"user_id": 4151948, "platform": "portal", "register_time": "2016-05-29T00:45:36.000Z", "timestamp": "2016-06-29T22:18:11.000Z"}
{"user_id": 2871923, "platform": "portal", "register_time": "2014-05-24T10:28:57.000Z", "timestamp": "2016-06-29T22:18:25.000Z"}
as you can see, my "main" timestamp to which I calculate these metrics is timestamp field, where register_time is only the dimension in stringy - ISO 8601 UTC format .
Aggregating
And now, for the fun part: I've been able to aggregate by timestamp (date) and register_time (date again) thanks to Time Format Extraction Function
Query looking like that:
{
"intervals": "2016-01-20/2016-07-01",
"dimensions": [
{
"type": "extraction",
"dimension": "register_time",
"outputName": "reg_date",
"extractionFn": {
"type": "timeFormat",
"format": "YYYY-MM-dd",
"timeZone": "Europe/Bratislava" ,
"locale": "sk-SK"
}
}
],
"granularity": {"timeZone": "Europe/Bratislava", "period": "P1D", "type": "period"},
"aggregations": [{"fieldName": "users", "name": "users", "type": "hyperUnique"}],
"dataSource": "ds1",
"queryType": "groupBy"
}
Filtering
Solution for filtering is based on JavaScript Extraction Function with which I can transform date to UNIX time and use it inside (for example) bound filter:
{
"intervals": "2016-01-20/2016-07-01",
"dimensions": [
"platform",
{
"type": "extraction",
"dimension": "register_time",
"outputName": "reg_date",
"extractionFn": {
"type": "javascript",
"function": "function(x) {return Date.parse(x)/1000}"
}
}
],
"granularity": {"timeZone": "Europe/Bratislava", "period": "P1D", "type": "period"},
"aggregations": [{"fieldName": "users", "name": "users", "type": "hyperUnique"}],
"dataSource": "ds1",
"queryType": "groupBy"
"filter": {
"type": "bound",
"dimension": "register_time",
"outputName": "reg_date",
"alphaNumeric": "true"
"extractionFn": {
"type": "javascript",
"function": "function(x) {return Date.parse(x)/1000}"
}
}
}
I've tried to filter it 'directly' with javascript filter but I haven't been able to convince druid to return the correct records although I've doublecheck it with various JavaScript REPLs, but hey, I'm no JavaScript expert.
Unfortunately Druid has only one time-stamp column that can be used to do rollup plus currently druid treat all the other columns as a strings (except metrics of course) so you can add another string columns with time-stamp values, but the only thing you can do with it is filtering.
I guess you might be able to hack it that way.
Hopefully in the future druid will allow different type of columns and maybe time-stamp will be one of those.
Another solution is add a longMin sort of metric for the timestamp and store the epoch time in that field or you convert the date time to a number and store it (eg 31st March 2021 08:00 to 310320210800)
As for Druid 0.22 it is stated in the documentation that secondary timestamps should be handled/parsed as dimensions of type long. Secondary timestamps can be parsed to longs at ingestion time with a tranformSpec and be transformed back if needed in querying time link.

Get list of related tracks HTTP API SoundCloud

I wasn't able to find anything fitting in HTTP API documentation.
As I know, there's some tracks popping out in SC widget after current track is finished, therefore there is some related tracks functionality in SC itself, yet can we access it via API?
I.e get a list of tracks, related to given track's id.
Disclaimer: This is an undocumented endpoint and is subject to change at anytime by SoundCloud.
There is an undocumented endpoint that allows you to access a track's related sounds:
HTTP GET: https://api.soundcloud.com/tracks/[TRACK_ID]/related?client_id=[YOUR_CLIENT_ID]
You didn't specify a language, so i'm just going to give a high-level overview on how to use the endpoint.
First, get your track URL. I'll use this one as an example: https://soundcloud.com/msmrsounds/ms-mr-hurricane-chvrches-remix
Then hit the resolve endpoint to get the track_id.
HTTP GET: https://api.soundcloud.com/resolve.json?url=https%3A%2F%2Fsoundcloud.com%2Fmsmrsounds%2Fms-mr-hurricane-chvrches-remix&client_id=[YOUR_CLIENT_ID]
Response:
{
"status": "302 - Found",
"location": "https://api.soundcloud.com/tracks/90787841.json?client_id=[YOUR_CLIENT_ID]"
}
Next, hit the related endpoint with your track_id.
HTTP GET: https://api.soundcloud.com/tracks/90787841/related?client_id=[YOUR_ClIENT_ID]
The full response will give you up to 50 related tracks. The response is too large to post, but it's just an array of tracks.
[
{
"kind": "track",
"id": 112741336,
"created_at": "2013/09/27 09:40:29 +0000",
"user_id": 59817646,
"duration": 215896,
"commentable": true,
"state": "finished",
"original_content_size": 38068298,
"last_modified": "2015/04/04 20:17:24 +0000",
"sharing": "public",
"tag_list": "CHVRCHES Whitney Houston Zane Lowe",
"permalink": "chvrches-its-not-right-but-its",
"streamable": true,
"embeddable_by": "all",
"downloadable": false,
"purchase_url": null,
"label_id": null,
"purchase_title": null,
"genre": "Electronic",
"title": "CHVRCHES - It's Not Right But It's Okay (Whitney Houston Cover)",
"description": "CHVRCHES - It's Not Right But It's OK (Whitney Houston Cover) from Zane's Live Sessions",
"label_name": "",
"release": "",
"track_type": "recording",
"key_signature": "",
"isrc": "",
"video_url": null,
"bpm": null,
"release_year": null,
"release_month": null,
"release_day": null,
"original_format": "wav",
"license": "all-rights-reserved",
"uri": "https://api.soundcloud.com/tracks/112741336",
"user": {
"id": 59817646,
"kind": "user",
"permalink": "uknewmusic",
"username": "UKNewMusic",
"last_modified": "2013/09/27 09:38:04 +0000",
"uri": "https://api.soundcloud.com/users/59817646",
"permalink_url": "http://soundcloud.com/uknewmusic",
"avatar_url": "https://a1.sndcdn.com/images/default_avatar_large.png"
},
"permalink_url": "http://soundcloud.com/uknewmusic/chvrches-its-not-right-but-its",
"artwork_url": "https://i1.sndcdn.com/artworks-000058757165-6tnuep-large.jpg",
"waveform_url": "https://w1.sndcdn.com/XkEffI5hwjZ7_m.png",
"stream_url": "https://api.soundcloud.com/tracks/112741336/stream",
"playback_count": 680326,
"download_count": 0,
"favoritings_count": 9241,
"comment_count": 199,
"attachments_uri": "https://api.soundcloud.com/tracks/112741336/attachments",
"policy": "ALLOW"
},
{ ...
}
]

How to get purchase_url from API

I added a buy link to one of my tracks and then tried to access it via API (Ruby wrapper). It displays always empty field.
Updating purchase_url is also not working, while other fields get updated.
Is this a bug or something wrong done on my side?
Can you post your URL? I'm able to retrieve this info fine from a REST console with a standard GET request.
Using this URL as an example:
https://soundcloud.com/maddecent/grandtheft-mobbin-feat
HTTP GET: https://api.soundcloud.com/resolve.json?url=https://soundcloud.com/maddecent/grandtheft-mobbin-feat&client_id=[client_id]
Returns:
{
"status": "302 - Found",
"location": "https://api.soundcloud.com/tracks/107686148.json?client_id=[client_id]"
}
Hitting the track endpoint:
HTTP GET: https://api.soundcloud.com/tracks/107686148.json?client_id=[client_id]
Returns:
{
"kind": "track",
"id": 107686148,
"created_at": "2013/08/28 17:24:39 +0000",
"user_id": 14730,
"duration": 186766,
"commentable": true,
"state": "finished",
"original_content_size": 9678964,
"last_modified": "2014/12/30 20:37:07 +0000",
"sharing": "public",
"tag_list": "Hedspin \"Mad Decent\" Jeffree's Dance Electronic Club Mobbin",
"permalink": "grandtheft-mobbin-feat",
"streamable": true,
"embeddable_by": "all",
"downloadable": false,
"purchase_url": "http://smarturl.it/GrandtheftMOB",
"label_id": null,
"purchase_title": "Buy on iTunes",
"genre": "",
"title": "Grandtheft - Mobbin feat. Hedspin",
"description": "Buy on iTunes: http://smarturl.it/GrandtheftMOB\r\nBuy on Beatport: http://bit.ly/GrandtheftBP\r\nBuy on Amazon: http://amzn.com/B00F4IFFQM\r\n\r\nRespected as one of the best live Canadian DJs in the game, Grandtheft has taken a break from globetrotting to pack in a HUGE release for Jeffree’s. Along with World Red Bull Thre3style champ and close pal Hedspin, they have made something minimal but fierce with their track “Mobbin.” The build channels the darkness of No Limit Records at its prime while the drop carries the bounce of a screwed and chopped new jack swing track. That, combined with the most menacing synth stab we’ve heard in a while, makes this tune unstoppable.\r\n\r\nWith “Give Me More,” Grandtheft lends us a soulful track that marries a delicious combination trap and dub in the same vein as his popular remix of Keys N Krates’ song “Treat Me Right” released off of Dim Mak. The juxtaposition of the drop is a total WTF moment for any club-goer and we mean that in the best way possible. Grandtheft’s momentum continues to pick up incredible speed with each release, and we don’t see his rise mellowing out anytime soon.\r\n\r\nGrandtheft\r\nSoundcloud: http://www.soundcloud.com/grandtheft\r\nFacebook: http://facebook.com/grandtheftmusic\r\nTwitter: https://twitter.com/grandtheft\r\nInstagram: http://instagram.com/itsgrandtheft\r\nYoutube: http://youtube.com/grandtheftofficial\r\n\r\nHedspin\r\nSoundcloud: https://soundcloud.com/hedspin\r\nFacebook: https://www.facebook.com/djhedspin\r\nTwitter: https://twitter.com/HEDSPIN\r\nInstagram: http://instagram.com/djhedspin",
"label_name": "Jeffree's",
"release": "JEFF060",
"track_type": "",
"key_signature": "",
"isrc": "US-Z4V-13-00221",
"video_url": null,
"bpm": null,
"release_year": 2013,
"release_month": 9,
"release_day": 17,
"original_format": "mp3",
"license": "all-rights-reserved",
"uri": "https://api.soundcloud.com/tracks/107686148",
"user": {
"id": 14730,
"kind": "user",
"permalink": "maddecent",
"username": "Mad Decent",
"last_modified": "2014/12/18 18:12:40 +0000",
"uri": "https://api.soundcloud.com/users/14730",
"permalink_url": "http://soundcloud.com/maddecent",
"avatar_url": "https://i1.sndcdn.com/avatars-000112599114-5etg3g-large.jpg"
},
"permalink_url": "http://soundcloud.com/maddecent/grandtheft-mobbin-feat",
"artwork_url": "https://i1.sndcdn.com/artworks-000056426845-b40tmr-large.jpg",
"waveform_url": "https://w1.sndcdn.com/JL8flUq6Vn0x_m.png",
"stream_url": "https://api.soundcloud.com/tracks/107686148/stream",
"playback_count": 770622,
"download_count": 16462,
"favoritings_count": 16626,
"comment_count": 489,
"attachments_uri": "https://api.soundcloud.com/tracks/107686148/attachments",
"policy": "MONETIZE"
}
Purchase info is in the JSON response:
"purchase_url": "http://smarturl.it/GrandtheftMOB",
"purchase_title": "Buy on iTunes",