Searching Google Calendar extendedProperties does not return any match - google-calendar-api

I am using Google Calendar API v3 in to search for a specific property/value. I was able to successfully create the extended property as you can see here:
{
"kind": "calendar#events",
"etag": "\"p33cf16d5ousve0g\"",
"summary": "Ryan's Personal Camptivities",
"updated": "2022-04-29T15:11:23.687Z",
"timeZone": "America/Los_Angeles",
"accessRole": "owner",
"defaultReminders": [
{
"method": "popup",
"minutes": 10
}
],
"nextSyncToken": "CNjwmaXHufcCENjwmaXHufcCGAUg67Ly0wE=",
"items": [
{
"extendedProperties": {
"private": {
"OutlookEventGO": "AAMkADNkODYzZGQ5LWY5ZGItNGFjZi1iMWMzLTI3MmY0YmIxMTcxNQBGAAAAAAC5E322QQ7ORLEmN7zGNq0zBwAUl432Bg61QItQhHQwcosuAAAAAAENAAAUl432Bg61QItQhHQwcosuAAF6QI0zAAA="
}
]
}
but when I go to search for the extendedProperty, i get no response:
https://www.googleapis.com/calendar/v3/calendars/ryan%40camptivities.com/events?privateExtendedProperty=OutlookEventGO%3DAAMkADNkODYzZGQ5LWY5ZGItNGFjZi1iMWMzLTI3MmY0YmIxMTcxNQBGAAAAAAC5E322QQ7ORLEmN7zGNq0zBwAUl432Bg61QItQhHQwcosuAAAAAAENAAAUl432Bg61QItQhHQwcosuAAF6QI0zAAA%3D&
{
"kind": "calendar#events",
"etag": "\"p33cf16d5ousve0g\"",
"summary": "Ryan's Personal Camptivities",
"updated": "2022-04-29T15:11:23.687Z",
"timeZone": "America/Los_Angeles",
"accessRole": "owner",
"defaultReminders": [
{
"method": "popup",
"minutes": 10
}
],
"nextSyncToken": "CNjwmaXHufcCENjwmaXHufcCGAUg67Ly0wE=",
"items": []
}
Is this because of the encoding of the extendedProperty value? If so, how do I fix this? If not, what am I doing wrong?
Thanks in advance...

The problem is the = at the end of your privateExtendedProperty value
This seems to create issues when it comes to the url encoding of the property.
If you use a property value without an =, e.g.
AAMkADNkODYzZGQ5LWY5ZGItNGFjZi1iMWMzLTI3MmY0YmIxMTcxNQBGAAAAAAC5E322QQ7ORLEmN7zGNq0zBwAUl432Bg61QItQhHQwcosuAAAAAAENAAAUl432Bg61QItQhHQwcosuAAF6QI0zAAA
you can perfectly retrieve it with out request:
https://www.googleapis.com/calendar/v3/calendars/ryan%40camptivities.com/events?privateExtendedProperty=OutlookEventGO%3DAAMkADNkODYzZGQ5LWY5ZGItNGFjZi1iMWMzLTI3MmY0YmIxMTcxNQBGAAAAAAC5E322QQ7ORLEmN7zGNq0zBwAUl432Bg61QItQhHQwcosuAAAAAAENAAAUl432Bg61QItQhHQwcosuAAF6QI0zAAA
Your privateExtendedProperty seems to be encoded, so if the = is important for you to decode the value back, you will need to add it back programatically when require.

Related

Is there a way to expand references in Swashbuckle to provide inline schemas?

Is there a mechanism in Swashbuckle that can prevent definitions from being created with referencing to them in parameters/responses/etc.?
By default, you might get a path that looks like this:
"/profile": {
"get": {
"summary": "Get my profile details.",
"produces": [
"application/json",
],
"parameters": [],
"responses": {
"200": {
"description": "Success",
"schema": {
"$ref": "#/definitions/ProfileModel"
}
}
}
}
}
But what I'd like is for it to expand the schema inline like this:
"/profile": {
"get": {
"summary": "Get my profile details.",
"produces": [
"application/json",
],
"parameters": [],
"responses": {
"200": {
"description": "Success",
"schema": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "id"
},
"firstName": {
"type": "string",
"description": "firstName"
},
"surname": {
"type": "string",
"description": "surname"
},
"emailAddress": {
"type": "string",
"description": "emailAddress"
}
}
}
}
}
}
}
I reviewed this StackOverflow question and I don't think it's what I'm looking for (or maybe misinterpreted).
Taken a look through the Swashbuckle README to understand its capabilities but coming up short. Any help here would be most appreciated.
For additional context, looking at the Swashbuckle PDF documentation in section 1.7, I essentially want to bypass or revert the action they describe as
automatically generating a corresponding schema for user-defined reference types and reference the definition via the $ref keyword.
Digging into the codebase a little, it looks like it's not possible at the moment.
However, you can create a custom ISchemaGenerator from the one in source and alter the GenerateConcreteSchema method under the DataType.Object case to not return as reference and this solves the issue.

