Rosie.Nutshell
0.4.3
See the version list below for details.
dotnet add package Rosie.Nutshell --version 0.4.3
NuGet\Install-Package Rosie.Nutshell -Version 0.4.3
<PackageReference Include="Rosie.Nutshell" Version="0.4.3" />
paket add Rosie.Nutshell --version 0.4.3
#r "nuget: Rosie.Nutshell, 0.4.3"
// Install Rosie.Nutshell as a Cake Addin #addin nuget:?package=Rosie.Nutshell&version=0.4.3 // Install Rosie.Nutshell as a Cake Tool #tool nuget:?package=Rosie.Nutshell&version=0.4.3
Nutshell Dotnet (from Naborforce)
This is a package that contains the Rosie Nutshell Dotnet library. Produced by @naborforce, we created this package to assist with managing our data stored in the Nutshell CRM. This package is not affiliated with Nutshell, and is not supported by Nutshell. It is provided as-is, and is not guaranteed to work. Use at your own risk.
Installation
Install Rosie.Nutshell using NuGet:
Install-Package Rosie.Nutshell
Or use the .NET core CLI to install Rosie.Nutshell:
dotnet add package Rosie.Nutshell
Usage
To use Nutshell Dotnet, you will need to have a Nutshell account. You will also need to have your API key and username. You can find these in your Nutshell account under Settings → API Keys.
Authentication
To authenticate with Nutshell, you will need to inject an object of type Rosie.Nutshell.Secrets.Nutshell
into the DI
container. You can do so easily by consuming the extension method:
services.AddNutshell(new Rosie.Nutshell.Secrets.Nutshell("Username", "ApiKey"));
Using the Injected Service
After adding Nutshell to your DI container, you can make use of the scoped service: Rosie.Nutshell.INutshellGateway
.
This service contains one overloaded method that you'll need: CallAsync
. There are three versions of this method:
Task<TOut> CallAsync<TOut, TIn>(NutshellRpc<TOut, TIn> method, TIn input)
→ this method will call a Nutshell remote procedure, sending along an input and returns a value.Task<TOut> CallAsync<TOut>(NutshellFunc<TOut> method)
→ this method will call a Nutshell remote procedure that returns a value, but does not take any input.Task CallAsync<TIn>(NutshellAction<TIn> method, TIn input)
→ this method will call a Nutshell remote procedure that takes an input, but does not return a value.
Example
using Rosie.Nutshell.Types.Common;
using Rosie.Nutshell.Types.Lead;
using Rosie.Platform.Extensions;
namespace Rosie.Nutshell;
public class Example
{
private readonly INutshellGateway nutshellGateway;
public Example(INutshellGateway nutshellGateway)
{
this.nutshellGateway = nutshellGateway;
}
public async Task Run()
{
var lead = new PatchLeadRequest()
.Update(PatchLeadRequest.Keys.Market, new NutshellEntityId(19))
.Update(PatchLeadRequest.Keys.Accounts, new[] { new NutshellEntityRevision(1384, "1") })
.UpdateNullable(PatchLeadRequest.Keys.Note, "This is a test note.")
.UpdateNullable(PatchLeadRequest.Keys.Confidence, (int?)80)
.Update(PatchLeadRequest.Keys.Tags, new[] { "tag1", "tag2" });
var createdLead = await nutshellGateway.CallAsync(NutshellRpc.NewLead, lead);
Console.WriteLine(createdLead.ToJson());
}
}
Additional Remote Procedures
See the static members of Rosie.Nutshell.NutshellRpc
for all available remote procedures.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net6.0
- Microsoft.Extensions.Http (>= 7.0.0)
- Rosie.Platform (>= 7.90.4)
-
net7.0
- Microsoft.Extensions.Http (>= 7.0.0)
- Rosie.Platform (>= 7.90.4)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
0.10.0 | 429 | 11/2/2023 |
0.9.2 | 172 | 9/5/2023 |
0.9.1 | 136 | 8/22/2023 |
0.9.0 | 190 | 8/15/2023 |
0.8.0 | 144 | 8/14/2023 |
0.7.1 | 165 | 8/14/2023 |
0.7.0 | 145 | 8/14/2023 |
0.6.0 | 173 | 8/14/2023 |
0.5.1 | 153 | 7/20/2023 |
0.5.0 | 153 | 7/20/2023 |
0.4.5 | 154 | 7/19/2023 |
0.4.4 | 155 | 6/27/2023 |
0.4.3 | 143 | 6/20/2023 |
0.4.2 | 163 | 6/13/2023 |
0.4.1 | 199 | 5/31/2023 |
0.4.0 | 124 | 5/31/2023 |
0.3.0 | 199 | 5/31/2023 |
A changelog is available at https://github.com/naborforce/nutshell-dotnet/releases.