From 86a2cef0787b5caaaa93c708253e72ee4b09e95c Mon Sep 17 00:00:00 2001 From: vitalii-bezuhlyi <157373241+vitalii-bezuhlyi@users.noreply.github.com> Date: Tue, 16 Apr 2024 18:49:12 +0300 Subject: [PATCH] Categories (#18) * added categories * Updated csproj --------- Co-authored-by: bZverok <137277669+bZverok@users.noreply.github.com> --- Apps.GoogleSheets/Apps.GoogleSheets.csproj | 4 ++-- Apps.GoogleSheets/GoogleSheetsApplication.cs | 17 ++++++++++++++--- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/Apps.GoogleSheets/Apps.GoogleSheets.csproj b/Apps.GoogleSheets/Apps.GoogleSheets.csproj index ef6c85d..a0fd1f5 100644 --- a/Apps.GoogleSheets/Apps.GoogleSheets.csproj +++ b/Apps.GoogleSheets/Apps.GoogleSheets.csproj @@ -5,11 +5,11 @@ enable Google Sheets Create and edit online spreadsheets. Get insights together with secure sharing in real-time and from any device - 1.2.9 + 1.2.10 Apps.GoogleSheets - + diff --git a/Apps.GoogleSheets/GoogleSheetsApplication.cs b/Apps.GoogleSheets/GoogleSheetsApplication.cs index b5d8ea9..3ecaee9 100644 --- a/Apps.GoogleSheets/GoogleSheetsApplication.cs +++ b/Apps.GoogleSheets/GoogleSheetsApplication.cs @@ -2,13 +2,24 @@ using Blackbird.Applications.Sdk.Common.Authentication.OAuth2; using Apps.GoogleSheets.Auth.OAuth2; using Blackbird.Applications.Sdk.Common.Invocation; +using Blackbird.Applications.Sdk.Common.Metadata; namespace Apps.GoogleSheets { - public class GoogleSheetsApplication : BaseInvocable, IApplication + public class GoogleSheetsApplication : BaseInvocable, IApplication, ICategoryProvider { private readonly Dictionary _typesInstances; + public IEnumerable Categories + { + get => + [ + ApplicationCategory.DatabaseAndSpreadsheet, ApplicationCategory.GoogleApps, + ApplicationCategory.ProjectManagementAndProductivity + ]; + set { } + } + public GoogleSheetsApplication(InvocationContext invocationContext) : base(invocationContext) { _typesInstances = CreateTypesInstances(); @@ -24,7 +35,7 @@ public T GetInstance() { if (!_typesInstances.TryGetValue(typeof(T), out var value)) throw new InvalidOperationException($"Instance of type '{typeof(T)}' not found"); - + return (T)value; } @@ -37,4 +48,4 @@ private Dictionary CreateTypesInstances() }; } } -} +} \ No newline at end of file