how to get specific items data from google calendar api

hi I am using google api to get all the events which is working fine. There is a parameter where I can specify fields name which I need to retrieve. There is a filed named as items where all the events data are coming. Now I want to get specific data of that items filed. Not all the data.
This is how I am getting all the data of that items.
https://www.googleapis.com/calendar/v3/calendars/CALENDAR_ID/events?showDeleted=true&timeMax=2021-08-16T06%3A00%3A46.000Z&timeMin=2021-04-16T06%3A00%3A46.000Z&prettyPrint=true&fields=items&key=[YOUR_API_KEY]
This is how data are coming.
{
"items": [
{
"kind": "calendar#event",
"etag": "\"hfsfjadj\"",
"id": "adfjadfjad",
"status": "confirmed",
"htmlLink": "https://www.google.com/calendar/event?eid=adfjdafjd",
"created": "2021-05-24T05:47:42.000Z",
"updated": "2021-05-24T05:47:42.331Z",
"summary": "dafhafj",
"creator": {
"email": "adfjadfj#gmail.com",
"self": true
},
"organizer": {
"email": "adfjadfj#gmail.com",
"self": true
},
"start": {
"dateTime": "2021-05-24T11:30:00+06:00"
},
"end": {
"dateTime": "2021-05-24T12:30:00+06:00"
},
"iCalUID": "dfjdfjdfj#google.com",
"sequence": 0,
"reminders": {
"useDefault": true
},
"eventType": "default"
}
]
}
I wanted to fetch only id, start,end and summary not the entire thing which is given above.
You can specify nested fields by enclosing them in round brackets, and multiple fields should be separated by commas. Your provided fields would be something like this:
items(id,start,end,summary)
Therefore, the URL would change from this:
https://www.googleapis.com/calendar/v3/calendars/CALENDAR_ID/events?showDeleted=true&timeMax=2021-08-16T06%3A00%3A46.000Z&timeMin=2021-04-16T06%3A00%3A46.000Z&prettyPrint=true&fields=items&key=[YOUR_API_KEY]
To this:
https://www.googleapis.com/calendar/v3/calendars/CALENDAR_ID/events?showDeleted=true&timeMax=2021-08-16T06%3A00%3A46.000Z&timeMin=2021-04-16T06%3A00%3A46.000Z&prettyPrint=true&fields=items(id%2Cstart%2Cend%2Csummary)&key=[YOUR_API_KEY]
Reference:
Partial response

Logic App > Cosmos PartitionKey Not Matching Error

