Rosie.Nutshell
0.7.0
See the version list below for details.
dotnet add package Rosie.Nutshell --version 0.7.0
NuGet\Install-Package Rosie.Nutshell -Version 0.7.0
<PackageReference Include="Rosie.Nutshell" Version="0.7.0" />
paket add Rosie.Nutshell --version 0.7.0
#r "nuget: Rosie.Nutshell, 0.7.0"
// Install Rosie.Nutshell as a Cake Addin #addin nuget:?package=Rosie.Nutshell&version=0.7.0 // Install Rosie.Nutshell as a Cake Tool #tool nuget:?package=Rosie.Nutshell&version=0.7.0
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;
// this is a typical constructor for a class that uses dependency injection
public Example(INutshellGateway nutshellGateway)
{
_nutshellGateway = nutshellGateway;
}
// you can alternatively use the static method to create a NutshellGateway
public static Example CreateExample()
{
var nutshellGateway = NutshellGatewayFactory.Create();
return new Example(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.Leads.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)
-
net7.0
- Microsoft.Extensions.Http (>= 7.0.0)
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 | 424 | 11/2/2023 |
0.9.2 | 169 | 9/5/2023 |
0.9.1 | 133 | 8/22/2023 |
0.9.0 | 187 | 8/15/2023 |
0.8.0 | 141 | 8/14/2023 |
0.7.1 | 162 | 8/14/2023 |
0.7.0 | 142 | 8/14/2023 |
0.6.0 | 170 | 8/14/2023 |
0.5.1 | 150 | 7/20/2023 |
0.5.0 | 150 | 7/20/2023 |
0.4.5 | 149 | 7/19/2023 |
0.4.4 | 152 | 6/27/2023 |
0.4.3 | 140 | 6/20/2023 |
0.4.2 | 160 | 6/13/2023 |
0.4.1 | 196 | 5/31/2023 |
0.4.0 | 121 | 5/31/2023 |
0.3.0 | 196 | 5/31/2023 |
A changelog is available at https://github.com/naborforce/nutshell-dotnet/releases.