Rosie.Nutshell 0.10.0

dotnet add package Rosie.Nutshell --version 0.10.0
NuGet\Install-Package Rosie.Nutshell -Version 0.10.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Rosie.Nutshell" Version="0.10.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Rosie.Nutshell --version 0.10.0
#r "nuget: Rosie.Nutshell, 0.10.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Rosie.Nutshell as a Cake Addin
#addin nuget:?package=Rosie.Nutshell&version=0.10.0

// Install Rosie.Nutshell as a Cake Tool
#tool nuget:?package=Rosie.Nutshell&version=0.10.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:

  1. 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.
  2. 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.
  3. 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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 316 11/2/2023
0.9.2 139 9/5/2023
0.9.1 100 8/22/2023
0.9.0 162 8/15/2023
0.8.0 115 8/14/2023
0.7.1 134 8/14/2023
0.7.0 116 8/14/2023
0.6.0 142 8/14/2023
0.5.1 122 7/20/2023
0.5.0 123 7/20/2023
0.4.5 120 7/19/2023
0.4.4 124 6/27/2023
0.4.3 118 6/20/2023
0.4.2 134 6/13/2023
0.4.1 169 5/31/2023
0.4.0 99 5/31/2023
0.3.0 174 5/31/2023