I'm scared to put this out there because it should be so easy and I am facing the same issue as the post here, here and here and I have tried each of the answers to no avail. Below is the current Resulting Input (redacted) and Related CodeView of the inputs.
The Result
{
"method": "post",
"headers": {
"x-ms-documentdb-raw-partitionkey": "\"2020\""
},
"path": "/dbs/xxxx/colls/smtp/docs",
"host": {
"connection": {
"name": "/subscriptions/..."
}
},
"body": {
"category": [
[
"cat facts"
]
],
"email": "example#test.com",
"event": "processed",
"id": "yada",
"partitionKey": "\"2020\"",
"sg_event_id": "yada yada",
"sg_message_id": "yada",
"smtp-id": "yada",
"timestamp": 1604345542
}
}
The Code View
{
"inputs": {
"body": {
"category": [
"#items('For_each')['category']"
],
"email": "#items('For_each')['email']",
"event": "#items('For_each')['event']",
"id": "#items('For_each')['sg_message_id']",
"partitionKey": "\"#{formatDateTime(utcNow(),'yyyy')}\"",
"sg_event_id": "#items('For_each')['sg_event_id']",
"sg_message_id": "#items('For_each')['sg_message_id']",
"smtp-id": "#items('For_each')['smtp-id']",
"timestamp": "#items('For_each')['timestamp']"
},
"headers": {
"x-ms-documentdb-raw-partitionkey": "\"#{formatDateTime(utcNow(),'yyyy')}\""
}
}
The error I'm getting is the usual one - PartitionKey extracted from document doesn't match the one specified in the header
I just can't see what I'm missing here now.
Thanks all.
First, as Matias comments, check your partition key path.
Then, change this code "partitionKey": "\"#{formatDateTime(utcNow(),'yyyy')}\"", to "partitionKey": "#{formatDateTime(utcNow(),'yyyy')}", in your document.
It works fine on my side:

copyIndex() inside a listKeys()

We're trying to deploy an ARM template which deploys a Stream Analytics job with n Event Hubs outputs depending on an input parameter.
Right now we're having success with all but the listKeys() function inside the outputs property copy loop function which gets each Event Hub's primary keys:
"sharedAccessPolicyKey": "[listKeys(resourceId('Microsoft.EventHub/namespaces/eventhubs/authorizationRules', variables('clientEventHubNamespace'), parameters('clients')[copyIndex('outputs')].id, variables('clientEventHubClientSharedAccessName')), '2015-08-01').primaryKey]"
We get the error:
17:44:31 - Error: Code=InvalidTemplate; Message=Deployment template
validation failed: 'The template resource
'tailor-router-axgf7t3gtspue' at line '129' and column '10' is not
valid: The template function 'copyIndex' is not expected at this
location. The function can only be used in a resource with copy
specified. Please see https://aka.ms/arm-copy for usage details..
Please see https://aka.ms/arm-template-expressions for usage
details.'.
However, if we change this to be a specific index:
"sharedAccessPolicyKey": "[listKeys(resourceId('Microsoft.EventHub/namespaces/eventhubs/authorizationRules', variables('clientEventHubNamespace'), parameters('clients')[0].id, variables('clientEventHubClientSharedAccessName')), '2015-08-01').primaryKey]"
it works.
Is copyIndex('propertyName') inside a listKeys() a supported function?
If not, is there a workaround that would achieve the same effect?
Kind regards,
Nick
Stream Analytics job resource definition:
{
"apiVersion": "2016-03-01",
"type": "Microsoft.StreamAnalytics/StreamingJobs",
"name": "[variables('routerStreamAnalyticsName')]",
"location": "[variables('location')]",
"dependsOn": [ "clientsEventHubCopy" ],
"tags": {
"boundedContext": "[variables('boundedContextName')]"
},
"properties": {
"sku": {
"name": "[parameters('routerStreamAnalyticsSkuTier')]"
},
"outputErrorPolicy": "drop",
"eventsOutOfOrderPolicy": "adjust",
"eventsOutOfOrderMaxDelayInSeconds": 0,
"eventsLateArrivalMaxDelayInSeconds": 5,
"dataLocale": "en-US",
"compatibilityLevel": "1.0",
"inputs": [
{
"name": "input0",
"properties": {
"type": "stream",
"serialization": {
"type": "Avro"
},
"datasource": {
"type": "Microsoft.ServiceBus/EventHub",
"properties": {
"serviceBusNamespace": "[parameters('input0EventHubNamespace')]",
"sharedAccessPolicyName": "[parameters('input0EventHubSharedAccessPolicyName')]",
"sharedAccessPolicyKey": "[parameters('input0EventHubSharedAccessPolicyKey')]",
"eventHubName": "[parameters('input0EventHubName')]"
}
}
}
}
],
"transformation": {
"name": "routing",
"properties": {
"streamingUnits": "[parameters('routerStreamAnalyticsSkuTier')]",
"query": "omitted"
}
},
"copy": [
{
"name": "outputs",
"count": "[length(parameters('clients'))]",
"input": {
"name": "[parameters('clients')[copyIndex('outputs')].id]",
"properties": {
"datasource": {
"type": "Microsoft.ServiceBus/EventHub",
"properties": {
"serviceBusNamespace": "[variables('clientEventHubNamespace')]",
"sharedAccessPolicyName": "[variables('clientEventHubClientSharedAccessName')]",
"sharedAccessPolicyKey": "[listKeys(resourceId('Microsoft.EventHub/namespaces/eventhubs/authorizationRules', variables('clientEventHubNamespace'), parameters('clients')[copyIndex('outputs')].id, variables('clientEventHubClientSharedAccessName')), '2015-08-01').primaryKey]",
"eventHubName": "[parameters('clients')[copyIndex('outputs')].id]"
}
},
"serialization": {
"type": "Avro"
}
}
}
}
]
}
},
Thanks for reporting this and sorry for the inconvenience.
I just talked to the ARM team, we had an issue when copyindex was inside the index tags eg 'array[copyindex()]'. It should be fixed now.
Let us know how it goes.
Thanks,
JS - Azure Stream Analytics

Google Calendar Events after 7pm are not retrieved until the Next Day using Google Events API

I've updated this because this question makes more sense than the original. I'm still including the test code that I used to show what's happening.
Please see the comments for more up to date information on what I've found.
Executed API to grab events for today (there should be 1):
/calendar/v3/calendars/{calid}/events?calendarId={calid}&singleEvents=true&timeMin=2013-04-24T00:00:00.000Z&timeMax=2013-04-25T00:00:00.000Z
It retrieves nothing. No events are returned.
If I execute the following (ie, the next day):
/calendar/v3/calendars/{calid}/events?calendarId={calid}&singleEvents=true&timeMin=2013-04-25T00:00:00.000Z&timeMax=2013-04-26T00:00:00.000Z
It retrieves the following which is set for the 24th (yet after 7pm), not the 25th:
{
"kind": "calendar#events",
"etag": "\"GZxpEFttRDAOmLHnWRxLHHWPGwk/01XVNYQjwJ5jTmd05uIgK9e6Uhw\"",
"summary": "test calendar",
"description": "test calendar",
"updated": "2013-04-24T13:09:12.000Z",
"timeZone": "America/Chicago",
"items": [
{
"kind": "calendar#event",
"etag": "\"GZxpEFttRDAOmLHnWRxLHHWPGwk/Z2NhbDAwMDAxMzY2MTQ4ODczODI3MDAw\"",
"id": "d1mdj3dasor22f0nm0lbohru7s",
"status": "confirmed",
"htmlLink": "https://www.google.com/calendar/event?eid=ZDFtZGozZGFzb3IyMmYwbm0wbGJvaHJ1N3MgYnZzdG9vbHMuY29tX2xidWt1ZmlnczJjMmFycjViODgycDVhYWhvQGc",
"created": "2013-04-16T21:47:53.000Z",
"updated": "2013-04-16T21:47:53.827Z",
"summary": "this should happen 4/24/2013",
"description": "testing event",
"creator": {
"email": "{my email address}",
"displayName": "my name"
},
"organizer": {
"email": "{calid}",
"displayName": "test calendar",
"self": true
},
"start": {
"dateTime": "2013-04-24T21:21:19-05:00"
},
"end": {
"dateTime": "2013-04-24T21:21:19-05:00"
},
"iCalUID": "d1mdj3dasor22f0nm0lbohru7s#google.com",
"sequence": 0,
"extendedProperties": {
"private": {
"evtKey": "key"
}
},
"reminders": {
"useDefault": true
}
}
]
}
It should be retrieving it for the first api call on the 24th, not the 2nd api call on the 25th unless I'm missing something.
Any ideas? Thanks!
a bit late but if you still needs it. I think the event you retrieved d1mdj3dasor22f0nm0lbohru7 seems to be in default timezone of the calendar, which is America/Chicago. That explains why it only showed when you set your query to 25th UTC time

Resources