Skip to content

Commit fe9e36d

Browse files
authored
feat: add dotnet sdk (#12)
1 parent ca495c2 commit fe9e36d

25 files changed

+737
-72
lines changed

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ devcontainer::
124124

125125
# TODO: fix dotnet_sdk builds
126126
#build:: provider dotnet_sdk go_sdk nodejs_sdk python_sdk
127-
build:: provider go_sdk nodejs_sdk python_sdk
127+
build:: provider go_sdk nodejs_sdk python_sdk dotnet_sdk
128128

129129
# Required for the codegen action that runs in pulumi/pulumi
130130
only_build:: build
@@ -159,3 +159,6 @@ install_go_sdk::
159159
install_nodejs_sdk::
160160
-yarn unlink --cwd $(WORKING_DIR)/sdk/nodejs/bin
161161
yarn link --cwd $(WORKING_DIR)/sdk/nodejs/bin
162+
163+
clean::
164+
rm -rf sdk/{dotnet,nodejs,go,python}

provider/cmd/pulumi-resource-pinecone/schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@
127127
"packageReferences": {
128128
"Pulumi": "3.*"
129129
},
130-
"rootNamespace": "Pinecone"
130+
"rootNamespace": "PineconeDatabase"
131131
},
132132
"go": {
133133
"generateResourceContainerTypes": true,

provider/pkg/pinecone/provider.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ func Provider() p.Provider {
5252
"packageReferences": map[string]string{
5353
"Pulumi": "3.*",
5454
},
55-
"rootNamespace": "Pinecone",
55+
"rootNamespace": "PineconeDatabase",
5656
},
5757
"nodejs": map[string]any{
5858
"dependencies": map[string]string{

sdk/dotnet/Config/Config.cs

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
using System;
55
using System.Collections.Immutable;
66

7-
namespace Pulumi.Pinecone
7+
namespace PineconeDatabase.Pinecone
88
{
99
public static class Config
1010
{
@@ -32,24 +32,14 @@ public void Set(T value)
3232

3333
private static readonly global::Pulumi.Config __config = new global::Pulumi.Config("pinecone");
3434

35-
private static readonly __Value<string?> _apiToken = new __Value<string?>(() => __config.Get("apiToken"));
35+
private static readonly __Value<string?> _APIKey = new __Value<string?>(() => __config.Get("APIKey"));
3636
/// <summary>
3737
/// The API token for Pinecone.
3838
/// </summary>
39-
public static string? ApiToken
39+
public static string? APIKey
4040
{
41-
get => _apiToken.Get();
42-
set => _apiToken.Set(value);
43-
}
44-
45-
private static readonly __Value<string?> _pineconeEnv = new __Value<string?>(() => __config.Get("pineconeEnv"));
46-
/// <summary>
47-
/// The environment for the Pinecone API.
48-
/// </summary>
49-
public static string? PineconeEnv
50-
{
51-
get => _pineconeEnv.Get();
52-
set => _pineconeEnv.Set(value);
41+
get => _APIKey.Get();
42+
set => _APIKey.Set(value);
5343
}
5444

5545
}

sdk/dotnet/Config/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
A Pulumi native provider for Pinecone

sdk/dotnet/Enums.cs

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
// *** WARNING: this file was generated by pulumi. ***
2+
// *** Do not edit by hand unless you're certain you know what you are doing! ***
3+
4+
using System;
5+
using System.ComponentModel;
6+
using Pulumi;
7+
8+
namespace PineconeDatabase.Pinecone
9+
{
10+
[EnumType]
11+
public readonly struct IndexMetric : IEquatable<IndexMetric>
12+
{
13+
private readonly string _value;
14+
15+
private IndexMetric(string value)
16+
{
17+
_value = value ?? throw new ArgumentNullException(nameof(value));
18+
}
19+
20+
public static IndexMetric Dotproduct { get; } = new IndexMetric("dotproduct");
21+
public static IndexMetric Cosine { get; } = new IndexMetric("cosine");
22+
public static IndexMetric Euclidean { get; } = new IndexMetric("euclidean");
23+
24+
public static bool operator ==(IndexMetric left, IndexMetric right) => left.Equals(right);
25+
public static bool operator !=(IndexMetric left, IndexMetric right) => !left.Equals(right);
26+
27+
public static explicit operator string(IndexMetric value) => value._value;
28+
29+
[EditorBrowsable(EditorBrowsableState.Never)]
30+
public override bool Equals(object? obj) => obj is IndexMetric other && Equals(other);
31+
public bool Equals(IndexMetric other) => string.Equals(_value, other._value, StringComparison.Ordinal);
32+
33+
[EditorBrowsable(EditorBrowsableState.Never)]
34+
public override int GetHashCode() => _value?.GetHashCode() ?? 0;
35+
36+
public override string ToString() => _value;
37+
}
38+
39+
[EnumType]
40+
public readonly struct ServerlessSpecCloud : IEquatable<ServerlessSpecCloud>
41+
{
42+
private readonly string _value;
43+
44+
private ServerlessSpecCloud(string value)
45+
{
46+
_value = value ?? throw new ArgumentNullException(nameof(value));
47+
}
48+
49+
public static ServerlessSpecCloud Aws { get; } = new ServerlessSpecCloud("aws");
50+
public static ServerlessSpecCloud Azure { get; } = new ServerlessSpecCloud("azure");
51+
public static ServerlessSpecCloud Gcp { get; } = new ServerlessSpecCloud("gcp");
52+
53+
public static bool operator ==(ServerlessSpecCloud left, ServerlessSpecCloud right) => left.Equals(right);
54+
public static bool operator !=(ServerlessSpecCloud left, ServerlessSpecCloud right) => !left.Equals(right);
55+
56+
public static explicit operator string(ServerlessSpecCloud value) => value._value;
57+
58+
[EditorBrowsable(EditorBrowsableState.Never)]
59+
public override bool Equals(object? obj) => obj is ServerlessSpecCloud other && Equals(other);
60+
public bool Equals(ServerlessSpecCloud other) => string.Equals(_value, other._value, StringComparison.Ordinal);
61+
62+
[EditorBrowsable(EditorBrowsableState.Never)]
63+
public override int GetHashCode() => _value?.GetHashCode() ?? 0;
64+
65+
public override string ToString() => _value;
66+
}
67+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// *** WARNING: this file was generated by pulumi. ***
2+
// *** Do not edit by hand unless you're certain you know what you are doing! ***
3+
4+
using System;
5+
using System.Collections.Generic;
6+
using System.Collections.Immutable;
7+
using System.Threading.Tasks;
8+
using Pulumi.Serialization;
9+
using Pulumi;
10+
11+
namespace PineconeDatabase.Pinecone.Inputs
12+
{
13+
14+
public sealed class MetaDataConfigArgs : global::Pulumi.ResourceArgs
15+
{
16+
[Input("indexed")]
17+
private InputList<string>? _indexed;
18+
public InputList<string> Indexed
19+
{
20+
get => _indexed ?? (_indexed = new InputList<string>());
21+
set => _indexed = value;
22+
}
23+
24+
public MetaDataConfigArgs()
25+
{
26+
}
27+
public static new MetaDataConfigArgs Empty => new MetaDataConfigArgs();
28+
}
29+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
// *** WARNING: this file was generated by pulumi. ***
2+
// *** Do not edit by hand unless you're certain you know what you are doing! ***
3+
4+
using System;
5+
using System.Collections.Generic;
6+
using System.Collections.Immutable;
7+
using System.Threading.Tasks;
8+
using Pulumi.Serialization;
9+
using Pulumi;
10+
11+
namespace PineconeDatabase.Pinecone.Inputs
12+
{
13+
14+
public sealed class PineconePodSpecArgs : global::Pulumi.ResourceArgs
15+
{
16+
[Input("environment", required: true)]
17+
public Input<string> Environment { get; set; } = null!;
18+
19+
[Input("metaDataConfig")]
20+
public Input<Inputs.MetaDataConfigArgs>? MetaDataConfig { get; set; }
21+
22+
[Input("podType", required: true)]
23+
public Input<string> PodType { get; set; } = null!;
24+
25+
[Input("pods")]
26+
public Input<int>? Pods { get; set; }
27+
28+
[Input("replicas", required: true)]
29+
public Input<int> Replicas { get; set; } = null!;
30+
31+
[Input("shards")]
32+
public Input<int>? Shards { get; set; }
33+
34+
[Input("sourceCollection")]
35+
public Input<string>? SourceCollection { get; set; }
36+
37+
public PineconePodSpecArgs()
38+
{
39+
}
40+
public static new PineconePodSpecArgs Empty => new PineconePodSpecArgs();
41+
}
42+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// *** WARNING: this file was generated by pulumi. ***
2+
// *** Do not edit by hand unless you're certain you know what you are doing! ***
3+
4+
using System;
5+
using System.Collections.Generic;
6+
using System.Collections.Immutable;
7+
using System.Threading.Tasks;
8+
using Pulumi.Serialization;
9+
using Pulumi;
10+
11+
namespace PineconeDatabase.Pinecone.Inputs
12+
{
13+
14+
public sealed class PineconeServerlessSpecArgs : global::Pulumi.ResourceArgs
15+
{
16+
[Input("cloud", required: true)]
17+
public Input<PineconeDatabase.Pinecone.ServerlessSpecCloud> Cloud { get; set; } = null!;
18+
19+
[Input("region", required: true)]
20+
public Input<string> Region { get; set; } = null!;
21+
22+
public PineconeServerlessSpecArgs()
23+
{
24+
}
25+
public static new PineconeServerlessSpecArgs Empty => new PineconeServerlessSpecArgs();
26+
}
27+
}

sdk/dotnet/Inputs/PineconeSpecArgs.cs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// *** WARNING: this file was generated by pulumi. ***
2+
// *** Do not edit by hand unless you're certain you know what you are doing! ***
3+
4+
using System;
5+
using System.Collections.Generic;
6+
using System.Collections.Immutable;
7+
using System.Threading.Tasks;
8+
using Pulumi.Serialization;
9+
using Pulumi;
10+
11+
namespace PineconeDatabase.Pinecone.Inputs
12+
{
13+
14+
public sealed class PineconeSpecArgs : global::Pulumi.ResourceArgs
15+
{
16+
[Input("pod")]
17+
public Input<Inputs.PineconePodSpecArgs>? Pod { get; set; }
18+
19+
[Input("serverless")]
20+
public Input<Inputs.PineconeServerlessSpecArgs>? Serverless { get; set; }
21+
22+
public PineconeSpecArgs()
23+
{
24+
}
25+
public static new PineconeSpecArgs Empty => new PineconeSpecArgs();
26+
}
27+
}

0 commit comments

Comments
 (0)