Skip to content

Commit

Permalink
MAK-59 IJ: Tool window to show calendar events
Browse files Browse the repository at this point in the history
  • Loading branch information
bcosynot committed Jul 8, 2023
1 parent 0546ba1 commit 5bc9cd5
Show file tree
Hide file tree
Showing 12 changed files with 493 additions and 57 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ track of all your notifications.
- See all your notifications from GitHub/Bitbucket in your IDE
- Add new tasks
- Start Flow Mode for a task to focus on it
- Added a tool window to see your calendar events for the next few hours
- Join an upcoming event with one click

### Changed

Expand Down
57 changes: 29 additions & 28 deletions src/main/kotlin/co/makerflow/client/apis/EventsApi.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,54 +15,55 @@

package co.makerflow.client.apis

import co.makerflow.client.models.CalendarEvent

import co.makerflow.client.infrastructure.*
import co.makerflow.client.infrastructure.ApiClient
import co.makerflow.client.infrastructure.HttpResponse
import co.makerflow.client.infrastructure.RequestConfig
import co.makerflow.client.infrastructure.RequestMethod
import co.makerflow.client.infrastructure.wrap
import co.makerflow.client.models.UpcomingCalendarEvents200Response
import com.fasterxml.jackson.databind.ObjectMapper
import io.ktor.client.HttpClientConfig
import io.ktor.client.request.forms.formData
import io.ktor.client.engine.HttpClientEngine
import io.ktor.http.ParametersBuilder
import com.fasterxml.jackson.databind.ObjectMapper

open class EventsApi(
open class EventsApi(
baseUrl: String = ApiClient.BASE_URL,
httpClientEngine: HttpClientEngine? = null,
httpClientConfig: ((HttpClientConfig<*>) -> Unit)? = null,
jsonBlock: ObjectMapper.() -> Unit = ApiClient.JSON_DEFAULT,
) : ApiClient(baseUrl, httpClientEngine, httpClientConfig, jsonBlock) {
) : ApiClient(baseUrl, httpClientEngine, httpClientConfig, jsonBlock) {

/**
*
*
* @param source To specify source of request (optional)
* @return kotlin.collections.List<CalendarEvent>
*/
@Suppress("UNCHECKED_CAST")
open suspend fun upcomingCalendarEvents(source: kotlin.String?): HttpResponse<kotlin.collections.List<CalendarEvent>> {
/**
*
*
* @param source To specify source of request (optional)
* @return UpcomingCalendarEvents200Response
*/
@Suppress("UNCHECKED_CAST")
open suspend fun upcomingCalendarEvents(source: kotlin.String?): HttpResponse<UpcomingCalendarEvents200Response> {

val localVariableAuthNames = listOf<String>("api_token")
val localVariableAuthNames = listOf<String>("api_token")

val localVariableBody =
io.ktor.client.utils.EmptyContent
val localVariableBody =
io.ktor.client.utils.EmptyContent

val localVariableQuery = mutableMapOf<String, List<String>>()
source?.apply { localVariableQuery["source"] = listOf("$source") }
val localVariableQuery = mutableMapOf<String, List<String>>()
source?.apply { localVariableQuery["source"] = listOf("$source") }

val localVariableHeaders = mutableMapOf<String, String>()
val localVariableHeaders = mutableMapOf<String, String>()

val localVariableConfig = RequestConfig<kotlin.Any?>(
val localVariableConfig = RequestConfig<kotlin.Any?>(
RequestMethod.GET,
"/tasks/calendar/events",
query = localVariableQuery,
headers = localVariableHeaders,
requiresAuthentication = true,
)
)

return request(
return request(
localVariableConfig,
localVariableBody,
localVariableAuthNames
).wrap()
}
).wrap()
}

}
}
32 changes: 18 additions & 14 deletions src/main/kotlin/co/makerflow/client/models/CalendarEvent.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,28 @@

package co.makerflow.client.models

import co.makerflow.client.models.Conference

import com.fasterxml.jackson.annotation.JsonIgnoreProperties
import com.fasterxml.jackson.annotation.JsonProperty

/**
* A event in user's calendar
*
* @param id
* @param userIntegrationId
* @param iCalUID
* @param start
* @param startTimezone
* @param end
* @param endTimezone
* @param summary
* @param htmlLink
* @param conference
* @param id
* @param userIntegrationId
* @param iCalUID
* @param start
* @param startTimezone
* @param end
* @param endTimezone
* @param summary
* @param htmlLink
* @param conference
* @param providerId
*/


data class CalendarEvent (
@JsonIgnoreProperties(ignoreUnknown = true)
data class CalendarEvent(

@field:JsonProperty("id")
val id: kotlin.Int? = null,
Expand Down Expand Up @@ -65,7 +66,10 @@ data class CalendarEvent (
val htmlLink: kotlin.String? = null,

@field:JsonProperty("conference")
val conference: Conference? = null
val conference: Conference? = null,

@field:JsonProperty("provider_id")
val providerId: kotlin.String? = null

)

20 changes: 10 additions & 10 deletions src/main/kotlin/co/makerflow/client/models/Conference.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,23 @@

package co.makerflow.client.models

import co.makerflow.client.models.ConferenceEntryPoint

import com.fasterxml.jackson.annotation.JsonIgnoreProperties
import com.fasterxml.jackson.annotation.JsonProperty

/**
*
*
* @param conferenceId
* @param location
* @param organizerEmail
* @param organizerName
* @param status
* @param entryPoints
*
* @param conferenceId
* @param location
* @param organizerEmail
* @param organizerName
* @param status
* @param entryPoints
*/


data class Conference (
@JsonIgnoreProperties(ignoreUnknown = true)
data class Conference(

@field:JsonProperty("conferenceId")
val conferenceId: kotlin.String? = null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,19 @@
package co.makerflow.client.models


import com.fasterxml.jackson.annotation.JsonIgnoreProperties
import com.fasterxml.jackson.annotation.JsonProperty

/**
* Information about calling into the meeting
*
* @param entryPointType
* @param label
* @param uri
* @param entryPointType
* @param label
* @param uri
*/


@JsonIgnoreProperties(ignoreUnknown = true)
data class ConferenceEntryPoint (

@field:JsonProperty("entryPointType")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/**
*
* Please note:
* This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* Do not edit this file manually.
*
*/

@file:Suppress(
"ArrayInDataClass",
"EnumEntryName",
"RemoveRedundantQualifierName",
"UnusedImport"
)

package co.makerflow.client.models

import com.fasterxml.jackson.annotation.JsonProperty

/**
*
*
* @param events
*/


data class UpcomingCalendarEvents200Response (

@field:JsonProperty("events")
val events: kotlin.collections.List<CalendarEvent>? = null

)

Loading

0 comments on commit 5bc9cd5

Please sign in to comment.