diff --git a/.github/workflows/dotnet-test.yml b/.github/workflows/dotnet-test.yml index ce92762..cff5283 100644 --- a/.github/workflows/dotnet-test.yml +++ b/.github/workflows/dotnet-test.yml @@ -24,7 +24,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v1 with: - dotnet-version: 6.0.x + dotnet-version: 7.0.x - name: Find and Replace Version templates run: | sed -i.bak 's/${VERSION}/0.0.1/g' src/Nitric.Sdk/Nitric.Sdk.csproj diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index 523468f..377ae77 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -4,37 +4,37 @@ on: pull_request: types: [closed] branches: - - 'main' + - "main" jobs: version: if: github.event.pull_request.merged == true runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Setup Dotnet - uses: actions/setup-dotnet@v1 - with: - dotnet-version: 5.0.x - - name: Git Identity - run: | - git config --global user.name 'github-actions[bot]' - git config --global user.email 'github-actions[bot]@users.noreply.github.com' - - name: Bump version and push tag - id: tag_version - uses: mathieudutour/github-tag-action@v5.5 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} + - name: Checkout + uses: actions/checkout@v2 + - name: Setup Dotnet + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 7.0.x + - name: Git Identity + run: | + git config --global user.name 'github-actions[bot]' + git config --global user.email 'github-actions[bot]@users.noreply.github.com' + - name: Bump version and push tag + id: tag_version + uses: mathieudutour/github-tag-action@v5.5 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} - - name: Create Draft Release - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ steps.tag_version.outputs.new_tag }} - release_name: Release ${{ steps.tag_version.outputs.new_tag }} - body: See CHANGELOG.md for changes - draft: true - prerelease: false \ No newline at end of file + - name: Create Draft Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ steps.tag_version.outputs.new_tag }} + release_name: Release ${{ steps.tag_version.outputs.new_tag }} + body: See CHANGELOG.md for changes + draft: true + prerelease: false diff --git a/.github/workflows/publish-on-release.yml b/.github/workflows/publish-on-release.yml index 9d18bc3..b5804f8 100644 --- a/.github/workflows/publish-on-release.yml +++ b/.github/workflows/publish-on-release.yml @@ -18,7 +18,7 @@ jobs: uses: actions/setup-dotnet@v1 with: source-url: https://api.nuget.org/v3/index.json - dotnet-version: 5.0.x + dotnet-version: 7.0.x env: NUGET_AUTH_TOKEN: ${{ secrets.NUGET_TOKEN }} - name: Normalize version string diff --git a/.gitignore b/.gitignore index 1dac2f4..6de619c 100644 --- a/.gitignore +++ b/.gitignore @@ -330,4 +330,7 @@ ASALocalRun/ **/obj/ **/bin/ .idea -.vs \ No newline at end of file +.vs +dotCover.* +__out/** +nitric/**/*.proto \ No newline at end of file diff --git a/makefile b/makefile index b883610..99284b5 100644 --- a/makefile +++ b/makefile @@ -1,25 +1,37 @@ +.PHONY: test + # the version of of https://github.com/nitrictech/nitric to use in base client generation. -NITRIC_VERSION := 0.33.0 +NITRIC_VERSION := 1.17.0 generate: clean download build test: - dotnet test tests/Nitric.Sdk.Test + @dotnet test test/Nitric.Sdk.Test build: - dotnet build src/Nitric.Sdk/Nitric.Sdk.csproj + @dotnet build src/Nitric.Sdk/Nitric.Sdk.csproj + @mv src/Nitric.Sdk/Proto/nitric/proto/* src/Nitric.Sdk/Proto/ + @rm -rf nitric + @rm -rf src/Nitric.Sdk/Proto/nitric clean: - rm -rf src/Nitric.Sdk/bin - rm -rf src/Nitric.Sdk/obj - rm -rf src/Nitric.Sdk/Proto + @rm -rf src/Nitric.Sdk/bin + @rm -rf src/Nitric.Sdk/obj + @rm -rf src/Nitric.Sdk/Proto + @dotnet clean download: - curl -L https://github.com/nitrictech/nitric/releases/download/v${NITRIC_VERSION}/contracts.tgz -o contracts.tgz - tar xvzf contracts.tgz - rm contracts.tgz + @curl -L https://github.com/nitrictech/nitric/releases/download/v${NITRIC_VERSION}/proto.tgz -o nitric.tgz + @tar xvzf nitric.tgz + @rm nitric.tgz pack: clean download - dotnet build src/Nitric.Sdk/Nitric.Sdk.csproj -c Release - mkdir -p __out - dotnet pack -c Release -o __out \ No newline at end of file + @dotnet build src/Nitric.Sdk/Nitric.Sdk.csproj -c Release + @mkdir -p __out + @dotnet pack -c Release -o __out + +coverage: + @echo "Using dotcover tool... Install using: 'dotnet tool install --global JetBrains.dotCover.GlobalTool'" + @rm -f coverage.xml dotCover.Output.html + @dotnet dotcover test --dcReportType=HTML --dcFilters="+:Nitric.Sdk;-:type=Nitric.Proto.*" + @open dotCover.Output.html \ No newline at end of file diff --git a/src/Nitric.Sdk/Common/Constants.cs b/src/Nitric.Sdk/Common/Constants.cs deleted file mode 100644 index fcc3f8f..0000000 --- a/src/Nitric.Sdk/Common/Constants.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -namespace Nitric.Sdk.Common -{ - internal static class Constants - { - internal static int DepthLimit => 1; - } -} diff --git a/src/Nitric.Sdk/Common/Exceptions.cs b/src/Nitric.Sdk/Common/Exceptions.cs index 59a6c47..f462026 100644 --- a/src/Nitric.Sdk/Common/Exceptions.cs +++ b/src/Nitric.Sdk/Common/Exceptions.cs @@ -48,7 +48,7 @@ public NitricException(string message) : base(message) { } - internal static NitricException FromRpcException(RpcException exception) + public static NitricException FromRpcException(RpcException exception) { return Exceptions.ContainsKey(exception.StatusCode) ? Exceptions[exception.StatusCode](exception.Message) diff --git a/src/Nitric.Sdk/Common/Struct.cs b/src/Nitric.Sdk/Common/Struct.cs new file mode 100644 index 0000000..56a7a5e --- /dev/null +++ b/src/Nitric.Sdk/Common/Struct.cs @@ -0,0 +1,48 @@ +// Copyright 2021, Nitric Technologies Pty Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using Google.Protobuf; +using Newtonsoft.Json; +using ProtoStruct = Google.Protobuf.WellKnownTypes.Struct; + +namespace Nitric.Sdk.Common +{ + public class Struct + { + public static T ToJsonSerializable(ProtoStruct @struct) + { + T jsonSerializable = default; + if (@struct != null) + { + JsonFormatter formatter = new JsonFormatter(JsonFormatter.Settings.Default); + jsonSerializable = JsonConvert.DeserializeObject(formatter.Format(@struct)); + } + + return jsonSerializable; + } + + public static ProtoStruct FromJsonSerializable(T jsonSerializable) + { + ProtoStruct structPayload = null; + if (jsonSerializable != null) + { + var jsonPayload = JsonConvert.SerializeObject(jsonSerializable); + structPayload = JsonParser.Default.Parse(jsonPayload); + } + + return structPayload; + } + } +} + diff --git a/src/Nitric.Sdk/Document/AbstractCollection.cs b/src/Nitric.Sdk/Document/AbstractCollection.cs deleted file mode 100644 index 719554e..0000000 --- a/src/Nitric.Sdk/Document/AbstractCollection.cs +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -using System; -using DocumentServiceClient = Nitric.Proto.Document.v1.DocumentService.DocumentServiceClient; -using Collection = Nitric.Proto.Document.v1.Collection; - -namespace Nitric.Sdk.Document -{ - public abstract class AbstractCollection - { - internal readonly DocumentServiceClient DocumentClient; - - /// - /// The name of the collection - /// - public readonly string Name; - - /// - /// A reference to the document this collection sits below. - /// - /// If set, this is a sub-collection. - /// - public readonly Key ParentKey; - - /// - /// Construct a new collection - /// - /// The client reference to use for operations on this collection - /// The name of the collection - /// An optional parent key - /// Throws if a required parameter is missing - protected AbstractCollection(DocumentServiceClient documentClient, string name, Key parentKey) - { - if (string.IsNullOrEmpty(name)) - { - throw new ArgumentNullException(nameof(name)); - } - - this.Name = name; - this.ParentKey = parentKey; - this.DocumentClient = documentClient; - } - - internal Collection ToGrpcCollection() - { - var collection = new Collection() - { - Name = this.Name, - }; - if (this.ParentKey != null) - { - collection.Parent = this.ParentKey.ToKey(); - } - - return collection; - } - - /// - /// Determines the depth of this collection. - /// - /// If the collection has no parent collections the depth will be 1. The depth is increased by 1 for each parent. - /// - /// - public int Depth() - { - var parentDepth = (this.ParentKey != null) ? this.ParentKey.Collection.Depth() : 0; - return 1 + parentDepth; - } - } - - /// - /// Document collection base class - /// - /// The type for documents in this collection - public abstract class AbstractCollection : AbstractCollection - { - - public AbstractCollection(DocumentServiceClient documentClient, string name, Key parentKey) : base(documentClient, name, parentKey) { - - } - - /// - /// Construct a query to find documents in the collection - /// - /// A new query builder - public Query Query() - { - return new Query(this.DocumentClient, this); - } - - } -} diff --git a/src/Nitric.Sdk/Document/CollectionGroupRef.cs b/src/Nitric.Sdk/Document/CollectionGroupRef.cs deleted file mode 100644 index df5c30e..0000000 --- a/src/Nitric.Sdk/Document/CollectionGroupRef.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -using System.Collections.Generic; -using DocumentServiceClient = Nitric.Proto.Document.v1.DocumentService.DocumentServiceClient; - -namespace Nitric.Sdk.Document -{ - /// - /// Represents a group of collections, used to search for documents in across multiple collections. - /// - /// This is typically used to search all sub-collections below docs in a single parent collections. - /// - /// E.g. search all cities in all states. The group of sub-collections are expected to have the same name (e.g. "cities") - /// - /// The type of documents contained in the group of collections - public class CollectionGroup : AbstractCollection - { - /// - /// Construct a new collection group - /// - /// The document client used to interact with this group - /// A name of the collections - /// The parent of the collection - public CollectionGroup(DocumentServiceClient documentClient, string name, Key parentKey) - : base(documentClient, name, parentKey) - { - } - } -} diff --git a/src/Nitric.Sdk/Document/CollectionRef.cs b/src/Nitric.Sdk/Document/CollectionRef.cs deleted file mode 100644 index 1a85dc7..0000000 --- a/src/Nitric.Sdk/Document/CollectionRef.cs +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -using System; -using DocumentServiceClient = Nitric.Proto.Document.v1.DocumentService.DocumentServiceClient; -using Constants = Nitric.Sdk.Common.Constants; - -namespace Nitric.Sdk.Document -{ - /// - /// A reference to a collection in the underlying document database. - /// - /// The type of documents stored in the collection. - public class CollectionRef : AbstractCollection - { - internal CollectionRef(DocumentServiceClient documentClient, string name, Key parentKey = null) - : base(documentClient, name, parentKey) - { - } - - /// - /// Create a reference to a document within the collection. - /// - /// The unique ID of the document. - /// A new document reference, which can be used to interact with the document. - /// - public DocumentRef Doc(string documentId) - { - if (string.IsNullOrEmpty(documentId)) - { - throw new ArgumentNullException(nameof(documentId)); - } - - return new DocumentRef( - this.DocumentClient, - this, - documentId); - } - - /// - /// Returns a reference to all sub-collections with a particular name within this collection. - /// - /// E.g. if this is a 'states' collection, the sub-collections could be 'cities'. - /// - /// The sub-collection name - /// A reference to all sub-collections with the provided name - /// - /// - public CollectionGroup Collection(string name) - { - if (string.IsNullOrEmpty(name)) - { - throw new ArgumentNullException(name); - } - - var collectionDepth = this.Depth(); - if (collectionDepth > Constants.DepthLimit) - { - throw new NotSupportedException("Currently sub-collections are only able to be nested to a depth of " + - Constants.DepthLimit + ", found depth " + collectionDepth); - } - - var parentKey = new Key { Collection = this }; - return new CollectionGroup( - this.DocumentClient, - name, - parentKey); - } - } -} diff --git a/src/Nitric.Sdk/Document/Document.cs b/src/Nitric.Sdk/Document/Document.cs deleted file mode 100644 index a65402e..0000000 --- a/src/Nitric.Sdk/Document/Document.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -using System.Collections.Generic; - -namespace Nitric.Sdk.Document -{ - /// - /// Represents a point-in-time version of a document, including the contents. - /// - /// The type of the contents of this document - public class Document - { - /// - /// The reference to the document in the document database. - /// - public DocumentRef Ref { get; private set; } - /// - /// The document contents. - /// - public T Content { get; private set; } - - internal Document(DocumentRef documentRef, T content) - { - this.Ref = documentRef; - this.Content = content; - } - } -} diff --git a/src/Nitric.Sdk/Document/DocumentRef.cs b/src/Nitric.Sdk/Document/DocumentRef.cs deleted file mode 100644 index 3e6739f..0000000 --- a/src/Nitric.Sdk/Document/DocumentRef.cs +++ /dev/null @@ -1,228 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -using System; -using System.Linq; -using Google.Protobuf; -using DocumentServiceClient = Nitric.Proto.Document.v1.DocumentService.DocumentServiceClient; -using GrpcKey = Nitric.Proto.Document.v1.Key; -using Nitric.Proto.Document.v1; -using Google.Protobuf.WellKnownTypes; -using Newtonsoft.Json; -using RpcException = Grpc.Core.RpcException; -using NitricException = Nitric.Sdk.Common.NitricException; -using Constants = Nitric.Sdk.Common.Constants; - -namespace Nitric.Sdk.Document -{ - /// - /// A reference to a specific document in a collection. - /// - /// The expected type of the document's contents - public class DocumentRef - { - private readonly DocumentServiceClient documentClient; - - /// - /// The unique key of the document. - /// - public readonly Key Key; - - private readonly AbstractCollection collection; - - /// - /// Construct a new document reference. - /// - protected DocumentRef() - { - } - - internal DocumentRef( - DocumentServiceClient documentClient, - AbstractCollection collection, - string documentId) - { - this.documentClient = documentClient; - this.Key = new Key { Collection = collection, Id = documentId }; - this.collection = collection; - } - - /// - /// Retrieve a document, including its contents - /// - /// The document - /// - public Document Get() - { - var request = new DocumentGetRequest - { - Key = this.Key.ToKey() - }; - - try - { - var response = this.documentClient.Get(request); - return new Document( - this, - DocumentToGeneric(response.Document.Content) - ); - } - catch (RpcException re) - { - throw NitricException.FromRpcException(re); - } - } - - /// - /// Persist the document with updated contents. - /// - /// The contents to store in the document. - /// - /// - public void Set(TDocument value) - { - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - var json = JsonConvert.SerializeObject(value); - var content = JsonParser.Default.Parse(json); - - var request = new DocumentSetRequest - { - Key = this.Key.ToKey(), - Content = content - }; - try - { - this.documentClient.Set(request); - } - catch (RpcException re) - { - throw NitricException.FromRpcException(re); - } - } - - /// - /// Delete the document from the collection. - /// - /// - public void Delete() - { - var request = new DocumentDeleteRequest - { - Key = this.Key.ToKey(), - }; - try - { - this.documentClient.Delete(request); - } - catch (RpcException re) - { - throw NitricException.FromRpcException(re); - } - } - - /// - /// Create a reference to a sub-collection within this document. - /// - /// The name of the sub-collection. - /// The reference to the sub-collection. - /// - /// - public CollectionRef Collection(string name) - { - if (string.IsNullOrEmpty(name)) - { - throw new ArgumentNullException(nameof(name)); - } - - var collectionDepth = this.Key.Collection.Depth(); - if (collectionDepth > Constants.DepthLimit) - { - throw new NotSupportedException("Currently sub-collections are only able to be nested to a depth of " + - Constants.DepthLimit + ", found depth " + collectionDepth); - } - - return new CollectionRef(this.documentClient, name, this.Key); - } - - /// - /// Create a new query builder to find documents in sub-collections of this document. - /// - /// The sub-collection name - /// The query builder. - /// - public Query Query(string name) - { - if (string.IsNullOrEmpty(name)) - { - throw new ArgumentNullException(nameof(name)); - } - - var collectionGroup = new CollectionGroup( - this.documentClient, - this.collection.Name, - this.Key); - return new Query(this.documentClient, collectionGroup); - } - - /// - /// Utility function to convert a struct document to its generic counterpart - /// - /// The struct to convert. - /// - protected TDocument DocumentToGeneric(Struct content) - { - var doc = content.Fields.ToDictionary( - kv => kv.Key, kv => UnwrapValue(kv.Value)); - - var dictInJson = JsonConvert.SerializeObject(doc, new JsonSerializerSettings - { - NullValueHandling = NullValueHandling.Ignore, - FloatFormatHandling = FloatFormatHandling.DefaultValue, - }); - - return JsonConvert.DeserializeObject(dictInJson); - } - - internal static object UnwrapValue(Value value) - { - switch (value.KindCase) - { - case Value.KindOneofCase.StringValue: - return value.StringValue; - case Value.KindOneofCase.BoolValue: - return value.BoolValue; - case Value.KindOneofCase.NumberValue: - return value.NumberValue; - case Value.KindOneofCase.NullValue: - return null; - case Value.KindOneofCase.StructValue: - var unwrappedStruct = - value.StructValue.Fields.ToDictionary(kv => kv.Key, kv => UnwrapValue(kv.Value)); - - return unwrappedStruct; - case Value.KindOneofCase.ListValue: - var unwrappedList = value.ListValue.Values.Select(UnwrapValue).ToList(); - - return unwrappedList; - case Value.KindOneofCase.None: - default: - throw new ArgumentException("Provide proto-value"); - } - } - } -} diff --git a/src/Nitric.Sdk/Document/DocumentsClient.cs b/src/Nitric.Sdk/Document/DocumentsClient.cs deleted file mode 100644 index e5a5fcb..0000000 --- a/src/Nitric.Sdk/Document/DocumentsClient.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -using System; -using Nitric.Sdk.Common; -using DocumentServiceClient = Nitric.Proto.Document.v1.DocumentService.DocumentServiceClient; - -namespace Nitric.Sdk.Document -{ - /// - /// A documents service reference. - /// - public class DocumentsClient - { - private readonly DocumentServiceClient documentClient; - - /// - /// Construct a new documents client. - /// - /// Optional gRPC client to reuse. - public DocumentsClient(DocumentServiceClient client = null) - { - this.documentClient = client ?? new DocumentServiceClient(GrpcChannelProvider.GetChannel()); - } - - /// - /// Create a reference to collection from the documents service. - /// - /// The collection name - /// The expected type for documents in the collection. - /// The collection reference. - /// - public CollectionRef Collection(string name) - { - if (string.IsNullOrEmpty(name)) - { - throw new ArgumentNullException(nameof(name)); - } - - return new CollectionRef(this.documentClient, name); - } - } -} diff --git a/src/Nitric.Sdk/Document/Key.cs b/src/Nitric.Sdk/Document/Key.cs deleted file mode 100644 index e6e2778..0000000 --- a/src/Nitric.Sdk/Document/Key.cs +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -using GrpcKey = Nitric.Proto.Document.v1.Key; - -namespace Nitric.Sdk.Document -{ - /// - /// A fully qualified reference to a specific document in the document service. - /// - /// Includes the unique ID of the document and a reference to the collection that contains it. - /// - /// The expected type for the contents of the document. - public class Key - { - /// - /// The collection containing this document. - /// - public AbstractCollection Collection { get; set; } - - /// - /// The unique ID of this document within its collection. - /// - public string Id { get; set; } - - internal Key() - { - // Internal construct to avoid external key creation. - } - - /// - /// Convert this key to a string. - /// - /// Useful for logging, should not be used for serialization of the key. - /// - /// A string with details of this key. - public override string ToString() - { - return this.GetType().Name + "[collection=" + Collection + ", id=" + Id + "]"; - } - - /// - /// Convert this key to its gRPC representation. - /// - /// - internal GrpcKey ToKey() - { - return new GrpcKey - { - Collection = this.Collection.ToGrpcCollection(), - Id = this.Id ?? "", - }; - } - } -} diff --git a/src/Nitric.Sdk/Document/Query.cs b/src/Nitric.Sdk/Document/Query.cs deleted file mode 100644 index 29011f8..0000000 --- a/src/Nitric.Sdk/Document/Query.cs +++ /dev/null @@ -1,346 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -using System; -using System.Collections.Generic; -using System.Linq; -using Newtonsoft.Json; -using GrpcExpression = Nitric.Proto.Document.v1.Expression; -using ExpressionValue = Nitric.Proto.Document.v1.ExpressionValue; -using DocumentServiceClient = Nitric.Proto.Document.v1.DocumentService.DocumentServiceClient; -using Nitric.Proto.Document.v1; - -namespace Nitric.Sdk.Document -{ - /// - /// A query object used to construct document queries. - /// - /// The expected type of the found documents. - public class Query - { - internal readonly DocumentServiceClient DocumentClient; - internal readonly AbstractCollection Collection; - internal readonly List Expressions; - internal object PagingToken; - internal int ResultsLimit; - - internal Query(DocumentServiceClient documentClient, AbstractCollection collection) - { - this.DocumentClient = documentClient; - this.Collection = collection; - this.Expressions = new List(); - this.PagingToken = new Dictionary(); - this.ResultsLimit = 0; - } - - /// - /// Add a 'where' clause to this query. - /// - /// The key of the document to compare with. - /// The comparison type. - /// The value to compare with. - /// The query with the 'where' claus added. - /// - public Query Where(string operand, string op, string value) - { - if (string.IsNullOrEmpty(operand)) - { - throw new ArgumentNullException(nameof(operand)); - } - - if (string.IsNullOrEmpty(op)) - { - throw new ArgumentNullException(nameof(op)); - } - - if (string.IsNullOrEmpty(value)) - { - throw new ArgumentNullException(nameof(value)); - } - - this.Expressions.Add(new Expression(operand, op, value)); - return this; - } - - /// - /// Add a 'where' clause to this query. - /// - /// The key of the document to compare with. - /// The comparison type. - /// The value to compare with. - /// The query with the 'where' claus added. - /// - public Query Where(string operand, string op, double value) - { - if (string.IsNullOrEmpty(operand)) - { - throw new ArgumentNullException(nameof(operand)); - } - - if (string.IsNullOrEmpty(op)) - { - throw new ArgumentNullException(nameof(op)); - } - - this.Expressions.Add(new Expression(operand, op, value)); - return this; - } - - /// - /// Add a 'where' clause to this query. - /// - /// The key of the document to compare with. - /// The comparison type. - /// The value to compare with. - /// The query with the 'where' claus added. - /// - public Query Where(string operand, string op, int value) - { - if (string.IsNullOrEmpty(operand)) - { - throw new ArgumentNullException(nameof(operand)); - } - - if (string.IsNullOrEmpty(op)) - { - throw new ArgumentNullException(nameof(op)); - } - - this.Expressions.Add(new Expression(operand, op, value)); - return this; - } - - /// - /// Add a 'where' clause to this query. - /// - /// The key of the document to compare with. - /// The comparison type. - /// The value to compare with. - /// The query with the 'where' claus added. - /// - public Query Where(string operand, string op, bool value) - { - if (string.IsNullOrEmpty(operand)) - { - throw new ArgumentNullException(nameof(operand)); - } - - if (string.IsNullOrEmpty(op)) - { - throw new ArgumentNullException(nameof(op)); - } - - this.Expressions.Add(new Expression(operand, op, value)); - return this; - } - - /// - /// Query results starting from an existing paging token. - /// - /// Used when paging the results of a query for requesting subsequent pages. - /// - /// A paging token returned from a previous query. - /// The query with the paging token added. - public Query PagingFrom(object pagingToken) - { - this.PagingToken = pagingToken; - return this; - } - - /// - /// Limit the number of results returned by this query. - /// - /// A positive integer represent the maximum number of results to return. - /// - public Query Limit(int limit) - { - this.ResultsLimit = Math.Max(0, limit); - return this; - } - - /// - /// Retrieve a page of query results. - /// - /// Results - public QueryResult Fetch() - { - return new QueryResult(this, false); - } - - /// - /// Returns a string with details about this query. - /// - /// - public override string ToString() - { - return this.GetType().Name - + "[collection=" + Collection - + ", expressions=" + Expressions - + ", limit=" + ResultsLimit - + ", pagingToken=" + PagingToken - + "]"; - } - } - - /// - /// Represents the results of an executed query. - /// - /// The expected type of the found documents. - public class QueryResult - { - private readonly Query query; - private readonly bool paginateAll; - - /// - /// An optional token from a previous query, indicates where to start when retrieving additional results. - /// - public object PagingToken { get; private set; } - - /// - /// The results returned from the query. - /// - public List> Documents { get; private set; } - - internal QueryResult(Query query, bool paginateAll) - { - this.query = query; - this.paginateAll = paginateAll; - this.PagingToken = query.PagingToken; - - var request = BuildDocQueryRequest(this.query.Expressions); - - try - { - var response = this.query.DocumentClient.Query(request); - LoadPageData(response); - } - catch (Grpc.Core.RpcException re) - { - throw Common.NitricException.FromRpcException(re); - } - } - - private DocumentQueryRequest BuildDocQueryRequest(List expressions) - { - var request = new DocumentQueryRequest - { - Collection = this.query.Collection.ToGrpcCollection(), - Limit = this.query.ResultsLimit, - }; - - request.Expressions.AddRange(expressions.Select(exp => exp.ToGrpcExpression())); - - if (this.PagingToken == null) return request; - - if (!(this.PagingToken is IDictionary token)) - { - throw new ArgumentException("Invalid paging token provided!"); - } - - foreach (var kv in token) - { - request.PagingToken.Add(kv.Key, kv.Value); - } - - return request; - } - - private void LoadPageData(DocumentQueryResponse response) - { - this.Documents = new List>(response.Documents.Count); - foreach (var doc in response.Documents) - { - var dict = doc.Content.Fields.ToDictionary( - kv => kv.Key, - kv => DocumentRef.UnwrapValue(kv.Value)); - - var dictInJson = JsonConvert.SerializeObject(dict, new JsonSerializerSettings - { - NullValueHandling = NullValueHandling.Ignore, - FloatFormatHandling = FloatFormatHandling.DefaultValue, - }); - - var content = JsonConvert.DeserializeObject(dictInJson); - - Documents.Add(new Document( - new DocumentRef( - this.query.DocumentClient, - this.query.Collection, - doc.Key.Id - ), - content - )); - } - - this.PagingToken = response.PagingToken.Clone(); - } - } - - class Expression - { - readonly string operand; - readonly string op; - readonly object value; - - internal Expression(string operand, string op, object value) - { - this.operand = operand; - this.op = op; - this.value = value; - } - - internal GrpcExpression ToGrpcExpression() - { - var expression = new GrpcExpression(); - var expressionValue = new ExpressionValue(); - - expression.Operand = operand; - expression.Operator = op; - - switch (value) - { - case string s: - expressionValue.StringValue = s; - break; - case double d: - expressionValue.DoubleValue = d; - break; - case int i: - expressionValue.IntValue = i; - break; - case bool b: - expressionValue.BoolValue = b; - break; - default: - { - var msg = value.GetType().Name - + "type is not supported. Please use: string, double, integer, boolean"; - throw new ArgumentException(msg); - } - } - - expression.Value = expressionValue; - return expression; - } - - public override string ToString() - { - return this.GetType().Name - + "[operand=" + this.operand - + ", operator=" + this.op - + ", value=" + this.value - + "]"; - } - } -} diff --git a/src/Nitric.Sdk/Event/Event.cs b/src/Nitric.Sdk/Event/Event.cs deleted file mode 100644 index 9c94cfc..0000000 --- a/src/Nitric.Sdk/Event/Event.cs +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -using System; -using System.Runtime.CompilerServices; -using System.Text; -using Google.Protobuf; -using Google.Protobuf.WellKnownTypes; -using Newtonsoft.Json; -using Nitric.Proto.Event.v1; - -namespace Nitric.Sdk.Event -{ - /// - /// Events represent a Message delivered via Publish/Subscribe. - /// - public class Event - { - /// - /// The unique ID of this event. - /// - /// Used to every reprocessing. - /// - public string Id { get; set; } - - /// - /// The expected type of the event's payload. - /// - public string PayloadType { get; set; } - - /// - /// The payload (contents) of the event. - /// - public T Payload { get; set; } - - /// - /// Create a new event. - /// - public Event() - { - } - - /// - /// Create a new event object. - /// - /// The unique id for this event. - /// The type of this event's payload. - /// The contents of the event message. - public Event(string id, string payloadType, T payload) - { - this.Payload = payload; - this.Id = id ?? Guid.NewGuid().ToString(); - this.PayloadType = payloadType ?? "none"; - } - - public static Event FromPayload(byte[] data) - { - var eventData = Encoding.Default.GetString(data); - return JsonConvert.DeserializeObject>(eventData); - } - - /// - /// Return a string representing the details of the event. - /// - /// A string - public override string ToString() - { - var jsonPayload = JsonConvert.SerializeObject(Payload); - return "Event[id=" + Id - + ", payloadType=" + PayloadType - + ", payload=" + jsonPayload - + "]"; - } - - internal NitricEvent ToWire() - { - Struct payload = null; - if (this.Payload != null) - { - var jsonPayload = JsonConvert.SerializeObject(this.Payload); - payload = JsonParser.Default.Parse(jsonPayload); - } - - return new NitricEvent - { - Id = this.Id ?? "", - PayloadType = this.PayloadType ?? "", - Payload = payload, - }; - } - } -} diff --git a/src/Nitric.Sdk/Event/EventsClient.cs b/src/Nitric.Sdk/Event/EventsClient.cs deleted file mode 100644 index 10526ff..0000000 --- a/src/Nitric.Sdk/Event/EventsClient.cs +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -using System; -using System.Collections.Generic; -using System.Linq; -using Nitric.Sdk.Common; -using NitricEvent = Nitric.Proto.Event.v1.NitricEvent; -using Nitric.Proto.Event.v1; -using GrpcClient = Nitric.Proto.Event.v1.EventService.EventServiceClient; -using TopicClient = Nitric.Proto.Event.v1.TopicService.TopicServiceClient; - -namespace Nitric.Sdk.Event -{ - /// - /// Events service client. - /// - public class EventsClient - { - internal readonly GrpcClient EventClient; - private readonly TopicClient topicClient; - - /// - /// Create a new events service client. - /// - /// The events gRPC client. - /// The topics gRPC client. - public EventsClient(GrpcClient client = null, TopicClient topic = null) - { - this.EventClient = client ?? new GrpcClient(GrpcChannelProvider.GetChannel()); - this.topicClient = topic ?? new TopicClient(GrpcChannelProvider.GetChannel()); - } - - /// - /// Create a reference to a topic. - /// - /// The name of the topic. - /// The topic reference. - /// - public Topic Topic(string topicName) - { - if (string.IsNullOrEmpty(topicName)) - { - throw new ArgumentNullException(nameof(topicName)); - } - - return new Topic(this, topicName); - } - - /// - /// Return a list of all accessible topics. - /// - /// A list of accessible topics. - /// - public List> List() - { - var request = new TopicListRequest { }; - - try - { - var response = topicClient.List(request); - return response.Topics.Select(topic => new Topic(this, topic.Name)).ToList(); - } - catch (Grpc.Core.RpcException re) - { - throw NitricException.FromRpcException(re); - } - } - } -} diff --git a/src/Nitric.Sdk/Function/BucketNotificationContext.cs b/src/Nitric.Sdk/Function/BucketNotificationContext.cs deleted file mode 100644 index baa3824..0000000 --- a/src/Nitric.Sdk/Function/BucketNotificationContext.cs +++ /dev/null @@ -1,215 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -using System; -using System.Text; -using Nitric.Proto.Faas.v1; -using Nitric.Sdk.Storage; -using TriggerRequestProto = Nitric.Proto.Faas.v1.TriggerRequest; -using BucketNotificationTypeProto = Nitric.Proto.Faas.v1.BucketNotificationType; - -namespace Nitric.Sdk.Function -{ - public enum BucketNotificationType - { - Write, - Delete - } - - /// - /// Represents a bucket notification being created by a write or delete event in the bucket - /// - public class BucketNotificationRequest : AbstractRequest - { - /// - /// A reference to the file that triggered this request - /// - public string Key { get; private set; } - - /// - /// The type of event that triggered this request - /// - /// - public BucketNotificationType NotificationType { get; private set; } - - /// - /// Construct a bucket notification request - /// - /// the payload of the message - /// the file that triggered the notification - /// the type of bucket notification - /// the bucket that triggered the notification - public BucketNotificationRequest(byte[] data, string key, BucketNotificationType notificationType) : base(data) - { - this.Key = key; - this.NotificationType = notificationType; - } - } - - - /// - /// Represents a bucket notification being created by a write or delete event in the bucket - /// - public class FileNotificationRequest : AbstractRequest - { - /// - /// A reference to the file that triggered this request - /// - public File File { get; private set; } - - /// - /// The type of event that triggered this request - /// - /// - public BucketNotificationType NotificationType { get; private set; } - - /// - /// Construct a bucket notification request - /// - /// the payload of the message - /// the file that triggered the notification - /// the type of bucket notification - /// the bucket that triggered the notification - public FileNotificationRequest(byte[] data, string key, BucketNotificationType notificationType, Bucket bucket) : base(data) - { - this.File = bucket.File(key); - this.NotificationType = notificationType; - } - } - - /// - /// Represents the results of processing a bucket notification. - /// - public class BucketNotificationResponse - { - /// - /// Indicates whether the event was successfully processed. - /// - /// If this value is false, the event may be resent. - /// - public bool Success { get; set; } - - /// - /// Construct a bucket notification response. - /// - /// Indicates whether the event was successfully processed. - public BucketNotificationResponse(bool success) - { - this.Success = success; - } - } - - /// - /// Represents the request/response context for a bucket notification. - /// - public class BucketNotificationContext : TriggerContext - { - /// - /// Construct a new BucketNotificationContext. - /// - /// The request object - /// The response object - public BucketNotificationContext(BucketNotificationRequest req, BucketNotificationResponse res) : base(req, res) - { - } - - /// - /// Construct a bucket notification context from a trigger request gRPC object. - /// - /// The trigger to convert into a BucketNotificationContext. - /// The bucket notification worker options describing the worker options. - /// the new bucket notification context - public static BucketNotificationContext FromGrpcTriggerRequest(TriggerRequestProto trigger, BucketNotificationWorkerOptions options) - { - var notificationType = FromGrpcBucketNotificationType(trigger.Notification.Bucket.Type); - - return new BucketNotificationContext( - new BucketNotificationRequest(trigger.Data.ToByteArray(), trigger.Notification.Bucket.Key, - notificationType), - new BucketNotificationResponse(true)); - } - - - private static BucketNotificationType FromGrpcBucketNotificationType( - BucketNotificationTypeProto notificationType) - { - return notificationType switch - { - BucketNotificationTypeProto.Created => BucketNotificationType.Write, - BucketNotificationTypeProto.Deleted => BucketNotificationType.Delete, - _ => throw new ArgumentException("Unsupported bucket notification type") - }; - } - - /// - /// Create a gRPC trigger response from this context. - /// - /// the new trigger response - public override TriggerResponse ToGrpcTriggerContext() - { - return new TriggerResponse { Notification = new NotificationResponseContext { Success = this.Res.Success } }; - } - } - - /// - /// Represents the request/response context for a bucket notification. - /// - public class FileNotificationContext : TriggerContext - { - /// - /// Construct a new BucketNotificationContext. - /// - /// The request object - /// The response object - public FileNotificationContext(FileNotificationRequest req, BucketNotificationResponse res) : base(req, res) - { - } - - /// - /// Construct a bucket notification context from a trigger request gRPC object. - /// - /// The trigger to convert into a BucketNotificationContext. - /// The bucket notification worker options describing the worker options. - /// the new bucket notification context - public static FileNotificationContext FromGrpcTriggerRequest(TriggerRequestProto trigger, FileNotificationWorkerOptions options) - { - var notificationType = FromGrpcBucketNotificationType(trigger.Notification.Bucket.Type); - - return new FileNotificationContext( - new FileNotificationRequest(trigger.Data.ToByteArray(), trigger.Notification.Bucket.Key, - notificationType, options.Bucket), - new BucketNotificationResponse(true)); - } - - private static BucketNotificationType FromGrpcBucketNotificationType( - BucketNotificationTypeProto notificationType) - { - return notificationType switch - { - BucketNotificationTypeProto.Created => BucketNotificationType.Write, - BucketNotificationTypeProto.Deleted => BucketNotificationType.Delete, - _ => throw new ArgumentException("Unsupported bucket notification type") - }; - } - - /// - /// Create a gRPC trigger response from this context. - /// - /// the new trigger response - public override TriggerResponse ToGrpcTriggerContext() - { - return new TriggerResponse { Notification = new NotificationResponseContext { Success = this.Res.Success }}; - } - } -} diff --git a/src/Nitric.Sdk/Function/Faas.cs b/src/Nitric.Sdk/Function/Faas.cs deleted file mode 100644 index 29266b0..0000000 --- a/src/Nitric.Sdk/Function/Faas.cs +++ /dev/null @@ -1,723 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Grpc.Core; -using Nitric.Proto.Faas.v1; -using Nitric.Sdk.Common; -using Nitric.Sdk.Resource; -using Nitric.Sdk.Storage; -using ProtoApiWorkerOptions = Nitric.Proto.Faas.v1.ApiWorkerOptions; -using ProtoClient = Nitric.Proto.Faas.v1.FaasService.FaasServiceClient; -using BucketNotificationTypeProto = Nitric.Proto.Faas.v1.BucketNotificationType; -using WebsocketNotificationTypeProto = Nitric.Proto.Faas.v1.WebsocketEvent; - -namespace Nitric.Sdk.Function -{ - /// - /// Supported HTTP request methods - /// - public enum HttpMethod - { - /// - /// GET - /// - GET, - - /// - /// POST - /// - POST, - - /// - /// PUT - /// - PUT, - - /// - /// DELETE - /// - DELETE, - - /// - /// PATCH - /// - PATCH, - - /// - /// OPTIONS - /// - OPTIONS, - } - - /// - /// Common Function as a Service worker options - /// - public interface IFaasOptions - { - } - - /// - /// Options for API request handling workers. - /// - public class ApiWorkerOptions : IFaasOptions - { - /// - /// The name of the API this worker should register with. - /// - public string Api { get; set; } - - /// - /// The route this worker handlers. - /// - public string Route { get; set; } - - /// - /// The HTTP method this worker can respond to. - /// - public HashSet Methods { get; set; } - - - public MethodOptions Options { get; set; } - } - - public class MethodOptions - { - public Dictionary Security { get; internal set; } - public Dictionary SecurityDefs { get; internal set; } - } - - /// - /// Options for subscription trigger handling workers. - /// - public class SubscriptionWorkerOptions : IFaasOptions - { - /// - /// - /// - public string Topic { get; set; } - } - - /// - /// Options for schedule trigger handling workers by a rate and frequency descriptors. - /// - public class ScheduleRateWorkerOptions : IFaasOptions - { - public string Description { get; set; } - public int Rate { get; set; } - public Frequency Frequency { get; set; } - } - - /// - /// Options for scheduling triggers for workers by a cron expression. - /// - public class ScheduleCronWorkerOptions : IFaasOptions - { - public string Description { get; set; } - public string Cron { get; set; } - } - - public class FileNotificationWorkerOptions : IFaasOptions - { - public Bucket Bucket { get; set; } - - public BucketNotificationTypeProto NotificationType { get; set; } - - public string NotificationPrefixFilter { get; set; } - - public FileNotificationWorkerOptions( - Bucket bucket, - BucketNotificationType notificationType, - string notificationPrefixFilter) - { - this.Bucket = bucket; - this.NotificationType = ToGrpcNotificationType(notificationType); - this.NotificationPrefixFilter = notificationPrefixFilter; - } - - /// - /// Converts a Nitric bucket notification type to the gRPC equivalent for over-the-wire transfer. - /// - /// The type of notification that the bucket should be triggered on - /// A gRPC representation of the bucket notification type - /// If there is no matching notification type - private static BucketNotificationTypeProto ToGrpcNotificationType(BucketNotificationType notificationType) - { - return notificationType switch - { - BucketNotificationType.Write => BucketNotificationTypeProto.Created, - BucketNotificationType.Delete => BucketNotificationTypeProto.Deleted, - _ => throw new ArgumentException("Unsupported bucket notification type") - }; - } - } - - public class BucketNotificationWorkerOptions : IFaasOptions - { - public string Bucket { get; set; } - public BucketNotificationTypeProto NotificationType { get; set; } - - public string NotificationPrefixFilter { get; set; } - - public BucketNotificationWorkerOptions( - string bucket, - BucketNotificationType notificationType, - string notificationPrefixFilter) - { - this.Bucket = bucket; - this.NotificationType = ToGrpcNotificationType(notificationType); - this.NotificationPrefixFilter = notificationPrefixFilter; - - } - - /// - /// Converts a Nitric bucket notification type to the gRPC equivalent for over-the-wire transfer. - /// - /// The type of notification that the bucket should be triggered on - /// A gRPC representation of the bucket notification type - /// If there is no matching notification type - private static BucketNotificationTypeProto ToGrpcNotificationType(BucketNotificationType notificationType) - { - return notificationType switch - { - BucketNotificationType.Write => BucketNotificationTypeProto.Created, - BucketNotificationType.Delete => BucketNotificationTypeProto.Deleted, - _ => throw new ArgumentException("Unsupported bucket notification type") - }; - } - } - - public class WebsocketWorkerOptions : IFaasOptions - { - public string Socket { get; set; } - - public WebsocketNotificationTypeProto NotificationType { get; set; } - - public WebsocketWorkerOptions( - string socket, - WebsocketEventType notificationType - ) - { - this.Socket = socket; - this.NotificationType = ToGrpcNotificationType(notificationType); - } - - /// - /// Converts a Nitric bucket notification type to the gRPC equivalent for over-the-wire transfer. - /// - /// The type of notification that the bucket should be triggered on - /// A gRPC representation of the bucket notification type - /// If there is no matching notification type - private static WebsocketNotificationTypeProto ToGrpcNotificationType(WebsocketEventType notificationType) - { - return notificationType switch - { - WebsocketEventType.Connected => WebsocketNotificationTypeProto.Connect, - WebsocketEventType.Disconnected => WebsocketNotificationTypeProto.Disconnect, - WebsocketEventType.Message => WebsocketNotificationTypeProto.Message, - _ => throw new ArgumentException("Unsupported websocket notification type") - }; - } - } - - /// - /// Function as a Service server. - /// - /// Registers itself with a Nitric Server then routes incoming request to the appropriate workers. - /// - public class Faas - { - /// - /// Function a as service options - /// - public IFaasOptions Options { get; } - - /// - /// Handlers for HTTP requests - /// - private Func HttpHandler; - - private List> HttpHandlers = new List>(); - - /// - /// Handlers for event requests - /// - private Func EventHandler; - - public List> EventHandlers = new List>(); - - /// - /// Handlers for bucket notification requests - /// - private Func BucketNotificationHandler; - - private List> BucketNotificationHandlers = - new List>(); - - private Func FileNotificationHandler; - - private List> FileNotificationHandlers = - new List>(); - - private Func WebsocketHandler; - - private List> WebsocketHandlers = new List>(); - - - public ProtoClient Client { get; } = new ProtoClient(GrpcChannelProvider.GetChannel()); - - public Faas(IFaasOptions options) - { - this.Options = options; - } - - /// - /// Add a handler to the list of HTTP handlers. Used to chain together HTTP middleware. - /// - /// The HTTP handler to add to the handlers list - /// A reference to this Faas object - public Faas Http(Func handler) - { - this.HttpHandler = handler; - - return this; - } - - public Faas Http(Middleware[] middleware) - { - this.HttpHandlers.AddRange(middleware); - - return this; - } - - /// - /// Add a handler to the list of event handlers. Used to chain together event middleware. - /// - /// The event handler to add to the handlers list - /// A reference to this Faas object - public Faas Event(Func handler) - { - this.EventHandler = handler; - - return this; - } - - public Faas Event(Middleware[] middleware) - { - this.EventHandlers.AddRange(middleware); - - return this; - } - - /// - /// Add a handler to the list of bucket notification handlers. Used to chain together notification middleware. - /// - /// The bucket notification to add to the handlers list - /// A reference to this Faas object - public Faas BucketNotification(Func handler) - { - this.BucketNotificationHandler = handler; - - return this; - } - - public Faas BucketNotification(Middleware[] middleware) - { - this.BucketNotificationHandlers.AddRange(middleware); - - return this; - } - - /// - /// Add a handler to the list of bucket notification handlers. Used to chain together notification middleware. - /// - /// The bucket notification to add to the handlers list - /// A reference to this Faas object - public Faas FileNotification(Func handler) - { - this.FileNotificationHandler = handler; - - return this; - } - - public Faas FileNotification(Middleware[] middleware) - { - this.FileNotificationHandlers.AddRange(middleware); - - return this; - } - - public Faas Websocket(Func handler) - { - this.WebsocketHandler = handler; - - return this; - } - - public Faas Websocket(Middleware[] middleware) - { - this.WebsocketHandlers.AddRange(middleware); - - return this; - } - - private static InitRequest OptionsToInit(IFaasOptions options) - { - switch (options) - { - case ApiWorkerOptions a: - var apiInitReq = new InitRequest { Api = new ApiWorker { Api = a.Api, Path = a.Route } }; - - apiInitReq.Api.Methods.Add(a.Methods.Select(m => m.ToString())); - - var opts = new ProtoApiWorkerOptions(); - - if (a.Options.Security.Count == 0) - { - opts.SecurityDisabled = false; - } else - { - foreach (KeyValuePair kv in a.Options.Security) - { - var scopes = new ApiWorkerScopes(); - scopes.Scopes.AddRange(kv.Value); - - opts.Security.Add(kv.Key, scopes); - } - } - - apiInitReq.Api.Options = opts; - - return apiInitReq; - case ScheduleRateWorkerOptions s: - var scheduleInitReq = new InitRequest - { - Schedule = new ScheduleWorker - { - Rate = new ScheduleRate { Rate = s.Rate + " " + s.Frequency.ToString().ToLower() }, - Key = s.Description - } - }; - return scheduleInitReq; - case ScheduleCronWorkerOptions s: - var scheduleCronInitReq = new InitRequest - { - Schedule = new ScheduleWorker - { - Cron = - { - Cron = s.Cron, - }, - Key = s.Description, - } - }; - return scheduleCronInitReq; - case SubscriptionWorkerOptions s: - var subInitReq = new InitRequest - { - Subscription = new SubscriptionWorker - { - Topic = s.Topic, - }, - }; - return subInitReq; - case BucketNotificationWorkerOptions b: - var notificationInitReq = new InitRequest - { - BucketNotification = new BucketNotificationWorker - { - Bucket = b.Bucket, - Config = new BucketNotificationConfig - { - NotificationPrefixFilter = b.NotificationPrefixFilter, - NotificationType = b.NotificationType, - } - } - }; - return notificationInitReq; - case FileNotificationWorkerOptions f: - var fNotificationInitRequest = new InitRequest - { - BucketNotification = new BucketNotificationWorker - { - Bucket = f.Bucket.Name, - Config = new BucketNotificationConfig - { - NotificationPrefixFilter = f.NotificationPrefixFilter, - NotificationType = f.NotificationType, - } - } - }; - return fNotificationInitRequest; - case WebsocketWorkerOptions w: - var websocketInitRequest = new InitRequest - { - Websocket = new WebsocketWorker - { - Socket = w.Socket, - Event = w.NotificationType, - } - }; - return websocketInitRequest; - } - - throw new Exception("Invalid worker options"); - } - - /// - /// Start the FaaS service to start receiving requests from the Nitric Server - /// - /// - /// - /// - /// - public async Task Start() - { - if ( - this.EventHandlers.Count == 0 && this.EventHandler == null && - this.HttpHandlers.Count == 0 && this.HttpHandler == null && - this.BucketNotificationHandlers.Count == 0 && this.BucketNotificationHandler == null && - this.FileNotificationHandlers.Count == 0 && this.FileNotificationHandler == null && - this.WebsocketHandlers.Count == 0 && this.WebsocketHandler == null - ) - { - throw new Exception("At least one handler must be provided."); - } - - using var call = this.Client.TriggerStream(); - - try - { - await call.RequestStream.WriteAsync( - new ClientMessage - { - InitRequest = OptionsToInit(this.Options), - } - ); - } - catch (RpcException re) - { - // If the server is unavailable, provide a informative message - throw re.StatusCode == StatusCode.Unavailable ? - new Exception( - "Unable to connect to a nitric server! If you're running locally make sure to run \"nitric start\"") - : NitricException.FromRpcException(re); - } - - try - { - while (await call.ResponseStream.MoveNext()) - { - var grpcRequest = call.ResponseStream.Current; - switch (grpcRequest.ContentCase) - { - case ServerMessage.ContentOneofCase.InitResponse: - break; //no-op - reserved for future use. - case ServerMessage.ContentOneofCase.TriggerRequest: - IContext resultContext; - switch (grpcRequest.TriggerRequest.ContextCase) - { - case TriggerRequest.ContextOneofCase.Http: - if (this.HttpHandlers.Count == 0 && this.HttpHandler == null) - { - throw new UnimplementedException("Cannot handle HTTP requests."); - } - - var ctxHttp = TriggerContext - .FromGrpcTriggerRequest(grpcRequest.TriggerRequest, this.Options); - - Func composedHttpHandler = this.HttpHandler; - if (this.HttpHandler == null) - { - Func lastCall = (context) => context; - - this.HttpHandlers.Reverse(); - - composedHttpHandler = this.HttpHandlers.Aggregate(lastCall, (next, handler) => - { - Func nextFunc = (context) => handler(context, next) ?? context; - - return nextFunc; - }); - } - - resultContext = composedHttpHandler(ctxHttp); - break; - case TriggerRequest.ContextOneofCase.Topic: - if (this.EventHandlers.Count == 0 && this.EventHandler == null) - { - throw new UnimplementedException("Cannot handle event requests."); - } - - var ctxEvent = TriggerContext - .FromGrpcTriggerRequest(grpcRequest.TriggerRequest, this.Options); - - - Func composedEventHandler = this.EventHandler; - if (this.EventHandler == null) - { - Func lastCall = (context) => context; - - this.EventHandlers.Reverse(); - - composedEventHandler = this.EventHandlers.Aggregate(lastCall, (next, handler) => - { - Func nextFunc = (context) => handler(context, next) ?? context; - - return nextFunc; - }); - - } - - resultContext = composedEventHandler(ctxEvent); - - break; - case TriggerRequest.ContextOneofCase.Notification: - if (this.Options.GetType() == typeof(BucketNotificationWorkerOptions)) - { - if (this.BucketNotificationHandlers.Count == 0 && - this.BucketNotificationHandler == null) - { - throw new UnimplementedException( - "Cannot handle bucket notification requests."); - } - - var ctxNotification = - TriggerContext - .FromGrpcTriggerRequest( - grpcRequest.TriggerRequest, this.Options); - - - var composedNotificationHandler = this.BucketNotificationHandler; - if (this.BucketNotificationHandler == null) - { - Func lastCall = - (context) => context; - - this.BucketNotificationHandlers.Reverse(); - - composedNotificationHandler = this.BucketNotificationHandlers.Aggregate( - lastCall, - (next, handler) => - { - Func - nextFunc = - (context) => handler(context, next) ?? context; - - return nextFunc; - }); - - } - - resultContext = composedNotificationHandler(ctxNotification); - } - else - { - if (this.FileNotificationHandlers.Count == 0 && - this.FileNotificationHandler == null) - { - throw new UnimplementedException( - "Cannot handle file notification requests."); - } - - var ctxNotification = - TriggerContext - .FromGrpcTriggerRequest( - grpcRequest.TriggerRequest, this.Options); - - - var composedNotificationHandler = this.FileNotificationHandler; - if (this.FileNotificationHandler == null) - { - Func lastCall = - (context) => context; - - this.FileNotificationHandlers.Reverse(); - - composedNotificationHandler = this.FileNotificationHandlers.Aggregate( - lastCall, - (next, handler) => - { - Func - nextFunc = - (context) => handler(context, next) ?? context; - - return nextFunc; - }); - - } - - resultContext = composedNotificationHandler(ctxNotification); - } - - break; - case TriggerRequest.ContextOneofCase.Websocket: - if (this.WebsocketHandlers.Count == 0 && this.WebsocketHandler == null) - { - throw new UnimplementedException("Cannot handle Websocket requests."); - } - - var ctxWebsocket = TriggerContext - .FromGrpcTriggerRequest(grpcRequest.TriggerRequest, this.Options); - - Func composedWebsocketHandler = this.WebsocketHandler; - if (this.WebsocketHandler == null) - { - Func lastCall = (context) => context; - - this.WebsocketHandlers.Reverse(); - - composedWebsocketHandler = this.WebsocketHandlers.Aggregate(lastCall, (next, handler) => - { - Func nextFunc = (context) => handler(context, next) ?? context; - - return nextFunc; - }); - } - - resultContext = composedWebsocketHandler(ctxWebsocket); - break; - case TriggerRequest.ContextOneofCase.None: - default: - throw new Exception("Unsupported trigger request type"); - } - - var grpcResponse = resultContext.ToGrpcTriggerContext(); - - //Write back the response to the server - await call.RequestStream.WriteAsync( - new ClientMessage - { - Id = grpcRequest.Id, - TriggerResponse = grpcResponse - } - ); - break; - case ServerMessage.ContentOneofCase.None: - break; - default: - throw new ArgumentOutOfRangeException(); - } - } - } - catch (RpcException re) - { - throw NitricException.FromRpcException(re); - } - } - } -} diff --git a/src/Nitric.Sdk/Function/TriggerContext.cs b/src/Nitric.Sdk/Function/TriggerContext.cs deleted file mode 100644 index e93d55e..0000000 --- a/src/Nitric.Sdk/Function/TriggerContext.cs +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -using System; -using Newtonsoft.Json; -using Nitric.Proto.Faas.v1; -using TriggerRequestProto = Nitric.Proto.Faas.v1.TriggerRequest; - -namespace Nitric.Sdk.Function -{ - /// - /// The base request structure, common to HTTP and Event requests. - /// - public abstract class AbstractRequest - { - /// - /// The payload of the request. - /// - protected byte[] data; - - /// - /// Construct a request. - /// - /// The payload of the request. - protected AbstractRequest(byte[] data) - { - this.data = data; - } - } - - public interface IContext - { - /// - /// Convert the context object to the gRPC wire representation. - /// - /// A TriggerResponse from the context - public TriggerResponse ToGrpcTriggerContext(); - } - - /// - /// The base context structure, common to HTTP and Event contexts. - /// - /// The context's request. - /// The context's response. - public abstract class TriggerContext : IContext where Request : AbstractRequest - { - public Request Req; - public Response Res; - - public abstract TriggerResponse ToGrpcTriggerContext(); - - /// - /// Create a new trigger context with the provided request and response objects. - /// - /// The request object that initiated the trigger - /// The response to be returned from processing the trigger - protected TriggerContext(Request req, Response res) - { - this.Req = req; - this.Res = res; - } - - /// - /// Construct the appropriate context object based on the type of the incoming trigger. - /// - /// The trigger to use to create the context. - /// The expected context type. - /// A new context object. - /// Throws if the context type is unknown or unsupported. - public static T FromGrpcTriggerRequest(TriggerRequestProto trigger, IFaasOptions options) where T : TriggerContext - { - return trigger.ContextCase switch - { - TriggerRequestProto.ContextOneofCase.Http => HttpContext.FromGrpcTriggerRequest(trigger) as T, - TriggerRequestProto.ContextOneofCase.Topic => EventContext.FromGrpcTriggerRequest(trigger) as T, - TriggerRequestProto.ContextOneofCase.Notification => - BucketNotificationContext.FromGrpcTriggerRequest(trigger, (BucketNotificationWorkerOptions)options) as T, - TriggerRequestProto.ContextOneofCase.Websocket => WebsocketContext.FromGrpcTriggerRequest(trigger) as T, - _ => throw new Exception("Unsupported trigger request type") - }; - } - } -} diff --git a/src/Nitric.Sdk/Job/Job.cs b/src/Nitric.Sdk/Job/Job.cs new file mode 100644 index 0000000..2ffd1bd --- /dev/null +++ b/src/Nitric.Sdk/Job/Job.cs @@ -0,0 +1,77 @@ +// Copyright 2021, Nitric Technologies Pty Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System; +using System.Threading.Tasks; +using Nitric.Proto.Batch.v1; +using Nitric.Sdk.Common; +using GrpcClient = Nitric.Proto.Batch.v1.Batch.BatchClient; + +namespace Nitric.Sdk.Job +{ + /// + /// A reference to a job. + /// + public class Job + { + internal readonly GrpcClient Client; + + /// + /// The name of the job. + /// + public string Name { get; private set; } + + public Job(string name, GrpcClient client = null) + { + if (string.IsNullOrEmpty(name)) + { + throw new ArgumentNullException(nameof(name)); + } + + this.Client = client; + this.Name = name; + } + + /// + /// Submit a job to the batch service asynchronously + /// + /// Data to submit to the job + public async Task Submit(T data) + { + var request = new JobSubmitRequest + { + JobName = this.Name, + }; + + if (data != null) + { + request.Data = new JobData + { + Struct = Struct.FromJsonSerializable(data), + }; + } + + await this.Client.SubmitJobAsync(request); + } + + /// + /// Return a string representation of the job. + /// + /// + public override string ToString() + { + return GetType().Name + "[name=" + Name + "]"; + } + } +} diff --git a/src/Nitric.Sdk/KeyValueStore/KeyValueStore.cs b/src/Nitric.Sdk/KeyValueStore/KeyValueStore.cs new file mode 100644 index 0000000..92faf36 --- /dev/null +++ b/src/Nitric.Sdk/KeyValueStore/KeyValueStore.cs @@ -0,0 +1,189 @@ +// Copyright 2021, Nitric Technologies Pty Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System; +using System.Threading; +using System.Threading.Tasks; +using Nitric.Proto.KvStore.v1; +using Nitric.Sdk.Common; +using GrpcClient = Nitric.Proto.KvStore.v1.KvStore.KvStoreClient; + +namespace Nitric.Sdk.KeyValueStore +{ + public class KeyValueStore + { + public string Name; + private readonly GrpcClient Client; + + public KeyValueStore(string name, GrpcClient client = null) + { + if (string.IsNullOrEmpty(name)) + { + throw new ArgumentNullException(nameof(name)); + } + + this.Client = client; + this.Name = name; + } + + /// + /// Get a value from the key value store by referencing the key. + /// + /// The unique key that references the value. + /// The value that was referenced by the key. + public async Task Get(string key) + { + var request = new KvStoreGetValueRequest + { + Ref = new ValueRef + { + Store = Name, + Key = key, + } + }; + + try + { + var resp = await this.Client.GetValueAsync(request); + + return Struct.ToJsonSerializable(resp.Value.Content); + } + catch (Grpc.Core.RpcException re) + { + throw NitricException.FromRpcException(re); + } + } + + /// + /// Set a key value pair in the key value store. + /// + /// A unique key that will reference the value. + /// The value to store. + public async Task Set(string key, T value) + { + var request = new KvStoreSetValueRequest + { + Content = Struct.FromJsonSerializable(value), + Ref = new ValueRef + { + Store = Name, + Key = key, + } + }; + + try + { + await this.Client.SetValueAsync(request); + } + catch (Grpc.Core.RpcException re) + { + throw NitricException.FromRpcException(re); + } + } + + /// + /// Delete a value from the key value store. + /// + /// The unique key that references the value. + public async Task Delete(string key) + { + var request = new KvStoreDeleteKeyRequest + { + Ref = new ValueRef + { + Store = Name, + Key = key, + } + }; + + try + { + await this.Client.DeleteKeyAsync(request); + } + catch (Grpc.Core.RpcException re) + { + throw NitricException.FromRpcException(re); + } + } + + public KeyValueKeysResponseStream Keys(string prefix = "") + { + var request = new KvStoreScanKeysRequest + { + Prefix = prefix, + Store = new Store + { + Name = this.Name, + }, + }; + + try + { + var resp = this.Client.ScanKeys(request); + + return new KeyValueKeysResponseStream(resp.ResponseStream); + + } + catch (Grpc.Core.RpcException re) + { + throw NitricException.FromRpcException(re); + } + } + + /// + /// Return a string representation of the key value store. Will not contain the key value store contents. + /// + /// + public override string ToString() + { + return GetType().Name + "[name=" + Name + "]"; + } + } + + public class KeyValueKeysResponseStream + { + private Grpc.Core.IAsyncStreamReader stream; + + internal KeyValueKeysResponseStream(Grpc.Core.IAsyncStreamReader stream) + { + this.stream = stream; + } + + /// + /// Advances the reader to the next element in the sequence, returning the result asynchronously + /// + /// Task containing the result of the operation: true if the reader was successfully advanced to the next element; false if the reader has passed the end of the sequence. + public Task MoveNext() + { + return stream.MoveNext(CancellationToken.None); + } + + /// + /// Advances the reader to the next element in the sequence, returning the result asynchronously + /// + /// Cancellation token that can be used to cancel the operation. + /// Task containing the result of the operation: true if the reader was successfully advanced to the next element; false if the reader has passed the end of the sequence. + public Task MoveNext(CancellationToken cancellationToken) + { + return stream.MoveNext(cancellationToken); + } + + + /// + /// Gets the current key in the iteration. + /// + public string Current { get => stream.Current.Key; } + } +} + diff --git a/src/Nitric.Sdk/Nitric.Sdk.csproj b/src/Nitric.Sdk/Nitric.Sdk.csproj index b7be4fe..c7f40ee 100644 --- a/src/Nitric.Sdk/Nitric.Sdk.csproj +++ b/src/Nitric.Sdk/Nitric.Sdk.csproj @@ -1,7 +1,7 @@ netstandard2.1 - 0.0.1 + 1.0.0-b Nitric.Sdk Nitric Pty Ltd LICENSE.txt @@ -13,7 +13,7 @@ - + @@ -23,15 +23,10 @@ - - - - - - - - + + + - \ No newline at end of file + diff --git a/src/Nitric.Sdk/Nitric.cs b/src/Nitric.Sdk/Nitric.cs index d01b980..817900c 100644 --- a/src/Nitric.Sdk/Nitric.cs +++ b/src/Nitric.Sdk/Nitric.cs @@ -15,8 +15,8 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; -using Nitric.Sdk.Function; using Nitric.Sdk.Resource; +using Nitric.Sdk.Worker; namespace Nitric.Sdk { @@ -25,14 +25,19 @@ namespace Nitric.Sdk /// public class Nitric { - private static readonly List Workers = new List(); + private static readonly List Workers = new List(); private static readonly Dictionary> Cache = new Dictionary>(); - internal static void RegisterWorker(Faas worker) + internal static void RegisterWorker(IWorker worker) { - Nitric.Workers.Add(worker); + if (worker == null) + { + throw new ArgumentNullException(nameof(worker)); + } + + Workers.Add(worker); } /// @@ -46,29 +51,7 @@ public static void Run() Task.WaitAll(Workers.Select(worker => worker.Start()).ToArray()); } - /// - /// Declare a REST/HTTP API resource. - /// - /// Used to register routes and handlers for HTTP requests. - /// - /// The unique name of this API. - /// - public static ApiResource Api(string name, ApiOptions options = null) - { - return new ApiResource(name, options); - } - - /// - /// Declare a schedule. - /// - /// A short description of the schedule - /// - public static ScheduleResource Schedule(string description) - { - return new ScheduleResource(description); - } - - private static T Cached(string name, Func make) where T : BaseResource + internal static T Register(string name, Func make) where T : BaseResource { var typeMap = Cache.GetValueOrDefault(typeof(T), new Dictionary()); var resource = typeMap!.GetValueOrDefault(name, make(name)) as T; @@ -80,56 +63,101 @@ private static T Cached(string name, Func make) where T : BaseReso } else { + resource.Register(); Cache.Add(typeof(T), typeMap); - } return resource; } + /// + /// Declare a REST/HTTP API resource. + /// + /// Used to register routes and handlers for HTTP requests. + /// + /// The unique name of this API. + /// + public static ApiResource Api(string name, ApiOptions options = null) => Register(name, s => new ApiResource(s, options)); + + /// + /// Declare a schedule. + /// + /// A short description of the schedule + /// + public static ScheduleResource Schedule(string description) => Register(description, s => new ScheduleResource(s)); + /// /// Declare a bucket resources for file/blob storage. /// /// The unique name of the bucket within this application. /// A bucket resource, if the name has already been declared the same resource will be returned. - public static BucketResource Bucket(string name) => Cached(name, t => new BucketResource(t)); + public static BucketResource Bucket(string name) => Register(name, t => new BucketResource(t)); /// - /// Declare a collection resource for document storage. + /// Declare a key value store resource for storing key value pairs. /// - /// The unique name of the collection within this application. - /// The type of documents to be stored in the collection. - /// A collection resource, if the name has already been declared the same resource will be returned. - public static CollectionResource Collection(string name) => - Cached(name, t => new CollectionResource(t)); + /// The unique name of the key value store within this application. + /// The type of values to be stored. + /// A key value resource, if the name has already been declared the same resource will be returned. + public static KeyValueStoreResource KV(string name) => + Register(name, t => new KeyValueStoreResource(t)); /// /// Declare a secret resource for accessing and putting secret values. /// /// The unique name of the secret within this application. /// A secret resource, if the name has already been declared the same resource will be returned. - public static SecretResource Secret(string name) => Cached(name, t => new SecretResource(t)); + public static SecretResource Secret(string name) => Register(name, t => new SecretResource(t)); /// /// Declare a queue resources for pull-based tasks and batch workloads. /// /// The unique name of the queue within this application. /// A queue resource, if the name has already been declared the same resource will be returned. - public static QueueResource Queue(string name) => Cached(name, n => new QueueResource(n)); + public static QueueResource Queue(string name) => Register(name, n => new QueueResource(n)); /// /// Declare a topic resource for push-based events and messaging. /// /// The unique name of the topic within this application. /// A topic resource, if the name has already been declared the same resource will be returned. - public static TopicResource Topic(string name) => Cached(name, t => new TopicResource(t)); + public static TopicResource Topic(string name) => Register(name, t => new TopicResource(t)); /// /// Declare a websocket resource for bidirectional HTTP communication. /// /// The unique name of the websocket within this application. /// A websocket resource, if the name has already been declared the same resource will be returned. - public static WebsocketResource Websocket(string name) => Cached(name, t => new WebsocketResource(t)); + public static WebsocketResource Websocket(string name) => Register(name, t => new WebsocketResource(t)); + + /// + /// Declare a new Oidc rule for API security. + /// + /// The name of the rule. + /// The OIDC issuer URI. + /// + /// + public static OidcScopes OidcRule(string name, string issuer, string[] audiences) + { + return scopes => + { + return new OidcOptions(name, issuer, audiences, scopes); + }; + } + + /// + /// Declare a SQL resource to access a relational database. + /// + /// The unique name of the database within this application. + /// A SQL resource, if the name has already been declared the same resource will be returned. + public static SqlResource Sql(string name, string migrations = "") => Register(name, t => new SqlResource(t, migrations)); + + /// + /// Declare a batch resource for long-running compute jobs. + /// + /// The unique name of the job within this application. + /// A job resource, if the name has already been declared the same resource will be returned. + public static JobResource Job(string name) => Register(name, t => new JobResource(t)); } } diff --git a/src/Nitric.Sdk/Proto/proto/storage/v1/Storage.cs b/src/Nitric.Sdk/Proto/nitric/proto/apis/v1/Apis.cs similarity index 55% rename from src/Nitric.Sdk/Proto/proto/storage/v1/Storage.cs rename to src/Nitric.Sdk/Proto/nitric/proto/apis/v1/Apis.cs index 1cd507d..3dbd2bf 100644 --- a/src/Nitric.Sdk/Proto/proto/storage/v1/Storage.cs +++ b/src/Nitric.Sdk/Proto/nitric/proto/apis/v1/Apis.cs @@ -1,6 +1,6 @@ // // Generated by the protocol buffer compiler. DO NOT EDIT! -// source: proto/storage/v1/storage.proto +// source: nitric/proto/apis/v1/apis.proto // #pragma warning disable 1591, 0612, 3021 #region Designer generated code @@ -9,95 +9,99 @@ using pbc = global::Google.Protobuf.Collections; using pbr = global::Google.Protobuf.Reflection; using scg = global::System.Collections.Generic; -namespace Nitric.Proto.Storage.v1 { +namespace Nitric.Proto.Apis.v1 { - /// Holder for reflection information generated from proto/storage/v1/storage.proto - public static partial class StorageReflection { + /// Holder for reflection information generated from nitric/proto/apis/v1/apis.proto + public static partial class ApisReflection { #region Descriptor - /// File descriptor for proto/storage/v1/storage.proto + /// File descriptor for nitric/proto/apis/v1/apis.proto public static pbr::FileDescriptor Descriptor { get { return descriptor; } } private static pbr::FileDescriptor descriptor; - static StorageReflection() { + static ApisReflection() { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( - "Ch5wcm90by9zdG9yYWdlL3YxL3N0b3JhZ2UucHJvdG8SEW5pdHJpYy5zdG9y", - "YWdlLnYxGhd2YWxpZGF0ZS92YWxpZGF0ZS5wcm90byJOChNTdG9yYWdlV3Jp", - "dGVSZXF1ZXN0EhMKC2J1Y2tldF9uYW1lGAEgASgJEhQKA2tleRgCIAEoCUIH", - "+kIEcgIQARIMCgRib2R5GAMgASgMIhYKFFN0b3JhZ2VXcml0ZVJlc3BvbnNl", - "Ij8KElN0b3JhZ2VSZWFkUmVxdWVzdBITCgtidWNrZXRfbmFtZRgBIAEoCRIU", - "CgNrZXkYAiABKAlCB/pCBHICEAEiIwoTU3RvcmFnZVJlYWRSZXNwb25zZRIM", - "CgRib2R5GAEgASgMIkEKFFN0b3JhZ2VEZWxldGVSZXF1ZXN0EhMKC2J1Y2tl", - "dF9uYW1lGAEgASgJEhQKA2tleRgCIAEoCUIH+kIEcgIQASIXChVTdG9yYWdl", - "RGVsZXRlUmVzcG9uc2UiwQEKGFN0b3JhZ2VQcmVTaWduVXJsUmVxdWVzdBIT", - "CgtidWNrZXRfbmFtZRgBIAEoCRIUCgNrZXkYAiABKAlCB/pCBHICEAESSAoJ", - "b3BlcmF0aW9uGAMgASgOMjUubml0cmljLnN0b3JhZ2UudjEuU3RvcmFnZVBy", - "ZVNpZ25VcmxSZXF1ZXN0Lk9wZXJhdGlvbhIOCgZleHBpcnkYBCABKA0iIAoJ", - "T3BlcmF0aW9uEggKBFJFQUQQABIJCgVXUklURRABIigKGVN0b3JhZ2VQcmVT", - "aWduVXJsUmVzcG9uc2USCwoDdXJsGAEgASgJIj4KF1N0b3JhZ2VMaXN0Rmls", - "ZXNSZXF1ZXN0EhMKC2J1Y2tldF9uYW1lGAEgASgJEg4KBnByZWZpeBgCIAEo", - "CSITCgRGaWxlEgsKA2tleRgBIAEoCSJCChhTdG9yYWdlTGlzdEZpbGVzUmVz", - "cG9uc2USJgoFZmlsZXMYASADKAsyFy5uaXRyaWMuc3RvcmFnZS52MS5GaWxl", - "IjwKFFN0b3JhZ2VFeGlzdHNSZXF1ZXN0Eg4KBmJ1Y2tldBgBIAEoCRIUCgNr", - "ZXkYAiABKAlCB/pCBHICEAEiJwoVU3RvcmFnZUV4aXN0c1Jlc3BvbnNlEg4K", - "BmV4aXN0cxgBIAEoCDLKBAoOU3RvcmFnZVNlcnZpY2USVQoEUmVhZBIlLm5p", - "dHJpYy5zdG9yYWdlLnYxLlN0b3JhZ2VSZWFkUmVxdWVzdBomLm5pdHJpYy5z", - "dG9yYWdlLnYxLlN0b3JhZ2VSZWFkUmVzcG9uc2USWAoFV3JpdGUSJi5uaXRy", - "aWMuc3RvcmFnZS52MS5TdG9yYWdlV3JpdGVSZXF1ZXN0Gicubml0cmljLnN0", - "b3JhZ2UudjEuU3RvcmFnZVdyaXRlUmVzcG9uc2USWwoGRGVsZXRlEicubml0", - "cmljLnN0b3JhZ2UudjEuU3RvcmFnZURlbGV0ZVJlcXVlc3QaKC5uaXRyaWMu", - "c3RvcmFnZS52MS5TdG9yYWdlRGVsZXRlUmVzcG9uc2USZwoKUHJlU2lnblVy", - "bBIrLm5pdHJpYy5zdG9yYWdlLnYxLlN0b3JhZ2VQcmVTaWduVXJsUmVxdWVz", - "dBosLm5pdHJpYy5zdG9yYWdlLnYxLlN0b3JhZ2VQcmVTaWduVXJsUmVzcG9u", - "c2USZAoJTGlzdEZpbGVzEioubml0cmljLnN0b3JhZ2UudjEuU3RvcmFnZUxp", - "c3RGaWxlc1JlcXVlc3QaKy5uaXRyaWMuc3RvcmFnZS52MS5TdG9yYWdlTGlz", - "dEZpbGVzUmVzcG9uc2USWwoGRXhpc3RzEicubml0cmljLnN0b3JhZ2UudjEu", - "U3RvcmFnZUV4aXN0c1JlcXVlc3QaKC5uaXRyaWMuc3RvcmFnZS52MS5TdG9y", - "YWdlRXhpc3RzUmVzcG9uc2VCkQEKGmlvLm5pdHJpYy5wcm90by5zdG9yYWdl", - "LnYxQghTdG9yYWdlc1ABWjNnaXRodWIuY29tL25pdHJpY3RlY2gvbml0cmlj", - "L2NvcmUvcGtnL2FwaS9uaXRyaWMvdjGqAhdOaXRyaWMuUHJvdG8uU3RvcmFn", - "ZS52McoCF05pdHJpY1xQcm90b1xTdG9yYWdlXFYxYgZwcm90bzM=")); + "Ch9uaXRyaWMvcHJvdG8vYXBpcy92MS9hcGlzLnByb3RvEhRuaXRyaWMucHJv", + "dG8uYXBpcy52MSIlChFBcGlEZXRhaWxzUmVxdWVzdBIQCghhcGlfbmFtZRgB", + "IAEoCSIhChJBcGlEZXRhaWxzUmVzcG9uc2USCwoDdXJsGAEgASgJIq4BCg1D", + "bGllbnRNZXNzYWdlEgoKAmlkGAEgASgJEkkKFHJlZ2lzdHJhdGlvbl9yZXF1", + "ZXN0GAIgASgLMikubml0cmljLnByb3RvLmFwaXMudjEuUmVnaXN0cmF0aW9u", + "UmVxdWVzdEgAEjsKDWh0dHBfcmVzcG9uc2UYAyABKAsyIi5uaXRyaWMucHJv", + "dG8uYXBpcy52MS5IdHRwUmVzcG9uc2VIAEIJCgdjb250ZW50IhwKC0hlYWRl", + "clZhbHVlEg0KBXZhbHVlGAEgAygJIhsKClF1ZXJ5VmFsdWUSDQoFdmFsdWUY", + "ASADKAki6AMKC0h0dHBSZXF1ZXN0Eg4KBm1ldGhvZBgBIAEoCRIMCgRwYXRo", + "GAIgASgJEj8KB2hlYWRlcnMYAyADKAsyLi5uaXRyaWMucHJvdG8uYXBpcy52", + "MS5IdHRwUmVxdWVzdC5IZWFkZXJzRW50cnkSSAoMcXVlcnlfcGFyYW1zGAQg", + "AygLMjIubml0cmljLnByb3RvLmFwaXMudjEuSHR0cFJlcXVlc3QuUXVlcnlQ", + "YXJhbXNFbnRyeRJGCgtwYXRoX3BhcmFtcxgFIAMoCzIxLm5pdHJpYy5wcm90", + "by5hcGlzLnYxLkh0dHBSZXF1ZXN0LlBhdGhQYXJhbXNFbnRyeRIMCgRib2R5", + "GAYgASgMGlEKDEhlYWRlcnNFbnRyeRILCgNrZXkYASABKAkSMAoFdmFsdWUY", + "AiABKAsyIS5uaXRyaWMucHJvdG8uYXBpcy52MS5IZWFkZXJWYWx1ZToCOAEa", + "VAoQUXVlcnlQYXJhbXNFbnRyeRILCgNrZXkYASABKAkSLwoFdmFsdWUYAiAB", + "KAsyIC5uaXRyaWMucHJvdG8uYXBpcy52MS5RdWVyeVZhbHVlOgI4ARoxCg9Q", + "YXRoUGFyYW1zRW50cnkSCwoDa2V5GAEgASgJEg0KBXZhbHVlGAIgASgJOgI4", + "ASLBAQoMSHR0cFJlc3BvbnNlEg4KBnN0YXR1cxgBIAEoBRJACgdoZWFkZXJz", + "GAIgAygLMi8ubml0cmljLnByb3RvLmFwaXMudjEuSHR0cFJlc3BvbnNlLkhl", + "YWRlcnNFbnRyeRIMCgRib2R5GAMgASgMGlEKDEhlYWRlcnNFbnRyeRILCgNr", + "ZXkYASABKAkSMAoFdmFsdWUYAiABKAsyIS5uaXRyaWMucHJvdG8uYXBpcy52", + "MS5IZWFkZXJWYWx1ZToCOAEirgEKDVNlcnZlck1lc3NhZ2USCgoCaWQYASAB", + "KAkSSwoVcmVnaXN0cmF0aW9uX3Jlc3BvbnNlGAIgASgLMioubml0cmljLnBy", + "b3RvLmFwaXMudjEuUmVnaXN0cmF0aW9uUmVzcG9uc2VIABI5CgxodHRwX3Jl", + "cXVlc3QYAyABKAsyIS5uaXRyaWMucHJvdG8uYXBpcy52MS5IdHRwUmVxdWVz", + "dEgAQgkKB2NvbnRlbnQiFgoUUmVnaXN0cmF0aW9uUmVzcG9uc2UiIQoPQXBp", + "V29ya2VyU2NvcGVzEg4KBnNjb3BlcxgBIAMoCSLNAQoQQXBpV29ya2VyT3B0", + "aW9ucxJGCghzZWN1cml0eRgBIAMoCzI0Lm5pdHJpYy5wcm90by5hcGlzLnYx", + "LkFwaVdvcmtlck9wdGlvbnMuU2VjdXJpdHlFbnRyeRIZChFzZWN1cml0eV9k", + "aXNhYmxlZBgCIAEoCBpWCg1TZWN1cml0eUVudHJ5EgsKA2tleRgBIAEoCRI0", + "CgV2YWx1ZRgCIAEoCzIlLm5pdHJpYy5wcm90by5hcGlzLnYxLkFwaVdvcmtl", + "clNjb3BlczoCOAEiegoTUmVnaXN0cmF0aW9uUmVxdWVzdBILCgNhcGkYASAB", + "KAkSDAoEcGF0aBgCIAEoCRIPCgdtZXRob2RzGAMgAygJEjcKB29wdGlvbnMY", + "BCABKAsyJi5uaXRyaWMucHJvdG8uYXBpcy52MS5BcGlXb3JrZXJPcHRpb25z", + "Mr0BCgNBcGkSVQoFU2VydmUSIy5uaXRyaWMucHJvdG8uYXBpcy52MS5DbGll", + "bnRNZXNzYWdlGiMubml0cmljLnByb3RvLmFwaXMudjEuU2VydmVyTWVzc2Fn", + "ZSgBMAESXwoKQXBpRGV0YWlscxInLm5pdHJpYy5wcm90by5hcGlzLnYxLkFw", + "aURldGFpbHNSZXF1ZXN0Gigubml0cmljLnByb3RvLmFwaXMudjEuQXBpRGV0", + "YWlsc1Jlc3BvbnNlQpIBChdpby5uaXRyaWMucHJvdG8uYXBpcy52MUILQXBp", + "c1NlcnZpY2VQAVo6Z2l0aHViLmNvbS9uaXRyaWN0ZWNoL25pdHJpYy9jb3Jl", + "L3BrZy9wcm90by9hcGlzL3YxO2FwaXNwYqoCFE5pdHJpYy5Qcm90by5BcGlz", + "LnYxygIUTml0cmljXFByb3RvXEFwaXNcVjFiBnByb3RvMw==")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, - new pbr::FileDescriptor[] { global::Validate.ValidateReflection.Descriptor, }, + new pbr::FileDescriptor[] { }, new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Storage.v1.StorageWriteRequest), global::Nitric.Proto.Storage.v1.StorageWriteRequest.Parser, new[]{ "BucketName", "Key", "Body" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Storage.v1.StorageWriteResponse), global::Nitric.Proto.Storage.v1.StorageWriteResponse.Parser, null, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Storage.v1.StorageReadRequest), global::Nitric.Proto.Storage.v1.StorageReadRequest.Parser, new[]{ "BucketName", "Key" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Storage.v1.StorageReadResponse), global::Nitric.Proto.Storage.v1.StorageReadResponse.Parser, new[]{ "Body" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Storage.v1.StorageDeleteRequest), global::Nitric.Proto.Storage.v1.StorageDeleteRequest.Parser, new[]{ "BucketName", "Key" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Storage.v1.StorageDeleteResponse), global::Nitric.Proto.Storage.v1.StorageDeleteResponse.Parser, null, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Storage.v1.StoragePreSignUrlRequest), global::Nitric.Proto.Storage.v1.StoragePreSignUrlRequest.Parser, new[]{ "BucketName", "Key", "Operation", "Expiry" }, null, new[]{ typeof(global::Nitric.Proto.Storage.v1.StoragePreSignUrlRequest.Types.Operation) }, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Storage.v1.StoragePreSignUrlResponse), global::Nitric.Proto.Storage.v1.StoragePreSignUrlResponse.Parser, new[]{ "Url" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Storage.v1.StorageListFilesRequest), global::Nitric.Proto.Storage.v1.StorageListFilesRequest.Parser, new[]{ "BucketName", "Prefix" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Storage.v1.File), global::Nitric.Proto.Storage.v1.File.Parser, new[]{ "Key" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Storage.v1.StorageListFilesResponse), global::Nitric.Proto.Storage.v1.StorageListFilesResponse.Parser, new[]{ "Files" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Storage.v1.StorageExistsRequest), global::Nitric.Proto.Storage.v1.StorageExistsRequest.Parser, new[]{ "Bucket", "Key" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Storage.v1.StorageExistsResponse), global::Nitric.Proto.Storage.v1.StorageExistsResponse.Parser, new[]{ "Exists" }, null, null, null, null) + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Apis.v1.ApiDetailsRequest), global::Nitric.Proto.Apis.v1.ApiDetailsRequest.Parser, new[]{ "ApiName" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Apis.v1.ApiDetailsResponse), global::Nitric.Proto.Apis.v1.ApiDetailsResponse.Parser, new[]{ "Url" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Apis.v1.ClientMessage), global::Nitric.Proto.Apis.v1.ClientMessage.Parser, new[]{ "Id", "RegistrationRequest", "HttpResponse" }, new[]{ "Content" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Apis.v1.HeaderValue), global::Nitric.Proto.Apis.v1.HeaderValue.Parser, new[]{ "Value" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Apis.v1.QueryValue), global::Nitric.Proto.Apis.v1.QueryValue.Parser, new[]{ "Value" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Apis.v1.HttpRequest), global::Nitric.Proto.Apis.v1.HttpRequest.Parser, new[]{ "Method", "Path", "Headers", "QueryParams", "PathParams", "Body" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { null, null, null, }), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Apis.v1.HttpResponse), global::Nitric.Proto.Apis.v1.HttpResponse.Parser, new[]{ "Status", "Headers", "Body" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { null, }), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Apis.v1.ServerMessage), global::Nitric.Proto.Apis.v1.ServerMessage.Parser, new[]{ "Id", "RegistrationResponse", "HttpRequest" }, new[]{ "Content" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Apis.v1.RegistrationResponse), global::Nitric.Proto.Apis.v1.RegistrationResponse.Parser, null, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Apis.v1.ApiWorkerScopes), global::Nitric.Proto.Apis.v1.ApiWorkerScopes.Parser, new[]{ "Scopes" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Apis.v1.ApiWorkerOptions), global::Nitric.Proto.Apis.v1.ApiWorkerOptions.Parser, new[]{ "Security", "SecurityDisabled" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { null, }), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Apis.v1.RegistrationRequest), global::Nitric.Proto.Apis.v1.RegistrationRequest.Parser, new[]{ "Api", "Path", "Methods", "Options" }, null, null, null, null) })); } #endregion } #region Messages - /// - /// Request to put (create/update) a storage item - /// - public sealed partial class StorageWriteRequest : pb::IMessage + public sealed partial class ApiDetailsRequest : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new StorageWriteRequest()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ApiDetailsRequest()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Storage.v1.StorageReflection.Descriptor.MessageTypes[0]; } + get { return global::Nitric.Proto.Apis.v1.ApisReflection.Descriptor.MessageTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -106,93 +110,55 @@ public sealed partial class StorageWriteRequest : pb::IMessageField number for the "bucket_name" field. - public const int BucketNameFieldNumber = 1; - private string bucketName_ = ""; - /// - /// Nitric name of the bucket to store in - /// this will be automatically resolved to the provider specific bucket identifier. - /// + /// Field number for the "api_name" field. + public const int ApiNameFieldNumber = 1; + private string apiName_ = ""; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string BucketName { - get { return bucketName_; } + public string ApiName { + get { return apiName_; } set { - bucketName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "key" field. - public const int KeyFieldNumber = 2; - private string key_ = ""; - /// - /// Key to store the item under - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string Key { - get { return key_; } - set { - key_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "body" field. - public const int BodyFieldNumber = 3; - private pb::ByteString body_ = pb::ByteString.Empty; - /// - /// bytes array to store - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pb::ByteString Body { - get { return body_; } - set { - body_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + apiName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { - return Equals(other as StorageWriteRequest); + return Equals(other as ApiDetailsRequest); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(StorageWriteRequest other) { + public bool Equals(ApiDetailsRequest other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } - if (BucketName != other.BucketName) return false; - if (Key != other.Key) return false; - if (Body != other.Body) return false; + if (ApiName != other.ApiName) return false; return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; - if (BucketName.Length != 0) hash ^= BucketName.GetHashCode(); - if (Key.Length != 0) hash ^= Key.GetHashCode(); - if (Body.Length != 0) hash ^= Body.GetHashCode(); + if (ApiName.Length != 0) hash ^= ApiName.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -209,17 +175,9 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else - if (BucketName.Length != 0) { + if (ApiName.Length != 0) { output.WriteRawTag(10); - output.WriteString(BucketName); - } - if (Key.Length != 0) { - output.WriteRawTag(18); - output.WriteString(Key); - } - if (Body.Length != 0) { - output.WriteRawTag(26); - output.WriteBytes(Body); + output.WriteString(ApiName); } if (_unknownFields != null) { _unknownFields.WriteTo(output); @@ -230,17 +188,9 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (BucketName.Length != 0) { + if (ApiName.Length != 0) { output.WriteRawTag(10); - output.WriteString(BucketName); - } - if (Key.Length != 0) { - output.WriteRawTag(18); - output.WriteString(Key); - } - if (Body.Length != 0) { - output.WriteRawTag(26); - output.WriteBytes(Body); + output.WriteString(ApiName); } if (_unknownFields != null) { _unknownFields.WriteTo(ref output); @@ -251,14 +201,8 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; - if (BucketName.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(BucketName); - } - if (Key.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Key); - } - if (Body.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeBytesSize(Body); + if (ApiName.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(ApiName); } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); @@ -267,18 +211,12 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(StorageWriteRequest other) { + public void MergeFrom(ApiDetailsRequest other) { if (other == null) { return; } - if (other.BucketName.Length != 0) { - BucketName = other.BucketName; - } - if (other.Key.Length != 0) { - Key = other.Key; - } - if (other.Body.Length != 0) { - Body = other.Body; + if (other.ApiName.Length != 0) { + ApiName = other.ApiName; } _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } @@ -295,15 +233,7 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { - BucketName = input.ReadString(); - break; - } - case 18: { - Key = input.ReadString(); - break; - } - case 26: { - Body = input.ReadBytes(); + ApiName = input.ReadString(); break; } } @@ -321,15 +251,7 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; case 10: { - BucketName = input.ReadString(); - break; - } - case 18: { - Key = input.ReadString(); - break; - } - case 26: { - Body = input.ReadBytes(); + ApiName = input.ReadString(); break; } } @@ -339,22 +261,19 @@ public void MergeFrom(pb::CodedInputStream input) { } - /// - /// Result of putting a storage item - /// - public sealed partial class StorageWriteResponse : pb::IMessage + public sealed partial class ApiDetailsResponse : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new StorageWriteResponse()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ApiDetailsResponse()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Storage.v1.StorageReflection.Descriptor.MessageTypes[1]; } + get { return global::Nitric.Proto.Apis.v1.ApisReflection.Descriptor.MessageTypes[1]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -363,41 +282,55 @@ public sealed partial class StorageWriteResponse : pb::IMessageField number for the "url" field. + public const int UrlFieldNumber = 1; + private string url_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Url { + get { return url_; } + set { + url_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { - return Equals(other as StorageWriteResponse); + return Equals(other as ApiDetailsResponse); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(StorageWriteResponse other) { + public bool Equals(ApiDetailsResponse other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } + if (Url != other.Url) return false; return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; + if (Url.Length != 0) hash ^= Url.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -414,6 +347,10 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else + if (Url.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Url); + } if (_unknownFields != null) { _unknownFields.WriteTo(output); } @@ -423,6 +360,10 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Url.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Url); + } if (_unknownFields != null) { _unknownFields.WriteTo(ref output); } @@ -432,6 +373,9 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; + if (Url.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Url); + } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); } @@ -439,10 +383,13 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(StorageWriteResponse other) { + public void MergeFrom(ApiDetailsResponse other) { if (other == null) { return; } + if (other.Url.Length != 0) { + Url = other.Url; + } _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } @@ -457,6 +404,10 @@ public void MergeFrom(pb::CodedInputStream input) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; + case 10: { + Url = input.ReadString(); + break; + } } } #endif @@ -471,6 +422,10 @@ public void MergeFrom(pb::CodedInputStream input) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; + case 10: { + Url = input.ReadString(); + break; + } } } } @@ -479,21 +434,21 @@ public void MergeFrom(pb::CodedInputStream input) { } /// - /// Request to retrieve a storage item + /// ClientMessage sent by the service to the nitric server /// - public sealed partial class StorageReadRequest : pb::IMessage + public sealed partial class ClientMessage : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new StorageReadRequest()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ClientMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Storage.v1.StorageReflection.Descriptor.MessageTypes[2]; } + get { return global::Nitric.Proto.Apis.v1.ApisReflection.Descriptor.MessageTypes[2]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -502,76 +457,120 @@ public sealed partial class StorageReadRequest : pb::IMessageField number for the "bucket_name" field. - public const int BucketNameFieldNumber = 1; - private string bucketName_ = ""; + /// Field number for the "id" field. + public const int IdFieldNumber = 1; + private string id_ = ""; /// - /// Nitric name of the bucket to retrieve from - /// this will be automatically resolved to the provider specific bucket identifier. + /// globally unique ID of the request/response pair /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string BucketName { - get { return bucketName_; } + public string Id { + get { return id_; } set { - bucketName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + id_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); } } - /// Field number for the "key" field. - public const int KeyFieldNumber = 2; - private string key_ = ""; + /// Field number for the "registration_request" field. + public const int RegistrationRequestFieldNumber = 2; /// - /// Key of item to retrieve + /// Register an API route handler /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string Key { - get { return key_; } + public global::Nitric.Proto.Apis.v1.RegistrationRequest RegistrationRequest { + get { return contentCase_ == ContentOneofCase.RegistrationRequest ? (global::Nitric.Proto.Apis.v1.RegistrationRequest) content_ : null; } set { - key_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + content_ = value; + contentCase_ = value == null ? ContentOneofCase.None : ContentOneofCase.RegistrationRequest; } } + /// Field number for the "http_response" field. + public const int HttpResponseFieldNumber = 3; + /// + /// Response to an HTTP request + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Nitric.Proto.Apis.v1.HttpResponse HttpResponse { + get { return contentCase_ == ContentOneofCase.HttpResponse ? (global::Nitric.Proto.Apis.v1.HttpResponse) content_ : null; } + set { + content_ = value; + contentCase_ = value == null ? ContentOneofCase.None : ContentOneofCase.HttpResponse; + } + } + + private object content_; + /// Enum of possible cases for the "content" oneof. + public enum ContentOneofCase { + None = 0, + RegistrationRequest = 2, + HttpResponse = 3, + } + private ContentOneofCase contentCase_ = ContentOneofCase.None; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ContentOneofCase ContentCase { + get { return contentCase_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void ClearContent() { + contentCase_ = ContentOneofCase.None; + content_ = null; + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { - return Equals(other as StorageReadRequest); + return Equals(other as ClientMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(StorageReadRequest other) { + public bool Equals(ClientMessage other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } - if (BucketName != other.BucketName) return false; - if (Key != other.Key) return false; + if (Id != other.Id) return false; + if (!object.Equals(RegistrationRequest, other.RegistrationRequest)) return false; + if (!object.Equals(HttpResponse, other.HttpResponse)) return false; + if (ContentCase != other.ContentCase) return false; return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; - if (BucketName.Length != 0) hash ^= BucketName.GetHashCode(); - if (Key.Length != 0) hash ^= Key.GetHashCode(); + if (Id.Length != 0) hash ^= Id.GetHashCode(); + if (contentCase_ == ContentOneofCase.RegistrationRequest) hash ^= RegistrationRequest.GetHashCode(); + if (contentCase_ == ContentOneofCase.HttpResponse) hash ^= HttpResponse.GetHashCode(); + hash ^= (int) contentCase_; if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -588,13 +587,17 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else - if (BucketName.Length != 0) { + if (Id.Length != 0) { output.WriteRawTag(10); - output.WriteString(BucketName); + output.WriteString(Id); } - if (Key.Length != 0) { + if (contentCase_ == ContentOneofCase.RegistrationRequest) { output.WriteRawTag(18); - output.WriteString(Key); + output.WriteMessage(RegistrationRequest); + } + if (contentCase_ == ContentOneofCase.HttpResponse) { + output.WriteRawTag(26); + output.WriteMessage(HttpResponse); } if (_unknownFields != null) { _unknownFields.WriteTo(output); @@ -605,13 +608,17 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (BucketName.Length != 0) { + if (Id.Length != 0) { output.WriteRawTag(10); - output.WriteString(BucketName); + output.WriteString(Id); } - if (Key.Length != 0) { + if (contentCase_ == ContentOneofCase.RegistrationRequest) { output.WriteRawTag(18); - output.WriteString(Key); + output.WriteMessage(RegistrationRequest); + } + if (contentCase_ == ContentOneofCase.HttpResponse) { + output.WriteRawTag(26); + output.WriteMessage(HttpResponse); } if (_unknownFields != null) { _unknownFields.WriteTo(ref output); @@ -622,11 +629,14 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; - if (BucketName.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(BucketName); + if (Id.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Id); } - if (Key.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Key); + if (contentCase_ == ContentOneofCase.RegistrationRequest) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(RegistrationRequest); + } + if (contentCase_ == ContentOneofCase.HttpResponse) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(HttpResponse); } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); @@ -635,16 +645,28 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(StorageReadRequest other) { + public void MergeFrom(ClientMessage other) { if (other == null) { return; } - if (other.BucketName.Length != 0) { - BucketName = other.BucketName; + if (other.Id.Length != 0) { + Id = other.Id; } - if (other.Key.Length != 0) { - Key = other.Key; + switch (other.ContentCase) { + case ContentOneofCase.RegistrationRequest: + if (RegistrationRequest == null) { + RegistrationRequest = new global::Nitric.Proto.Apis.v1.RegistrationRequest(); + } + RegistrationRequest.MergeFrom(other.RegistrationRequest); + break; + case ContentOneofCase.HttpResponse: + if (HttpResponse == null) { + HttpResponse = new global::Nitric.Proto.Apis.v1.HttpResponse(); + } + HttpResponse.MergeFrom(other.HttpResponse); + break; } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } @@ -660,11 +682,25 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { - BucketName = input.ReadString(); + Id = input.ReadString(); break; } case 18: { - Key = input.ReadString(); + global::Nitric.Proto.Apis.v1.RegistrationRequest subBuilder = new global::Nitric.Proto.Apis.v1.RegistrationRequest(); + if (contentCase_ == ContentOneofCase.RegistrationRequest) { + subBuilder.MergeFrom(RegistrationRequest); + } + input.ReadMessage(subBuilder); + RegistrationRequest = subBuilder; + break; + } + case 26: { + global::Nitric.Proto.Apis.v1.HttpResponse subBuilder = new global::Nitric.Proto.Apis.v1.HttpResponse(); + if (contentCase_ == ContentOneofCase.HttpResponse) { + subBuilder.MergeFrom(HttpResponse); + } + input.ReadMessage(subBuilder); + HttpResponse = subBuilder; break; } } @@ -682,11 +718,25 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; case 10: { - BucketName = input.ReadString(); + Id = input.ReadString(); break; } case 18: { - Key = input.ReadString(); + global::Nitric.Proto.Apis.v1.RegistrationRequest subBuilder = new global::Nitric.Proto.Apis.v1.RegistrationRequest(); + if (contentCase_ == ContentOneofCase.RegistrationRequest) { + subBuilder.MergeFrom(RegistrationRequest); + } + input.ReadMessage(subBuilder); + RegistrationRequest = subBuilder; + break; + } + case 26: { + global::Nitric.Proto.Apis.v1.HttpResponse subBuilder = new global::Nitric.Proto.Apis.v1.HttpResponse(); + if (contentCase_ == ContentOneofCase.HttpResponse) { + subBuilder.MergeFrom(HttpResponse); + } + input.ReadMessage(subBuilder); + HttpResponse = subBuilder; break; } } @@ -696,22 +746,19 @@ public void MergeFrom(pb::CodedInputStream input) { } - /// - /// Returned storage item - /// - public sealed partial class StorageReadResponse : pb::IMessage + public sealed partial class HeaderValue : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new StorageReadResponse()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new HeaderValue()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Storage.v1.StorageReflection.Descriptor.MessageTypes[3]; } + get { return global::Nitric.Proto.Apis.v1.ApisReflection.Descriptor.MessageTypes[3]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -720,58 +767,54 @@ public sealed partial class StorageReadResponse : pb::IMessageField number for the "body" field. - public const int BodyFieldNumber = 1; - private pb::ByteString body_ = pb::ByteString.Empty; - /// - /// The body bytes of the retrieved storage item - /// + /// Field number for the "value" field. + public const int ValueFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_value_codec + = pb::FieldCodec.ForString(10); + private readonly pbc::RepeatedField value_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pb::ByteString Body { - get { return body_; } - set { - body_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } + public pbc::RepeatedField Value { + get { return value_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { - return Equals(other as StorageReadResponse); + return Equals(other as HeaderValue); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(StorageReadResponse other) { + public bool Equals(HeaderValue other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } - if (Body != other.Body) return false; + if(!value_.Equals(other.value_)) return false; return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; - if (Body.Length != 0) hash ^= Body.GetHashCode(); + hash ^= value_.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -788,10 +831,7 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else - if (Body.Length != 0) { - output.WriteRawTag(10); - output.WriteBytes(Body); - } + value_.WriteTo(output, _repeated_value_codec); if (_unknownFields != null) { _unknownFields.WriteTo(output); } @@ -801,10 +841,7 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (Body.Length != 0) { - output.WriteRawTag(10); - output.WriteBytes(Body); - } + value_.WriteTo(ref output, _repeated_value_codec); if (_unknownFields != null) { _unknownFields.WriteTo(ref output); } @@ -814,9 +851,7 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; - if (Body.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeBytesSize(Body); - } + size += value_.CalculateSize(_repeated_value_codec); if (_unknownFields != null) { size += _unknownFields.CalculateSize(); } @@ -824,13 +859,11 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(StorageReadResponse other) { + public void MergeFrom(HeaderValue other) { if (other == null) { return; } - if (other.Body.Length != 0) { - Body = other.Body; - } + value_.Add(other.value_); _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } @@ -846,7 +879,7 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { - Body = input.ReadBytes(); + value_.AddEntriesFrom(input, _repeated_value_codec); break; } } @@ -864,7 +897,7 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; case 10: { - Body = input.ReadBytes(); + value_.AddEntriesFrom(ref input, _repeated_value_codec); break; } } @@ -874,22 +907,19 @@ public void MergeFrom(pb::CodedInputStream input) { } - /// - /// Request to delete a storage item - /// - public sealed partial class StorageDeleteRequest : pb::IMessage + public sealed partial class QueryValue : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new StorageDeleteRequest()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new QueryValue()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Storage.v1.StorageReflection.Descriptor.MessageTypes[4]; } + get { return global::Nitric.Proto.Apis.v1.ApisReflection.Descriptor.MessageTypes[4]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -898,75 +928,54 @@ public sealed partial class StorageDeleteRequest : pb::IMessageField number for the "bucket_name" field. - public const int BucketNameFieldNumber = 1; - private string bucketName_ = ""; - /// - /// Name of the bucket to delete from - /// + /// Field number for the "value" field. + public const int ValueFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_value_codec + = pb::FieldCodec.ForString(10); + private readonly pbc::RepeatedField value_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string BucketName { - get { return bucketName_; } - set { - bucketName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "key" field. - public const int KeyFieldNumber = 2; - private string key_ = ""; - /// - /// Key of item to delete - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string Key { - get { return key_; } - set { - key_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } + public pbc::RepeatedField Value { + get { return value_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { - return Equals(other as StorageDeleteRequest); + return Equals(other as QueryValue); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(StorageDeleteRequest other) { + public bool Equals(QueryValue other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } - if (BucketName != other.BucketName) return false; - if (Key != other.Key) return false; + if(!value_.Equals(other.value_)) return false; return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; - if (BucketName.Length != 0) hash ^= BucketName.GetHashCode(); - if (Key.Length != 0) hash ^= Key.GetHashCode(); + hash ^= value_.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -983,14 +992,7 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else - if (BucketName.Length != 0) { - output.WriteRawTag(10); - output.WriteString(BucketName); - } - if (Key.Length != 0) { - output.WriteRawTag(18); - output.WriteString(Key); - } + value_.WriteTo(output, _repeated_value_codec); if (_unknownFields != null) { _unknownFields.WriteTo(output); } @@ -1000,14 +1002,7 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (BucketName.Length != 0) { - output.WriteRawTag(10); - output.WriteString(BucketName); - } - if (Key.Length != 0) { - output.WriteRawTag(18); - output.WriteString(Key); - } + value_.WriteTo(ref output, _repeated_value_codec); if (_unknownFields != null) { _unknownFields.WriteTo(ref output); } @@ -1017,12 +1012,7 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; - if (BucketName.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(BucketName); - } - if (Key.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Key); - } + size += value_.CalculateSize(_repeated_value_codec); if (_unknownFields != null) { size += _unknownFields.CalculateSize(); } @@ -1030,16 +1020,11 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(StorageDeleteRequest other) { + public void MergeFrom(QueryValue other) { if (other == null) { return; } - if (other.BucketName.Length != 0) { - BucketName = other.BucketName; - } - if (other.Key.Length != 0) { - Key = other.Key; - } + value_.Add(other.value_); _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } @@ -1054,161 +1039,10 @@ public void MergeFrom(pb::CodedInputStream input) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; - case 10: { - BucketName = input.ReadString(); - break; - } - case 18: { - Key = input.ReadString(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - BucketName = input.ReadString(); - break; - } - case 18: { - Key = input.ReadString(); - break; - } - } - } - } - #endif - - } - - /// - /// Result of deleting a storage item - /// - public sealed partial class StorageDeleteResponse : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new StorageDeleteResponse()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Storage.v1.StorageReflection.Descriptor.MessageTypes[5]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public StorageDeleteResponse() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public StorageDeleteResponse(StorageDeleteResponse other) : this() { - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public StorageDeleteResponse Clone() { - return new StorageDeleteResponse(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as StorageDeleteResponse); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(StorageDeleteResponse other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(StorageDeleteResponse other) { - if (other == null) { - return; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + case 10: { + value_.AddEntriesFrom(input, _repeated_value_codec); break; + } } } #endif @@ -1223,6 +1057,10 @@ public void MergeFrom(pb::CodedInputStream input) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; + case 10: { + value_.AddEntriesFrom(ref input, _repeated_value_codec); + break; + } } } } @@ -1230,22 +1068,19 @@ public void MergeFrom(pb::CodedInputStream input) { } - /// - /// Request to generate a pre-signed URL for a file to perform a specific operation, such as read or write. - /// - public sealed partial class StoragePreSignUrlRequest : pb::IMessage + public sealed partial class HttpRequest : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new StoragePreSignUrlRequest()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new HttpRequest()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Storage.v1.StorageReflection.Descriptor.MessageTypes[6]; } + get { return global::Nitric.Proto.Apis.v1.ApisReflection.Descriptor.MessageTypes[5]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1254,110 +1089,140 @@ public sealed partial class StoragePreSignUrlRequest : pb::IMessageField number for the "bucket_name" field. - public const int BucketNameFieldNumber = 1; - private string bucketName_ = ""; + /// Field number for the "method" field. + public const int MethodFieldNumber = 1; + private string method_ = ""; /// - /// Nitric name of the bucket to retrieve from - /// this will be automatically resolved to the provider specific bucket identifier. + /// The request method /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string BucketName { - get { return bucketName_; } + public string Method { + get { return method_; } set { - bucketName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + method_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); } } - /// Field number for the "key" field. - public const int KeyFieldNumber = 2; - private string key_ = ""; + /// Field number for the "path" field. + public const int PathFieldNumber = 2; + private string path_ = ""; /// - /// Key of item to generate the signed URL for. - /// The URL and the token it contains will only be valid for operations on this resource specifically. + /// The path of the request /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string Key { - get { return key_; } + public string Path { + get { return path_; } set { - key_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + path_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); } } - /// Field number for the "operation" field. - public const int OperationFieldNumber = 3; - private global::Nitric.Proto.Storage.v1.StoragePreSignUrlRequest.Types.Operation operation_ = global::Nitric.Proto.Storage.v1.StoragePreSignUrlRequest.Types.Operation.Read; + /// Field number for the "headers" field. + public const int HeadersFieldNumber = 3; + private static readonly pbc::MapField.Codec _map_headers_codec + = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForMessage(18, global::Nitric.Proto.Apis.v1.HeaderValue.Parser), 26); + private readonly pbc::MapField headers_ = new pbc::MapField(); + /// + /// HTTP request headers + /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Storage.v1.StoragePreSignUrlRequest.Types.Operation Operation { - get { return operation_; } - set { - operation_ = value; - } + public pbc::MapField Headers { + get { return headers_; } + } + + /// Field number for the "query_params" field. + public const int QueryParamsFieldNumber = 4; + private static readonly pbc::MapField.Codec _map_queryParams_codec + = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForMessage(18, global::Nitric.Proto.Apis.v1.QueryValue.Parser), 34); + private readonly pbc::MapField queryParams_ = new pbc::MapField(); + /// + /// HTTP Query params + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::MapField QueryParams { + get { return queryParams_; } + } + + /// Field number for the "path_params" field. + public const int PathParamsFieldNumber = 5; + private static readonly pbc::MapField.Codec _map_pathParams_codec + = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForString(18, ""), 42); + private readonly pbc::MapField pathParams_ = new pbc::MapField(); + /// + /// HTTP Path parameters + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::MapField PathParams { + get { return pathParams_; } } - /// Field number for the "expiry" field. - public const int ExpiryFieldNumber = 4; - private uint expiry_; + /// Field number for the "body" field. + public const int BodyFieldNumber = 6; + private pb::ByteString body_ = pb::ByteString.Empty; /// - /// Expiry time in seconds for the token included in the signed URL. - /// Time starts from when the access token is generated, not when this request is made. - /// e.g. time.Now().Add(expiry * time.Second) on the server + /// HTTP Request body /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public uint Expiry { - get { return expiry_; } + public pb::ByteString Body { + get { return body_; } set { - expiry_ = value; + body_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { - return Equals(other as StoragePreSignUrlRequest); + return Equals(other as HttpRequest); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(StoragePreSignUrlRequest other) { + public bool Equals(HttpRequest other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } - if (BucketName != other.BucketName) return false; - if (Key != other.Key) return false; - if (Operation != other.Operation) return false; - if (Expiry != other.Expiry) return false; + if (Method != other.Method) return false; + if (Path != other.Path) return false; + if (!Headers.Equals(other.Headers)) return false; + if (!QueryParams.Equals(other.QueryParams)) return false; + if (!PathParams.Equals(other.PathParams)) return false; + if (Body != other.Body) return false; return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; - if (BucketName.Length != 0) hash ^= BucketName.GetHashCode(); - if (Key.Length != 0) hash ^= Key.GetHashCode(); - if (Operation != global::Nitric.Proto.Storage.v1.StoragePreSignUrlRequest.Types.Operation.Read) hash ^= Operation.GetHashCode(); - if (Expiry != 0) hash ^= Expiry.GetHashCode(); + if (Method.Length != 0) hash ^= Method.GetHashCode(); + if (Path.Length != 0) hash ^= Path.GetHashCode(); + hash ^= Headers.GetHashCode(); + hash ^= QueryParams.GetHashCode(); + hash ^= PathParams.GetHashCode(); + if (Body.Length != 0) hash ^= Body.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -1374,21 +1239,20 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else - if (BucketName.Length != 0) { + if (Method.Length != 0) { output.WriteRawTag(10); - output.WriteString(BucketName); + output.WriteString(Method); } - if (Key.Length != 0) { + if (Path.Length != 0) { output.WriteRawTag(18); - output.WriteString(Key); - } - if (Operation != global::Nitric.Proto.Storage.v1.StoragePreSignUrlRequest.Types.Operation.Read) { - output.WriteRawTag(24); - output.WriteEnum((int) Operation); + output.WriteString(Path); } - if (Expiry != 0) { - output.WriteRawTag(32); - output.WriteUInt32(Expiry); + headers_.WriteTo(output, _map_headers_codec); + queryParams_.WriteTo(output, _map_queryParams_codec); + pathParams_.WriteTo(output, _map_pathParams_codec); + if (Body.Length != 0) { + output.WriteRawTag(50); + output.WriteBytes(Body); } if (_unknownFields != null) { _unknownFields.WriteTo(output); @@ -1399,21 +1263,20 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (BucketName.Length != 0) { + if (Method.Length != 0) { output.WriteRawTag(10); - output.WriteString(BucketName); + output.WriteString(Method); } - if (Key.Length != 0) { + if (Path.Length != 0) { output.WriteRawTag(18); - output.WriteString(Key); + output.WriteString(Path); } - if (Operation != global::Nitric.Proto.Storage.v1.StoragePreSignUrlRequest.Types.Operation.Read) { - output.WriteRawTag(24); - output.WriteEnum((int) Operation); - } - if (Expiry != 0) { - output.WriteRawTag(32); - output.WriteUInt32(Expiry); + headers_.WriteTo(ref output, _map_headers_codec); + queryParams_.WriteTo(ref output, _map_queryParams_codec); + pathParams_.WriteTo(ref output, _map_pathParams_codec); + if (Body.Length != 0) { + output.WriteRawTag(50); + output.WriteBytes(Body); } if (_unknownFields != null) { _unknownFields.WriteTo(ref output); @@ -1424,17 +1287,17 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; - if (BucketName.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(BucketName); - } - if (Key.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Key); + if (Method.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Method); } - if (Operation != global::Nitric.Proto.Storage.v1.StoragePreSignUrlRequest.Types.Operation.Read) { - size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Operation); + if (Path.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Path); } - if (Expiry != 0) { - size += 1 + pb::CodedOutputStream.ComputeUInt32Size(Expiry); + size += headers_.CalculateSize(_map_headers_codec); + size += queryParams_.CalculateSize(_map_queryParams_codec); + size += pathParams_.CalculateSize(_map_pathParams_codec); + if (Body.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeBytesSize(Body); } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); @@ -1443,21 +1306,21 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(StoragePreSignUrlRequest other) { + public void MergeFrom(HttpRequest other) { if (other == null) { return; } - if (other.BucketName.Length != 0) { - BucketName = other.BucketName; + if (other.Method.Length != 0) { + Method = other.Method; } - if (other.Key.Length != 0) { - Key = other.Key; + if (other.Path.Length != 0) { + Path = other.Path; } - if (other.Operation != global::Nitric.Proto.Storage.v1.StoragePreSignUrlRequest.Types.Operation.Read) { - Operation = other.Operation; - } - if (other.Expiry != 0) { - Expiry = other.Expiry; + headers_.Add(other.headers_); + queryParams_.Add(other.queryParams_); + pathParams_.Add(other.pathParams_); + if (other.Body.Length != 0) { + Body = other.Body; } _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } @@ -1474,19 +1337,27 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { - BucketName = input.ReadString(); + Method = input.ReadString(); break; } case 18: { - Key = input.ReadString(); + Path = input.ReadString(); + break; + } + case 26: { + headers_.AddEntriesFrom(input, _map_headers_codec); break; } - case 24: { - Operation = (global::Nitric.Proto.Storage.v1.StoragePreSignUrlRequest.Types.Operation) input.ReadEnum(); + case 34: { + queryParams_.AddEntriesFrom(input, _map_queryParams_codec); break; } - case 32: { - Expiry = input.ReadUInt32(); + case 42: { + pathParams_.AddEntriesFrom(input, _map_pathParams_codec); + break; + } + case 50: { + Body = input.ReadBytes(); break; } } @@ -1504,19 +1375,27 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; case 10: { - BucketName = input.ReadString(); + Method = input.ReadString(); break; } case 18: { - Key = input.ReadString(); + Path = input.ReadString(); + break; + } + case 26: { + headers_.AddEntriesFrom(ref input, _map_headers_codec); + break; + } + case 34: { + queryParams_.AddEntriesFrom(ref input, _map_queryParams_codec); break; } - case 24: { - Operation = (global::Nitric.Proto.Storage.v1.StoragePreSignUrlRequest.Types.Operation) input.ReadEnum(); + case 42: { + pathParams_.AddEntriesFrom(ref input, _map_pathParams_codec); break; } - case 32: { - Expiry = input.ReadUInt32(); + case 50: { + Body = input.ReadBytes(); break; } } @@ -1524,36 +1403,24 @@ public void MergeFrom(pb::CodedInputStream input) { } #endif - #region Nested types - /// Container for nested types declared in the StoragePreSignUrlRequest message type. - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static partial class Types { - /// - /// Operation - /// - public enum Operation { - [pbr::OriginalName("READ")] Read = 0, - [pbr::OriginalName("WRITE")] Write = 1, - } - - } - #endregion - } - public sealed partial class StoragePreSignUrlResponse : pb::IMessage + /// + /// HttpResponseMessage + /// + public sealed partial class HttpResponse : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new StoragePreSignUrlResponse()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new HttpResponse()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Storage.v1.StorageReflection.Descriptor.MessageTypes[7]; } + get { return global::Nitric.Proto.Apis.v1.ApisReflection.Descriptor.MessageTypes[6]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1562,58 +1429,91 @@ public sealed partial class StoragePreSignUrlResponse : pb::IMessageField number for the "url" field. - public const int UrlFieldNumber = 1; - private string url_ = ""; + /// Field number for the "status" field. + public const int StatusFieldNumber = 1; + private int status_; /// - /// The pre-signed url, restricted to the operation, resource and expiry time specified in the request. + /// The HTTP response status code /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string Url { - get { return url_; } + public int Status { + get { return status_; } set { - url_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + status_ = value; + } + } + + /// Field number for the "headers" field. + public const int HeadersFieldNumber = 2; + private static readonly pbc::MapField.Codec _map_headers_codec + = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForMessage(18, global::Nitric.Proto.Apis.v1.HeaderValue.Parser), 18); + private readonly pbc::MapField headers_ = new pbc::MapField(); + /// + /// HTTP response headers + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::MapField Headers { + get { return headers_; } + } + + /// Field number for the "body" field. + public const int BodyFieldNumber = 3; + private pb::ByteString body_ = pb::ByteString.Empty; + /// + /// HTTP response body + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pb::ByteString Body { + get { return body_; } + set { + body_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { - return Equals(other as StoragePreSignUrlResponse); + return Equals(other as HttpResponse); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(StoragePreSignUrlResponse other) { + public bool Equals(HttpResponse other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } - if (Url != other.Url) return false; + if (Status != other.Status) return false; + if (!Headers.Equals(other.Headers)) return false; + if (Body != other.Body) return false; return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; - if (Url.Length != 0) hash ^= Url.GetHashCode(); + if (Status != 0) hash ^= Status.GetHashCode(); + hash ^= Headers.GetHashCode(); + if (Body.Length != 0) hash ^= Body.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -1630,9 +1530,14 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else - if (Url.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Url); + if (Status != 0) { + output.WriteRawTag(8); + output.WriteInt32(Status); + } + headers_.WriteTo(output, _map_headers_codec); + if (Body.Length != 0) { + output.WriteRawTag(26); + output.WriteBytes(Body); } if (_unknownFields != null) { _unknownFields.WriteTo(output); @@ -1643,9 +1548,14 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (Url.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Url); + if (Status != 0) { + output.WriteRawTag(8); + output.WriteInt32(Status); + } + headers_.WriteTo(ref output, _map_headers_codec); + if (Body.Length != 0) { + output.WriteRawTag(26); + output.WriteBytes(Body); } if (_unknownFields != null) { _unknownFields.WriteTo(ref output); @@ -1656,8 +1566,12 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; - if (Url.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Url); + if (Status != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Status); + } + size += headers_.CalculateSize(_map_headers_codec); + if (Body.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeBytesSize(Body); } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); @@ -1666,12 +1580,16 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(StoragePreSignUrlResponse other) { + public void MergeFrom(HttpResponse other) { if (other == null) { return; } - if (other.Url.Length != 0) { - Url = other.Url; + if (other.Status != 0) { + Status = other.Status; + } + headers_.Add(other.headers_); + if (other.Body.Length != 0) { + Body = other.Body; } _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } @@ -1687,8 +1605,16 @@ public void MergeFrom(pb::CodedInputStream input) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; - case 10: { - Url = input.ReadString(); + case 8: { + Status = input.ReadInt32(); + break; + } + case 18: { + headers_.AddEntriesFrom(input, _map_headers_codec); + break; + } + case 26: { + Body = input.ReadBytes(); break; } } @@ -1705,8 +1631,16 @@ public void MergeFrom(pb::CodedInputStream input) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; - case 10: { - Url = input.ReadString(); + case 8: { + Status = input.ReadInt32(); + break; + } + case 18: { + headers_.AddEntriesFrom(ref input, _map_headers_codec); + break; + } + case 26: { + Body = input.ReadBytes(); break; } } @@ -1716,19 +1650,22 @@ public void MergeFrom(pb::CodedInputStream input) { } - public sealed partial class StorageListFilesRequest : pb::IMessage + /// + /// ServerMessage sent by the nitric server to the service + /// + public sealed partial class ServerMessage : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new StorageListFilesRequest()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ServerMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Storage.v1.StorageReflection.Descriptor.MessageTypes[8]; } + get { return global::Nitric.Proto.Apis.v1.ApisReflection.Descriptor.MessageTypes[7]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1737,69 +1674,120 @@ public sealed partial class StorageListFilesRequest : pb::IMessageField number for the "id" field. + public const int IdFieldNumber = 1; + private string id_ = ""; + /// + /// globally unique ID of the request/response pair + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Id { + get { return id_; } + set { + id_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } } - /// Field number for the "bucket_name" field. - public const int BucketNameFieldNumber = 1; - private string bucketName_ = ""; + /// Field number for the "registration_response" field. + public const int RegistrationResponseFieldNumber = 2; + /// + /// Response to an API serve request + /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string BucketName { - get { return bucketName_; } + public global::Nitric.Proto.Apis.v1.RegistrationResponse RegistrationResponse { + get { return contentCase_ == ContentOneofCase.RegistrationResponse ? (global::Nitric.Proto.Apis.v1.RegistrationResponse) content_ : null; } set { - bucketName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + content_ = value; + contentCase_ = value == null ? ContentOneofCase.None : ContentOneofCase.RegistrationResponse; } } - /// Field number for the "prefix" field. - public const int PrefixFieldNumber = 2; - private string prefix_ = ""; + /// Field number for the "http_request" field. + public const int HttpRequestFieldNumber = 3; + /// + /// HTTP request to be routed to the service (handler) + /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string Prefix { - get { return prefix_; } + public global::Nitric.Proto.Apis.v1.HttpRequest HttpRequest { + get { return contentCase_ == ContentOneofCase.HttpRequest ? (global::Nitric.Proto.Apis.v1.HttpRequest) content_ : null; } set { - prefix_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + content_ = value; + contentCase_ = value == null ? ContentOneofCase.None : ContentOneofCase.HttpRequest; } } + private object content_; + /// Enum of possible cases for the "content" oneof. + public enum ContentOneofCase { + None = 0, + RegistrationResponse = 2, + HttpRequest = 3, + } + private ContentOneofCase contentCase_ = ContentOneofCase.None; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ContentOneofCase ContentCase { + get { return contentCase_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void ClearContent() { + contentCase_ = ContentOneofCase.None; + content_ = null; + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { - return Equals(other as StorageListFilesRequest); + return Equals(other as ServerMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(StorageListFilesRequest other) { + public bool Equals(ServerMessage other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } - if (BucketName != other.BucketName) return false; - if (Prefix != other.Prefix) return false; + if (Id != other.Id) return false; + if (!object.Equals(RegistrationResponse, other.RegistrationResponse)) return false; + if (!object.Equals(HttpRequest, other.HttpRequest)) return false; + if (ContentCase != other.ContentCase) return false; return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; - if (BucketName.Length != 0) hash ^= BucketName.GetHashCode(); - if (Prefix.Length != 0) hash ^= Prefix.GetHashCode(); + if (Id.Length != 0) hash ^= Id.GetHashCode(); + if (contentCase_ == ContentOneofCase.RegistrationResponse) hash ^= RegistrationResponse.GetHashCode(); + if (contentCase_ == ContentOneofCase.HttpRequest) hash ^= HttpRequest.GetHashCode(); + hash ^= (int) contentCase_; if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -1816,13 +1804,17 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else - if (BucketName.Length != 0) { + if (Id.Length != 0) { output.WriteRawTag(10); - output.WriteString(BucketName); + output.WriteString(Id); } - if (Prefix.Length != 0) { + if (contentCase_ == ContentOneofCase.RegistrationResponse) { output.WriteRawTag(18); - output.WriteString(Prefix); + output.WriteMessage(RegistrationResponse); + } + if (contentCase_ == ContentOneofCase.HttpRequest) { + output.WriteRawTag(26); + output.WriteMessage(HttpRequest); } if (_unknownFields != null) { _unknownFields.WriteTo(output); @@ -1833,13 +1825,17 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (BucketName.Length != 0) { + if (Id.Length != 0) { output.WriteRawTag(10); - output.WriteString(BucketName); + output.WriteString(Id); } - if (Prefix.Length != 0) { + if (contentCase_ == ContentOneofCase.RegistrationResponse) { output.WriteRawTag(18); - output.WriteString(Prefix); + output.WriteMessage(RegistrationResponse); + } + if (contentCase_ == ContentOneofCase.HttpRequest) { + output.WriteRawTag(26); + output.WriteMessage(HttpRequest); } if (_unknownFields != null) { _unknownFields.WriteTo(ref output); @@ -1850,11 +1846,14 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; - if (BucketName.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(BucketName); + if (Id.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Id); + } + if (contentCase_ == ContentOneofCase.RegistrationResponse) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(RegistrationResponse); } - if (Prefix.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Prefix); + if (contentCase_ == ContentOneofCase.HttpRequest) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(HttpRequest); } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); @@ -1863,16 +1862,28 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(StorageListFilesRequest other) { + public void MergeFrom(ServerMessage other) { if (other == null) { return; } - if (other.BucketName.Length != 0) { - BucketName = other.BucketName; + if (other.Id.Length != 0) { + Id = other.Id; } - if (other.Prefix.Length != 0) { - Prefix = other.Prefix; + switch (other.ContentCase) { + case ContentOneofCase.RegistrationResponse: + if (RegistrationResponse == null) { + RegistrationResponse = new global::Nitric.Proto.Apis.v1.RegistrationResponse(); + } + RegistrationResponse.MergeFrom(other.RegistrationResponse); + break; + case ContentOneofCase.HttpRequest: + if (HttpRequest == null) { + HttpRequest = new global::Nitric.Proto.Apis.v1.HttpRequest(); + } + HttpRequest.MergeFrom(other.HttpRequest); + break; } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } @@ -1888,11 +1899,25 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { - BucketName = input.ReadString(); + Id = input.ReadString(); break; } case 18: { - Prefix = input.ReadString(); + global::Nitric.Proto.Apis.v1.RegistrationResponse subBuilder = new global::Nitric.Proto.Apis.v1.RegistrationResponse(); + if (contentCase_ == ContentOneofCase.RegistrationResponse) { + subBuilder.MergeFrom(RegistrationResponse); + } + input.ReadMessage(subBuilder); + RegistrationResponse = subBuilder; + break; + } + case 26: { + global::Nitric.Proto.Apis.v1.HttpRequest subBuilder = new global::Nitric.Proto.Apis.v1.HttpRequest(); + if (contentCase_ == ContentOneofCase.HttpRequest) { + subBuilder.MergeFrom(HttpRequest); + } + input.ReadMessage(subBuilder); + HttpRequest = subBuilder; break; } } @@ -1910,11 +1935,25 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; case 10: { - BucketName = input.ReadString(); + Id = input.ReadString(); break; } case 18: { - Prefix = input.ReadString(); + global::Nitric.Proto.Apis.v1.RegistrationResponse subBuilder = new global::Nitric.Proto.Apis.v1.RegistrationResponse(); + if (contentCase_ == ContentOneofCase.RegistrationResponse) { + subBuilder.MergeFrom(RegistrationResponse); + } + input.ReadMessage(subBuilder); + RegistrationResponse = subBuilder; + break; + } + case 26: { + global::Nitric.Proto.Apis.v1.HttpRequest subBuilder = new global::Nitric.Proto.Apis.v1.HttpRequest(); + if (contentCase_ == ContentOneofCase.HttpRequest) { + subBuilder.MergeFrom(HttpRequest); + } + input.ReadMessage(subBuilder); + HttpRequest = subBuilder; break; } } @@ -1924,19 +1963,19 @@ public void MergeFrom(pb::CodedInputStream input) { } - public sealed partial class File : pb::IMessage + public sealed partial class RegistrationResponse : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new File()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RegistrationResponse()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Storage.v1.StorageReflection.Descriptor.MessageTypes[9]; } + get { return global::Nitric.Proto.Apis.v1.ApisReflection.Descriptor.MessageTypes[8]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1945,55 +1984,41 @@ public sealed partial class File : pb::IMessage } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public File() { + public RegistrationResponse() { OnConstruction(); } partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public File(File other) : this() { - key_ = other.key_; + public RegistrationResponse(RegistrationResponse other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public File Clone() { - return new File(this); - } - - /// Field number for the "key" field. - public const int KeyFieldNumber = 1; - private string key_ = ""; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string Key { - get { return key_; } - set { - key_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } + public RegistrationResponse Clone() { + return new RegistrationResponse(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { - return Equals(other as File); + return Equals(other as RegistrationResponse); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(File other) { + public bool Equals(RegistrationResponse other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } - if (Key != other.Key) return false; return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; - if (Key.Length != 0) hash ^= Key.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -2010,10 +2035,6 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else - if (Key.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Key); - } if (_unknownFields != null) { _unknownFields.WriteTo(output); } @@ -2023,10 +2044,6 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (Key.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Key); - } if (_unknownFields != null) { _unknownFields.WriteTo(ref output); } @@ -2036,9 +2053,6 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; - if (Key.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Key); - } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); } @@ -2046,13 +2060,10 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(File other) { + public void MergeFrom(RegistrationResponse other) { if (other == null) { return; } - if (other.Key.Length != 0) { - Key = other.Key; - } _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } @@ -2067,10 +2078,6 @@ public void MergeFrom(pb::CodedInputStream input) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; - case 10: { - Key = input.ReadString(); - break; - } } } #endif @@ -2085,10 +2092,6 @@ public void MergeFrom(pb::CodedInputStream input) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; - case 10: { - Key = input.ReadString(); - break; - } } } } @@ -2096,19 +2099,19 @@ public void MergeFrom(pb::CodedInputStream input) { } - public sealed partial class StorageListFilesResponse : pb::IMessage + public sealed partial class ApiWorkerScopes : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new StorageListFilesResponse()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ApiWorkerScopes()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Storage.v1.StorageReflection.Descriptor.MessageTypes[10]; } + get { return global::Nitric.Proto.Apis.v1.ApisReflection.Descriptor.MessageTypes[9]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -2117,57 +2120,54 @@ public sealed partial class StorageListFilesResponse : pb::IMessageField number for the "files" field. - public const int FilesFieldNumber = 1; - private static readonly pb::FieldCodec _repeated_files_codec - = pb::FieldCodec.ForMessage(10, global::Nitric.Proto.Storage.v1.File.Parser); - private readonly pbc::RepeatedField files_ = new pbc::RepeatedField(); - /// - /// keys of the files in the bucket - /// + /// Field number for the "scopes" field. + public const int ScopesFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_scopes_codec + = pb::FieldCodec.ForString(10); + private readonly pbc::RepeatedField scopes_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField Files { - get { return files_; } + public pbc::RepeatedField Scopes { + get { return scopes_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { - return Equals(other as StorageListFilesResponse); + return Equals(other as ApiWorkerScopes); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(StorageListFilesResponse other) { + public bool Equals(ApiWorkerScopes other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } - if(!files_.Equals(other.files_)) return false; + if(!scopes_.Equals(other.scopes_)) return false; return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; - hash ^= files_.GetHashCode(); + hash ^= scopes_.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -2184,7 +2184,7 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else - files_.WriteTo(output, _repeated_files_codec); + scopes_.WriteTo(output, _repeated_scopes_codec); if (_unknownFields != null) { _unknownFields.WriteTo(output); } @@ -2194,7 +2194,7 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - files_.WriteTo(ref output, _repeated_files_codec); + scopes_.WriteTo(ref output, _repeated_scopes_codec); if (_unknownFields != null) { _unknownFields.WriteTo(ref output); } @@ -2204,7 +2204,7 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; - size += files_.CalculateSize(_repeated_files_codec); + size += scopes_.CalculateSize(_repeated_scopes_codec); if (_unknownFields != null) { size += _unknownFields.CalculateSize(); } @@ -2212,11 +2212,11 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(StorageListFilesResponse other) { + public void MergeFrom(ApiWorkerScopes other) { if (other == null) { return; } - files_.Add(other.files_); + scopes_.Add(other.scopes_); _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } @@ -2232,7 +2232,7 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { - files_.AddEntriesFrom(input, _repeated_files_codec); + scopes_.AddEntriesFrom(input, _repeated_scopes_codec); break; } } @@ -2250,7 +2250,7 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; case 10: { - files_.AddEntriesFrom(ref input, _repeated_files_codec); + scopes_.AddEntriesFrom(ref input, _repeated_scopes_codec); break; } } @@ -2260,19 +2260,19 @@ public void MergeFrom(pb::CodedInputStream input) { } - public sealed partial class StorageExistsRequest : pb::IMessage + public sealed partial class ApiWorkerOptions : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new StorageExistsRequest()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ApiWorkerOptions()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Storage.v1.StorageReflection.Descriptor.MessageTypes[11]; } + get { return global::Nitric.Proto.Apis.v1.ApisReflection.Descriptor.MessageTypes[10]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -2281,72 +2281,78 @@ public sealed partial class StorageExistsRequest : pb::IMessageField number for the "bucket" field. - public const int BucketFieldNumber = 1; - private string bucket_ = ""; + /// Field number for the "security" field. + public const int SecurityFieldNumber = 1; + private static readonly pbc::MapField.Codec _map_security_codec + = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForMessage(18, global::Nitric.Proto.Apis.v1.ApiWorkerScopes.Parser), 10); + private readonly pbc::MapField security_ = new pbc::MapField(); + /// + /// Apply security definitions to this operation + /// This will be mapped to named ApiSecurityDefinitionResource(s) + /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string Bucket { - get { return bucket_; } - set { - bucket_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } + public pbc::MapField Security { + get { return security_; } } - /// Field number for the "key" field. - public const int KeyFieldNumber = 2; - private string key_ = ""; + /// Field number for the "security_disabled" field. + public const int SecurityDisabledFieldNumber = 2; + private bool securityDisabled_; /// - /// Key of item to retrieve + /// explicitly disable security for this endpoint + /// We need to do this as the default value of a repeated field + /// is always empty so there is no way of knowing if security is explicitly + /// disabled /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string Key { - get { return key_; } + public bool SecurityDisabled { + get { return securityDisabled_; } set { - key_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + securityDisabled_ = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { - return Equals(other as StorageExistsRequest); + return Equals(other as ApiWorkerOptions); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(StorageExistsRequest other) { + public bool Equals(ApiWorkerOptions other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } - if (Bucket != other.Bucket) return false; - if (Key != other.Key) return false; + if (!Security.Equals(other.Security)) return false; + if (SecurityDisabled != other.SecurityDisabled) return false; return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; - if (Bucket.Length != 0) hash ^= Bucket.GetHashCode(); - if (Key.Length != 0) hash ^= Key.GetHashCode(); + hash ^= Security.GetHashCode(); + if (SecurityDisabled != false) hash ^= SecurityDisabled.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -2363,13 +2369,10 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else - if (Bucket.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Bucket); - } - if (Key.Length != 0) { - output.WriteRawTag(18); - output.WriteString(Key); + security_.WriteTo(output, _map_security_codec); + if (SecurityDisabled != false) { + output.WriteRawTag(16); + output.WriteBool(SecurityDisabled); } if (_unknownFields != null) { _unknownFields.WriteTo(output); @@ -2380,13 +2383,10 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (Bucket.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Bucket); - } - if (Key.Length != 0) { - output.WriteRawTag(18); - output.WriteString(Key); + security_.WriteTo(ref output, _map_security_codec); + if (SecurityDisabled != false) { + output.WriteRawTag(16); + output.WriteBool(SecurityDisabled); } if (_unknownFields != null) { _unknownFields.WriteTo(ref output); @@ -2397,11 +2397,9 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; - if (Bucket.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Bucket); - } - if (Key.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Key); + size += security_.CalculateSize(_map_security_codec); + if (SecurityDisabled != false) { + size += 1 + 1; } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); @@ -2410,15 +2408,13 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(StorageExistsRequest other) { + public void MergeFrom(ApiWorkerOptions other) { if (other == null) { return; } - if (other.Bucket.Length != 0) { - Bucket = other.Bucket; - } - if (other.Key.Length != 0) { - Key = other.Key; + security_.Add(other.security_); + if (other.SecurityDisabled != false) { + SecurityDisabled = other.SecurityDisabled; } _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } @@ -2435,11 +2431,11 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { - Bucket = input.ReadString(); + security_.AddEntriesFrom(input, _map_security_codec); break; } - case 18: { - Key = input.ReadString(); + case 16: { + SecurityDisabled = input.ReadBool(); break; } } @@ -2457,11 +2453,11 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; case 10: { - Bucket = input.ReadString(); + security_.AddEntriesFrom(ref input, _map_security_codec); break; } - case 18: { - Key = input.ReadString(); + case 16: { + SecurityDisabled = input.ReadBool(); break; } } @@ -2471,19 +2467,19 @@ public void MergeFrom(pb::CodedInputStream input) { } - public sealed partial class StorageExistsResponse : pb::IMessage + public sealed partial class RegistrationRequest : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new StorageExistsResponse()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RegistrationRequest()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Storage.v1.StorageReflection.Descriptor.MessageTypes[12]; } + get { return global::Nitric.Proto.Apis.v1.ApisReflection.Descriptor.MessageTypes[11]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -2492,55 +2488,96 @@ public sealed partial class StorageExistsResponse : pb::IMessageField number for the "api" field. + public const int ApiFieldNumber = 1; + private string api_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Api { + get { return api_; } + set { + api_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "path" field. + public const int PathFieldNumber = 2; + private string path_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Path { + get { return path_; } + set { + path_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "methods" field. + public const int MethodsFieldNumber = 3; + private static readonly pb::FieldCodec _repeated_methods_codec + = pb::FieldCodec.ForString(26); + private readonly pbc::RepeatedField methods_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField Methods { + get { return methods_; } } - /// Field number for the "exists" field. - public const int ExistsFieldNumber = 1; - private bool exists_; + /// Field number for the "options" field. + public const int OptionsFieldNumber = 4; + private global::Nitric.Proto.Apis.v1.ApiWorkerOptions options_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Exists { - get { return exists_; } + public global::Nitric.Proto.Apis.v1.ApiWorkerOptions Options { + get { return options_; } set { - exists_ = value; + options_ = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { - return Equals(other as StorageExistsResponse); + return Equals(other as RegistrationRequest); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(StorageExistsResponse other) { + public bool Equals(RegistrationRequest other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } - if (Exists != other.Exists) return false; + if (Api != other.Api) return false; + if (Path != other.Path) return false; + if(!methods_.Equals(other.methods_)) return false; + if (!object.Equals(Options, other.Options)) return false; return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; - if (Exists != false) hash ^= Exists.GetHashCode(); + if (Api.Length != 0) hash ^= Api.GetHashCode(); + if (Path.Length != 0) hash ^= Path.GetHashCode(); + hash ^= methods_.GetHashCode(); + if (options_ != null) hash ^= Options.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -2557,9 +2594,18 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else - if (Exists != false) { - output.WriteRawTag(8); - output.WriteBool(Exists); + if (Api.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Api); + } + if (Path.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Path); + } + methods_.WriteTo(output, _repeated_methods_codec); + if (options_ != null) { + output.WriteRawTag(34); + output.WriteMessage(Options); } if (_unknownFields != null) { _unknownFields.WriteTo(output); @@ -2570,9 +2616,18 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (Exists != false) { - output.WriteRawTag(8); - output.WriteBool(Exists); + if (Api.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Api); + } + if (Path.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Path); + } + methods_.WriteTo(ref output, _repeated_methods_codec); + if (options_ != null) { + output.WriteRawTag(34); + output.WriteMessage(Options); } if (_unknownFields != null) { _unknownFields.WriteTo(ref output); @@ -2583,8 +2638,15 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; - if (Exists != false) { - size += 1 + 1; + if (Api.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Api); + } + if (Path.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Path); + } + size += methods_.CalculateSize(_repeated_methods_codec); + if (options_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Options); } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); @@ -2593,12 +2655,22 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(StorageExistsResponse other) { + public void MergeFrom(RegistrationRequest other) { if (other == null) { return; } - if (other.Exists != false) { - Exists = other.Exists; + if (other.Api.Length != 0) { + Api = other.Api; + } + if (other.Path.Length != 0) { + Path = other.Path; + } + methods_.Add(other.methods_); + if (other.options_ != null) { + if (options_ == null) { + Options = new global::Nitric.Proto.Apis.v1.ApiWorkerOptions(); + } + Options.MergeFrom(other.Options); } _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } @@ -2614,8 +2686,23 @@ public void MergeFrom(pb::CodedInputStream input) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; - case 8: { - Exists = input.ReadBool(); + case 10: { + Api = input.ReadString(); + break; + } + case 18: { + Path = input.ReadString(); + break; + } + case 26: { + methods_.AddEntriesFrom(input, _repeated_methods_codec); + break; + } + case 34: { + if (options_ == null) { + Options = new global::Nitric.Proto.Apis.v1.ApiWorkerOptions(); + } + input.ReadMessage(Options); break; } } @@ -2632,8 +2719,23 @@ public void MergeFrom(pb::CodedInputStream input) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; - case 8: { - Exists = input.ReadBool(); + case 10: { + Api = input.ReadString(); + break; + } + case 18: { + Path = input.ReadString(); + break; + } + case 26: { + methods_.AddEntriesFrom(ref input, _repeated_methods_codec); + break; + } + case 34: { + if (options_ == null) { + Options = new global::Nitric.Proto.Apis.v1.ApiWorkerOptions(); + } + input.ReadMessage(Options); break; } } diff --git a/src/Nitric.Sdk/Proto/nitric/proto/apis/v1/ApisGrpc.cs b/src/Nitric.Sdk/Proto/nitric/proto/apis/v1/ApisGrpc.cs new file mode 100644 index 0000000..2e8595a --- /dev/null +++ b/src/Nitric.Sdk/Proto/nitric/proto/apis/v1/ApisGrpc.cs @@ -0,0 +1,217 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: nitric/proto/apis/v1/apis.proto +// +#pragma warning disable 0414, 1591 +#region Designer generated code + +using grpc = global::Grpc.Core; + +namespace Nitric.Proto.Apis.v1 { + /// + /// Service for API routing and handlers + /// + public static partial class Api + { + static readonly string __ServiceName = "nitric.proto.apis.v1.Api"; + + static void __Helper_SerializeMessage(global::Google.Protobuf.IMessage message, grpc::SerializationContext context) + { + #if !GRPC_DISABLE_PROTOBUF_BUFFER_SERIALIZATION + if (message is global::Google.Protobuf.IBufferMessage) + { + context.SetPayloadLength(message.CalculateSize()); + global::Google.Protobuf.MessageExtensions.WriteTo(message, context.GetBufferWriter()); + context.Complete(); + return; + } + #endif + context.Complete(global::Google.Protobuf.MessageExtensions.ToByteArray(message)); + } + + static class __Helper_MessageCache + { + public static readonly bool IsBufferMessage = global::System.Reflection.IntrospectionExtensions.GetTypeInfo(typeof(global::Google.Protobuf.IBufferMessage)).IsAssignableFrom(typeof(T)); + } + + static T __Helper_DeserializeMessage(grpc::DeserializationContext context, global::Google.Protobuf.MessageParser parser) where T : global::Google.Protobuf.IMessage + { + #if !GRPC_DISABLE_PROTOBUF_BUFFER_SERIALIZATION + if (__Helper_MessageCache.IsBufferMessage) + { + return parser.ParseFrom(context.PayloadAsReadOnlySequence()); + } + #endif + return parser.ParseFrom(context.PayloadAsNewBuffer()); + } + + static readonly grpc::Marshaller __Marshaller_nitric_proto_apis_v1_ClientMessage = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Apis.v1.ClientMessage.Parser)); + static readonly grpc::Marshaller __Marshaller_nitric_proto_apis_v1_ServerMessage = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Apis.v1.ServerMessage.Parser)); + static readonly grpc::Marshaller __Marshaller_nitric_proto_apis_v1_ApiDetailsRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Apis.v1.ApiDetailsRequest.Parser)); + static readonly grpc::Marshaller __Marshaller_nitric_proto_apis_v1_ApiDetailsResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Apis.v1.ApiDetailsResponse.Parser)); + + static readonly grpc::Method __Method_Serve = new grpc::Method( + grpc::MethodType.DuplexStreaming, + __ServiceName, + "Serve", + __Marshaller_nitric_proto_apis_v1_ClientMessage, + __Marshaller_nitric_proto_apis_v1_ServerMessage); + + static readonly grpc::Method __Method_ApiDetails = new grpc::Method( + grpc::MethodType.Unary, + __ServiceName, + "ApiDetails", + __Marshaller_nitric_proto_apis_v1_ApiDetailsRequest, + __Marshaller_nitric_proto_apis_v1_ApiDetailsResponse); + + /// Service descriptor + public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor + { + get { return global::Nitric.Proto.Apis.v1.ApisReflection.Descriptor.Services[0]; } + } + + /// Base class for server-side implementations of Api + [grpc::BindServiceMethod(typeof(Api), "BindService")] + public abstract partial class ApiBase + { + /// + /// Serve a route on an API + /// + /// Used for reading requests from the client. + /// Used for sending responses back to the client. + /// The context of the server-side call handler being invoked. + /// A task indicating completion of the handler. + public virtual global::System.Threading.Tasks.Task Serve(grpc::IAsyncStreamReader requestStream, grpc::IServerStreamWriter responseStream, grpc::ServerCallContext context) + { + throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); + } + + /// + /// Retrieve details about an API + /// + /// The request received from the client. + /// The context of the server-side call handler being invoked. + /// The response to send back to the client (wrapped by a task). + public virtual global::System.Threading.Tasks.Task ApiDetails(global::Nitric.Proto.Apis.v1.ApiDetailsRequest request, grpc::ServerCallContext context) + { + throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); + } + + } + + /// Client for Api + public partial class ApiClient : grpc::ClientBase + { + /// Creates a new client for Api + /// The channel to use to make remote calls. + public ApiClient(grpc::ChannelBase channel) : base(channel) + { + } + /// Creates a new client for Api that uses a custom CallInvoker. + /// The callInvoker to use to make remote calls. + public ApiClient(grpc::CallInvoker callInvoker) : base(callInvoker) + { + } + /// Protected parameterless constructor to allow creation of test doubles. + protected ApiClient() : base() + { + } + /// Protected constructor to allow creation of configured clients. + /// The client configuration. + protected ApiClient(ClientBaseConfiguration configuration) : base(configuration) + { + } + + /// + /// Serve a route on an API + /// + /// The initial metadata to send with the call. This parameter is optional. + /// An optional deadline for the call. The call will be cancelled if deadline is hit. + /// An optional token for canceling the call. + /// The call object. + public virtual grpc::AsyncDuplexStreamingCall Serve(grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return Serve(new grpc::CallOptions(headers, deadline, cancellationToken)); + } + /// + /// Serve a route on an API + /// + /// The options for the call. + /// The call object. + public virtual grpc::AsyncDuplexStreamingCall Serve(grpc::CallOptions options) + { + return CallInvoker.AsyncDuplexStreamingCall(__Method_Serve, null, options); + } + /// + /// Retrieve details about an API + /// + /// The request to send to the server. + /// The initial metadata to send with the call. This parameter is optional. + /// An optional deadline for the call. The call will be cancelled if deadline is hit. + /// An optional token for canceling the call. + /// The response received from the server. + public virtual global::Nitric.Proto.Apis.v1.ApiDetailsResponse ApiDetails(global::Nitric.Proto.Apis.v1.ApiDetailsRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return ApiDetails(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + /// + /// Retrieve details about an API + /// + /// The request to send to the server. + /// The options for the call. + /// The response received from the server. + public virtual global::Nitric.Proto.Apis.v1.ApiDetailsResponse ApiDetails(global::Nitric.Proto.Apis.v1.ApiDetailsRequest request, grpc::CallOptions options) + { + return CallInvoker.BlockingUnaryCall(__Method_ApiDetails, null, options, request); + } + /// + /// Retrieve details about an API + /// + /// The request to send to the server. + /// The initial metadata to send with the call. This parameter is optional. + /// An optional deadline for the call. The call will be cancelled if deadline is hit. + /// An optional token for canceling the call. + /// The call object. + public virtual grpc::AsyncUnaryCall ApiDetailsAsync(global::Nitric.Proto.Apis.v1.ApiDetailsRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return ApiDetailsAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + /// + /// Retrieve details about an API + /// + /// The request to send to the server. + /// The options for the call. + /// The call object. + public virtual grpc::AsyncUnaryCall ApiDetailsAsync(global::Nitric.Proto.Apis.v1.ApiDetailsRequest request, grpc::CallOptions options) + { + return CallInvoker.AsyncUnaryCall(__Method_ApiDetails, null, options, request); + } + /// Creates a new instance of client from given ClientBaseConfiguration. + protected override ApiClient NewInstance(ClientBaseConfiguration configuration) + { + return new ApiClient(configuration); + } + } + + /// Creates service definition that can be registered with a server + /// An object implementing the server-side handling logic. + public static grpc::ServerServiceDefinition BindService(ApiBase serviceImpl) + { + return grpc::ServerServiceDefinition.CreateBuilder() + .AddMethod(__Method_Serve, serviceImpl.Serve) + .AddMethod(__Method_ApiDetails, serviceImpl.ApiDetails).Build(); + } + + /// Register service method with a service binder with or without implementation. Useful when customizing the service binding logic. + /// Note: this method is part of an experimental API that can change or be removed without any prior notice. + /// Service methods will be bound by calling AddMethod on this object. + /// An object implementing the server-side handling logic. + public static void BindService(grpc::ServiceBinderBase serviceBinder, ApiBase serviceImpl) + { + serviceBinder.AddMethod(__Method_Serve, serviceImpl == null ? null : new grpc::DuplexStreamingServerMethod(serviceImpl.Serve)); + serviceBinder.AddMethod(__Method_ApiDetails, serviceImpl == null ? null : new grpc::UnaryServerMethod(serviceImpl.ApiDetails)); + } + + } +} +#endregion diff --git a/src/Nitric.Sdk/Proto/nitric/proto/batch/v1/Batch.cs b/src/Nitric.Sdk/Proto/nitric/proto/batch/v1/Batch.cs new file mode 100644 index 0000000..dea7f7e --- /dev/null +++ b/src/Nitric.Sdk/Proto/nitric/proto/batch/v1/Batch.cs @@ -0,0 +1,2275 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: nitric/proto/batch/v1/batch.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Nitric.Proto.Batch.v1 { + + /// Holder for reflection information generated from nitric/proto/batch/v1/batch.proto + public static partial class BatchReflection { + + #region Descriptor + /// File descriptor for nitric/proto/batch/v1/batch.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static BatchReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CiFuaXRyaWMvcHJvdG8vYmF0Y2gvdjEvYmF0Y2gucHJvdG8SFW5pdHJpYy5w", + "cm90by5iYXRjaC52MRocZ29vZ2xlL3Byb3RvYnVmL3N0cnVjdC5wcm90byKu", + "AQoNQ2xpZW50TWVzc2FnZRIKCgJpZBgBIAEoCRJKChRyZWdpc3RyYXRpb25f", + "cmVxdWVzdBgCIAEoCzIqLm5pdHJpYy5wcm90by5iYXRjaC52MS5SZWdpc3Ry", + "YXRpb25SZXF1ZXN0SAASOgoMam9iX3Jlc3BvbnNlGAMgASgLMiIubml0cmlj", + "LnByb3RvLmJhdGNoLnYxLkpvYlJlc3BvbnNlSABCCQoHY29udGVudCJMCgpK", + "b2JSZXF1ZXN0EhAKCGpvYl9uYW1lGAEgASgJEiwKBGRhdGEYAiABKAsyHi5u", + "aXRyaWMucHJvdG8uYmF0Y2gudjEuSm9iRGF0YSI8CgdKb2JEYXRhEikKBnN0", + "cnVjdBgBIAEoCzIXLmdvb2dsZS5wcm90b2J1Zi5TdHJ1Y3RIAEIGCgRkYXRh", + "Ih4KC0pvYlJlc3BvbnNlEg8KB3N1Y2Nlc3MYASABKAgibQoTUmVnaXN0cmF0", + "aW9uUmVxdWVzdBIQCghqb2JfbmFtZRgBIAEoCRJECgxyZXF1aXJlbWVudHMY", + "AiABKAsyLi5uaXRyaWMucHJvdG8uYmF0Y2gudjEuSm9iUmVzb3VyY2VSZXF1", + "aXJlbWVudHMiFgoUUmVnaXN0cmF0aW9uUmVzcG9uc2UiRQoXSm9iUmVzb3Vy", + "Y2VSZXF1aXJlbWVudHMSDAoEY3B1cxgBIAEoAhIOCgZtZW1vcnkYAiABKAMS", + "DAoEZ3B1cxgDIAEoAyKuAQoNU2VydmVyTWVzc2FnZRIKCgJpZBgBIAEoCRJM", + "ChVyZWdpc3RyYXRpb25fcmVzcG9uc2UYAiABKAsyKy5uaXRyaWMucHJvdG8u", + "YmF0Y2gudjEuUmVnaXN0cmF0aW9uUmVzcG9uc2VIABI4Cgtqb2JfcmVxdWVz", + "dBgDIAEoCzIhLm5pdHJpYy5wcm90by5iYXRjaC52MS5Kb2JSZXF1ZXN0SABC", + "CQoHY29udGVudCJSChBKb2JTdWJtaXRSZXF1ZXN0EhAKCGpvYl9uYW1lGAEg", + "ASgJEiwKBGRhdGEYAiABKAsyHi5uaXRyaWMucHJvdG8uYmF0Y2gudjEuSm9i", + "RGF0YSITChFKb2JTdWJtaXRSZXNwb25zZTJiCgNKb2ISWwoJSGFuZGxlSm9i", + "EiQubml0cmljLnByb3RvLmJhdGNoLnYxLkNsaWVudE1lc3NhZ2UaJC5uaXRy", + "aWMucHJvdG8uYmF0Y2gudjEuU2VydmVyTWVzc2FnZSgBMAEyZwoFQmF0Y2gS", + "XgoJU3VibWl0Sm9iEicubml0cmljLnByb3RvLmJhdGNoLnYxLkpvYlN1Ym1p", + "dFJlcXVlc3QaKC5uaXRyaWMucHJvdG8uYmF0Y2gudjEuSm9iU3VibWl0UmVz", + "cG9uc2VCmAEKGGlvLm5pdHJpYy5wcm90by5iYXRjaC52MUIMQmF0Y2hTZXJ2", + "aWNlUAFaPGdpdGh1Yi5jb20vbml0cmljdGVjaC9uaXRyaWMvY29yZS9wa2cv", + "cHJvdG8vYmF0Y2gvdjE7YmF0Y2hwYqoCFU5pdHJpYy5Qcm90by5CYXRjaC52", + "McoCFU5pdHJpY1xQcm90b1xCYXRjaFxWMWIGcHJvdG8z")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Google.Protobuf.WellKnownTypes.StructReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Batch.v1.ClientMessage), global::Nitric.Proto.Batch.v1.ClientMessage.Parser, new[]{ "Id", "RegistrationRequest", "JobResponse" }, new[]{ "Content" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Batch.v1.JobRequest), global::Nitric.Proto.Batch.v1.JobRequest.Parser, new[]{ "JobName", "Data" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Batch.v1.JobData), global::Nitric.Proto.Batch.v1.JobData.Parser, new[]{ "Struct" }, new[]{ "Data" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Batch.v1.JobResponse), global::Nitric.Proto.Batch.v1.JobResponse.Parser, new[]{ "Success" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Batch.v1.RegistrationRequest), global::Nitric.Proto.Batch.v1.RegistrationRequest.Parser, new[]{ "JobName", "Requirements" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Batch.v1.RegistrationResponse), global::Nitric.Proto.Batch.v1.RegistrationResponse.Parser, null, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Batch.v1.JobResourceRequirements), global::Nitric.Proto.Batch.v1.JobResourceRequirements.Parser, new[]{ "Cpus", "Memory", "Gpus" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Batch.v1.ServerMessage), global::Nitric.Proto.Batch.v1.ServerMessage.Parser, new[]{ "Id", "RegistrationResponse", "JobRequest" }, new[]{ "Content" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Batch.v1.JobSubmitRequest), global::Nitric.Proto.Batch.v1.JobSubmitRequest.Parser, new[]{ "JobName", "Data" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Batch.v1.JobSubmitResponse), global::Nitric.Proto.Batch.v1.JobSubmitResponse.Parser, null, null, null, null, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class ClientMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ClientMessage()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Nitric.Proto.Batch.v1.BatchReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ClientMessage() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ClientMessage(ClientMessage other) : this() { + id_ = other.id_; + switch (other.ContentCase) { + case ContentOneofCase.RegistrationRequest: + RegistrationRequest = other.RegistrationRequest.Clone(); + break; + case ContentOneofCase.JobResponse: + JobResponse = other.JobResponse.Clone(); + break; + } + + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ClientMessage Clone() { + return new ClientMessage(this); + } + + /// Field number for the "id" field. + public const int IdFieldNumber = 1; + private string id_ = ""; + /// + /// globally unique ID of the request/response pair + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Id { + get { return id_; } + set { + id_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "registration_request" field. + public const int RegistrationRequestFieldNumber = 2; + /// + /// Register a handler for a job + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Nitric.Proto.Batch.v1.RegistrationRequest RegistrationRequest { + get { return contentCase_ == ContentOneofCase.RegistrationRequest ? (global::Nitric.Proto.Batch.v1.RegistrationRequest) content_ : null; } + set { + content_ = value; + contentCase_ = value == null ? ContentOneofCase.None : ContentOneofCase.RegistrationRequest; + } + } + + /// Field number for the "job_response" field. + public const int JobResponseFieldNumber = 3; + /// + /// Handle a job submission + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Nitric.Proto.Batch.v1.JobResponse JobResponse { + get { return contentCase_ == ContentOneofCase.JobResponse ? (global::Nitric.Proto.Batch.v1.JobResponse) content_ : null; } + set { + content_ = value; + contentCase_ = value == null ? ContentOneofCase.None : ContentOneofCase.JobResponse; + } + } + + private object content_; + /// Enum of possible cases for the "content" oneof. + public enum ContentOneofCase { + None = 0, + RegistrationRequest = 2, + JobResponse = 3, + } + private ContentOneofCase contentCase_ = ContentOneofCase.None; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ContentOneofCase ContentCase { + get { return contentCase_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void ClearContent() { + contentCase_ = ContentOneofCase.None; + content_ = null; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as ClientMessage); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ClientMessage other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Id != other.Id) return false; + if (!object.Equals(RegistrationRequest, other.RegistrationRequest)) return false; + if (!object.Equals(JobResponse, other.JobResponse)) return false; + if (ContentCase != other.ContentCase) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Id.Length != 0) hash ^= Id.GetHashCode(); + if (contentCase_ == ContentOneofCase.RegistrationRequest) hash ^= RegistrationRequest.GetHashCode(); + if (contentCase_ == ContentOneofCase.JobResponse) hash ^= JobResponse.GetHashCode(); + hash ^= (int) contentCase_; + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (Id.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Id); + } + if (contentCase_ == ContentOneofCase.RegistrationRequest) { + output.WriteRawTag(18); + output.WriteMessage(RegistrationRequest); + } + if (contentCase_ == ContentOneofCase.JobResponse) { + output.WriteRawTag(26); + output.WriteMessage(JobResponse); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Id.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Id); + } + if (contentCase_ == ContentOneofCase.RegistrationRequest) { + output.WriteRawTag(18); + output.WriteMessage(RegistrationRequest); + } + if (contentCase_ == ContentOneofCase.JobResponse) { + output.WriteRawTag(26); + output.WriteMessage(JobResponse); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Id.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Id); + } + if (contentCase_ == ContentOneofCase.RegistrationRequest) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(RegistrationRequest); + } + if (contentCase_ == ContentOneofCase.JobResponse) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(JobResponse); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(ClientMessage other) { + if (other == null) { + return; + } + if (other.Id.Length != 0) { + Id = other.Id; + } + switch (other.ContentCase) { + case ContentOneofCase.RegistrationRequest: + if (RegistrationRequest == null) { + RegistrationRequest = new global::Nitric.Proto.Batch.v1.RegistrationRequest(); + } + RegistrationRequest.MergeFrom(other.RegistrationRequest); + break; + case ContentOneofCase.JobResponse: + if (JobResponse == null) { + JobResponse = new global::Nitric.Proto.Batch.v1.JobResponse(); + } + JobResponse.MergeFrom(other.JobResponse); + break; + } + + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Id = input.ReadString(); + break; + } + case 18: { + global::Nitric.Proto.Batch.v1.RegistrationRequest subBuilder = new global::Nitric.Proto.Batch.v1.RegistrationRequest(); + if (contentCase_ == ContentOneofCase.RegistrationRequest) { + subBuilder.MergeFrom(RegistrationRequest); + } + input.ReadMessage(subBuilder); + RegistrationRequest = subBuilder; + break; + } + case 26: { + global::Nitric.Proto.Batch.v1.JobResponse subBuilder = new global::Nitric.Proto.Batch.v1.JobResponse(); + if (contentCase_ == ContentOneofCase.JobResponse) { + subBuilder.MergeFrom(JobResponse); + } + input.ReadMessage(subBuilder); + JobResponse = subBuilder; + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Id = input.ReadString(); + break; + } + case 18: { + global::Nitric.Proto.Batch.v1.RegistrationRequest subBuilder = new global::Nitric.Proto.Batch.v1.RegistrationRequest(); + if (contentCase_ == ContentOneofCase.RegistrationRequest) { + subBuilder.MergeFrom(RegistrationRequest); + } + input.ReadMessage(subBuilder); + RegistrationRequest = subBuilder; + break; + } + case 26: { + global::Nitric.Proto.Batch.v1.JobResponse subBuilder = new global::Nitric.Proto.Batch.v1.JobResponse(); + if (contentCase_ == ContentOneofCase.JobResponse) { + subBuilder.MergeFrom(JobResponse); + } + input.ReadMessage(subBuilder); + JobResponse = subBuilder; + break; + } + } + } + } + #endif + + } + + public sealed partial class JobRequest : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new JobRequest()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Nitric.Proto.Batch.v1.BatchReflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public JobRequest() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public JobRequest(JobRequest other) : this() { + jobName_ = other.jobName_; + data_ = other.data_ != null ? other.data_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public JobRequest Clone() { + return new JobRequest(this); + } + + /// Field number for the "job_name" field. + public const int JobNameFieldNumber = 1; + private string jobName_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string JobName { + get { return jobName_; } + set { + jobName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "data" field. + public const int DataFieldNumber = 2; + private global::Nitric.Proto.Batch.v1.JobData data_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Nitric.Proto.Batch.v1.JobData Data { + get { return data_; } + set { + data_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as JobRequest); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(JobRequest other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (JobName != other.JobName) return false; + if (!object.Equals(Data, other.Data)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (JobName.Length != 0) hash ^= JobName.GetHashCode(); + if (data_ != null) hash ^= Data.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (JobName.Length != 0) { + output.WriteRawTag(10); + output.WriteString(JobName); + } + if (data_ != null) { + output.WriteRawTag(18); + output.WriteMessage(Data); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (JobName.Length != 0) { + output.WriteRawTag(10); + output.WriteString(JobName); + } + if (data_ != null) { + output.WriteRawTag(18); + output.WriteMessage(Data); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (JobName.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(JobName); + } + if (data_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Data); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(JobRequest other) { + if (other == null) { + return; + } + if (other.JobName.Length != 0) { + JobName = other.JobName; + } + if (other.data_ != null) { + if (data_ == null) { + Data = new global::Nitric.Proto.Batch.v1.JobData(); + } + Data.MergeFrom(other.Data); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + JobName = input.ReadString(); + break; + } + case 18: { + if (data_ == null) { + Data = new global::Nitric.Proto.Batch.v1.JobData(); + } + input.ReadMessage(Data); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + JobName = input.ReadString(); + break; + } + case 18: { + if (data_ == null) { + Data = new global::Nitric.Proto.Batch.v1.JobData(); + } + input.ReadMessage(Data); + break; + } + } + } + } + #endif + + } + + public sealed partial class JobData : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new JobData()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Nitric.Proto.Batch.v1.BatchReflection.Descriptor.MessageTypes[2]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public JobData() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public JobData(JobData other) : this() { + switch (other.DataCase) { + case DataOneofCase.Struct: + Struct = other.Struct.Clone(); + break; + } + + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public JobData Clone() { + return new JobData(this); + } + + /// Field number for the "struct" field. + public const int StructFieldNumber = 1; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Google.Protobuf.WellKnownTypes.Struct Struct { + get { return dataCase_ == DataOneofCase.Struct ? (global::Google.Protobuf.WellKnownTypes.Struct) data_ : null; } + set { + data_ = value; + dataCase_ = value == null ? DataOneofCase.None : DataOneofCase.Struct; + } + } + + private object data_; + /// Enum of possible cases for the "data" oneof. + public enum DataOneofCase { + None = 0, + Struct = 1, + } + private DataOneofCase dataCase_ = DataOneofCase.None; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public DataOneofCase DataCase { + get { return dataCase_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void ClearData() { + dataCase_ = DataOneofCase.None; + data_ = null; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as JobData); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(JobData other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(Struct, other.Struct)) return false; + if (DataCase != other.DataCase) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (dataCase_ == DataOneofCase.Struct) hash ^= Struct.GetHashCode(); + hash ^= (int) dataCase_; + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (dataCase_ == DataOneofCase.Struct) { + output.WriteRawTag(10); + output.WriteMessage(Struct); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (dataCase_ == DataOneofCase.Struct) { + output.WriteRawTag(10); + output.WriteMessage(Struct); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (dataCase_ == DataOneofCase.Struct) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Struct); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(JobData other) { + if (other == null) { + return; + } + switch (other.DataCase) { + case DataOneofCase.Struct: + if (Struct == null) { + Struct = new global::Google.Protobuf.WellKnownTypes.Struct(); + } + Struct.MergeFrom(other.Struct); + break; + } + + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + global::Google.Protobuf.WellKnownTypes.Struct subBuilder = new global::Google.Protobuf.WellKnownTypes.Struct(); + if (dataCase_ == DataOneofCase.Struct) { + subBuilder.MergeFrom(Struct); + } + input.ReadMessage(subBuilder); + Struct = subBuilder; + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + global::Google.Protobuf.WellKnownTypes.Struct subBuilder = new global::Google.Protobuf.WellKnownTypes.Struct(); + if (dataCase_ == DataOneofCase.Struct) { + subBuilder.MergeFrom(Struct); + } + input.ReadMessage(subBuilder); + Struct = subBuilder; + break; + } + } + } + } + #endif + + } + + public sealed partial class JobResponse : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new JobResponse()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Nitric.Proto.Batch.v1.BatchReflection.Descriptor.MessageTypes[3]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public JobResponse() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public JobResponse(JobResponse other) : this() { + success_ = other.success_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public JobResponse Clone() { + return new JobResponse(this); + } + + /// Field number for the "success" field. + public const int SuccessFieldNumber = 1; + private bool success_; + /// + /// Mark if the job was successfully processed + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Success { + get { return success_; } + set { + success_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as JobResponse); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(JobResponse other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Success != other.Success) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Success != false) hash ^= Success.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (Success != false) { + output.WriteRawTag(8); + output.WriteBool(Success); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Success != false) { + output.WriteRawTag(8); + output.WriteBool(Success); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Success != false) { + size += 1 + 1; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(JobResponse other) { + if (other == null) { + return; + } + if (other.Success != false) { + Success = other.Success; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Success = input.ReadBool(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Success = input.ReadBool(); + break; + } + } + } + } + #endif + + } + + public sealed partial class RegistrationRequest : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RegistrationRequest()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Nitric.Proto.Batch.v1.BatchReflection.Descriptor.MessageTypes[4]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public RegistrationRequest() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public RegistrationRequest(RegistrationRequest other) : this() { + jobName_ = other.jobName_; + requirements_ = other.requirements_ != null ? other.requirements_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public RegistrationRequest Clone() { + return new RegistrationRequest(this); + } + + /// Field number for the "job_name" field. + public const int JobNameFieldNumber = 1; + private string jobName_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string JobName { + get { return jobName_; } + set { + jobName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "requirements" field. + public const int RequirementsFieldNumber = 2; + private global::Nitric.Proto.Batch.v1.JobResourceRequirements requirements_; + /// + /// Register with default requirements + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Nitric.Proto.Batch.v1.JobResourceRequirements Requirements { + get { return requirements_; } + set { + requirements_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as RegistrationRequest); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(RegistrationRequest other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (JobName != other.JobName) return false; + if (!object.Equals(Requirements, other.Requirements)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (JobName.Length != 0) hash ^= JobName.GetHashCode(); + if (requirements_ != null) hash ^= Requirements.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (JobName.Length != 0) { + output.WriteRawTag(10); + output.WriteString(JobName); + } + if (requirements_ != null) { + output.WriteRawTag(18); + output.WriteMessage(Requirements); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (JobName.Length != 0) { + output.WriteRawTag(10); + output.WriteString(JobName); + } + if (requirements_ != null) { + output.WriteRawTag(18); + output.WriteMessage(Requirements); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (JobName.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(JobName); + } + if (requirements_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Requirements); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(RegistrationRequest other) { + if (other == null) { + return; + } + if (other.JobName.Length != 0) { + JobName = other.JobName; + } + if (other.requirements_ != null) { + if (requirements_ == null) { + Requirements = new global::Nitric.Proto.Batch.v1.JobResourceRequirements(); + } + Requirements.MergeFrom(other.Requirements); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + JobName = input.ReadString(); + break; + } + case 18: { + if (requirements_ == null) { + Requirements = new global::Nitric.Proto.Batch.v1.JobResourceRequirements(); + } + input.ReadMessage(Requirements); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + JobName = input.ReadString(); + break; + } + case 18: { + if (requirements_ == null) { + Requirements = new global::Nitric.Proto.Batch.v1.JobResourceRequirements(); + } + input.ReadMessage(Requirements); + break; + } + } + } + } + #endif + + } + + public sealed partial class RegistrationResponse : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RegistrationResponse()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Nitric.Proto.Batch.v1.BatchReflection.Descriptor.MessageTypes[5]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public RegistrationResponse() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public RegistrationResponse(RegistrationResponse other) : this() { + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public RegistrationResponse Clone() { + return new RegistrationResponse(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as RegistrationResponse); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(RegistrationResponse other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(RegistrationResponse other) { + if (other == null) { + return; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + } + } + } + #endif + + } + + public sealed partial class JobResourceRequirements : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new JobResourceRequirements()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Nitric.Proto.Batch.v1.BatchReflection.Descriptor.MessageTypes[6]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public JobResourceRequirements() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public JobResourceRequirements(JobResourceRequirements other) : this() { + cpus_ = other.cpus_; + memory_ = other.memory_; + gpus_ = other.gpus_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public JobResourceRequirements Clone() { + return new JobResourceRequirements(this); + } + + /// Field number for the "cpus" field. + public const int CpusFieldNumber = 1; + private float cpus_; + /// + /// The number of CPUs to allocate for the job + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public float Cpus { + get { return cpus_; } + set { + cpus_ = value; + } + } + + /// Field number for the "memory" field. + public const int MemoryFieldNumber = 2; + private long memory_; + /// + /// The amount of memory to allocate for the job + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long Memory { + get { return memory_; } + set { + memory_ = value; + } + } + + /// Field number for the "gpus" field. + public const int GpusFieldNumber = 3; + private long gpus_; + /// + /// The number of GPUs to allocate for the job + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long Gpus { + get { return gpus_; } + set { + gpus_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as JobResourceRequirements); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(JobResourceRequirements other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Cpus, other.Cpus)) return false; + if (Memory != other.Memory) return false; + if (Gpus != other.Gpus) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Cpus != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Cpus); + if (Memory != 0L) hash ^= Memory.GetHashCode(); + if (Gpus != 0L) hash ^= Gpus.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (Cpus != 0F) { + output.WriteRawTag(13); + output.WriteFloat(Cpus); + } + if (Memory != 0L) { + output.WriteRawTag(16); + output.WriteInt64(Memory); + } + if (Gpus != 0L) { + output.WriteRawTag(24); + output.WriteInt64(Gpus); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Cpus != 0F) { + output.WriteRawTag(13); + output.WriteFloat(Cpus); + } + if (Memory != 0L) { + output.WriteRawTag(16); + output.WriteInt64(Memory); + } + if (Gpus != 0L) { + output.WriteRawTag(24); + output.WriteInt64(Gpus); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Cpus != 0F) { + size += 1 + 4; + } + if (Memory != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(Memory); + } + if (Gpus != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(Gpus); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(JobResourceRequirements other) { + if (other == null) { + return; + } + if (other.Cpus != 0F) { + Cpus = other.Cpus; + } + if (other.Memory != 0L) { + Memory = other.Memory; + } + if (other.Gpus != 0L) { + Gpus = other.Gpus; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 13: { + Cpus = input.ReadFloat(); + break; + } + case 16: { + Memory = input.ReadInt64(); + break; + } + case 24: { + Gpus = input.ReadInt64(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 13: { + Cpus = input.ReadFloat(); + break; + } + case 16: { + Memory = input.ReadInt64(); + break; + } + case 24: { + Gpus = input.ReadInt64(); + break; + } + } + } + } + #endif + + } + + /// + /// ServerMessage is the message sent from the nitric server to the service + /// + public sealed partial class ServerMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ServerMessage()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Nitric.Proto.Batch.v1.BatchReflection.Descriptor.MessageTypes[7]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ServerMessage() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ServerMessage(ServerMessage other) : this() { + id_ = other.id_; + switch (other.ContentCase) { + case ContentOneofCase.RegistrationResponse: + RegistrationResponse = other.RegistrationResponse.Clone(); + break; + case ContentOneofCase.JobRequest: + JobRequest = other.JobRequest.Clone(); + break; + } + + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ServerMessage Clone() { + return new ServerMessage(this); + } + + /// Field number for the "id" field. + public const int IdFieldNumber = 1; + private string id_ = ""; + /// + /// globally unique ID of the request/response pair + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Id { + get { return id_; } + set { + id_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "registration_response" field. + public const int RegistrationResponseFieldNumber = 2; + /// + /// + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Nitric.Proto.Batch.v1.RegistrationResponse RegistrationResponse { + get { return contentCase_ == ContentOneofCase.RegistrationResponse ? (global::Nitric.Proto.Batch.v1.RegistrationResponse) content_ : null; } + set { + content_ = value; + contentCase_ = value == null ? ContentOneofCase.None : ContentOneofCase.RegistrationResponse; + } + } + + /// Field number for the "job_request" field. + public const int JobRequestFieldNumber = 3; + /// + /// Request to a job handler + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Nitric.Proto.Batch.v1.JobRequest JobRequest { + get { return contentCase_ == ContentOneofCase.JobRequest ? (global::Nitric.Proto.Batch.v1.JobRequest) content_ : null; } + set { + content_ = value; + contentCase_ = value == null ? ContentOneofCase.None : ContentOneofCase.JobRequest; + } + } + + private object content_; + /// Enum of possible cases for the "content" oneof. + public enum ContentOneofCase { + None = 0, + RegistrationResponse = 2, + JobRequest = 3, + } + private ContentOneofCase contentCase_ = ContentOneofCase.None; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ContentOneofCase ContentCase { + get { return contentCase_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void ClearContent() { + contentCase_ = ContentOneofCase.None; + content_ = null; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as ServerMessage); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ServerMessage other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Id != other.Id) return false; + if (!object.Equals(RegistrationResponse, other.RegistrationResponse)) return false; + if (!object.Equals(JobRequest, other.JobRequest)) return false; + if (ContentCase != other.ContentCase) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Id.Length != 0) hash ^= Id.GetHashCode(); + if (contentCase_ == ContentOneofCase.RegistrationResponse) hash ^= RegistrationResponse.GetHashCode(); + if (contentCase_ == ContentOneofCase.JobRequest) hash ^= JobRequest.GetHashCode(); + hash ^= (int) contentCase_; + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (Id.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Id); + } + if (contentCase_ == ContentOneofCase.RegistrationResponse) { + output.WriteRawTag(18); + output.WriteMessage(RegistrationResponse); + } + if (contentCase_ == ContentOneofCase.JobRequest) { + output.WriteRawTag(26); + output.WriteMessage(JobRequest); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Id.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Id); + } + if (contentCase_ == ContentOneofCase.RegistrationResponse) { + output.WriteRawTag(18); + output.WriteMessage(RegistrationResponse); + } + if (contentCase_ == ContentOneofCase.JobRequest) { + output.WriteRawTag(26); + output.WriteMessage(JobRequest); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Id.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Id); + } + if (contentCase_ == ContentOneofCase.RegistrationResponse) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(RegistrationResponse); + } + if (contentCase_ == ContentOneofCase.JobRequest) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(JobRequest); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(ServerMessage other) { + if (other == null) { + return; + } + if (other.Id.Length != 0) { + Id = other.Id; + } + switch (other.ContentCase) { + case ContentOneofCase.RegistrationResponse: + if (RegistrationResponse == null) { + RegistrationResponse = new global::Nitric.Proto.Batch.v1.RegistrationResponse(); + } + RegistrationResponse.MergeFrom(other.RegistrationResponse); + break; + case ContentOneofCase.JobRequest: + if (JobRequest == null) { + JobRequest = new global::Nitric.Proto.Batch.v1.JobRequest(); + } + JobRequest.MergeFrom(other.JobRequest); + break; + } + + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Id = input.ReadString(); + break; + } + case 18: { + global::Nitric.Proto.Batch.v1.RegistrationResponse subBuilder = new global::Nitric.Proto.Batch.v1.RegistrationResponse(); + if (contentCase_ == ContentOneofCase.RegistrationResponse) { + subBuilder.MergeFrom(RegistrationResponse); + } + input.ReadMessage(subBuilder); + RegistrationResponse = subBuilder; + break; + } + case 26: { + global::Nitric.Proto.Batch.v1.JobRequest subBuilder = new global::Nitric.Proto.Batch.v1.JobRequest(); + if (contentCase_ == ContentOneofCase.JobRequest) { + subBuilder.MergeFrom(JobRequest); + } + input.ReadMessage(subBuilder); + JobRequest = subBuilder; + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Id = input.ReadString(); + break; + } + case 18: { + global::Nitric.Proto.Batch.v1.RegistrationResponse subBuilder = new global::Nitric.Proto.Batch.v1.RegistrationResponse(); + if (contentCase_ == ContentOneofCase.RegistrationResponse) { + subBuilder.MergeFrom(RegistrationResponse); + } + input.ReadMessage(subBuilder); + RegistrationResponse = subBuilder; + break; + } + case 26: { + global::Nitric.Proto.Batch.v1.JobRequest subBuilder = new global::Nitric.Proto.Batch.v1.JobRequest(); + if (contentCase_ == ContentOneofCase.JobRequest) { + subBuilder.MergeFrom(JobRequest); + } + input.ReadMessage(subBuilder); + JobRequest = subBuilder; + break; + } + } + } + } + #endif + + } + + public sealed partial class JobSubmitRequest : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new JobSubmitRequest()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Nitric.Proto.Batch.v1.BatchReflection.Descriptor.MessageTypes[8]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public JobSubmitRequest() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public JobSubmitRequest(JobSubmitRequest other) : this() { + jobName_ = other.jobName_; + data_ = other.data_ != null ? other.data_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public JobSubmitRequest Clone() { + return new JobSubmitRequest(this); + } + + /// Field number for the "job_name" field. + public const int JobNameFieldNumber = 1; + private string jobName_ = ""; + /// + /// The name of the job that should handle the data + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string JobName { + get { return jobName_; } + set { + jobName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "data" field. + public const int DataFieldNumber = 2; + private global::Nitric.Proto.Batch.v1.JobData data_; + /// + /// The data to be processed by the job + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Nitric.Proto.Batch.v1.JobData Data { + get { return data_; } + set { + data_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as JobSubmitRequest); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(JobSubmitRequest other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (JobName != other.JobName) return false; + if (!object.Equals(Data, other.Data)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (JobName.Length != 0) hash ^= JobName.GetHashCode(); + if (data_ != null) hash ^= Data.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (JobName.Length != 0) { + output.WriteRawTag(10); + output.WriteString(JobName); + } + if (data_ != null) { + output.WriteRawTag(18); + output.WriteMessage(Data); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (JobName.Length != 0) { + output.WriteRawTag(10); + output.WriteString(JobName); + } + if (data_ != null) { + output.WriteRawTag(18); + output.WriteMessage(Data); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (JobName.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(JobName); + } + if (data_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Data); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(JobSubmitRequest other) { + if (other == null) { + return; + } + if (other.JobName.Length != 0) { + JobName = other.JobName; + } + if (other.data_ != null) { + if (data_ == null) { + Data = new global::Nitric.Proto.Batch.v1.JobData(); + } + Data.MergeFrom(other.Data); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + JobName = input.ReadString(); + break; + } + case 18: { + if (data_ == null) { + Data = new global::Nitric.Proto.Batch.v1.JobData(); + } + input.ReadMessage(Data); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + JobName = input.ReadString(); + break; + } + case 18: { + if (data_ == null) { + Data = new global::Nitric.Proto.Batch.v1.JobData(); + } + input.ReadMessage(Data); + break; + } + } + } + } + #endif + + } + + public sealed partial class JobSubmitResponse : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new JobSubmitResponse()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Nitric.Proto.Batch.v1.BatchReflection.Descriptor.MessageTypes[9]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public JobSubmitResponse() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public JobSubmitResponse(JobSubmitResponse other) : this() { + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public JobSubmitResponse Clone() { + return new JobSubmitResponse(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as JobSubmitResponse); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(JobSubmitResponse other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(JobSubmitResponse other) { + if (other == null) { + return; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + } + } + } + #endif + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/src/Nitric.Sdk/Proto/nitric/proto/batch/v1/BatchGrpc.cs b/src/Nitric.Sdk/Proto/nitric/proto/batch/v1/BatchGrpc.cs new file mode 100644 index 0000000..d2d255d --- /dev/null +++ b/src/Nitric.Sdk/Proto/nitric/proto/batch/v1/BatchGrpc.cs @@ -0,0 +1,260 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: nitric/proto/batch/v1/batch.proto +// +#pragma warning disable 0414, 1591 +#region Designer generated code + +using grpc = global::Grpc.Core; + +namespace Nitric.Proto.Batch.v1 { + /// + /// Service for processing jobs + /// + public static partial class Job + { + static readonly string __ServiceName = "nitric.proto.batch.v1.Job"; + + static void __Helper_SerializeMessage(global::Google.Protobuf.IMessage message, grpc::SerializationContext context) + { + #if !GRPC_DISABLE_PROTOBUF_BUFFER_SERIALIZATION + if (message is global::Google.Protobuf.IBufferMessage) + { + context.SetPayloadLength(message.CalculateSize()); + global::Google.Protobuf.MessageExtensions.WriteTo(message, context.GetBufferWriter()); + context.Complete(); + return; + } + #endif + context.Complete(global::Google.Protobuf.MessageExtensions.ToByteArray(message)); + } + + static class __Helper_MessageCache + { + public static readonly bool IsBufferMessage = global::System.Reflection.IntrospectionExtensions.GetTypeInfo(typeof(global::Google.Protobuf.IBufferMessage)).IsAssignableFrom(typeof(T)); + } + + static T __Helper_DeserializeMessage(grpc::DeserializationContext context, global::Google.Protobuf.MessageParser parser) where T : global::Google.Protobuf.IMessage + { + #if !GRPC_DISABLE_PROTOBUF_BUFFER_SERIALIZATION + if (__Helper_MessageCache.IsBufferMessage) + { + return parser.ParseFrom(context.PayloadAsReadOnlySequence()); + } + #endif + return parser.ParseFrom(context.PayloadAsNewBuffer()); + } + + static readonly grpc::Marshaller __Marshaller_nitric_proto_batch_v1_ClientMessage = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Batch.v1.ClientMessage.Parser)); + static readonly grpc::Marshaller __Marshaller_nitric_proto_batch_v1_ServerMessage = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Batch.v1.ServerMessage.Parser)); + + static readonly grpc::Method __Method_HandleJob = new grpc::Method( + grpc::MethodType.DuplexStreaming, + __ServiceName, + "HandleJob", + __Marshaller_nitric_proto_batch_v1_ClientMessage, + __Marshaller_nitric_proto_batch_v1_ServerMessage); + + /// Service descriptor + public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor + { + get { return global::Nitric.Proto.Batch.v1.BatchReflection.Descriptor.Services[0]; } + } + + /// Base class for server-side implementations of Job + [grpc::BindServiceMethod(typeof(Job), "BindService")] + public abstract partial class JobBase + { + public virtual global::System.Threading.Tasks.Task HandleJob(grpc::IAsyncStreamReader requestStream, grpc::IServerStreamWriter responseStream, grpc::ServerCallContext context) + { + throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); + } + + } + + /// Client for Job + public partial class JobClient : grpc::ClientBase + { + /// Creates a new client for Job + /// The channel to use to make remote calls. + public JobClient(grpc::ChannelBase channel) : base(channel) + { + } + /// Creates a new client for Job that uses a custom CallInvoker. + /// The callInvoker to use to make remote calls. + public JobClient(grpc::CallInvoker callInvoker) : base(callInvoker) + { + } + /// Protected parameterless constructor to allow creation of test doubles. + protected JobClient() : base() + { + } + /// Protected constructor to allow creation of configured clients. + /// The client configuration. + protected JobClient(ClientBaseConfiguration configuration) : base(configuration) + { + } + + public virtual grpc::AsyncDuplexStreamingCall HandleJob(grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return HandleJob(new grpc::CallOptions(headers, deadline, cancellationToken)); + } + public virtual grpc::AsyncDuplexStreamingCall HandleJob(grpc::CallOptions options) + { + return CallInvoker.AsyncDuplexStreamingCall(__Method_HandleJob, null, options); + } + /// Creates a new instance of client from given ClientBaseConfiguration. + protected override JobClient NewInstance(ClientBaseConfiguration configuration) + { + return new JobClient(configuration); + } + } + + /// Creates service definition that can be registered with a server + /// An object implementing the server-side handling logic. + public static grpc::ServerServiceDefinition BindService(JobBase serviceImpl) + { + return grpc::ServerServiceDefinition.CreateBuilder() + .AddMethod(__Method_HandleJob, serviceImpl.HandleJob).Build(); + } + + /// Register service method with a service binder with or without implementation. Useful when customizing the service binding logic. + /// Note: this method is part of an experimental API that can change or be removed without any prior notice. + /// Service methods will be bound by calling AddMethod on this object. + /// An object implementing the server-side handling logic. + public static void BindService(grpc::ServiceBinderBase serviceBinder, JobBase serviceImpl) + { + serviceBinder.AddMethod(__Method_HandleJob, serviceImpl == null ? null : new grpc::DuplexStreamingServerMethod(serviceImpl.HandleJob)); + } + + } + /// + /// Service for submitting jobs to be processed + /// + public static partial class Batch + { + static readonly string __ServiceName = "nitric.proto.batch.v1.Batch"; + + static void __Helper_SerializeMessage(global::Google.Protobuf.IMessage message, grpc::SerializationContext context) + { + #if !GRPC_DISABLE_PROTOBUF_BUFFER_SERIALIZATION + if (message is global::Google.Protobuf.IBufferMessage) + { + context.SetPayloadLength(message.CalculateSize()); + global::Google.Protobuf.MessageExtensions.WriteTo(message, context.GetBufferWriter()); + context.Complete(); + return; + } + #endif + context.Complete(global::Google.Protobuf.MessageExtensions.ToByteArray(message)); + } + + static class __Helper_MessageCache + { + public static readonly bool IsBufferMessage = global::System.Reflection.IntrospectionExtensions.GetTypeInfo(typeof(global::Google.Protobuf.IBufferMessage)).IsAssignableFrom(typeof(T)); + } + + static T __Helper_DeserializeMessage(grpc::DeserializationContext context, global::Google.Protobuf.MessageParser parser) where T : global::Google.Protobuf.IMessage + { + #if !GRPC_DISABLE_PROTOBUF_BUFFER_SERIALIZATION + if (__Helper_MessageCache.IsBufferMessage) + { + return parser.ParseFrom(context.PayloadAsReadOnlySequence()); + } + #endif + return parser.ParseFrom(context.PayloadAsNewBuffer()); + } + + static readonly grpc::Marshaller __Marshaller_nitric_proto_batch_v1_JobSubmitRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Batch.v1.JobSubmitRequest.Parser)); + static readonly grpc::Marshaller __Marshaller_nitric_proto_batch_v1_JobSubmitResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Batch.v1.JobSubmitResponse.Parser)); + + static readonly grpc::Method __Method_SubmitJob = new grpc::Method( + grpc::MethodType.Unary, + __ServiceName, + "SubmitJob", + __Marshaller_nitric_proto_batch_v1_JobSubmitRequest, + __Marshaller_nitric_proto_batch_v1_JobSubmitResponse); + + /// Service descriptor + public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor + { + get { return global::Nitric.Proto.Batch.v1.BatchReflection.Descriptor.Services[1]; } + } + + /// Base class for server-side implementations of Batch + [grpc::BindServiceMethod(typeof(Batch), "BindService")] + public abstract partial class BatchBase + { + public virtual global::System.Threading.Tasks.Task SubmitJob(global::Nitric.Proto.Batch.v1.JobSubmitRequest request, grpc::ServerCallContext context) + { + throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); + } + + } + + /// Client for Batch + public partial class BatchClient : grpc::ClientBase + { + /// Creates a new client for Batch + /// The channel to use to make remote calls. + public BatchClient(grpc::ChannelBase channel) : base(channel) + { + } + /// Creates a new client for Batch that uses a custom CallInvoker. + /// The callInvoker to use to make remote calls. + public BatchClient(grpc::CallInvoker callInvoker) : base(callInvoker) + { + } + /// Protected parameterless constructor to allow creation of test doubles. + protected BatchClient() : base() + { + } + /// Protected constructor to allow creation of configured clients. + /// The client configuration. + protected BatchClient(ClientBaseConfiguration configuration) : base(configuration) + { + } + + public virtual global::Nitric.Proto.Batch.v1.JobSubmitResponse SubmitJob(global::Nitric.Proto.Batch.v1.JobSubmitRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return SubmitJob(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + public virtual global::Nitric.Proto.Batch.v1.JobSubmitResponse SubmitJob(global::Nitric.Proto.Batch.v1.JobSubmitRequest request, grpc::CallOptions options) + { + return CallInvoker.BlockingUnaryCall(__Method_SubmitJob, null, options, request); + } + public virtual grpc::AsyncUnaryCall SubmitJobAsync(global::Nitric.Proto.Batch.v1.JobSubmitRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return SubmitJobAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + public virtual grpc::AsyncUnaryCall SubmitJobAsync(global::Nitric.Proto.Batch.v1.JobSubmitRequest request, grpc::CallOptions options) + { + return CallInvoker.AsyncUnaryCall(__Method_SubmitJob, null, options, request); + } + /// Creates a new instance of client from given ClientBaseConfiguration. + protected override BatchClient NewInstance(ClientBaseConfiguration configuration) + { + return new BatchClient(configuration); + } + } + + /// Creates service definition that can be registered with a server + /// An object implementing the server-side handling logic. + public static grpc::ServerServiceDefinition BindService(BatchBase serviceImpl) + { + return grpc::ServerServiceDefinition.CreateBuilder() + .AddMethod(__Method_SubmitJob, serviceImpl.SubmitJob).Build(); + } + + /// Register service method with a service binder with or without implementation. Useful when customizing the service binding logic. + /// Note: this method is part of an experimental API that can change or be removed without any prior notice. + /// Service methods will be bound by calling AddMethod on this object. + /// An object implementing the server-side handling logic. + public static void BindService(grpc::ServiceBinderBase serviceBinder, BatchBase serviceImpl) + { + serviceBinder.AddMethod(__Method_SubmitJob, serviceImpl == null ? null : new grpc::UnaryServerMethod(serviceImpl.SubmitJob)); + } + + } +} +#endregion diff --git a/src/Nitric.Sdk/Proto/proto/deploy/v1/Deploy.cs b/src/Nitric.Sdk/Proto/nitric/proto/deployments/v1/Deployments.cs similarity index 64% rename from src/Nitric.Sdk/Proto/proto/deploy/v1/Deploy.cs rename to src/Nitric.Sdk/Proto/nitric/proto/deployments/v1/Deployments.cs index 38cccd7..ebe6a0d 100644 --- a/src/Nitric.Sdk/Proto/proto/deploy/v1/Deploy.cs +++ b/src/Nitric.Sdk/Proto/nitric/proto/deployments/v1/Deployments.cs @@ -1,6 +1,6 @@ // // Generated by the protocol buffer compiler. DO NOT EDIT! -// source: proto/deploy/v1/deploy.proto +// source: nitric/proto/deployments/v1/deployments.proto // #pragma warning disable 1591, 0612, 3021 #region Designer generated code @@ -9,142 +9,224 @@ using pbc = global::Google.Protobuf.Collections; using pbr = global::Google.Protobuf.Reflection; using scg = global::System.Collections.Generic; -namespace Nitric.Proto.Deploy.v1 { +namespace Nitric.Proto.Deployments.v1 { - /// Holder for reflection information generated from proto/deploy/v1/deploy.proto - public static partial class DeployReflection { + /// Holder for reflection information generated from nitric/proto/deployments/v1/deployments.proto + public static partial class DeploymentsReflection { #region Descriptor - /// File descriptor for proto/deploy/v1/deploy.proto + /// File descriptor for nitric/proto/deployments/v1/deployments.proto public static pbr::FileDescriptor Descriptor { get { return descriptor; } } private static pbr::FileDescriptor descriptor; - static DeployReflection() { + static DeploymentsReflection() { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( - "Chxwcm90by9kZXBsb3kvdjEvZGVwbG95LnByb3RvEhBuaXRyaWMuZGVwbG95", - "LnYxGhxnb29nbGUvcHJvdG9idWYvc3RydWN0LnByb3RvGiBwcm90by9yZXNv", - "dXJjZS92MS9yZXNvdXJjZS5wcm90bxoYcHJvdG8vZmFhcy92MS9mYWFzLnBy", - "b3RvImQKD0RlcGxveVVwUmVxdWVzdBIkCgRzcGVjGAEgASgLMhYubml0cmlj", - "LmRlcGxveS52MS5TcGVjEisKCmF0dHJpYnV0ZXMYAiABKAsyFy5nb29nbGUu", - "cHJvdG9idWYuU3RydWN0IowBCg1EZXBsb3lVcEV2ZW50EjcKB21lc3NhZ2UY", - "ASABKAsyJC5uaXRyaWMuZGVwbG95LnYxLkRlcGxveUV2ZW50TWVzc2FnZUgA", - "EjcKBnJlc3VsdBgCIAEoCzIlLm5pdHJpYy5kZXBsb3kudjEuRGVwbG95VXBF", - "dmVudFJlc3VsdEgAQgkKB2NvbnRlbnQiJQoSRGVwbG95RXZlbnRNZXNzYWdl", - "Eg8KB21lc3NhZ2UYASABKAkiLgoIVXBSZXN1bHQSFwoNc3RyaW5nX3Jlc3Vs", - "dBgBIAEoCUgAQgkKB2NvbnRlbnQiUgoTRGVwbG95VXBFdmVudFJlc3VsdBIP", - "CgdzdWNjZXNzGAEgASgIEioKBnJlc3VsdBgCIAEoCzIaLm5pdHJpYy5kZXBs", - "b3kudjEuVXBSZXN1bHQiQAoRRGVwbG95RG93blJlcXVlc3QSKwoKYXR0cmli", - "dXRlcxgBIAEoCzIXLmdvb2dsZS5wcm90b2J1Zi5TdHJ1Y3QikAEKD0RlcGxv", - "eURvd25FdmVudBI3CgdtZXNzYWdlGAEgASgLMiQubml0cmljLmRlcGxveS52", - "MS5EZXBsb3lFdmVudE1lc3NhZ2VIABI5CgZyZXN1bHQYAiABKAsyJy5uaXRy", - "aWMuZGVwbG95LnYxLkRlcGxveURvd25FdmVudFJlc3VsdEgAQgkKB2NvbnRl", - "bnQiFwoVRGVwbG95RG93bkV2ZW50UmVzdWx0IhoKC0ltYWdlU291cmNlEgsK", - "A3VyaRgBIAEoCSL0AQoNRXhlY3V0aW9uVW5pdBIuCgVpbWFnZRgBIAEoCzId", - "Lm5pdHJpYy5kZXBsb3kudjEuSW1hZ2VTb3VyY2VIABIPCgd3b3JrZXJzGAog", - "ASgFEhMKB3RpbWVvdXQYCyABKAVCAhgBEhIKBm1lbW9yeRgMIAEoBUICGAES", - "DAoEdHlwZRgNIAEoCRI1CgNlbnYYDiADKAsyKC5uaXRyaWMuZGVwbG95LnYx", - "LkV4ZWN1dGlvblVuaXQuRW52RW50cnkaKgoIRW52RW50cnkSCwoDa2V5GAEg", - "ASgJEg0KBXZhbHVlGAIgASgJOgI4AUIICgZzb3VyY2UiSwoGQnVja2V0EkEK", - "DW5vdGlmaWNhdGlvbnMYASADKAsyKi5uaXRyaWMuZGVwbG95LnYxLkJ1Y2tl", - "dE5vdGlmaWNhdGlvblRhcmdldCJ4ChhCdWNrZXROb3RpZmljYXRpb25UYXJn", - "ZXQSOAoGY29uZmlnGAEgASgLMigubml0cmljLmZhYXMudjEuQnVja2V0Tm90", - "aWZpY2F0aW9uQ29uZmlnEhgKDmV4ZWN1dGlvbl91bml0GAIgASgJSABCCAoG", - "dGFyZ2V0IkQKBVRvcGljEjsKDXN1YnNjcmlwdGlvbnMYASADKAsyJC5uaXRy", - "aWMuZGVwbG95LnYxLlN1YnNjcmlwdGlvblRhcmdldCIHCgVRdWV1ZSIMCgpD", - "b2xsZWN0aW9uIggKBlNlY3JldCI4ChJTdWJzY3JpcHRpb25UYXJnZXQSGAoO", - "ZXhlY3V0aW9uX3VuaXQYASABKAlIAEIICgZ0YXJnZXQiSQoRVG9waWNTdWJz", - "Y3JpcHRpb24SNAoGdGFyZ2V0GAEgASgLMiQubml0cmljLmRlcGxveS52MS5T", - "dWJzY3JpcHRpb25UYXJnZXQiMAoKSHR0cFRhcmdldBIYCg5leGVjdXRpb25f", - "dW5pdBgBIAEoCUgAQggKBnRhcmdldCI0CgRIdHRwEiwKBnRhcmdldBgBIAEo", - "CzIcLm5pdHJpYy5kZXBsb3kudjEuSHR0cFRhcmdldCIkCgNBcGkSEQoHb3Bl", - "bmFwaRgBIAEoCUgAQgoKCGRvY3VtZW50Ir8BCglXZWJzb2NrZXQSOQoOY29u", - "bmVjdF90YXJnZXQYASABKAsyIS5uaXRyaWMuZGVwbG95LnYxLldlYnNvY2tl", - "dFRhcmdldBI8ChFkaXNjb25uZWN0X3RhcmdldBgCIAEoCzIhLm5pdHJpYy5k", - "ZXBsb3kudjEuV2Vic29ja2V0VGFyZ2V0EjkKDm1lc3NhZ2VfdGFyZ2V0GAMg", - "ASgLMiEubml0cmljLmRlcGxveS52MS5XZWJzb2NrZXRUYXJnZXQiNQoPV2Vi", - "c29ja2V0VGFyZ2V0EhgKDmV4ZWN1dGlvbl91bml0GAEgASgJSABCCAoGdGFy", - "Z2V0IjQKDlNjaGVkdWxlVGFyZ2V0EhgKDmV4ZWN1dGlvbl91bml0GAEgASgJ", - "SABCCAoGdGFyZ2V0IkoKCFNjaGVkdWxlEgwKBGNyb24YASABKAkSMAoGdGFy", - "Z2V0GAIgASgLMiAubml0cmljLmRlcGxveS52MS5TY2hlZHVsZVRhcmdldCLJ", - "BAoIUmVzb3VyY2USDAoEbmFtZRgBIAEoCRIuCgR0eXBlGAIgASgOMiAubml0", - "cmljLnJlc291cmNlLnYxLlJlc291cmNlVHlwZRI5Cg5leGVjdXRpb25fdW5p", - "dBgKIAEoCzIfLm5pdHJpYy5kZXBsb3kudjEuRXhlY3V0aW9uVW5pdEgAEioK", - "BmJ1Y2tldBgLIAEoCzIYLm5pdHJpYy5kZXBsb3kudjEuQnVja2V0SAASKAoF", - "dG9waWMYDCABKAsyFy5uaXRyaWMuZGVwbG95LnYxLlRvcGljSAASKAoFcXVl", - "dWUYDSABKAsyFy5uaXRyaWMuZGVwbG95LnYxLlF1ZXVlSAASJAoDYXBpGA4g", - "ASgLMhUubml0cmljLmRlcGxveS52MS5BcGlIABIqCgZwb2xpY3kYDyABKAsy", - "GC5uaXRyaWMuZGVwbG95LnYxLlBvbGljeUgAEi4KCHNjaGVkdWxlGBAgASgL", - "Mhoubml0cmljLmRlcGxveS52MS5TY2hlZHVsZUgAEjIKCmNvbGxlY3Rpb24Y", - "ESABKAsyHC5uaXRyaWMuZGVwbG95LnYxLkNvbGxlY3Rpb25IABIqCgZzZWNy", - "ZXQYEiABKAsyGC5uaXRyaWMuZGVwbG95LnYxLlNlY3JldEgAEjAKCXdlYnNv", - "Y2tldBgTIAEoCzIbLm5pdHJpYy5kZXBsb3kudjEuV2Vic29ja2V0SAASJgoE", - "aHR0cBgUIAEoCzIWLm5pdHJpYy5kZXBsb3kudjEuSHR0cEgAQggKBmNvbmZp", - "ZyKUAQoGUG9saWN5Ei4KCnByaW5jaXBhbHMYASADKAsyGi5uaXRyaWMuZGVw", - "bG95LnYxLlJlc291cmNlEisKB2FjdGlvbnMYAiADKA4yGi5uaXRyaWMucmVz", - "b3VyY2UudjEuQWN0aW9uEi0KCXJlc291cmNlcxgDIAMoCzIaLm5pdHJpYy5k", - "ZXBsb3kudjEuUmVzb3VyY2UiNQoEU3BlYxItCglyZXNvdXJjZXMYASADKAsy", - "Gi5uaXRyaWMuZGVwbG95LnYxLlJlc291cmNlMq0BCg1EZXBsb3lTZXJ2aWNl", - "EkoKAlVwEiEubml0cmljLmRlcGxveS52MS5EZXBsb3lVcFJlcXVlc3QaHy5u", - "aXRyaWMuZGVwbG95LnYxLkRlcGxveVVwRXZlbnQwARJQCgREb3duEiMubml0", - "cmljLmRlcGxveS52MS5EZXBsb3lEb3duUmVxdWVzdBohLm5pdHJpYy5kZXBs", - "b3kudjEuRGVwbG95RG93bkV2ZW50MAFClAEKGWlvLm5pdHJpYy5wcm90by5k", - "ZXBsb3kudjFCB0RlcGxveXNQAVo6Z2l0aHViLmNvbS9uaXRyaWN0ZWNoL25p", - "dHJpYy9jb3JlL3BrZy9hcGkvbml0cmljL2RlcGxveS92MaoCFk5pdHJpYy5Q", - "cm90by5EZXBsb3kudjHKAhZOaXRyaWNcUHJvdG9cRGVwbG95XFYxYgZwcm90", - "bzM=")); + "Ci1uaXRyaWMvcHJvdG8vZGVwbG95bWVudHMvdjEvZGVwbG95bWVudHMucHJv", + "dG8SG25pdHJpYy5wcm90by5kZXBsb3ltZW50cy52MRocZ29vZ2xlL3Byb3Rv", + "YnVmL3N0cnVjdC5wcm90bxohbml0cmljL3Byb3RvL2JhdGNoL3YxL2JhdGNo", + "LnByb3RvGiluaXRyaWMvcHJvdG8vcmVzb3VyY2VzL3YxL3Jlc291cmNlcy5w", + "cm90bxolbml0cmljL3Byb3RvL3N0b3JhZ2UvdjEvc3RvcmFnZS5wcm90byKI", + "AQoTRGVwbG95bWVudFVwUmVxdWVzdBIvCgRzcGVjGAEgASgLMiEubml0cmlj", + "LnByb3RvLmRlcGxveW1lbnRzLnYxLlNwZWMSKwoKYXR0cmlidXRlcxgCIAEo", + "CzIXLmdvb2dsZS5wcm90b2J1Zi5TdHJ1Y3QSEwoLaW50ZXJhY3RpdmUYAyAB", + "KAgiqQEKEURlcGxveW1lbnRVcEV2ZW50EhEKB21lc3NhZ2UYASABKAlIABI9", + "CgZ1cGRhdGUYAiABKAsyKy5uaXRyaWMucHJvdG8uZGVwbG95bWVudHMudjEu", + "UmVzb3VyY2VVcGRhdGVIABI3CgZyZXN1bHQYAyABKAsyJS5uaXRyaWMucHJv", + "dG8uZGVwbG95bWVudHMudjEuVXBSZXN1bHRIAEIJCgdjb250ZW50IoACCg5S", + "ZXNvdXJjZVVwZGF0ZRI5CgJpZBgBIAEoCzItLm5pdHJpYy5wcm90by5yZXNv", + "dXJjZXMudjEuUmVzb3VyY2VJZGVudGlmaWVyEkUKBmFjdGlvbhgDIAEoDjI1", + "Lm5pdHJpYy5wcm90by5kZXBsb3ltZW50cy52MS5SZXNvdXJjZURlcGxveW1l", + "bnRBY3Rpb24SRQoGc3RhdHVzGAQgASgOMjUubml0cmljLnByb3RvLmRlcGxv", + "eW1lbnRzLnYxLlJlc291cmNlRGVwbG95bWVudFN0YXR1cxIUCgxzdWJfcmVz", + "b3VyY2UYBSABKAkSDwoHbWVzc2FnZRgGIAEoCSI2CghVcFJlc3VsdBIPCgdz", + "dWNjZXNzGAEgASgIEg4KBHRleHQYAiABKAlIAEIJCgdjb250ZW50IlkKFURl", + "cGxveW1lbnREb3duUmVxdWVzdBIrCgphdHRyaWJ1dGVzGAEgASgLMhcuZ29v", + "Z2xlLnByb3RvYnVmLlN0cnVjdBITCgtpbnRlcmFjdGl2ZRgCIAEoCCKtAQoT", + "RGVwbG95bWVudERvd25FdmVudBIRCgdtZXNzYWdlGAEgASgJSAASOQoGcmVz", + "dWx0GAIgASgLMicubml0cmljLnByb3RvLmRlcGxveW1lbnRzLnYxLkRvd25S", + "ZXN1bHRIABI9CgZ1cGRhdGUYAyABKAsyKy5uaXRyaWMucHJvdG8uZGVwbG95", + "bWVudHMudjEuUmVzb3VyY2VVcGRhdGVIAEIJCgdjb250ZW50IgwKCkRvd25S", + "ZXN1bHQiGgoLSW1hZ2VTb3VyY2USCwoDdXJpGAEgASgJIv4BCgdTZXJ2aWNl", + "EjkKBWltYWdlGAEgASgLMigubml0cmljLnByb3RvLmRlcGxveW1lbnRzLnYx", + "LkltYWdlU291cmNlSAASDwoHd29ya2VycxgKIAEoBRITCgd0aW1lb3V0GAsg", + "ASgFQgIYARISCgZtZW1vcnkYDCABKAVCAhgBEgwKBHR5cGUYDSABKAkSOgoD", + "ZW52GA4gAygLMi0ubml0cmljLnByb3RvLmRlcGxveW1lbnRzLnYxLlNlcnZp", + "Y2UuRW52RW50cnkaKgoIRW52RW50cnkSCwoDa2V5GAEgASgJEg0KBXZhbHVl", + "GAIgASgJOgI4AUIICgZzb3VyY2UiWQoDSm9iEgwKBG5hbWUYASABKAkSRAoM", + "cmVxdWlyZW1lbnRzGAIgASgLMi4ubml0cmljLnByb3RvLmJhdGNoLnYxLkpv", + "YlJlc291cmNlUmVxdWlyZW1lbnRzIvABCgVCYXRjaBI5CgVpbWFnZRgBIAEo", + "CzIoLm5pdHJpYy5wcm90by5kZXBsb3ltZW50cy52MS5JbWFnZVNvdXJjZUgA", + "EgwKBHR5cGUYCiABKAkSOAoDZW52GAsgAygLMisubml0cmljLnByb3RvLmRl", + "cGxveW1lbnRzLnYxLkJhdGNoLkVudkVudHJ5Ei4KBGpvYnMYDCADKAsyIC5u", + "aXRyaWMucHJvdG8uZGVwbG95bWVudHMudjEuSm9iGioKCEVudkVudHJ5EgsK", + "A2tleRgBIAEoCRINCgV2YWx1ZRgCIAEoCToCOAFCCAoGc291cmNlIkgKBkJ1", + "Y2tldBI+CglsaXN0ZW5lcnMYASADKAsyKy5uaXRyaWMucHJvdG8uZGVwbG95", + "bWVudHMudjEuQnVja2V0TGlzdGVuZXIiawoOQnVja2V0TGlzdGVuZXISPAoG", + "Y29uZmlnGAEgASgLMiwubml0cmljLnByb3RvLnN0b3JhZ2UudjEuUmVnaXN0", + "cmF0aW9uUmVxdWVzdBIRCgdzZXJ2aWNlGAIgASgJSABCCAoGdGFyZ2V0Ik8K", + "BVRvcGljEkYKDXN1YnNjcmlwdGlvbnMYASADKAsyLy5uaXRyaWMucHJvdG8u", + "ZGVwbG95bWVudHMudjEuU3Vic2NyaXB0aW9uVGFyZ2V0IgcKBVF1ZXVlIg8K", + "DUtleVZhbHVlU3RvcmUiCAoGU2VjcmV0IjEKElN1YnNjcmlwdGlvblRhcmdl", + "dBIRCgdzZXJ2aWNlGAEgASgJSABCCAoGdGFyZ2V0IlQKEVRvcGljU3Vic2Ny", + "aXB0aW9uEj8KBnRhcmdldBgBIAEoCzIvLm5pdHJpYy5wcm90by5kZXBsb3lt", + "ZW50cy52MS5TdWJzY3JpcHRpb25UYXJnZXQiKQoKSHR0cFRhcmdldBIRCgdz", + "ZXJ2aWNlGAEgASgJSABCCAoGdGFyZ2V0Ij8KBEh0dHASNwoGdGFyZ2V0GAEg", + "ASgLMicubml0cmljLnByb3RvLmRlcGxveW1lbnRzLnYxLkh0dHBUYXJnZXQi", + "JAoDQXBpEhEKB29wZW5hcGkYASABKAlIAEIKCghkb2N1bWVudCLgAQoJV2Vi", + "c29ja2V0EkQKDmNvbm5lY3RfdGFyZ2V0GAEgASgLMiwubml0cmljLnByb3Rv", + "LmRlcGxveW1lbnRzLnYxLldlYnNvY2tldFRhcmdldBJHChFkaXNjb25uZWN0", + "X3RhcmdldBgCIAEoCzIsLm5pdHJpYy5wcm90by5kZXBsb3ltZW50cy52MS5X", + "ZWJzb2NrZXRUYXJnZXQSRAoObWVzc2FnZV90YXJnZXQYAyABKAsyLC5uaXRy", + "aWMucHJvdG8uZGVwbG95bWVudHMudjEuV2Vic29ja2V0VGFyZ2V0Ii4KD1dl", + "YnNvY2tldFRhcmdldBIRCgdzZXJ2aWNlGAEgASgJSABCCAoGdGFyZ2V0Ii0K", + "DlNjaGVkdWxlVGFyZ2V0EhEKB3NlcnZpY2UYASABKAlIAEIICgZ0YXJnZXQi", + "ygEKCFNjaGVkdWxlEjsKBnRhcmdldBgBIAEoCzIrLm5pdHJpYy5wcm90by5k", + "ZXBsb3ltZW50cy52MS5TY2hlZHVsZVRhcmdldBI7CgVldmVyeRgKIAEoCzIq", + "Lm5pdHJpYy5wcm90by5kZXBsb3ltZW50cy52MS5TY2hlZHVsZUV2ZXJ5SAAS", + "OQoEY3JvbhgLIAEoCzIpLm5pdHJpYy5wcm90by5kZXBsb3ltZW50cy52MS5T", + "Y2hlZHVsZUNyb25IAEIJCgdjYWRlbmNlIjAKC1NxbERhdGFiYXNlEhMKCWlt", + "YWdlX3VyaRgBIAEoCUgAQgwKCm1pZ3JhdGlvbnMiHQoNU2NoZWR1bGVFdmVy", + "eRIMCgRyYXRlGAEgASgJIiIKDFNjaGVkdWxlQ3JvbhISCgpleHByZXNzaW9u", + "GAEgASgJIrEGCghSZXNvdXJjZRI5CgJpZBgBIAEoCzItLm5pdHJpYy5wcm90", + "by5yZXNvdXJjZXMudjEuUmVzb3VyY2VJZGVudGlmaWVyEjcKB3NlcnZpY2UY", + "CiABKAsyJC5uaXRyaWMucHJvdG8uZGVwbG95bWVudHMudjEuU2VydmljZUgA", + "EjUKBmJ1Y2tldBgLIAEoCzIjLm5pdHJpYy5wcm90by5kZXBsb3ltZW50cy52", + "MS5CdWNrZXRIABIzCgV0b3BpYxgMIAEoCzIiLm5pdHJpYy5wcm90by5kZXBs", + "b3ltZW50cy52MS5Ub3BpY0gAEi8KA2FwaRgNIAEoCzIgLm5pdHJpYy5wcm90", + "by5kZXBsb3ltZW50cy52MS5BcGlIABI1CgZwb2xpY3kYDiABKAsyIy5uaXRy", + "aWMucHJvdG8uZGVwbG95bWVudHMudjEuUG9saWN5SAASOQoIc2NoZWR1bGUY", + "DyABKAsyJS5uaXRyaWMucHJvdG8uZGVwbG95bWVudHMudjEuU2NoZWR1bGVI", + "ABJFCg9rZXlfdmFsdWVfc3RvcmUYECABKAsyKi5uaXRyaWMucHJvdG8uZGVw", + "bG95bWVudHMudjEuS2V5VmFsdWVTdG9yZUgAEjUKBnNlY3JldBgRIAEoCzIj", + "Lm5pdHJpYy5wcm90by5kZXBsb3ltZW50cy52MS5TZWNyZXRIABI7Cgl3ZWJz", + "b2NrZXQYEiABKAsyJi5uaXRyaWMucHJvdG8uZGVwbG95bWVudHMudjEuV2Vi", + "c29ja2V0SAASMQoEaHR0cBgTIAEoCzIhLm5pdHJpYy5wcm90by5kZXBsb3lt", + "ZW50cy52MS5IdHRwSAASMwoFcXVldWUYFCABKAsyIi5uaXRyaWMucHJvdG8u", + "ZGVwbG95bWVudHMudjEuUXVldWVIABJACgxzcWxfZGF0YWJhc2UYFSABKAsy", + "KC5uaXRyaWMucHJvdG8uZGVwbG95bWVudHMudjEuU3FsRGF0YWJhc2VIABIz", + "CgViYXRjaBgWIAEoCzIiLm5pdHJpYy5wcm90by5kZXBsb3ltZW50cy52MS5C", + "YXRjaEgAQggKBmNvbmZpZyKxAQoGUG9saWN5EjkKCnByaW5jaXBhbHMYASAD", + "KAsyJS5uaXRyaWMucHJvdG8uZGVwbG95bWVudHMudjEuUmVzb3VyY2USMgoH", + "YWN0aW9ucxgCIAMoDjIhLm5pdHJpYy5wcm90by5yZXNvdXJjZXMudjEuQWN0", + "aW9uEjgKCXJlc291cmNlcxgDIAMoCzIlLm5pdHJpYy5wcm90by5kZXBsb3lt", + "ZW50cy52MS5SZXNvdXJjZSJACgRTcGVjEjgKCXJlc291cmNlcxgBIAMoCzIl", + "Lm5pdHJpYy5wcm90by5kZXBsb3ltZW50cy52MS5SZXNvdXJjZSpVChhSZXNv", + "dXJjZURlcGxveW1lbnRBY3Rpb24SCgoGQ1JFQVRFEAASCgoGVVBEQVRFEAES", + "CwoHUkVQTEFDRRACEggKBFNBTUUQAxIKCgZERUxFVEUQBCpRChhSZXNvdXJj", + "ZURlcGxveW1lbnRTdGF0dXMSCwoHUEVORElORxAAEg8KC0lOX1BST0dSRVNT", + "EAESCwoHU1VDQ0VTUxACEgoKBkZBSUxFRBADMuYBCgpEZXBsb3ltZW50EmgK", + "AlVwEjAubml0cmljLnByb3RvLmRlcGxveW1lbnRzLnYxLkRlcGxveW1lbnRV", + "cFJlcXVlc3QaLi5uaXRyaWMucHJvdG8uZGVwbG95bWVudHMudjEuRGVwbG95", + "bWVudFVwRXZlbnQwARJuCgREb3duEjIubml0cmljLnByb3RvLmRlcGxveW1l", + "bnRzLnYxLkRlcGxveW1lbnREb3duUmVxdWVzdBowLm5pdHJpYy5wcm90by5k", + "ZXBsb3ltZW50cy52MS5EZXBsb3ltZW50RG93bkV2ZW50MAFCvAEKHmlvLm5p", + "dHJpYy5wcm90by5kZXBsb3ltZW50cy52MUISRGVwbG95bWVudHNTZXJ2aWNl", + "UAFaSGdpdGh1Yi5jb20vbml0cmljdGVjaC9uaXRyaWMvY29yZS9wa2cvcHJv", + "dG8vZGVwbG95bWVudHMvdjE7ZGVwbG95bWVudHNwYqoCG05pdHJpYy5Qcm90", + "by5EZXBsb3ltZW50cy52McoCG05pdHJpY1xQcm90b1xEZXBsb3ltZW50c1xW", + "MWIGcHJvdG8z")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, - new pbr::FileDescriptor[] { global::Google.Protobuf.WellKnownTypes.StructReflection.Descriptor, global::Nitric.Proto.Resource.v1.ResourceReflection.Descriptor, global::Nitric.Proto.Faas.v1.FaasReflection.Descriptor, }, - new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Deploy.v1.DeployUpRequest), global::Nitric.Proto.Deploy.v1.DeployUpRequest.Parser, new[]{ "Spec", "Attributes" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Deploy.v1.DeployUpEvent), global::Nitric.Proto.Deploy.v1.DeployUpEvent.Parser, new[]{ "Message", "Result" }, new[]{ "Content" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Deploy.v1.DeployEventMessage), global::Nitric.Proto.Deploy.v1.DeployEventMessage.Parser, new[]{ "Message" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Deploy.v1.UpResult), global::Nitric.Proto.Deploy.v1.UpResult.Parser, new[]{ "StringResult" }, new[]{ "Content" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Deploy.v1.DeployUpEventResult), global::Nitric.Proto.Deploy.v1.DeployUpEventResult.Parser, new[]{ "Success", "Result" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Deploy.v1.DeployDownRequest), global::Nitric.Proto.Deploy.v1.DeployDownRequest.Parser, new[]{ "Attributes" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Deploy.v1.DeployDownEvent), global::Nitric.Proto.Deploy.v1.DeployDownEvent.Parser, new[]{ "Message", "Result" }, new[]{ "Content" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Deploy.v1.DeployDownEventResult), global::Nitric.Proto.Deploy.v1.DeployDownEventResult.Parser, null, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Deploy.v1.ImageSource), global::Nitric.Proto.Deploy.v1.ImageSource.Parser, new[]{ "Uri" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Deploy.v1.ExecutionUnit), global::Nitric.Proto.Deploy.v1.ExecutionUnit.Parser, new[]{ "Image", "Workers", "Timeout", "Memory", "Type", "Env" }, new[]{ "Source" }, null, null, new pbr::GeneratedClrTypeInfo[] { null, }), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Deploy.v1.Bucket), global::Nitric.Proto.Deploy.v1.Bucket.Parser, new[]{ "Notifications" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Deploy.v1.BucketNotificationTarget), global::Nitric.Proto.Deploy.v1.BucketNotificationTarget.Parser, new[]{ "Config", "ExecutionUnit" }, new[]{ "Target" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Deploy.v1.Topic), global::Nitric.Proto.Deploy.v1.Topic.Parser, new[]{ "Subscriptions" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Deploy.v1.Queue), global::Nitric.Proto.Deploy.v1.Queue.Parser, null, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Deploy.v1.Collection), global::Nitric.Proto.Deploy.v1.Collection.Parser, null, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Deploy.v1.Secret), global::Nitric.Proto.Deploy.v1.Secret.Parser, null, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Deploy.v1.SubscriptionTarget), global::Nitric.Proto.Deploy.v1.SubscriptionTarget.Parser, new[]{ "ExecutionUnit" }, new[]{ "Target" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Deploy.v1.TopicSubscription), global::Nitric.Proto.Deploy.v1.TopicSubscription.Parser, new[]{ "Target" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Deploy.v1.HttpTarget), global::Nitric.Proto.Deploy.v1.HttpTarget.Parser, new[]{ "ExecutionUnit" }, new[]{ "Target" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Deploy.v1.Http), global::Nitric.Proto.Deploy.v1.Http.Parser, new[]{ "Target" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Deploy.v1.Api), global::Nitric.Proto.Deploy.v1.Api.Parser, new[]{ "Openapi" }, new[]{ "Document" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Deploy.v1.Websocket), global::Nitric.Proto.Deploy.v1.Websocket.Parser, new[]{ "ConnectTarget", "DisconnectTarget", "MessageTarget" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Deploy.v1.WebsocketTarget), global::Nitric.Proto.Deploy.v1.WebsocketTarget.Parser, new[]{ "ExecutionUnit" }, new[]{ "Target" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Deploy.v1.ScheduleTarget), global::Nitric.Proto.Deploy.v1.ScheduleTarget.Parser, new[]{ "ExecutionUnit" }, new[]{ "Target" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Deploy.v1.Schedule), global::Nitric.Proto.Deploy.v1.Schedule.Parser, new[]{ "Cron", "Target" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Deploy.v1.Resource), global::Nitric.Proto.Deploy.v1.Resource.Parser, new[]{ "Name", "Type", "ExecutionUnit", "Bucket", "Topic", "Queue", "Api", "Policy", "Schedule", "Collection", "Secret", "Websocket", "Http" }, new[]{ "Config" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Deploy.v1.Policy), global::Nitric.Proto.Deploy.v1.Policy.Parser, new[]{ "Principals", "Actions", "Resources" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Deploy.v1.Spec), global::Nitric.Proto.Deploy.v1.Spec.Parser, new[]{ "Resources" }, null, null, null, null) + new pbr::FileDescriptor[] { global::Google.Protobuf.WellKnownTypes.StructReflection.Descriptor, global::Nitric.Proto.Batch.v1.BatchReflection.Descriptor, global::Nitric.Proto.Resources.v1.ResourcesReflection.Descriptor, global::Nitric.Proto.Storage.v1.StorageReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Nitric.Proto.Deployments.v1.ResourceDeploymentAction), typeof(global::Nitric.Proto.Deployments.v1.ResourceDeploymentStatus), }, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Deployments.v1.DeploymentUpRequest), global::Nitric.Proto.Deployments.v1.DeploymentUpRequest.Parser, new[]{ "Spec", "Attributes", "Interactive" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Deployments.v1.DeploymentUpEvent), global::Nitric.Proto.Deployments.v1.DeploymentUpEvent.Parser, new[]{ "Message", "Update", "Result" }, new[]{ "Content" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Deployments.v1.ResourceUpdate), global::Nitric.Proto.Deployments.v1.ResourceUpdate.Parser, new[]{ "Id", "Action", "Status", "SubResource", "Message" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Deployments.v1.UpResult), global::Nitric.Proto.Deployments.v1.UpResult.Parser, new[]{ "Success", "Text" }, new[]{ "Content" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Deployments.v1.DeploymentDownRequest), global::Nitric.Proto.Deployments.v1.DeploymentDownRequest.Parser, new[]{ "Attributes", "Interactive" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Deployments.v1.DeploymentDownEvent), global::Nitric.Proto.Deployments.v1.DeploymentDownEvent.Parser, new[]{ "Message", "Result", "Update" }, new[]{ "Content" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Deployments.v1.DownResult), global::Nitric.Proto.Deployments.v1.DownResult.Parser, null, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Deployments.v1.ImageSource), global::Nitric.Proto.Deployments.v1.ImageSource.Parser, new[]{ "Uri" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Deployments.v1.Service), global::Nitric.Proto.Deployments.v1.Service.Parser, new[]{ "Image", "Workers", "Timeout", "Memory", "Type", "Env" }, new[]{ "Source" }, null, null, new pbr::GeneratedClrTypeInfo[] { null, }), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Deployments.v1.Job), global::Nitric.Proto.Deployments.v1.Job.Parser, new[]{ "Name", "Requirements" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Deployments.v1.Batch), global::Nitric.Proto.Deployments.v1.Batch.Parser, new[]{ "Image", "Type", "Env", "Jobs" }, new[]{ "Source" }, null, null, new pbr::GeneratedClrTypeInfo[] { null, }), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Deployments.v1.Bucket), global::Nitric.Proto.Deployments.v1.Bucket.Parser, new[]{ "Listeners" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Deployments.v1.BucketListener), global::Nitric.Proto.Deployments.v1.BucketListener.Parser, new[]{ "Config", "Service" }, new[]{ "Target" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Deployments.v1.Topic), global::Nitric.Proto.Deployments.v1.Topic.Parser, new[]{ "Subscriptions" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Deployments.v1.Queue), global::Nitric.Proto.Deployments.v1.Queue.Parser, null, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Deployments.v1.KeyValueStore), global::Nitric.Proto.Deployments.v1.KeyValueStore.Parser, null, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Deployments.v1.Secret), global::Nitric.Proto.Deployments.v1.Secret.Parser, null, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Deployments.v1.SubscriptionTarget), global::Nitric.Proto.Deployments.v1.SubscriptionTarget.Parser, new[]{ "Service" }, new[]{ "Target" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Deployments.v1.TopicSubscription), global::Nitric.Proto.Deployments.v1.TopicSubscription.Parser, new[]{ "Target" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Deployments.v1.HttpTarget), global::Nitric.Proto.Deployments.v1.HttpTarget.Parser, new[]{ "Service" }, new[]{ "Target" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Deployments.v1.Http), global::Nitric.Proto.Deployments.v1.Http.Parser, new[]{ "Target" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Deployments.v1.Api), global::Nitric.Proto.Deployments.v1.Api.Parser, new[]{ "Openapi" }, new[]{ "Document" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Deployments.v1.Websocket), global::Nitric.Proto.Deployments.v1.Websocket.Parser, new[]{ "ConnectTarget", "DisconnectTarget", "MessageTarget" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Deployments.v1.WebsocketTarget), global::Nitric.Proto.Deployments.v1.WebsocketTarget.Parser, new[]{ "Service" }, new[]{ "Target" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Deployments.v1.ScheduleTarget), global::Nitric.Proto.Deployments.v1.ScheduleTarget.Parser, new[]{ "Service" }, new[]{ "Target" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Deployments.v1.Schedule), global::Nitric.Proto.Deployments.v1.Schedule.Parser, new[]{ "Target", "Every", "Cron" }, new[]{ "Cadence" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Deployments.v1.SqlDatabase), global::Nitric.Proto.Deployments.v1.SqlDatabase.Parser, new[]{ "ImageUri" }, new[]{ "Migrations" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Deployments.v1.ScheduleEvery), global::Nitric.Proto.Deployments.v1.ScheduleEvery.Parser, new[]{ "Rate" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Deployments.v1.ScheduleCron), global::Nitric.Proto.Deployments.v1.ScheduleCron.Parser, new[]{ "Expression" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Deployments.v1.Resource), global::Nitric.Proto.Deployments.v1.Resource.Parser, new[]{ "Id", "Service", "Bucket", "Topic", "Api", "Policy", "Schedule", "KeyValueStore", "Secret", "Websocket", "Http", "Queue", "SqlDatabase", "Batch" }, new[]{ "Config" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Deployments.v1.Policy), global::Nitric.Proto.Deployments.v1.Policy.Parser, new[]{ "Principals", "Actions", "Resources" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Deployments.v1.Spec), global::Nitric.Proto.Deployments.v1.Spec.Parser, new[]{ "Resources" }, null, null, null, null) })); } #endregion } + #region Enums + public enum ResourceDeploymentAction { + /// + /// A new resource is being created + /// + [pbr::OriginalName("CREATE")] Create = 0, + /// + /// An existing resource is being updated + /// + [pbr::OriginalName("UPDATE")] Update = 1, + /// + /// An existing resource is being replaced + /// + [pbr::OriginalName("REPLACE")] Replace = 2, + /// + /// No-op on the resource (it already exists and requires no changes) + /// + [pbr::OriginalName("SAME")] Same = 3, + /// + /// An existing resource is being deleted + /// + [pbr::OriginalName("DELETE")] Delete = 4, + } + + public enum ResourceDeploymentStatus { + /// + /// The action hasn't started, usually due to a dependency + /// + [pbr::OriginalName("PENDING")] Pending = 0, + /// + /// The action in currently in-flight, e.g. waiting for cloud provider to provision a resource + /// + [pbr::OriginalName("IN_PROGRESS")] InProgress = 1, + /// + /// The action has been applied successfully + /// + [pbr::OriginalName("SUCCESS")] Success = 2, + /// + /// The action has failed to be (completely) applied + /// + [pbr::OriginalName("FAILED")] Failed = 3, + } + + #endregion + #region Messages - public sealed partial class DeployUpRequest : pb::IMessage + public sealed partial class DeploymentUpRequest : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DeployUpRequest()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DeploymentUpRequest()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Deploy.v1.DeployReflection.Descriptor.MessageTypes[0]; } + get { return global::Nitric.Proto.Deployments.v1.DeploymentsReflection.Descriptor.MessageTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -153,32 +235,33 @@ public sealed partial class DeployUpRequest : pb::IMessage } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public DeployUpRequest() { + public DeploymentUpRequest() { OnConstruction(); } partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public DeployUpRequest(DeployUpRequest other) : this() { + public DeploymentUpRequest(DeploymentUpRequest other) : this() { spec_ = other.spec_ != null ? other.spec_.Clone() : null; attributes_ = other.attributes_ != null ? other.attributes_.Clone() : null; + interactive_ = other.interactive_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public DeployUpRequest Clone() { - return new DeployUpRequest(this); + public DeploymentUpRequest Clone() { + return new DeploymentUpRequest(this); } /// Field number for the "spec" field. public const int SpecFieldNumber = 1; - private global::Nitric.Proto.Deploy.v1.Spec spec_; + private global::Nitric.Proto.Deployments.v1.Spec spec_; /// /// The spec to deploy /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Deploy.v1.Spec Spec { + public global::Nitric.Proto.Deployments.v1.Spec Spec { get { return spec_; } set { spec_ = value; @@ -200,13 +283,28 @@ public DeployUpRequest Clone() { } } + /// Field number for the "interactive" field. + public const int InteractiveFieldNumber = 3; + private bool interactive_; + /// + /// A hint to the provider of the kind of output that the client can accept + /// This will allow provider developers to provider richer output back to clients. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Interactive { + get { return interactive_; } + set { + interactive_ = value; + } + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { - return Equals(other as DeployUpRequest); + return Equals(other as DeploymentUpRequest); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(DeployUpRequest other) { + public bool Equals(DeploymentUpRequest other) { if (ReferenceEquals(other, null)) { return false; } @@ -215,6 +313,7 @@ public bool Equals(DeployUpRequest other) { } if (!object.Equals(Spec, other.Spec)) return false; if (!object.Equals(Attributes, other.Attributes)) return false; + if (Interactive != other.Interactive) return false; return Equals(_unknownFields, other._unknownFields); } @@ -223,6 +322,7 @@ public override int GetHashCode() { int hash = 1; if (spec_ != null) hash ^= Spec.GetHashCode(); if (attributes_ != null) hash ^= Attributes.GetHashCode(); + if (Interactive != false) hash ^= Interactive.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -247,6 +347,10 @@ public void WriteTo(pb::CodedOutputStream output) { output.WriteRawTag(18); output.WriteMessage(Attributes); } + if (Interactive != false) { + output.WriteRawTag(24); + output.WriteBool(Interactive); + } if (_unknownFields != null) { _unknownFields.WriteTo(output); } @@ -264,6 +368,10 @@ public void WriteTo(pb::CodedOutputStream output) { output.WriteRawTag(18); output.WriteMessage(Attributes); } + if (Interactive != false) { + output.WriteRawTag(24); + output.WriteBool(Interactive); + } if (_unknownFields != null) { _unknownFields.WriteTo(ref output); } @@ -279,6 +387,9 @@ public int CalculateSize() { if (attributes_ != null) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(Attributes); } + if (Interactive != false) { + size += 1 + 1; + } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); } @@ -286,13 +397,13 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(DeployUpRequest other) { + public void MergeFrom(DeploymentUpRequest other) { if (other == null) { return; } if (other.spec_ != null) { if (spec_ == null) { - Spec = new global::Nitric.Proto.Deploy.v1.Spec(); + Spec = new global::Nitric.Proto.Deployments.v1.Spec(); } Spec.MergeFrom(other.Spec); } @@ -302,6 +413,9 @@ public void MergeFrom(DeployUpRequest other) { } Attributes.MergeFrom(other.Attributes); } + if (other.Interactive != false) { + Interactive = other.Interactive; + } _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } @@ -318,7 +432,7 @@ public void MergeFrom(pb::CodedInputStream input) { break; case 10: { if (spec_ == null) { - Spec = new global::Nitric.Proto.Deploy.v1.Spec(); + Spec = new global::Nitric.Proto.Deployments.v1.Spec(); } input.ReadMessage(Spec); break; @@ -330,6 +444,10 @@ public void MergeFrom(pb::CodedInputStream input) { input.ReadMessage(Attributes); break; } + case 24: { + Interactive = input.ReadBool(); + break; + } } } #endif @@ -346,7 +464,7 @@ public void MergeFrom(pb::CodedInputStream input) { break; case 10: { if (spec_ == null) { - Spec = new global::Nitric.Proto.Deploy.v1.Spec(); + Spec = new global::Nitric.Proto.Deployments.v1.Spec(); } input.ReadMessage(Spec); break; @@ -358,6 +476,10 @@ public void MergeFrom(pb::CodedInputStream input) { input.ReadMessage(Attributes); break; } + case 24: { + Interactive = input.ReadBool(); + break; + } } } } @@ -365,19 +487,19 @@ public void MergeFrom(pb::CodedInputStream input) { } - public sealed partial class DeployUpEvent : pb::IMessage + public sealed partial class DeploymentUpEvent : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DeployUpEvent()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DeploymentUpEvent()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Deploy.v1.DeployReflection.Descriptor.MessageTypes[1]; } + get { return global::Nitric.Proto.Deployments.v1.DeploymentsReflection.Descriptor.MessageTypes[1]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -386,17 +508,20 @@ public sealed partial class DeployUpEvent : pb::IMessage } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public DeployUpEvent() { + public DeploymentUpEvent() { OnConstruction(); } partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public DeployUpEvent(DeployUpEvent other) : this() { + public DeploymentUpEvent(DeploymentUpEvent other) : this() { switch (other.ContentCase) { case ContentOneofCase.Message: - Message = other.Message.Clone(); + Message = other.Message; + break; + case ContentOneofCase.Update: + Update = other.Update.Clone(); break; case ContentOneofCase.Result: Result = other.Result.Clone(); @@ -407,26 +532,37 @@ public DeployUpEvent(DeployUpEvent other) : this() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public DeployUpEvent Clone() { - return new DeployUpEvent(this); + public DeploymentUpEvent Clone() { + return new DeploymentUpEvent(this); } /// Field number for the "message" field. public const int MessageFieldNumber = 1; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Deploy.v1.DeployEventMessage Message { - get { return contentCase_ == ContentOneofCase.Message ? (global::Nitric.Proto.Deploy.v1.DeployEventMessage) content_ : null; } + public string Message { + get { return contentCase_ == ContentOneofCase.Message ? (string) content_ : ""; } + set { + content_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + contentCase_ = ContentOneofCase.Message; + } + } + + /// Field number for the "update" field. + public const int UpdateFieldNumber = 2; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Nitric.Proto.Deployments.v1.ResourceUpdate Update { + get { return contentCase_ == ContentOneofCase.Update ? (global::Nitric.Proto.Deployments.v1.ResourceUpdate) content_ : null; } set { content_ = value; - contentCase_ = value == null ? ContentOneofCase.None : ContentOneofCase.Message; + contentCase_ = value == null ? ContentOneofCase.None : ContentOneofCase.Update; } } /// Field number for the "result" field. - public const int ResultFieldNumber = 2; + public const int ResultFieldNumber = 3; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Deploy.v1.DeployUpEventResult Result { - get { return contentCase_ == ContentOneofCase.Result ? (global::Nitric.Proto.Deploy.v1.DeployUpEventResult) content_ : null; } + public global::Nitric.Proto.Deployments.v1.UpResult Result { + get { return contentCase_ == ContentOneofCase.Result ? (global::Nitric.Proto.Deployments.v1.UpResult) content_ : null; } set { content_ = value; contentCase_ = value == null ? ContentOneofCase.None : ContentOneofCase.Result; @@ -438,7 +574,8 @@ public DeployUpEvent Clone() { public enum ContentOneofCase { None = 0, Message = 1, - Result = 2, + Update = 2, + Result = 3, } private ContentOneofCase contentCase_ = ContentOneofCase.None; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -454,18 +591,19 @@ public void ClearContent() { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { - return Equals(other as DeployUpEvent); + return Equals(other as DeploymentUpEvent); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(DeployUpEvent other) { + public bool Equals(DeploymentUpEvent other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } - if (!object.Equals(Message, other.Message)) return false; + if (Message != other.Message) return false; + if (!object.Equals(Update, other.Update)) return false; if (!object.Equals(Result, other.Result)) return false; if (ContentCase != other.ContentCase) return false; return Equals(_unknownFields, other._unknownFields); @@ -475,6 +613,7 @@ public bool Equals(DeployUpEvent other) { public override int GetHashCode() { int hash = 1; if (contentCase_ == ContentOneofCase.Message) hash ^= Message.GetHashCode(); + if (contentCase_ == ContentOneofCase.Update) hash ^= Update.GetHashCode(); if (contentCase_ == ContentOneofCase.Result) hash ^= Result.GetHashCode(); hash ^= (int) contentCase_; if (_unknownFields != null) { @@ -495,10 +634,14 @@ public void WriteTo(pb::CodedOutputStream output) { #else if (contentCase_ == ContentOneofCase.Message) { output.WriteRawTag(10); - output.WriteMessage(Message); + output.WriteString(Message); } - if (contentCase_ == ContentOneofCase.Result) { + if (contentCase_ == ContentOneofCase.Update) { output.WriteRawTag(18); + output.WriteMessage(Update); + } + if (contentCase_ == ContentOneofCase.Result) { + output.WriteRawTag(26); output.WriteMessage(Result); } if (_unknownFields != null) { @@ -512,10 +655,14 @@ public void WriteTo(pb::CodedOutputStream output) { void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (contentCase_ == ContentOneofCase.Message) { output.WriteRawTag(10); - output.WriteMessage(Message); + output.WriteString(Message); } - if (contentCase_ == ContentOneofCase.Result) { + if (contentCase_ == ContentOneofCase.Update) { output.WriteRawTag(18); + output.WriteMessage(Update); + } + if (contentCase_ == ContentOneofCase.Result) { + output.WriteRawTag(26); output.WriteMessage(Result); } if (_unknownFields != null) { @@ -528,7 +675,10 @@ public void WriteTo(pb::CodedOutputStream output) { public int CalculateSize() { int size = 0; if (contentCase_ == ContentOneofCase.Message) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Message); + size += 1 + pb::CodedOutputStream.ComputeStringSize(Message); + } + if (contentCase_ == ContentOneofCase.Update) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Update); } if (contentCase_ == ContentOneofCase.Result) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(Result); @@ -540,20 +690,23 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(DeployUpEvent other) { + public void MergeFrom(DeploymentUpEvent other) { if (other == null) { return; } switch (other.ContentCase) { case ContentOneofCase.Message: - if (Message == null) { - Message = new global::Nitric.Proto.Deploy.v1.DeployEventMessage(); + Message = other.Message; + break; + case ContentOneofCase.Update: + if (Update == null) { + Update = new global::Nitric.Proto.Deployments.v1.ResourceUpdate(); } - Message.MergeFrom(other.Message); + Update.MergeFrom(other.Update); break; case ContentOneofCase.Result: if (Result == null) { - Result = new global::Nitric.Proto.Deploy.v1.DeployUpEventResult(); + Result = new global::Nitric.Proto.Deployments.v1.UpResult(); } Result.MergeFrom(other.Result); break; @@ -574,16 +727,20 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { - global::Nitric.Proto.Deploy.v1.DeployEventMessage subBuilder = new global::Nitric.Proto.Deploy.v1.DeployEventMessage(); - if (contentCase_ == ContentOneofCase.Message) { - subBuilder.MergeFrom(Message); + Message = input.ReadString(); + break; + } + case 18: { + global::Nitric.Proto.Deployments.v1.ResourceUpdate subBuilder = new global::Nitric.Proto.Deployments.v1.ResourceUpdate(); + if (contentCase_ == ContentOneofCase.Update) { + subBuilder.MergeFrom(Update); } input.ReadMessage(subBuilder); - Message = subBuilder; + Update = subBuilder; break; } - case 18: { - global::Nitric.Proto.Deploy.v1.DeployUpEventResult subBuilder = new global::Nitric.Proto.Deploy.v1.DeployUpEventResult(); + case 26: { + global::Nitric.Proto.Deployments.v1.UpResult subBuilder = new global::Nitric.Proto.Deployments.v1.UpResult(); if (contentCase_ == ContentOneofCase.Result) { subBuilder.MergeFrom(Result); } @@ -606,16 +763,20 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; case 10: { - global::Nitric.Proto.Deploy.v1.DeployEventMessage subBuilder = new global::Nitric.Proto.Deploy.v1.DeployEventMessage(); - if (contentCase_ == ContentOneofCase.Message) { - subBuilder.MergeFrom(Message); + Message = input.ReadString(); + break; + } + case 18: { + global::Nitric.Proto.Deployments.v1.ResourceUpdate subBuilder = new global::Nitric.Proto.Deployments.v1.ResourceUpdate(); + if (contentCase_ == ContentOneofCase.Update) { + subBuilder.MergeFrom(Update); } input.ReadMessage(subBuilder); - Message = subBuilder; + Update = subBuilder; break; } - case 18: { - global::Nitric.Proto.Deploy.v1.DeployUpEventResult subBuilder = new global::Nitric.Proto.Deploy.v1.DeployUpEventResult(); + case 26: { + global::Nitric.Proto.Deployments.v1.UpResult subBuilder = new global::Nitric.Proto.Deployments.v1.UpResult(); if (contentCase_ == ContentOneofCase.Result) { subBuilder.MergeFrom(Result); } @@ -630,22 +791,19 @@ public void MergeFrom(pb::CodedInputStream input) { } - /// - /// Messages to provide status updates on the deployment - /// - public sealed partial class DeployEventMessage : pb::IMessage + public sealed partial class ResourceUpdate : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DeployEventMessage()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ResourceUpdate()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Deploy.v1.DeployReflection.Descriptor.MessageTypes[2]; } + get { return global::Nitric.Proto.Deployments.v1.DeploymentsReflection.Descriptor.MessageTypes[2]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -654,26 +812,92 @@ public sealed partial class DeployEventMessage : pb::IMessageField number for the "id" field. + public const int IdFieldNumber = 1; + private global::Nitric.Proto.Resources.v1.ResourceIdentifier id_; + /// + /// The resource being updated, if this is nil the update applies to the stack + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Nitric.Proto.Resources.v1.ResourceIdentifier Id { + get { return id_; } + set { + id_ = value; + } + } + + /// Field number for the "action" field. + public const int ActionFieldNumber = 3; + private global::Nitric.Proto.Deployments.v1.ResourceDeploymentAction action_ = global::Nitric.Proto.Deployments.v1.ResourceDeploymentAction.Create; + /// + /// The type of update being applied + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Nitric.Proto.Deployments.v1.ResourceDeploymentAction Action { + get { return action_; } + set { + action_ = value; + } + } + + /// Field number for the "status" field. + public const int StatusFieldNumber = 4; + private global::Nitric.Proto.Deployments.v1.ResourceDeploymentStatus status_ = global::Nitric.Proto.Deployments.v1.ResourceDeploymentStatus.Pending; + /// + /// The current status of the action being applied + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Nitric.Proto.Deployments.v1.ResourceDeploymentStatus Status { + get { return status_; } + set { + status_ = value; + } + } + + /// Field number for the "sub_resource" field. + public const int SubResourceFieldNumber = 5; + private string subResource_ = ""; + /// + /// (optional) A globally unique identifier (scoped to the id above), used when Nitric Resources map 1:many in a cloud provider. + /// e.g. the container image repository for a service deployment. + /// This can also be set when id is nil above and it will imply a non-nitric resource that is necessary to deploy for a stack to operate + /// e.g. an Azure StorageAccount + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string SubResource { + get { return subResource_; } + set { + subResource_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } } /// Field number for the "message" field. - public const int MessageFieldNumber = 1; + public const int MessageFieldNumber = 6; private string message_ = ""; + /// + /// Additional information about the update + /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public string Message { get { return message_; } @@ -684,17 +908,21 @@ public string Message { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { - return Equals(other as DeployEventMessage); + return Equals(other as ResourceUpdate); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(DeployEventMessage other) { + public bool Equals(ResourceUpdate other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } + if (!object.Equals(Id, other.Id)) return false; + if (Action != other.Action) return false; + if (Status != other.Status) return false; + if (SubResource != other.SubResource) return false; if (Message != other.Message) return false; return Equals(_unknownFields, other._unknownFields); } @@ -702,6 +930,10 @@ public bool Equals(DeployEventMessage other) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; + if (id_ != null) hash ^= Id.GetHashCode(); + if (Action != global::Nitric.Proto.Deployments.v1.ResourceDeploymentAction.Create) hash ^= Action.GetHashCode(); + if (Status != global::Nitric.Proto.Deployments.v1.ResourceDeploymentStatus.Pending) hash ^= Status.GetHashCode(); + if (SubResource.Length != 0) hash ^= SubResource.GetHashCode(); if (Message.Length != 0) hash ^= Message.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); @@ -719,8 +951,24 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else - if (Message.Length != 0) { + if (id_ != null) { output.WriteRawTag(10); + output.WriteMessage(Id); + } + if (Action != global::Nitric.Proto.Deployments.v1.ResourceDeploymentAction.Create) { + output.WriteRawTag(24); + output.WriteEnum((int) Action); + } + if (Status != global::Nitric.Proto.Deployments.v1.ResourceDeploymentStatus.Pending) { + output.WriteRawTag(32); + output.WriteEnum((int) Status); + } + if (SubResource.Length != 0) { + output.WriteRawTag(42); + output.WriteString(SubResource); + } + if (Message.Length != 0) { + output.WriteRawTag(50); output.WriteString(Message); } if (_unknownFields != null) { @@ -732,8 +980,24 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (Message.Length != 0) { + if (id_ != null) { output.WriteRawTag(10); + output.WriteMessage(Id); + } + if (Action != global::Nitric.Proto.Deployments.v1.ResourceDeploymentAction.Create) { + output.WriteRawTag(24); + output.WriteEnum((int) Action); + } + if (Status != global::Nitric.Proto.Deployments.v1.ResourceDeploymentStatus.Pending) { + output.WriteRawTag(32); + output.WriteEnum((int) Status); + } + if (SubResource.Length != 0) { + output.WriteRawTag(42); + output.WriteString(SubResource); + } + if (Message.Length != 0) { + output.WriteRawTag(50); output.WriteString(Message); } if (_unknownFields != null) { @@ -745,6 +1009,18 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; + if (id_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Id); + } + if (Action != global::Nitric.Proto.Deployments.v1.ResourceDeploymentAction.Create) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Action); + } + if (Status != global::Nitric.Proto.Deployments.v1.ResourceDeploymentStatus.Pending) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Status); + } + if (SubResource.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(SubResource); + } if (Message.Length != 0) { size += 1 + pb::CodedOutputStream.ComputeStringSize(Message); } @@ -755,10 +1031,25 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(DeployEventMessage other) { + public void MergeFrom(ResourceUpdate other) { if (other == null) { return; } + if (other.id_ != null) { + if (id_ == null) { + Id = new global::Nitric.Proto.Resources.v1.ResourceIdentifier(); + } + Id.MergeFrom(other.Id); + } + if (other.Action != global::Nitric.Proto.Deployments.v1.ResourceDeploymentAction.Create) { + Action = other.Action; + } + if (other.Status != global::Nitric.Proto.Deployments.v1.ResourceDeploymentStatus.Pending) { + Status = other.Status; + } + if (other.SubResource.Length != 0) { + SubResource = other.SubResource; + } if (other.Message.Length != 0) { Message = other.Message; } @@ -777,6 +1068,25 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { + if (id_ == null) { + Id = new global::Nitric.Proto.Resources.v1.ResourceIdentifier(); + } + input.ReadMessage(Id); + break; + } + case 24: { + Action = (global::Nitric.Proto.Deployments.v1.ResourceDeploymentAction) input.ReadEnum(); + break; + } + case 32: { + Status = (global::Nitric.Proto.Deployments.v1.ResourceDeploymentStatus) input.ReadEnum(); + break; + } + case 42: { + SubResource = input.ReadString(); + break; + } + case 50: { Message = input.ReadString(); break; } @@ -795,6 +1105,25 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; case 10: { + if (id_ == null) { + Id = new global::Nitric.Proto.Resources.v1.ResourceIdentifier(); + } + input.ReadMessage(Id); + break; + } + case 24: { + Action = (global::Nitric.Proto.Deployments.v1.ResourceDeploymentAction) input.ReadEnum(); + break; + } + case 32: { + Status = (global::Nitric.Proto.Deployments.v1.ResourceDeploymentStatus) input.ReadEnum(); + break; + } + case 42: { + SubResource = input.ReadString(); + break; + } + case 50: { Message = input.ReadString(); break; } @@ -805,6 +1134,9 @@ public void MergeFrom(pb::CodedInputStream input) { } + /// + /// Terminal message indicating deployment success + /// public sealed partial class UpResult : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -817,7 +1149,7 @@ public sealed partial class UpResult : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Deploy.v1.DeployReflection.Descriptor.MessageTypes[3]; } + get { return global::Nitric.Proto.Deployments.v1.DeploymentsReflection.Descriptor.MessageTypes[3]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -834,9 +1166,10 @@ public UpResult() { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public UpResult(UpResult other) : this() { + success_ = other.success_; switch (other.ContentCase) { - case ContentOneofCase.StringResult: - StringResult = other.StringResult; + case ContentOneofCase.Text: + Text = other.Text; break; } @@ -848,17 +1181,31 @@ public UpResult Clone() { return new UpResult(this); } - /// Field number for the "string_result" field. - public const int StringResultFieldNumber = 1; + /// Field number for the "success" field. + public const int SuccessFieldNumber = 1; + private bool success_; + /// + /// Indicate the success status + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Success { + get { return success_; } + set { + success_ = value; + } + } + + /// Field number for the "text" field. + public const int TextFieldNumber = 2; /// - /// Simple formatted string output as result + /// Simple text output as result /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string StringResult { - get { return contentCase_ == ContentOneofCase.StringResult ? (string) content_ : ""; } + public string Text { + get { return contentCase_ == ContentOneofCase.Text ? (string) content_ : ""; } set { content_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - contentCase_ = ContentOneofCase.StringResult; + contentCase_ = ContentOneofCase.Text; } } @@ -866,7 +1213,7 @@ public string StringResult { /// Enum of possible cases for the "content" oneof. public enum ContentOneofCase { None = 0, - StringResult = 1, + Text = 2, } private ContentOneofCase contentCase_ = ContentOneofCase.None; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -893,7 +1240,8 @@ public bool Equals(UpResult other) { if (ReferenceEquals(other, this)) { return true; } - if (StringResult != other.StringResult) return false; + if (Success != other.Success) return false; + if (Text != other.Text) return false; if (ContentCase != other.ContentCase) return false; return Equals(_unknownFields, other._unknownFields); } @@ -901,7 +1249,8 @@ public bool Equals(UpResult other) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; - if (contentCase_ == ContentOneofCase.StringResult) hash ^= StringResult.GetHashCode(); + if (Success != false) hash ^= Success.GetHashCode(); + if (contentCase_ == ContentOneofCase.Text) hash ^= Text.GetHashCode(); hash ^= (int) contentCase_; if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); @@ -919,9 +1268,13 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else - if (contentCase_ == ContentOneofCase.StringResult) { - output.WriteRawTag(10); - output.WriteString(StringResult); + if (Success != false) { + output.WriteRawTag(8); + output.WriteBool(Success); + } + if (contentCase_ == ContentOneofCase.Text) { + output.WriteRawTag(18); + output.WriteString(Text); } if (_unknownFields != null) { _unknownFields.WriteTo(output); @@ -932,9 +1285,13 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (contentCase_ == ContentOneofCase.StringResult) { - output.WriteRawTag(10); - output.WriteString(StringResult); + if (Success != false) { + output.WriteRawTag(8); + output.WriteBool(Success); + } + if (contentCase_ == ContentOneofCase.Text) { + output.WriteRawTag(18); + output.WriteString(Text); } if (_unknownFields != null) { _unknownFields.WriteTo(ref output); @@ -945,8 +1302,11 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; - if (contentCase_ == ContentOneofCase.StringResult) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(StringResult); + if (Success != false) { + size += 1 + 1; + } + if (contentCase_ == ContentOneofCase.Text) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Text); } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); @@ -959,9 +1319,12 @@ public void MergeFrom(UpResult other) { if (other == null) { return; } + if (other.Success != false) { + Success = other.Success; + } switch (other.ContentCase) { - case ContentOneofCase.StringResult: - StringResult = other.StringResult; + case ContentOneofCase.Text: + Text = other.Text; break; } @@ -979,8 +1342,12 @@ public void MergeFrom(pb::CodedInputStream input) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; - case 10: { - StringResult = input.ReadString(); + case 8: { + Success = input.ReadBool(); + break; + } + case 18: { + Text = input.ReadString(); break; } } @@ -997,8 +1364,12 @@ public void MergeFrom(pb::CodedInputStream input) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; - case 10: { - StringResult = input.ReadString(); + case 8: { + Success = input.ReadBool(); + break; + } + case 18: { + Text = input.ReadString(); break; } } @@ -1008,22 +1379,19 @@ public void MergeFrom(pb::CodedInputStream input) { } - /// - /// Terminal message indicating deployment success - /// - public sealed partial class DeployUpEventResult : pb::IMessage + public sealed partial class DeploymentDownRequest : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DeployUpEventResult()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DeploymentDownRequest()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Deploy.v1.DeployReflection.Descriptor.MessageTypes[4]; } + get { return global::Nitric.Proto.Deployments.v1.DeploymentsReflection.Descriptor.MessageTypes[4]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1032,76 +1400,77 @@ public sealed partial class DeployUpEventResult : pb::IMessageField number for the "success" field. - public const int SuccessFieldNumber = 1; - private bool success_; + /// Field number for the "attributes" field. + public const int AttributesFieldNumber = 1; + private global::Google.Protobuf.WellKnownTypes.Struct attributes_; /// - /// Indicate the success status + /// A map of attributes related to the deploy request + /// this allows for adding project identifiers etc. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Success { - get { return success_; } + public global::Google.Protobuf.WellKnownTypes.Struct Attributes { + get { return attributes_; } set { - success_ = value; + attributes_ = value; } } - /// Field number for the "result" field. - public const int ResultFieldNumber = 2; - private global::Nitric.Proto.Deploy.v1.UpResult result_; + /// Field number for the "interactive" field. + public const int InteractiveFieldNumber = 2; + private bool interactive_; /// - /// Output state as a struct, this can be provided as an output file - /// or pretty printed for CLI output + /// A hint to the provider of the kind of output that the client can accept + /// This will allow provider developers to provider richer output back to clients. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Deploy.v1.UpResult Result { - get { return result_; } + public bool Interactive { + get { return interactive_; } set { - result_ = value; + interactive_ = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { - return Equals(other as DeployUpEventResult); + return Equals(other as DeploymentDownRequest); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(DeployUpEventResult other) { + public bool Equals(DeploymentDownRequest other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } - if (Success != other.Success) return false; - if (!object.Equals(Result, other.Result)) return false; + if (!object.Equals(Attributes, other.Attributes)) return false; + if (Interactive != other.Interactive) return false; return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; - if (Success != false) hash ^= Success.GetHashCode(); - if (result_ != null) hash ^= Result.GetHashCode(); + if (attributes_ != null) hash ^= Attributes.GetHashCode(); + if (Interactive != false) hash ^= Interactive.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -1118,13 +1487,13 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else - if (Success != false) { - output.WriteRawTag(8); - output.WriteBool(Success); + if (attributes_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Attributes); } - if (result_ != null) { - output.WriteRawTag(18); - output.WriteMessage(Result); + if (Interactive != false) { + output.WriteRawTag(16); + output.WriteBool(Interactive); } if (_unknownFields != null) { _unknownFields.WriteTo(output); @@ -1135,13 +1504,13 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (Success != false) { - output.WriteRawTag(8); - output.WriteBool(Success); + if (attributes_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Attributes); } - if (result_ != null) { - output.WriteRawTag(18); - output.WriteMessage(Result); + if (Interactive != false) { + output.WriteRawTag(16); + output.WriteBool(Interactive); } if (_unknownFields != null) { _unknownFields.WriteTo(ref output); @@ -1152,11 +1521,11 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; - if (Success != false) { - size += 1 + 1; + if (attributes_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Attributes); } - if (result_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Result); + if (Interactive != false) { + size += 1 + 1; } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); @@ -1165,211 +1534,18 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(DeployUpEventResult other) { + public void MergeFrom(DeploymentDownRequest other) { if (other == null) { return; } - if (other.Success != false) { - Success = other.Success; - } - if (other.result_ != null) { - if (result_ == null) { - Result = new global::Nitric.Proto.Deploy.v1.UpResult(); + if (other.attributes_ != null) { + if (attributes_ == null) { + Attributes = new global::Google.Protobuf.WellKnownTypes.Struct(); } - Result.MergeFrom(other.Result); + Attributes.MergeFrom(other.Attributes); } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 8: { - Success = input.ReadBool(); - break; - } - case 18: { - if (result_ == null) { - Result = new global::Nitric.Proto.Deploy.v1.UpResult(); - } - input.ReadMessage(Result); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 8: { - Success = input.ReadBool(); - break; - } - case 18: { - if (result_ == null) { - Result = new global::Nitric.Proto.Deploy.v1.UpResult(); - } - input.ReadMessage(Result); - break; - } - } - } - } - #endif - - } - - public sealed partial class DeployDownRequest : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DeployDownRequest()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Deploy.v1.DeployReflection.Descriptor.MessageTypes[5]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public DeployDownRequest() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public DeployDownRequest(DeployDownRequest other) : this() { - attributes_ = other.attributes_ != null ? other.attributes_.Clone() : null; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public DeployDownRequest Clone() { - return new DeployDownRequest(this); - } - - /// Field number for the "attributes" field. - public const int AttributesFieldNumber = 1; - private global::Google.Protobuf.WellKnownTypes.Struct attributes_; - /// - /// A map of attributes related to the deploy request - /// this allows for adding project identifiers etc. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Google.Protobuf.WellKnownTypes.Struct Attributes { - get { return attributes_; } - set { - attributes_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as DeployDownRequest); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(DeployDownRequest other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!object.Equals(Attributes, other.Attributes)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (attributes_ != null) hash ^= Attributes.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (attributes_ != null) { - output.WriteRawTag(10); - output.WriteMessage(Attributes); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (attributes_ != null) { - output.WriteRawTag(10); - output.WriteMessage(Attributes); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (attributes_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Attributes); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(DeployDownRequest other) { - if (other == null) { - return; - } - if (other.attributes_ != null) { - if (attributes_ == null) { - Attributes = new global::Google.Protobuf.WellKnownTypes.Struct(); - } - Attributes.MergeFrom(other.Attributes); + if (other.Interactive != false) { + Interactive = other.Interactive; } _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } @@ -1392,6 +1568,10 @@ public void MergeFrom(pb::CodedInputStream input) { input.ReadMessage(Attributes); break; } + case 16: { + Interactive = input.ReadBool(); + break; + } } } #endif @@ -1413,6 +1593,10 @@ public void MergeFrom(pb::CodedInputStream input) { input.ReadMessage(Attributes); break; } + case 16: { + Interactive = input.ReadBool(); + break; + } } } } @@ -1420,19 +1604,19 @@ public void MergeFrom(pb::CodedInputStream input) { } - public sealed partial class DeployDownEvent : pb::IMessage + public sealed partial class DeploymentDownEvent : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DeployDownEvent()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DeploymentDownEvent()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Deploy.v1.DeployReflection.Descriptor.MessageTypes[6]; } + get { return global::Nitric.Proto.Deployments.v1.DeploymentsReflection.Descriptor.MessageTypes[5]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1441,59 +1625,74 @@ public sealed partial class DeployDownEvent : pb::IMessage } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public DeployDownEvent() { + public DeploymentDownEvent() { OnConstruction(); } partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public DeployDownEvent(DeployDownEvent other) : this() { + public DeploymentDownEvent(DeploymentDownEvent other) : this() { switch (other.ContentCase) { case ContentOneofCase.Message: - Message = other.Message.Clone(); + Message = other.Message; break; case ContentOneofCase.Result: Result = other.Result.Clone(); break; + case ContentOneofCase.Update: + Update = other.Update.Clone(); + break; } _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public DeployDownEvent Clone() { - return new DeployDownEvent(this); + public DeploymentDownEvent Clone() { + return new DeploymentDownEvent(this); } /// Field number for the "message" field. public const int MessageFieldNumber = 1; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Deploy.v1.DeployEventMessage Message { - get { return contentCase_ == ContentOneofCase.Message ? (global::Nitric.Proto.Deploy.v1.DeployEventMessage) content_ : null; } + public string Message { + get { return contentCase_ == ContentOneofCase.Message ? (string) content_ : ""; } set { - content_ = value; - contentCase_ = value == null ? ContentOneofCase.None : ContentOneofCase.Message; + content_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + contentCase_ = ContentOneofCase.Message; } } /// Field number for the "result" field. public const int ResultFieldNumber = 2; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Deploy.v1.DeployDownEventResult Result { - get { return contentCase_ == ContentOneofCase.Result ? (global::Nitric.Proto.Deploy.v1.DeployDownEventResult) content_ : null; } + public global::Nitric.Proto.Deployments.v1.DownResult Result { + get { return contentCase_ == ContentOneofCase.Result ? (global::Nitric.Proto.Deployments.v1.DownResult) content_ : null; } set { content_ = value; contentCase_ = value == null ? ContentOneofCase.None : ContentOneofCase.Result; } } + /// Field number for the "update" field. + public const int UpdateFieldNumber = 3; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Nitric.Proto.Deployments.v1.ResourceUpdate Update { + get { return contentCase_ == ContentOneofCase.Update ? (global::Nitric.Proto.Deployments.v1.ResourceUpdate) content_ : null; } + set { + content_ = value; + contentCase_ = value == null ? ContentOneofCase.None : ContentOneofCase.Update; + } + } + private object content_; /// Enum of possible cases for the "content" oneof. public enum ContentOneofCase { None = 0, Message = 1, Result = 2, + Update = 3, } private ContentOneofCase contentCase_ = ContentOneofCase.None; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1509,19 +1708,20 @@ public void ClearContent() { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { - return Equals(other as DeployDownEvent); + return Equals(other as DeploymentDownEvent); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(DeployDownEvent other) { + public bool Equals(DeploymentDownEvent other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } - if (!object.Equals(Message, other.Message)) return false; + if (Message != other.Message) return false; if (!object.Equals(Result, other.Result)) return false; + if (!object.Equals(Update, other.Update)) return false; if (ContentCase != other.ContentCase) return false; return Equals(_unknownFields, other._unknownFields); } @@ -1531,6 +1731,7 @@ public override int GetHashCode() { int hash = 1; if (contentCase_ == ContentOneofCase.Message) hash ^= Message.GetHashCode(); if (contentCase_ == ContentOneofCase.Result) hash ^= Result.GetHashCode(); + if (contentCase_ == ContentOneofCase.Update) hash ^= Update.GetHashCode(); hash ^= (int) contentCase_; if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); @@ -1550,12 +1751,16 @@ public void WriteTo(pb::CodedOutputStream output) { #else if (contentCase_ == ContentOneofCase.Message) { output.WriteRawTag(10); - output.WriteMessage(Message); + output.WriteString(Message); } if (contentCase_ == ContentOneofCase.Result) { output.WriteRawTag(18); output.WriteMessage(Result); } + if (contentCase_ == ContentOneofCase.Update) { + output.WriteRawTag(26); + output.WriteMessage(Update); + } if (_unknownFields != null) { _unknownFields.WriteTo(output); } @@ -1567,12 +1772,16 @@ public void WriteTo(pb::CodedOutputStream output) { void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (contentCase_ == ContentOneofCase.Message) { output.WriteRawTag(10); - output.WriteMessage(Message); + output.WriteString(Message); } if (contentCase_ == ContentOneofCase.Result) { output.WriteRawTag(18); output.WriteMessage(Result); } + if (contentCase_ == ContentOneofCase.Update) { + output.WriteRawTag(26); + output.WriteMessage(Update); + } if (_unknownFields != null) { _unknownFields.WriteTo(ref output); } @@ -1583,11 +1792,14 @@ public void WriteTo(pb::CodedOutputStream output) { public int CalculateSize() { int size = 0; if (contentCase_ == ContentOneofCase.Message) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Message); + size += 1 + pb::CodedOutputStream.ComputeStringSize(Message); } if (contentCase_ == ContentOneofCase.Result) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(Result); } + if (contentCase_ == ContentOneofCase.Update) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Update); + } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); } @@ -1595,23 +1807,26 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(DeployDownEvent other) { + public void MergeFrom(DeploymentDownEvent other) { if (other == null) { return; } switch (other.ContentCase) { case ContentOneofCase.Message: - if (Message == null) { - Message = new global::Nitric.Proto.Deploy.v1.DeployEventMessage(); - } - Message.MergeFrom(other.Message); + Message = other.Message; break; case ContentOneofCase.Result: if (Result == null) { - Result = new global::Nitric.Proto.Deploy.v1.DeployDownEventResult(); + Result = new global::Nitric.Proto.Deployments.v1.DownResult(); } Result.MergeFrom(other.Result); break; + case ContentOneofCase.Update: + if (Update == null) { + Update = new global::Nitric.Proto.Deployments.v1.ResourceUpdate(); + } + Update.MergeFrom(other.Update); + break; } _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); @@ -1629,16 +1844,11 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { - global::Nitric.Proto.Deploy.v1.DeployEventMessage subBuilder = new global::Nitric.Proto.Deploy.v1.DeployEventMessage(); - if (contentCase_ == ContentOneofCase.Message) { - subBuilder.MergeFrom(Message); - } - input.ReadMessage(subBuilder); - Message = subBuilder; + Message = input.ReadString(); break; } case 18: { - global::Nitric.Proto.Deploy.v1.DeployDownEventResult subBuilder = new global::Nitric.Proto.Deploy.v1.DeployDownEventResult(); + global::Nitric.Proto.Deployments.v1.DownResult subBuilder = new global::Nitric.Proto.Deployments.v1.DownResult(); if (contentCase_ == ContentOneofCase.Result) { subBuilder.MergeFrom(Result); } @@ -1646,6 +1856,15 @@ public void MergeFrom(pb::CodedInputStream input) { Result = subBuilder; break; } + case 26: { + global::Nitric.Proto.Deployments.v1.ResourceUpdate subBuilder = new global::Nitric.Proto.Deployments.v1.ResourceUpdate(); + if (contentCase_ == ContentOneofCase.Update) { + subBuilder.MergeFrom(Update); + } + input.ReadMessage(subBuilder); + Update = subBuilder; + break; + } } } #endif @@ -1661,16 +1880,11 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; case 10: { - global::Nitric.Proto.Deploy.v1.DeployEventMessage subBuilder = new global::Nitric.Proto.Deploy.v1.DeployEventMessage(); - if (contentCase_ == ContentOneofCase.Message) { - subBuilder.MergeFrom(Message); - } - input.ReadMessage(subBuilder); - Message = subBuilder; + Message = input.ReadString(); break; } case 18: { - global::Nitric.Proto.Deploy.v1.DeployDownEventResult subBuilder = new global::Nitric.Proto.Deploy.v1.DeployDownEventResult(); + global::Nitric.Proto.Deployments.v1.DownResult subBuilder = new global::Nitric.Proto.Deployments.v1.DownResult(); if (contentCase_ == ContentOneofCase.Result) { subBuilder.MergeFrom(Result); } @@ -1678,6 +1892,15 @@ public void MergeFrom(pb::CodedInputStream input) { Result = subBuilder; break; } + case 26: { + global::Nitric.Proto.Deployments.v1.ResourceUpdate subBuilder = new global::Nitric.Proto.Deployments.v1.ResourceUpdate(); + if (contentCase_ == ContentOneofCase.Update) { + subBuilder.MergeFrom(Update); + } + input.ReadMessage(subBuilder); + Update = subBuilder; + break; + } } } } @@ -1688,19 +1911,19 @@ public void MergeFrom(pb::CodedInputStream input) { /// /// Terminal message indicating deployment success /// - public sealed partial class DeployDownEventResult : pb::IMessage + public sealed partial class DownResult : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DeployDownEventResult()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DownResult()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Deploy.v1.DeployReflection.Descriptor.MessageTypes[7]; } + get { return global::Nitric.Proto.Deployments.v1.DeploymentsReflection.Descriptor.MessageTypes[6]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1709,29 +1932,29 @@ public sealed partial class DeployDownEventResult : pb::IMessage - /// An image source to be used for execution unit deployment + /// An image source to be used for service deployment /// public sealed partial class ImageSource : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE @@ -1839,7 +2062,7 @@ public sealed partial class ImageSource : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Deploy.v1.DeployReflection.Descriptor.MessageTypes[8]; } + get { return global::Nitric.Proto.Deployments.v1.DeploymentsReflection.Descriptor.MessageTypes[7]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1870,7 +2093,7 @@ public ImageSource Clone() { private string uri_ = ""; /// /// URI of the docker image - /// TODO: May also need to provide auth information (although this should just be configured on the running client already) + /// To support remote images this may also need to provide auth information /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public string Uri { @@ -2004,21 +2227,21 @@ public void MergeFrom(pb::CodedInputStream input) { } /// - /// A unit of execution (i.e. function/container) + /// A unit of compute (i.e. function/container) /// - public sealed partial class ExecutionUnit : pb::IMessage + public sealed partial class Service : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ExecutionUnit()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Service()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Deploy.v1.DeployReflection.Descriptor.MessageTypes[9]; } + get { return global::Nitric.Proto.Deployments.v1.DeploymentsReflection.Descriptor.MessageTypes[8]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -2027,14 +2250,14 @@ public sealed partial class ExecutionUnit : pb::IMessage } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ExecutionUnit() { + public Service() { OnConstruction(); } partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ExecutionUnit(ExecutionUnit other) : this() { + public Service(Service other) : this() { workers_ = other.workers_; timeout_ = other.timeout_; memory_ = other.memory_; @@ -2050,18 +2273,18 @@ public ExecutionUnit(ExecutionUnit other) : this() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ExecutionUnit Clone() { - return new ExecutionUnit(this); + public Service Clone() { + return new Service(this); } /// Field number for the "image" field. public const int ImageFieldNumber = 1; /// - /// Container image as a execution unit + /// Container image as a service /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Deploy.v1.ImageSource Image { - get { return sourceCase_ == SourceOneofCase.Image ? (global::Nitric.Proto.Deploy.v1.ImageSource) source_ : null; } + public global::Nitric.Proto.Deployments.v1.ImageSource Image { + get { return sourceCase_ == SourceOneofCase.Image ? (global::Nitric.Proto.Deployments.v1.ImageSource) source_ : null; } set { source_ = value; sourceCase_ = value == null ? SourceOneofCase.None : SourceOneofCase.Image; @@ -2072,7 +2295,7 @@ public ExecutionUnit Clone() { public const int WorkersFieldNumber = 10; private int workers_; /// - /// Expected worker count for this execution unit + /// Expected worker count for this service /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int Workers { @@ -2117,7 +2340,7 @@ public int Memory { private string type_ = ""; /// /// A simple type property - /// describes the requested type of execution unit that this should be + /// describes the requested type of service that this should be /// for this project, a provider can implement how this request is satisfied /// in any way /// @@ -2135,7 +2358,7 @@ public string Type { = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForString(18, ""), 114); private readonly pbc::MapField env_ = new pbc::MapField(); /// - /// Environment variables for this execution unit + /// Environment variables for this service /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public pbc::MapField Env { @@ -2162,11 +2385,11 @@ public void ClearSource() { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { - return Equals(other as ExecutionUnit); + return Equals(other as Service); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(ExecutionUnit other) { + public bool Equals(Service other) { if (ReferenceEquals(other, null)) { return false; } @@ -2292,7 +2515,7 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(ExecutionUnit other) { + public void MergeFrom(Service other) { if (other == null) { return; } @@ -2312,7 +2535,7 @@ public void MergeFrom(ExecutionUnit other) { switch (other.SourceCase) { case SourceOneofCase.Image: if (Image == null) { - Image = new global::Nitric.Proto.Deploy.v1.ImageSource(); + Image = new global::Nitric.Proto.Deployments.v1.ImageSource(); } Image.MergeFrom(other.Image); break; @@ -2333,7 +2556,7 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { - global::Nitric.Proto.Deploy.v1.ImageSource subBuilder = new global::Nitric.Proto.Deploy.v1.ImageSource(); + global::Nitric.Proto.Deployments.v1.ImageSource subBuilder = new global::Nitric.Proto.Deployments.v1.ImageSource(); if (sourceCase_ == SourceOneofCase.Image) { subBuilder.MergeFrom(Image); } @@ -2376,7 +2599,7 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; case 10: { - global::Nitric.Proto.Deploy.v1.ImageSource subBuilder = new global::Nitric.Proto.Deploy.v1.ImageSource(); + global::Nitric.Proto.Deployments.v1.ImageSource subBuilder = new global::Nitric.Proto.Deployments.v1.ImageSource(); if (sourceCase_ == SourceOneofCase.Image) { subBuilder.MergeFrom(Image); } @@ -2411,19 +2634,19 @@ public void MergeFrom(pb::CodedInputStream input) { } - public sealed partial class Bucket : pb::IMessage + public sealed partial class Job : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Bucket()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Job()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Deploy.v1.DeployReflection.Descriptor.MessageTypes[10]; } + get { return global::Nitric.Proto.Deployments.v1.DeploymentsReflection.Descriptor.MessageTypes[9]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -2432,54 +2655,75 @@ public sealed partial class Bucket : pb::IMessage } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Bucket() { + public Job() { OnConstruction(); } partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Bucket(Bucket other) : this() { - notifications_ = other.notifications_.Clone(); + public Job(Job other) : this() { + name_ = other.name_; + requirements_ = other.requirements_ != null ? other.requirements_.Clone() : null; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Bucket Clone() { - return new Bucket(this); + public Job Clone() { + return new Job(this); + } + + /// Field number for the "name" field. + public const int NameFieldNumber = 1; + private string name_ = ""; + /// + /// The name of the job to create + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Name { + get { return name_; } + set { + name_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } } - /// Field number for the "notifications" field. - public const int NotificationsFieldNumber = 1; - private static readonly pb::FieldCodec _repeated_notifications_codec - = pb::FieldCodec.ForMessage(10, global::Nitric.Proto.Deploy.v1.BucketNotificationTarget.Parser); - private readonly pbc::RepeatedField notifications_ = new pbc::RepeatedField(); + /// Field number for the "requirements" field. + public const int RequirementsFieldNumber = 2; + private global::Nitric.Proto.Batch.v1.JobResourceRequirements requirements_; + /// + /// The default resource requirements of the job + /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField Notifications { - get { return notifications_; } + public global::Nitric.Proto.Batch.v1.JobResourceRequirements Requirements { + get { return requirements_; } + set { + requirements_ = value; + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { - return Equals(other as Bucket); + return Equals(other as Job); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(Bucket other) { + public bool Equals(Job other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } - if(!notifications_.Equals(other.notifications_)) return false; + if (Name != other.Name) return false; + if (!object.Equals(Requirements, other.Requirements)) return false; return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; - hash ^= notifications_.GetHashCode(); + if (Name.Length != 0) hash ^= Name.GetHashCode(); + if (requirements_ != null) hash ^= Requirements.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -2496,7 +2740,14 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else - notifications_.WriteTo(output, _repeated_notifications_codec); + if (Name.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Name); + } + if (requirements_ != null) { + output.WriteRawTag(18); + output.WriteMessage(Requirements); + } if (_unknownFields != null) { _unknownFields.WriteTo(output); } @@ -2506,9 +2757,16 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - notifications_.WriteTo(ref output, _repeated_notifications_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); + if (Name.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Name); + } + if (requirements_ != null) { + output.WriteRawTag(18); + output.WriteMessage(Requirements); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); } } #endif @@ -2516,7 +2774,12 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; - size += notifications_.CalculateSize(_repeated_notifications_codec); + if (Name.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Name); + } + if (requirements_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Requirements); + } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); } @@ -2524,11 +2787,19 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(Bucket other) { + public void MergeFrom(Job other) { if (other == null) { return; } - notifications_.Add(other.notifications_); + if (other.Name.Length != 0) { + Name = other.Name; + } + if (other.requirements_ != null) { + if (requirements_ == null) { + Requirements = new global::Nitric.Proto.Batch.v1.JobResourceRequirements(); + } + Requirements.MergeFrom(other.Requirements); + } _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } @@ -2544,7 +2815,14 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { - notifications_.AddEntriesFrom(input, _repeated_notifications_codec); + Name = input.ReadString(); + break; + } + case 18: { + if (requirements_ == null) { + Requirements = new global::Nitric.Proto.Batch.v1.JobResourceRequirements(); + } + input.ReadMessage(Requirements); break; } } @@ -2562,7 +2840,14 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; case 10: { - notifications_.AddEntriesFrom(ref input, _repeated_notifications_codec); + Name = input.ReadString(); + break; + } + case 18: { + if (requirements_ == null) { + Requirements = new global::Nitric.Proto.Batch.v1.JobResourceRequirements(); + } + input.ReadMessage(Requirements); break; } } @@ -2572,19 +2857,19 @@ public void MergeFrom(pb::CodedInputStream input) { } - public sealed partial class BucketNotificationTarget : pb::IMessage + public sealed partial class Batch : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new BucketNotificationTarget()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Batch()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Deploy.v1.DeployReflection.Descriptor.MessageTypes[11]; } + get { return global::Nitric.Proto.Deployments.v1.DeploymentsReflection.Descriptor.MessageTypes[10]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -2593,18 +2878,20 @@ public sealed partial class BucketNotificationTarget : pb::IMessageField number for the "config" field. - public const int ConfigFieldNumber = 1; - private global::Nitric.Proto.Faas.v1.BucketNotificationConfig config_; + /// Field number for the "image" field. + public const int ImageFieldNumber = 1; + /// + /// Image URI for this batch service + /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Faas.v1.BucketNotificationConfig Config { - get { return config_; } + public global::Nitric.Proto.Deployments.v1.ImageSource Image { + get { return sourceCase_ == SourceOneofCase.Image ? (global::Nitric.Proto.Deployments.v1.ImageSource) source_ : null; } set { - config_ = value; + source_ = value; + sourceCase_ = value == null ? SourceOneofCase.None : SourceOneofCase.Image; } } - /// Field number for the "execution_unit" field. - public const int ExecutionUnitFieldNumber = 2; + /// Field number for the "type" field. + public const int TypeFieldNumber = 10; + private string type_ = ""; /// - /// The name of an execution unit to target + /// A simple type property + /// describes the requested type of batch that this should be + /// for this project, a provider can implement how this request is satisfied + /// in any way /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string ExecutionUnit { - get { return targetCase_ == TargetOneofCase.ExecutionUnit ? (string) target_ : ""; } + public string Type { + get { return type_; } set { - target_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - targetCase_ = TargetOneofCase.ExecutionUnit; + type_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); } } - private object target_; - /// Enum of possible cases for the "target" oneof. - public enum TargetOneofCase { + /// Field number for the "env" field. + public const int EnvFieldNumber = 11; + private static readonly pbc::MapField.Codec _map_env_codec + = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForString(18, ""), 90); + private readonly pbc::MapField env_ = new pbc::MapField(); + /// + /// Environment variables for this Batch + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::MapField Env { + get { return env_; } + } + + /// Field number for the "jobs" field. + public const int JobsFieldNumber = 12; + private static readonly pb::FieldCodec _repeated_jobs_codec + = pb::FieldCodec.ForMessage(98, global::Nitric.Proto.Deployments.v1.Job.Parser); + private readonly pbc::RepeatedField jobs_ = new pbc::RepeatedField(); + /// + /// Jobs that are defined in this Batch + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField Jobs { + get { return jobs_; } + } + + private object source_; + /// Enum of possible cases for the "source" oneof. + public enum SourceOneofCase { None = 0, - ExecutionUnit = 2, + Image = 1, } - private TargetOneofCase targetCase_ = TargetOneofCase.None; + private SourceOneofCase sourceCase_ = SourceOneofCase.None; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public TargetOneofCase TargetCase { - get { return targetCase_; } + public SourceOneofCase SourceCase { + get { return sourceCase_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearTarget() { - targetCase_ = TargetOneofCase.None; - target_ = null; + public void ClearSource() { + sourceCase_ = SourceOneofCase.None; + source_ = null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { - return Equals(other as BucketNotificationTarget); + return Equals(other as Batch); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(BucketNotificationTarget other) { + public bool Equals(Batch other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } - if (!object.Equals(Config, other.Config)) return false; - if (ExecutionUnit != other.ExecutionUnit) return false; - if (TargetCase != other.TargetCase) return false; + if (!object.Equals(Image, other.Image)) return false; + if (Type != other.Type) return false; + if (!Env.Equals(other.Env)) return false; + if(!jobs_.Equals(other.jobs_)) return false; + if (SourceCase != other.SourceCase) return false; return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; - if (config_ != null) hash ^= Config.GetHashCode(); - if (targetCase_ == TargetOneofCase.ExecutionUnit) hash ^= ExecutionUnit.GetHashCode(); - hash ^= (int) targetCase_; + if (sourceCase_ == SourceOneofCase.Image) hash ^= Image.GetHashCode(); + if (Type.Length != 0) hash ^= Type.GetHashCode(); + hash ^= Env.GetHashCode(); + hash ^= jobs_.GetHashCode(); + hash ^= (int) sourceCase_; if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -2700,14 +3023,16 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else - if (config_ != null) { + if (sourceCase_ == SourceOneofCase.Image) { output.WriteRawTag(10); - output.WriteMessage(Config); + output.WriteMessage(Image); } - if (targetCase_ == TargetOneofCase.ExecutionUnit) { - output.WriteRawTag(18); - output.WriteString(ExecutionUnit); + if (Type.Length != 0) { + output.WriteRawTag(82); + output.WriteString(Type); } + env_.WriteTo(output, _map_env_codec); + jobs_.WriteTo(output, _repeated_jobs_codec); if (_unknownFields != null) { _unknownFields.WriteTo(output); } @@ -2717,14 +3042,16 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (config_ != null) { + if (sourceCase_ == SourceOneofCase.Image) { output.WriteRawTag(10); - output.WriteMessage(Config); + output.WriteMessage(Image); } - if (targetCase_ == TargetOneofCase.ExecutionUnit) { - output.WriteRawTag(18); - output.WriteString(ExecutionUnit); + if (Type.Length != 0) { + output.WriteRawTag(82); + output.WriteString(Type); } + env_.WriteTo(ref output, _map_env_codec); + jobs_.WriteTo(ref output, _repeated_jobs_codec); if (_unknownFields != null) { _unknownFields.WriteTo(ref output); } @@ -2734,12 +3061,14 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; - if (config_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Config); + if (sourceCase_ == SourceOneofCase.Image) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Image); } - if (targetCase_ == TargetOneofCase.ExecutionUnit) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(ExecutionUnit); + if (Type.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Type); } + size += env_.CalculateSize(_map_env_codec); + size += jobs_.CalculateSize(_repeated_jobs_codec); if (_unknownFields != null) { size += _unknownFields.CalculateSize(); } @@ -2747,19 +3076,21 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(BucketNotificationTarget other) { + public void MergeFrom(Batch other) { if (other == null) { return; } - if (other.config_ != null) { - if (config_ == null) { - Config = new global::Nitric.Proto.Faas.v1.BucketNotificationConfig(); - } - Config.MergeFrom(other.Config); + if (other.Type.Length != 0) { + Type = other.Type; } - switch (other.TargetCase) { - case TargetOneofCase.ExecutionUnit: - ExecutionUnit = other.ExecutionUnit; + env_.Add(other.env_); + jobs_.Add(other.jobs_); + switch (other.SourceCase) { + case SourceOneofCase.Image: + if (Image == null) { + Image = new global::Nitric.Proto.Deployments.v1.ImageSource(); + } + Image.MergeFrom(other.Image); break; } @@ -2778,14 +3109,24 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { - if (config_ == null) { - Config = new global::Nitric.Proto.Faas.v1.BucketNotificationConfig(); + global::Nitric.Proto.Deployments.v1.ImageSource subBuilder = new global::Nitric.Proto.Deployments.v1.ImageSource(); + if (sourceCase_ == SourceOneofCase.Image) { + subBuilder.MergeFrom(Image); } - input.ReadMessage(Config); + input.ReadMessage(subBuilder); + Image = subBuilder; break; } - case 18: { - ExecutionUnit = input.ReadString(); + case 82: { + Type = input.ReadString(); + break; + } + case 90: { + env_.AddEntriesFrom(input, _map_env_codec); + break; + } + case 98: { + jobs_.AddEntriesFrom(input, _repeated_jobs_codec); break; } } @@ -2803,14 +3144,24 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; case 10: { - if (config_ == null) { - Config = new global::Nitric.Proto.Faas.v1.BucketNotificationConfig(); + global::Nitric.Proto.Deployments.v1.ImageSource subBuilder = new global::Nitric.Proto.Deployments.v1.ImageSource(); + if (sourceCase_ == SourceOneofCase.Image) { + subBuilder.MergeFrom(Image); } - input.ReadMessage(Config); + input.ReadMessage(subBuilder); + Image = subBuilder; break; } - case 18: { - ExecutionUnit = input.ReadString(); + case 82: { + Type = input.ReadString(); + break; + } + case 90: { + env_.AddEntriesFrom(ref input, _map_env_codec); + break; + } + case 98: { + jobs_.AddEntriesFrom(ref input, _repeated_jobs_codec); break; } } @@ -2820,19 +3171,19 @@ public void MergeFrom(pb::CodedInputStream input) { } - public sealed partial class Topic : pb::IMessage + public sealed partial class Bucket : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Topic()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Bucket()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Deploy.v1.DeployReflection.Descriptor.MessageTypes[12]; } + get { return global::Nitric.Proto.Deployments.v1.DeploymentsReflection.Descriptor.MessageTypes[11]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -2841,57 +3192,54 @@ public sealed partial class Topic : pb::IMessage } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Topic() { + public Bucket() { OnConstruction(); } partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Topic(Topic other) : this() { - subscriptions_ = other.subscriptions_.Clone(); + public Bucket(Bucket other) : this() { + listeners_ = other.listeners_.Clone(); _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Topic Clone() { - return new Topic(this); + public Bucket Clone() { + return new Bucket(this); } - /// Field number for the "subscriptions" field. - public const int SubscriptionsFieldNumber = 1; - private static readonly pb::FieldCodec _repeated_subscriptions_codec - = pb::FieldCodec.ForMessage(10, global::Nitric.Proto.Deploy.v1.SubscriptionTarget.Parser); - private readonly pbc::RepeatedField subscriptions_ = new pbc::RepeatedField(); - /// - /// TODO: Include topic specifications here - /// + /// Field number for the "listeners" field. + public const int ListenersFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_listeners_codec + = pb::FieldCodec.ForMessage(10, global::Nitric.Proto.Deployments.v1.BucketListener.Parser); + private readonly pbc::RepeatedField listeners_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField Subscriptions { - get { return subscriptions_; } + public pbc::RepeatedField Listeners { + get { return listeners_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { - return Equals(other as Topic); + return Equals(other as Bucket); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(Topic other) { + public bool Equals(Bucket other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } - if(!subscriptions_.Equals(other.subscriptions_)) return false; + if(!listeners_.Equals(other.listeners_)) return false; return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; - hash ^= subscriptions_.GetHashCode(); + hash ^= listeners_.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -2908,7 +3256,7 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else - subscriptions_.WriteTo(output, _repeated_subscriptions_codec); + listeners_.WriteTo(output, _repeated_listeners_codec); if (_unknownFields != null) { _unknownFields.WriteTo(output); } @@ -2918,7 +3266,7 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - subscriptions_.WriteTo(ref output, _repeated_subscriptions_codec); + listeners_.WriteTo(ref output, _repeated_listeners_codec); if (_unknownFields != null) { _unknownFields.WriteTo(ref output); } @@ -2928,7 +3276,7 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; - size += subscriptions_.CalculateSize(_repeated_subscriptions_codec); + size += listeners_.CalculateSize(_repeated_listeners_codec); if (_unknownFields != null) { size += _unknownFields.CalculateSize(); } @@ -2936,11 +3284,11 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(Topic other) { + public void MergeFrom(Bucket other) { if (other == null) { return; } - subscriptions_.Add(other.subscriptions_); + listeners_.Add(other.listeners_); _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } @@ -2956,7 +3304,7 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { - subscriptions_.AddEntriesFrom(input, _repeated_subscriptions_codec); + listeners_.AddEntriesFrom(input, _repeated_listeners_codec); break; } } @@ -2974,7 +3322,7 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; case 10: { - subscriptions_.AddEntriesFrom(ref input, _repeated_subscriptions_codec); + listeners_.AddEntriesFrom(ref input, _repeated_listeners_codec); break; } } @@ -2984,22 +3332,19 @@ public void MergeFrom(pb::CodedInputStream input) { } - /// - /// TODO: Include queue specifications here - /// - public sealed partial class Queue : pb::IMessage + public sealed partial class BucketListener : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Queue()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new BucketListener()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Deploy.v1.DeployReflection.Descriptor.MessageTypes[13]; } + get { return global::Nitric.Proto.Deployments.v1.DeploymentsReflection.Descriptor.MessageTypes[12]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -3008,41 +3353,97 @@ public sealed partial class Queue : pb::IMessage } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Queue() { + public BucketListener() { OnConstruction(); } partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Queue(Queue other) : this() { + public BucketListener(BucketListener other) : this() { + config_ = other.config_ != null ? other.config_.Clone() : null; + switch (other.TargetCase) { + case TargetOneofCase.Service: + Service = other.Service; + break; + } + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Queue Clone() { - return new Queue(this); + public BucketListener Clone() { + return new BucketListener(this); + } + + /// Field number for the "config" field. + public const int ConfigFieldNumber = 1; + private global::Nitric.Proto.Storage.v1.RegistrationRequest config_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Nitric.Proto.Storage.v1.RegistrationRequest Config { + get { return config_; } + set { + config_ = value; + } + } + + /// Field number for the "service" field. + public const int ServiceFieldNumber = 2; + /// + /// The name of an service to target + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Service { + get { return targetCase_ == TargetOneofCase.Service ? (string) target_ : ""; } + set { + target_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + targetCase_ = TargetOneofCase.Service; + } + } + + private object target_; + /// Enum of possible cases for the "target" oneof. + public enum TargetOneofCase { + None = 0, + Service = 2, + } + private TargetOneofCase targetCase_ = TargetOneofCase.None; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public TargetOneofCase TargetCase { + get { return targetCase_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void ClearTarget() { + targetCase_ = TargetOneofCase.None; + target_ = null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { - return Equals(other as Queue); + return Equals(other as BucketListener); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(Queue other) { + public bool Equals(BucketListener other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } + if (!object.Equals(Config, other.Config)) return false; + if (Service != other.Service) return false; + if (TargetCase != other.TargetCase) return false; return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; + if (config_ != null) hash ^= Config.GetHashCode(); + if (targetCase_ == TargetOneofCase.Service) hash ^= Service.GetHashCode(); + hash ^= (int) targetCase_; if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -3059,6 +3460,14 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else + if (config_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Config); + } + if (targetCase_ == TargetOneofCase.Service) { + output.WriteRawTag(18); + output.WriteString(Service); + } if (_unknownFields != null) { _unknownFields.WriteTo(output); } @@ -3068,6 +3477,14 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (config_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Config); + } + if (targetCase_ == TargetOneofCase.Service) { + output.WriteRawTag(18); + output.WriteString(Service); + } if (_unknownFields != null) { _unknownFields.WriteTo(ref output); } @@ -3077,6 +3494,12 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; + if (config_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Config); + } + if (targetCase_ == TargetOneofCase.Service) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Service); + } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); } @@ -3084,10 +3507,22 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(Queue other) { + public void MergeFrom(BucketListener other) { if (other == null) { return; } + if (other.config_ != null) { + if (config_ == null) { + Config = new global::Nitric.Proto.Storage.v1.RegistrationRequest(); + } + Config.MergeFrom(other.Config); + } + switch (other.TargetCase) { + case TargetOneofCase.Service: + Service = other.Service; + break; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } @@ -3102,6 +3537,17 @@ public void MergeFrom(pb::CodedInputStream input) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; + case 10: { + if (config_ == null) { + Config = new global::Nitric.Proto.Storage.v1.RegistrationRequest(); + } + input.ReadMessage(Config); + break; + } + case 18: { + Service = input.ReadString(); + break; + } } } #endif @@ -3116,6 +3562,17 @@ public void MergeFrom(pb::CodedInputStream input) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; + case 10: { + if (config_ == null) { + Config = new global::Nitric.Proto.Storage.v1.RegistrationRequest(); + } + input.ReadMessage(Config); + break; + } + case 18: { + Service = input.ReadString(); + break; + } } } } @@ -3123,19 +3580,19 @@ public void MergeFrom(pb::CodedInputStream input) { } - public sealed partial class Collection : pb::IMessage + public sealed partial class Topic : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Collection()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Topic()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Deploy.v1.DeployReflection.Descriptor.MessageTypes[14]; } + get { return global::Nitric.Proto.Deployments.v1.DeploymentsReflection.Descriptor.MessageTypes[13]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -3144,41 +3601,54 @@ public sealed partial class Collection : pb::IMessage } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Collection() { + public Topic() { OnConstruction(); } partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Collection(Collection other) : this() { + public Topic(Topic other) : this() { + subscriptions_ = other.subscriptions_.Clone(); _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Collection Clone() { - return new Collection(this); + public Topic Clone() { + return new Topic(this); + } + + /// Field number for the "subscriptions" field. + public const int SubscriptionsFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_subscriptions_codec + = pb::FieldCodec.ForMessage(10, global::Nitric.Proto.Deployments.v1.SubscriptionTarget.Parser); + private readonly pbc::RepeatedField subscriptions_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField Subscriptions { + get { return subscriptions_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { - return Equals(other as Collection); + return Equals(other as Topic); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(Collection other) { + public bool Equals(Topic other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } + if(!subscriptions_.Equals(other.subscriptions_)) return false; return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; + hash ^= subscriptions_.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -3195,6 +3665,7 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else + subscriptions_.WriteTo(output, _repeated_subscriptions_codec); if (_unknownFields != null) { _unknownFields.WriteTo(output); } @@ -3204,6 +3675,7 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + subscriptions_.WriteTo(ref output, _repeated_subscriptions_codec); if (_unknownFields != null) { _unknownFields.WriteTo(ref output); } @@ -3213,6 +3685,7 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; + size += subscriptions_.CalculateSize(_repeated_subscriptions_codec); if (_unknownFields != null) { size += _unknownFields.CalculateSize(); } @@ -3220,10 +3693,11 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(Collection other) { + public void MergeFrom(Topic other) { if (other == null) { return; } + subscriptions_.Add(other.subscriptions_); _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } @@ -3238,6 +3712,10 @@ public void MergeFrom(pb::CodedInputStream input) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; + case 10: { + subscriptions_.AddEntriesFrom(input, _repeated_subscriptions_codec); + break; + } } } #endif @@ -3252,6 +3730,10 @@ public void MergeFrom(pb::CodedInputStream input) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; + case 10: { + subscriptions_.AddEntriesFrom(ref input, _repeated_subscriptions_codec); + break; + } } } } @@ -3259,19 +3741,19 @@ public void MergeFrom(pb::CodedInputStream input) { } - public sealed partial class Secret : pb::IMessage + public sealed partial class Queue : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Secret()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Queue()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Deploy.v1.DeployReflection.Descriptor.MessageTypes[15]; } + get { return global::Nitric.Proto.Deployments.v1.DeploymentsReflection.Descriptor.MessageTypes[14]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -3280,29 +3762,29 @@ public sealed partial class Secret : pb::IMessage } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Secret() { + public Queue() { OnConstruction(); } partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Secret(Secret other) : this() { + public Queue(Queue other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Secret Clone() { - return new Secret(this); + public Queue Clone() { + return new Queue(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { - return Equals(other as Secret); + return Equals(other as Queue); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(Secret other) { + public bool Equals(Queue other) { if (ReferenceEquals(other, null)) { return false; } @@ -3356,7 +3838,7 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(Secret other) { + public void MergeFrom(Queue other) { if (other == null) { return; } @@ -3395,19 +3877,19 @@ public void MergeFrom(pb::CodedInputStream input) { } - public sealed partial class SubscriptionTarget : pb::IMessage + public sealed partial class KeyValueStore : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SubscriptionTarget()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new KeyValueStore()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Deploy.v1.DeployReflection.Descriptor.MessageTypes[16]; } + get { return global::Nitric.Proto.Deployments.v1.DeploymentsReflection.Descriptor.MessageTypes[15]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -3416,83 +3898,41 @@ public sealed partial class SubscriptionTarget : pb::IMessageField number for the "execution_unit" field. - public const int ExecutionUnitFieldNumber = 1; - /// - /// The name of an execution unit to target - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string ExecutionUnit { - get { return targetCase_ == TargetOneofCase.ExecutionUnit ? (string) target_ : ""; } - set { - target_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - targetCase_ = TargetOneofCase.ExecutionUnit; - } - } - - private object target_; - /// Enum of possible cases for the "target" oneof. - public enum TargetOneofCase { - None = 0, - ExecutionUnit = 1, - } - private TargetOneofCase targetCase_ = TargetOneofCase.None; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public TargetOneofCase TargetCase { - get { return targetCase_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearTarget() { - targetCase_ = TargetOneofCase.None; - target_ = null; + public KeyValueStore Clone() { + return new KeyValueStore(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { - return Equals(other as SubscriptionTarget); + return Equals(other as KeyValueStore); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(SubscriptionTarget other) { + public bool Equals(KeyValueStore other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } - if (ExecutionUnit != other.ExecutionUnit) return false; - if (TargetCase != other.TargetCase) return false; return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; - if (targetCase_ == TargetOneofCase.ExecutionUnit) hash ^= ExecutionUnit.GetHashCode(); - hash ^= (int) targetCase_; if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -3509,10 +3949,6 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else - if (targetCase_ == TargetOneofCase.ExecutionUnit) { - output.WriteRawTag(10); - output.WriteString(ExecutionUnit); - } if (_unknownFields != null) { _unknownFields.WriteTo(output); } @@ -3522,10 +3958,6 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (targetCase_ == TargetOneofCase.ExecutionUnit) { - output.WriteRawTag(10); - output.WriteString(ExecutionUnit); - } if (_unknownFields != null) { _unknownFields.WriteTo(ref output); } @@ -3535,9 +3967,6 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; - if (targetCase_ == TargetOneofCase.ExecutionUnit) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(ExecutionUnit); - } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); } @@ -3545,16 +3974,10 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(SubscriptionTarget other) { + public void MergeFrom(KeyValueStore other) { if (other == null) { return; } - switch (other.TargetCase) { - case TargetOneofCase.ExecutionUnit: - ExecutionUnit = other.ExecutionUnit; - break; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } @@ -3569,10 +3992,6 @@ public void MergeFrom(pb::CodedInputStream input) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; - case 10: { - ExecutionUnit = input.ReadString(); - break; - } } } #endif @@ -3587,10 +4006,6 @@ public void MergeFrom(pb::CodedInputStream input) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; - case 10: { - ExecutionUnit = input.ReadString(); - break; - } } } } @@ -3598,19 +4013,19 @@ public void MergeFrom(pb::CodedInputStream input) { } - public sealed partial class TopicSubscription : pb::IMessage + public sealed partial class Secret : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TopicSubscription()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Secret()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Deploy.v1.DeployReflection.Descriptor.MessageTypes[17]; } + get { return global::Nitric.Proto.Deployments.v1.DeploymentsReflection.Descriptor.MessageTypes[16]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -3619,55 +4034,41 @@ public sealed partial class TopicSubscription : pb::IMessage } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public TopicSubscription() { + public Secret() { OnConstruction(); } partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public TopicSubscription(TopicSubscription other) : this() { - target_ = other.target_ != null ? other.target_.Clone() : null; + public Secret(Secret other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public TopicSubscription Clone() { - return new TopicSubscription(this); - } - - /// Field number for the "target" field. - public const int TargetFieldNumber = 1; - private global::Nitric.Proto.Deploy.v1.SubscriptionTarget target_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Deploy.v1.SubscriptionTarget Target { - get { return target_; } - set { - target_ = value; - } + public Secret Clone() { + return new Secret(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { - return Equals(other as TopicSubscription); + return Equals(other as Secret); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(TopicSubscription other) { + public bool Equals(Secret other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } - if (!object.Equals(Target, other.Target)) return false; return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; - if (target_ != null) hash ^= Target.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -3684,10 +4085,6 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else - if (target_ != null) { - output.WriteRawTag(10); - output.WriteMessage(Target); - } if (_unknownFields != null) { _unknownFields.WriteTo(output); } @@ -3697,10 +4094,6 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (target_ != null) { - output.WriteRawTag(10); - output.WriteMessage(Target); - } if (_unknownFields != null) { _unknownFields.WriteTo(ref output); } @@ -3710,9 +4103,6 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; - if (target_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Target); - } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); } @@ -3720,16 +4110,10 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(TopicSubscription other) { + public void MergeFrom(Secret other) { if (other == null) { return; } - if (other.target_ != null) { - if (target_ == null) { - Target = new global::Nitric.Proto.Deploy.v1.SubscriptionTarget(); - } - Target.MergeFrom(other.Target); - } _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } @@ -3744,13 +4128,6 @@ public void MergeFrom(pb::CodedInputStream input) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; - case 10: { - if (target_ == null) { - Target = new global::Nitric.Proto.Deploy.v1.SubscriptionTarget(); - } - input.ReadMessage(Target); - break; - } } } #endif @@ -3765,13 +4142,6 @@ public void MergeFrom(pb::CodedInputStream input) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; - case 10: { - if (target_ == null) { - Target = new global::Nitric.Proto.Deploy.v1.SubscriptionTarget(); - } - input.ReadMessage(Target); - break; - } } } } @@ -3779,19 +4149,19 @@ public void MergeFrom(pb::CodedInputStream input) { } - public sealed partial class HttpTarget : pb::IMessage + public sealed partial class SubscriptionTarget : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new HttpTarget()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SubscriptionTarget()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Deploy.v1.DeployReflection.Descriptor.MessageTypes[18]; } + get { return global::Nitric.Proto.Deployments.v1.DeploymentsReflection.Descriptor.MessageTypes[17]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -3800,17 +4170,17 @@ public sealed partial class HttpTarget : pb::IMessage } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public HttpTarget() { + public SubscriptionTarget() { OnConstruction(); } partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public HttpTarget(HttpTarget other) : this() { + public SubscriptionTarget(SubscriptionTarget other) : this() { switch (other.TargetCase) { - case TargetOneofCase.ExecutionUnit: - ExecutionUnit = other.ExecutionUnit; + case TargetOneofCase.Service: + Service = other.Service; break; } @@ -3818,21 +4188,21 @@ public HttpTarget(HttpTarget other) : this() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public HttpTarget Clone() { - return new HttpTarget(this); + public SubscriptionTarget Clone() { + return new SubscriptionTarget(this); } - /// Field number for the "execution_unit" field. - public const int ExecutionUnitFieldNumber = 1; + /// Field number for the "service" field. + public const int ServiceFieldNumber = 1; /// - /// The name of an execution unit to target + /// The name of an service to target /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string ExecutionUnit { - get { return targetCase_ == TargetOneofCase.ExecutionUnit ? (string) target_ : ""; } + public string Service { + get { return targetCase_ == TargetOneofCase.Service ? (string) target_ : ""; } set { target_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - targetCase_ = TargetOneofCase.ExecutionUnit; + targetCase_ = TargetOneofCase.Service; } } @@ -3840,7 +4210,7 @@ public string ExecutionUnit { /// Enum of possible cases for the "target" oneof. public enum TargetOneofCase { None = 0, - ExecutionUnit = 1, + Service = 1, } private TargetOneofCase targetCase_ = TargetOneofCase.None; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -3856,18 +4226,18 @@ public void ClearTarget() { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { - return Equals(other as HttpTarget); + return Equals(other as SubscriptionTarget); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(HttpTarget other) { + public bool Equals(SubscriptionTarget other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } - if (ExecutionUnit != other.ExecutionUnit) return false; + if (Service != other.Service) return false; if (TargetCase != other.TargetCase) return false; return Equals(_unknownFields, other._unknownFields); } @@ -3875,7 +4245,7 @@ public bool Equals(HttpTarget other) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; - if (targetCase_ == TargetOneofCase.ExecutionUnit) hash ^= ExecutionUnit.GetHashCode(); + if (targetCase_ == TargetOneofCase.Service) hash ^= Service.GetHashCode(); hash ^= (int) targetCase_; if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); @@ -3893,9 +4263,9 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else - if (targetCase_ == TargetOneofCase.ExecutionUnit) { + if (targetCase_ == TargetOneofCase.Service) { output.WriteRawTag(10); - output.WriteString(ExecutionUnit); + output.WriteString(Service); } if (_unknownFields != null) { _unknownFields.WriteTo(output); @@ -3906,9 +4276,9 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (targetCase_ == TargetOneofCase.ExecutionUnit) { + if (targetCase_ == TargetOneofCase.Service) { output.WriteRawTag(10); - output.WriteString(ExecutionUnit); + output.WriteString(Service); } if (_unknownFields != null) { _unknownFields.WriteTo(ref output); @@ -3919,8 +4289,8 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; - if (targetCase_ == TargetOneofCase.ExecutionUnit) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(ExecutionUnit); + if (targetCase_ == TargetOneofCase.Service) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Service); } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); @@ -3929,13 +4299,13 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(HttpTarget other) { + public void MergeFrom(SubscriptionTarget other) { if (other == null) { return; } switch (other.TargetCase) { - case TargetOneofCase.ExecutionUnit: - ExecutionUnit = other.ExecutionUnit; + case TargetOneofCase.Service: + Service = other.Service; break; } @@ -3954,7 +4324,7 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { - ExecutionUnit = input.ReadString(); + Service = input.ReadString(); break; } } @@ -3972,7 +4342,7 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; case 10: { - ExecutionUnit = input.ReadString(); + Service = input.ReadString(); break; } } @@ -3982,22 +4352,19 @@ public void MergeFrom(pb::CodedInputStream input) { } - /// - /// A http resource - /// - public sealed partial class Http : pb::IMessage + public sealed partial class TopicSubscription : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Http()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TopicSubscription()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Deploy.v1.DeployReflection.Descriptor.MessageTypes[19]; } + get { return global::Nitric.Proto.Deployments.v1.DeploymentsReflection.Descriptor.MessageTypes[18]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -4006,28 +4373,28 @@ public sealed partial class Http : pb::IMessage } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Http() { + public TopicSubscription() { OnConstruction(); } partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Http(Http other) : this() { + public TopicSubscription(TopicSubscription other) : this() { target_ = other.target_ != null ? other.target_.Clone() : null; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Http Clone() { - return new Http(this); + public TopicSubscription Clone() { + return new TopicSubscription(this); } /// Field number for the "target" field. public const int TargetFieldNumber = 1; - private global::Nitric.Proto.Deploy.v1.HttpTarget target_; + private global::Nitric.Proto.Deployments.v1.SubscriptionTarget target_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Deploy.v1.HttpTarget Target { + public global::Nitric.Proto.Deployments.v1.SubscriptionTarget Target { get { return target_; } set { target_ = value; @@ -4036,11 +4403,11 @@ public Http Clone() { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { - return Equals(other as Http); + return Equals(other as TopicSubscription); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(Http other) { + public bool Equals(TopicSubscription other) { if (ReferenceEquals(other, null)) { return false; } @@ -4107,13 +4474,13 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(Http other) { + public void MergeFrom(TopicSubscription other) { if (other == null) { return; } if (other.target_ != null) { if (target_ == null) { - Target = new global::Nitric.Proto.Deploy.v1.HttpTarget(); + Target = new global::Nitric.Proto.Deployments.v1.SubscriptionTarget(); } Target.MergeFrom(other.Target); } @@ -4133,7 +4500,7 @@ public void MergeFrom(pb::CodedInputStream input) { break; case 10: { if (target_ == null) { - Target = new global::Nitric.Proto.Deploy.v1.HttpTarget(); + Target = new global::Nitric.Proto.Deployments.v1.SubscriptionTarget(); } input.ReadMessage(Target); break; @@ -4154,7 +4521,7 @@ public void MergeFrom(pb::CodedInputStream input) { break; case 10: { if (target_ == null) { - Target = new global::Nitric.Proto.Deploy.v1.HttpTarget(); + Target = new global::Nitric.Proto.Deployments.v1.SubscriptionTarget(); } input.ReadMessage(Target); break; @@ -4166,19 +4533,893 @@ public void MergeFrom(pb::CodedInputStream input) { } - public sealed partial class Api : pb::IMessage + public sealed partial class HttpTarget : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new HttpTarget()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Nitric.Proto.Deployments.v1.DeploymentsReflection.Descriptor.MessageTypes[19]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public HttpTarget() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public HttpTarget(HttpTarget other) : this() { + switch (other.TargetCase) { + case TargetOneofCase.Service: + Service = other.Service; + break; + } + + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public HttpTarget Clone() { + return new HttpTarget(this); + } + + /// Field number for the "service" field. + public const int ServiceFieldNumber = 1; + /// + /// The name of an service to target + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Service { + get { return targetCase_ == TargetOneofCase.Service ? (string) target_ : ""; } + set { + target_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + targetCase_ = TargetOneofCase.Service; + } + } + + private object target_; + /// Enum of possible cases for the "target" oneof. + public enum TargetOneofCase { + None = 0, + Service = 1, + } + private TargetOneofCase targetCase_ = TargetOneofCase.None; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public TargetOneofCase TargetCase { + get { return targetCase_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void ClearTarget() { + targetCase_ = TargetOneofCase.None; + target_ = null; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as HttpTarget); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(HttpTarget other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Service != other.Service) return false; + if (TargetCase != other.TargetCase) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (targetCase_ == TargetOneofCase.Service) hash ^= Service.GetHashCode(); + hash ^= (int) targetCase_; + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (targetCase_ == TargetOneofCase.Service) { + output.WriteRawTag(10); + output.WriteString(Service); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (targetCase_ == TargetOneofCase.Service) { + output.WriteRawTag(10); + output.WriteString(Service); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (targetCase_ == TargetOneofCase.Service) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Service); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(HttpTarget other) { + if (other == null) { + return; + } + switch (other.TargetCase) { + case TargetOneofCase.Service: + Service = other.Service; + break; + } + + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Service = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Service = input.ReadString(); + break; + } + } + } + } + #endif + + } + + /// + /// An http proxy resource + /// + public sealed partial class Http : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Http()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Nitric.Proto.Deployments.v1.DeploymentsReflection.Descriptor.MessageTypes[20]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Http() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Http(Http other) : this() { + target_ = other.target_ != null ? other.target_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Http Clone() { + return new Http(this); + } + + /// Field number for the "target" field. + public const int TargetFieldNumber = 1; + private global::Nitric.Proto.Deployments.v1.HttpTarget target_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Nitric.Proto.Deployments.v1.HttpTarget Target { + get { return target_; } + set { + target_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as Http); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(Http other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(Target, other.Target)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (target_ != null) hash ^= Target.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (target_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Target); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (target_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Target); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (target_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Target); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(Http other) { + if (other == null) { + return; + } + if (other.target_ != null) { + if (target_ == null) { + Target = new global::Nitric.Proto.Deployments.v1.HttpTarget(); + } + Target.MergeFrom(other.Target); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (target_ == null) { + Target = new global::Nitric.Proto.Deployments.v1.HttpTarget(); + } + input.ReadMessage(Target); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (target_ == null) { + Target = new global::Nitric.Proto.Deployments.v1.HttpTarget(); + } + input.ReadMessage(Target); + break; + } + } + } + } + #endif + + } + + public sealed partial class Api : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Api()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Nitric.Proto.Deployments.v1.DeploymentsReflection.Descriptor.MessageTypes[21]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Api() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Api(Api other) : this() { + switch (other.DocumentCase) { + case DocumentOneofCase.Openapi: + Openapi = other.Openapi; + break; + } + + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Api Clone() { + return new Api(this); + } + + /// Field number for the "openapi" field. + public const int OpenapiFieldNumber = 1; + /// + /// An OpenAPI document for deployment + /// This document will contain extensions that hint of services that should be targeted as part of the deployment + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Openapi { + get { return documentCase_ == DocumentOneofCase.Openapi ? (string) document_ : ""; } + set { + document_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + documentCase_ = DocumentOneofCase.Openapi; + } + } + + private object document_; + /// Enum of possible cases for the "document" oneof. + public enum DocumentOneofCase { + None = 0, + Openapi = 1, + } + private DocumentOneofCase documentCase_ = DocumentOneofCase.None; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public DocumentOneofCase DocumentCase { + get { return documentCase_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void ClearDocument() { + documentCase_ = DocumentOneofCase.None; + document_ = null; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as Api); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(Api other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Openapi != other.Openapi) return false; + if (DocumentCase != other.DocumentCase) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (documentCase_ == DocumentOneofCase.Openapi) hash ^= Openapi.GetHashCode(); + hash ^= (int) documentCase_; + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (documentCase_ == DocumentOneofCase.Openapi) { + output.WriteRawTag(10); + output.WriteString(Openapi); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (documentCase_ == DocumentOneofCase.Openapi) { + output.WriteRawTag(10); + output.WriteString(Openapi); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (documentCase_ == DocumentOneofCase.Openapi) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Openapi); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(Api other) { + if (other == null) { + return; + } + switch (other.DocumentCase) { + case DocumentOneofCase.Openapi: + Openapi = other.Openapi; + break; + } + + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Openapi = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Openapi = input.ReadString(); + break; + } + } + } + } + #endif + + } + + /// + /// Declare a new websocket + /// + public sealed partial class Websocket : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Websocket()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Nitric.Proto.Deployments.v1.DeploymentsReflection.Descriptor.MessageTypes[22]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Websocket() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Websocket(Websocket other) : this() { + connectTarget_ = other.connectTarget_ != null ? other.connectTarget_.Clone() : null; + disconnectTarget_ = other.disconnectTarget_ != null ? other.disconnectTarget_.Clone() : null; + messageTarget_ = other.messageTarget_ != null ? other.messageTarget_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Websocket Clone() { + return new Websocket(this); + } + + /// Field number for the "connect_target" field. + public const int ConnectTargetFieldNumber = 1; + private global::Nitric.Proto.Deployments.v1.WebsocketTarget connectTarget_; + /// + /// Target for handling new client connections + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Nitric.Proto.Deployments.v1.WebsocketTarget ConnectTarget { + get { return connectTarget_; } + set { + connectTarget_ = value; + } + } + + /// Field number for the "disconnect_target" field. + public const int DisconnectTargetFieldNumber = 2; + private global::Nitric.Proto.Deployments.v1.WebsocketTarget disconnectTarget_; + /// + /// Target for handling client disconnections + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Nitric.Proto.Deployments.v1.WebsocketTarget DisconnectTarget { + get { return disconnectTarget_; } + set { + disconnectTarget_ = value; + } + } + + /// Field number for the "message_target" field. + public const int MessageTargetFieldNumber = 3; + private global::Nitric.Proto.Deployments.v1.WebsocketTarget messageTarget_; + /// + /// Target for handling all other message types + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Nitric.Proto.Deployments.v1.WebsocketTarget MessageTarget { + get { return messageTarget_; } + set { + messageTarget_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as Websocket); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(Websocket other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(ConnectTarget, other.ConnectTarget)) return false; + if (!object.Equals(DisconnectTarget, other.DisconnectTarget)) return false; + if (!object.Equals(MessageTarget, other.MessageTarget)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (connectTarget_ != null) hash ^= ConnectTarget.GetHashCode(); + if (disconnectTarget_ != null) hash ^= DisconnectTarget.GetHashCode(); + if (messageTarget_ != null) hash ^= MessageTarget.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (connectTarget_ != null) { + output.WriteRawTag(10); + output.WriteMessage(ConnectTarget); + } + if (disconnectTarget_ != null) { + output.WriteRawTag(18); + output.WriteMessage(DisconnectTarget); + } + if (messageTarget_ != null) { + output.WriteRawTag(26); + output.WriteMessage(MessageTarget); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (connectTarget_ != null) { + output.WriteRawTag(10); + output.WriteMessage(ConnectTarget); + } + if (disconnectTarget_ != null) { + output.WriteRawTag(18); + output.WriteMessage(DisconnectTarget); + } + if (messageTarget_ != null) { + output.WriteRawTag(26); + output.WriteMessage(MessageTarget); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (connectTarget_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(ConnectTarget); + } + if (disconnectTarget_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(DisconnectTarget); + } + if (messageTarget_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(MessageTarget); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(Websocket other) { + if (other == null) { + return; + } + if (other.connectTarget_ != null) { + if (connectTarget_ == null) { + ConnectTarget = new global::Nitric.Proto.Deployments.v1.WebsocketTarget(); + } + ConnectTarget.MergeFrom(other.ConnectTarget); + } + if (other.disconnectTarget_ != null) { + if (disconnectTarget_ == null) { + DisconnectTarget = new global::Nitric.Proto.Deployments.v1.WebsocketTarget(); + } + DisconnectTarget.MergeFrom(other.DisconnectTarget); + } + if (other.messageTarget_ != null) { + if (messageTarget_ == null) { + MessageTarget = new global::Nitric.Proto.Deployments.v1.WebsocketTarget(); + } + MessageTarget.MergeFrom(other.MessageTarget); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (connectTarget_ == null) { + ConnectTarget = new global::Nitric.Proto.Deployments.v1.WebsocketTarget(); + } + input.ReadMessage(ConnectTarget); + break; + } + case 18: { + if (disconnectTarget_ == null) { + DisconnectTarget = new global::Nitric.Proto.Deployments.v1.WebsocketTarget(); + } + input.ReadMessage(DisconnectTarget); + break; + } + case 26: { + if (messageTarget_ == null) { + MessageTarget = new global::Nitric.Proto.Deployments.v1.WebsocketTarget(); + } + input.ReadMessage(MessageTarget); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (connectTarget_ == null) { + ConnectTarget = new global::Nitric.Proto.Deployments.v1.WebsocketTarget(); + } + input.ReadMessage(ConnectTarget); + break; + } + case 18: { + if (disconnectTarget_ == null) { + DisconnectTarget = new global::Nitric.Proto.Deployments.v1.WebsocketTarget(); + } + input.ReadMessage(DisconnectTarget); + break; + } + case 26: { + if (messageTarget_ == null) { + MessageTarget = new global::Nitric.Proto.Deployments.v1.WebsocketTarget(); + } + input.ReadMessage(MessageTarget); + break; + } + } + } + } + #endif + + } + + public sealed partial class WebsocketTarget : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Api()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new WebsocketTarget()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Deploy.v1.DeployReflection.Descriptor.MessageTypes[20]; } + get { return global::Nitric.Proto.Deployments.v1.DeploymentsReflection.Descriptor.MessageTypes[23]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -4187,17 +5428,17 @@ public sealed partial class Api : pb::IMessage } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Api() { + public WebsocketTarget() { OnConstruction(); } partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Api(Api other) : this() { - switch (other.DocumentCase) { - case DocumentOneofCase.Openapi: - Openapi = other.Openapi; + public WebsocketTarget(WebsocketTarget other) : this() { + switch (other.TargetCase) { + case TargetOneofCase.Service: + Service = other.Service; break; } @@ -4205,66 +5446,268 @@ public Api(Api other) : this() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Api Clone() { - return new Api(this); + public WebsocketTarget Clone() { + return new WebsocketTarget(this); } - /// Field number for the "openapi" field. - public const int OpenapiFieldNumber = 1; + /// Field number for the "service" field. + public const int ServiceFieldNumber = 1; /// - /// An OpenAPI document for deployment - /// This document will contain extensions that hint of execution units that should be targeted as part of the deployment + /// The name of an service to target /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string Openapi { - get { return documentCase_ == DocumentOneofCase.Openapi ? (string) document_ : ""; } + public string Service { + get { return targetCase_ == TargetOneofCase.Service ? (string) target_ : ""; } set { - document_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - documentCase_ = DocumentOneofCase.Openapi; + target_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + targetCase_ = TargetOneofCase.Service; } } - private object document_; - /// Enum of possible cases for the "document" oneof. - public enum DocumentOneofCase { + private object target_; + /// Enum of possible cases for the "target" oneof. + public enum TargetOneofCase { None = 0, - Openapi = 1, + Service = 1, } - private DocumentOneofCase documentCase_ = DocumentOneofCase.None; + private TargetOneofCase targetCase_ = TargetOneofCase.None; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public DocumentOneofCase DocumentCase { - get { return documentCase_; } + public TargetOneofCase TargetCase { + get { return targetCase_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearDocument() { - documentCase_ = DocumentOneofCase.None; - document_ = null; + public void ClearTarget() { + targetCase_ = TargetOneofCase.None; + target_ = null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { - return Equals(other as Api); + return Equals(other as WebsocketTarget); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(Api other) { + public bool Equals(WebsocketTarget other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Service != other.Service) return false; + if (TargetCase != other.TargetCase) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (targetCase_ == TargetOneofCase.Service) hash ^= Service.GetHashCode(); + hash ^= (int) targetCase_; + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (targetCase_ == TargetOneofCase.Service) { + output.WriteRawTag(10); + output.WriteString(Service); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (targetCase_ == TargetOneofCase.Service) { + output.WriteRawTag(10); + output.WriteString(Service); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (targetCase_ == TargetOneofCase.Service) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Service); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(WebsocketTarget other) { + if (other == null) { + return; + } + switch (other.TargetCase) { + case TargetOneofCase.Service: + Service = other.Service; + break; + } + + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Service = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Service = input.ReadString(); + break; + } + } + } + } + #endif + + } + + public sealed partial class ScheduleTarget : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ScheduleTarget()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Nitric.Proto.Deployments.v1.DeploymentsReflection.Descriptor.MessageTypes[24]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ScheduleTarget() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ScheduleTarget(ScheduleTarget other) : this() { + switch (other.TargetCase) { + case TargetOneofCase.Service: + Service = other.Service; + break; + } + + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ScheduleTarget Clone() { + return new ScheduleTarget(this); + } + + /// Field number for the "service" field. + public const int ServiceFieldNumber = 1; + /// + /// The name of an service to target + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Service { + get { return targetCase_ == TargetOneofCase.Service ? (string) target_ : ""; } + set { + target_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + targetCase_ = TargetOneofCase.Service; + } + } + + private object target_; + /// Enum of possible cases for the "target" oneof. + public enum TargetOneofCase { + None = 0, + Service = 1, + } + private TargetOneofCase targetCase_ = TargetOneofCase.None; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public TargetOneofCase TargetCase { + get { return targetCase_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void ClearTarget() { + targetCase_ = TargetOneofCase.None; + target_ = null; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as ScheduleTarget); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ScheduleTarget other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } - if (Openapi != other.Openapi) return false; - if (DocumentCase != other.DocumentCase) return false; + if (Service != other.Service) return false; + if (TargetCase != other.TargetCase) return false; return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; - if (documentCase_ == DocumentOneofCase.Openapi) hash ^= Openapi.GetHashCode(); - hash ^= (int) documentCase_; + if (targetCase_ == TargetOneofCase.Service) hash ^= Service.GetHashCode(); + hash ^= (int) targetCase_; if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -4281,9 +5724,9 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else - if (documentCase_ == DocumentOneofCase.Openapi) { + if (targetCase_ == TargetOneofCase.Service) { output.WriteRawTag(10); - output.WriteString(Openapi); + output.WriteString(Service); } if (_unknownFields != null) { _unknownFields.WriteTo(output); @@ -4294,9 +5737,9 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (documentCase_ == DocumentOneofCase.Openapi) { + if (targetCase_ == TargetOneofCase.Service) { output.WriteRawTag(10); - output.WriteString(Openapi); + output.WriteString(Service); } if (_unknownFields != null) { _unknownFields.WriteTo(ref output); @@ -4307,8 +5750,8 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; - if (documentCase_ == DocumentOneofCase.Openapi) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Openapi); + if (targetCase_ == TargetOneofCase.Service) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Service); } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); @@ -4317,13 +5760,13 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(Api other) { + public void MergeFrom(ScheduleTarget other) { if (other == null) { return; } - switch (other.DocumentCase) { - case DocumentOneofCase.Openapi: - Openapi = other.Openapi; + switch (other.TargetCase) { + case TargetOneofCase.Service: + Service = other.Service; break; } @@ -4342,7 +5785,7 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { - Openapi = input.ReadString(); + Service = input.ReadString(); break; } } @@ -4360,7 +5803,7 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; case 10: { - Openapi = input.ReadString(); + Service = input.ReadString(); break; } } @@ -4370,22 +5813,19 @@ public void MergeFrom(pb::CodedInputStream input) { } - /// - /// Declare a new websocket - /// - public sealed partial class Websocket : pb::IMessage + public sealed partial class Schedule : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Websocket()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Schedule()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Deploy.v1.DeployReflection.Descriptor.MessageTypes[21]; } + get { return global::Nitric.Proto.Deployments.v1.DeploymentsReflection.Descriptor.MessageTypes[25]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -4394,92 +5834,111 @@ public sealed partial class Websocket : pb::IMessage } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Websocket() { + public Schedule() { OnConstruction(); } partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Websocket(Websocket other) : this() { - connectTarget_ = other.connectTarget_ != null ? other.connectTarget_.Clone() : null; - disconnectTarget_ = other.disconnectTarget_ != null ? other.disconnectTarget_.Clone() : null; - messageTarget_ = other.messageTarget_ != null ? other.messageTarget_.Clone() : null; + public Schedule(Schedule other) : this() { + target_ = other.target_ != null ? other.target_.Clone() : null; + switch (other.CadenceCase) { + case CadenceOneofCase.Every: + Every = other.Every.Clone(); + break; + case CadenceOneofCase.Cron: + Cron = other.Cron.Clone(); + break; + } + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Websocket Clone() { - return new Websocket(this); + public Schedule Clone() { + return new Schedule(this); } - /// Field number for the "connect_target" field. - public const int ConnectTargetFieldNumber = 1; - private global::Nitric.Proto.Deploy.v1.WebsocketTarget connectTarget_; - /// - /// Target for handling new client connections - /// + /// Field number for the "target" field. + public const int TargetFieldNumber = 1; + private global::Nitric.Proto.Deployments.v1.ScheduleTarget target_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Deploy.v1.WebsocketTarget ConnectTarget { - get { return connectTarget_; } + public global::Nitric.Proto.Deployments.v1.ScheduleTarget Target { + get { return target_; } set { - connectTarget_ = value; + target_ = value; } } - /// Field number for the "disconnect_target" field. - public const int DisconnectTargetFieldNumber = 2; - private global::Nitric.Proto.Deploy.v1.WebsocketTarget disconnectTarget_; - /// - /// Target for handling client disconnections - /// + /// Field number for the "every" field. + public const int EveryFieldNumber = 10; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Deploy.v1.WebsocketTarget DisconnectTarget { - get { return disconnectTarget_; } + public global::Nitric.Proto.Deployments.v1.ScheduleEvery Every { + get { return cadenceCase_ == CadenceOneofCase.Every ? (global::Nitric.Proto.Deployments.v1.ScheduleEvery) cadence_ : null; } set { - disconnectTarget_ = value; + cadence_ = value; + cadenceCase_ = value == null ? CadenceOneofCase.None : CadenceOneofCase.Every; } } - /// Field number for the "message_target" field. - public const int MessageTargetFieldNumber = 3; - private global::Nitric.Proto.Deploy.v1.WebsocketTarget messageTarget_; - /// - /// Target for handling all other message types - /// + /// Field number for the "cron" field. + public const int CronFieldNumber = 11; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Deploy.v1.WebsocketTarget MessageTarget { - get { return messageTarget_; } + public global::Nitric.Proto.Deployments.v1.ScheduleCron Cron { + get { return cadenceCase_ == CadenceOneofCase.Cron ? (global::Nitric.Proto.Deployments.v1.ScheduleCron) cadence_ : null; } set { - messageTarget_ = value; + cadence_ = value; + cadenceCase_ = value == null ? CadenceOneofCase.None : CadenceOneofCase.Cron; } } + private object cadence_; + /// Enum of possible cases for the "cadence" oneof. + public enum CadenceOneofCase { + None = 0, + Every = 10, + Cron = 11, + } + private CadenceOneofCase cadenceCase_ = CadenceOneofCase.None; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CadenceOneofCase CadenceCase { + get { return cadenceCase_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void ClearCadence() { + cadenceCase_ = CadenceOneofCase.None; + cadence_ = null; + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { - return Equals(other as Websocket); + return Equals(other as Schedule); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(Websocket other) { + public bool Equals(Schedule other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } - if (!object.Equals(ConnectTarget, other.ConnectTarget)) return false; - if (!object.Equals(DisconnectTarget, other.DisconnectTarget)) return false; - if (!object.Equals(MessageTarget, other.MessageTarget)) return false; + if (!object.Equals(Target, other.Target)) return false; + if (!object.Equals(Every, other.Every)) return false; + if (!object.Equals(Cron, other.Cron)) return false; + if (CadenceCase != other.CadenceCase) return false; return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; - if (connectTarget_ != null) hash ^= ConnectTarget.GetHashCode(); - if (disconnectTarget_ != null) hash ^= DisconnectTarget.GetHashCode(); - if (messageTarget_ != null) hash ^= MessageTarget.GetHashCode(); + if (target_ != null) hash ^= Target.GetHashCode(); + if (cadenceCase_ == CadenceOneofCase.Every) hash ^= Every.GetHashCode(); + if (cadenceCase_ == CadenceOneofCase.Cron) hash ^= Cron.GetHashCode(); + hash ^= (int) cadenceCase_; if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -4496,17 +5955,17 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else - if (connectTarget_ != null) { + if (target_ != null) { output.WriteRawTag(10); - output.WriteMessage(ConnectTarget); + output.WriteMessage(Target); } - if (disconnectTarget_ != null) { - output.WriteRawTag(18); - output.WriteMessage(DisconnectTarget); + if (cadenceCase_ == CadenceOneofCase.Every) { + output.WriteRawTag(82); + output.WriteMessage(Every); } - if (messageTarget_ != null) { - output.WriteRawTag(26); - output.WriteMessage(MessageTarget); + if (cadenceCase_ == CadenceOneofCase.Cron) { + output.WriteRawTag(90); + output.WriteMessage(Cron); } if (_unknownFields != null) { _unknownFields.WriteTo(output); @@ -4517,17 +5976,17 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (connectTarget_ != null) { + if (target_ != null) { output.WriteRawTag(10); - output.WriteMessage(ConnectTarget); + output.WriteMessage(Target); } - if (disconnectTarget_ != null) { - output.WriteRawTag(18); - output.WriteMessage(DisconnectTarget); + if (cadenceCase_ == CadenceOneofCase.Every) { + output.WriteRawTag(82); + output.WriteMessage(Every); } - if (messageTarget_ != null) { - output.WriteRawTag(26); - output.WriteMessage(MessageTarget); + if (cadenceCase_ == CadenceOneofCase.Cron) { + output.WriteRawTag(90); + output.WriteMessage(Cron); } if (_unknownFields != null) { _unknownFields.WriteTo(ref output); @@ -4538,14 +5997,14 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; - if (connectTarget_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(ConnectTarget); + if (target_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Target); } - if (disconnectTarget_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(DisconnectTarget); + if (cadenceCase_ == CadenceOneofCase.Every) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Every); } - if (messageTarget_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(MessageTarget); + if (cadenceCase_ == CadenceOneofCase.Cron) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Cron); } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); @@ -4554,28 +6013,31 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(Websocket other) { + public void MergeFrom(Schedule other) { if (other == null) { return; } - if (other.connectTarget_ != null) { - if (connectTarget_ == null) { - ConnectTarget = new global::Nitric.Proto.Deploy.v1.WebsocketTarget(); - } - ConnectTarget.MergeFrom(other.ConnectTarget); - } - if (other.disconnectTarget_ != null) { - if (disconnectTarget_ == null) { - DisconnectTarget = new global::Nitric.Proto.Deploy.v1.WebsocketTarget(); + if (other.target_ != null) { + if (target_ == null) { + Target = new global::Nitric.Proto.Deployments.v1.ScheduleTarget(); } - DisconnectTarget.MergeFrom(other.DisconnectTarget); + Target.MergeFrom(other.Target); } - if (other.messageTarget_ != null) { - if (messageTarget_ == null) { - MessageTarget = new global::Nitric.Proto.Deploy.v1.WebsocketTarget(); - } - MessageTarget.MergeFrom(other.MessageTarget); + switch (other.CadenceCase) { + case CadenceOneofCase.Every: + if (Every == null) { + Every = new global::Nitric.Proto.Deployments.v1.ScheduleEvery(); + } + Every.MergeFrom(other.Every); + break; + case CadenceOneofCase.Cron: + if (Cron == null) { + Cron = new global::Nitric.Proto.Deployments.v1.ScheduleCron(); + } + Cron.MergeFrom(other.Cron); + break; } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } @@ -4591,24 +6053,28 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { - if (connectTarget_ == null) { - ConnectTarget = new global::Nitric.Proto.Deploy.v1.WebsocketTarget(); + if (target_ == null) { + Target = new global::Nitric.Proto.Deployments.v1.ScheduleTarget(); } - input.ReadMessage(ConnectTarget); + input.ReadMessage(Target); break; } - case 18: { - if (disconnectTarget_ == null) { - DisconnectTarget = new global::Nitric.Proto.Deploy.v1.WebsocketTarget(); + case 82: { + global::Nitric.Proto.Deployments.v1.ScheduleEvery subBuilder = new global::Nitric.Proto.Deployments.v1.ScheduleEvery(); + if (cadenceCase_ == CadenceOneofCase.Every) { + subBuilder.MergeFrom(Every); } - input.ReadMessage(DisconnectTarget); + input.ReadMessage(subBuilder); + Every = subBuilder; break; } - case 26: { - if (messageTarget_ == null) { - MessageTarget = new global::Nitric.Proto.Deploy.v1.WebsocketTarget(); + case 90: { + global::Nitric.Proto.Deployments.v1.ScheduleCron subBuilder = new global::Nitric.Proto.Deployments.v1.ScheduleCron(); + if (cadenceCase_ == CadenceOneofCase.Cron) { + subBuilder.MergeFrom(Cron); } - input.ReadMessage(MessageTarget); + input.ReadMessage(subBuilder); + Cron = subBuilder; break; } } @@ -4626,24 +6092,28 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; case 10: { - if (connectTarget_ == null) { - ConnectTarget = new global::Nitric.Proto.Deploy.v1.WebsocketTarget(); + if (target_ == null) { + Target = new global::Nitric.Proto.Deployments.v1.ScheduleTarget(); } - input.ReadMessage(ConnectTarget); + input.ReadMessage(Target); break; } - case 18: { - if (disconnectTarget_ == null) { - DisconnectTarget = new global::Nitric.Proto.Deploy.v1.WebsocketTarget(); + case 82: { + global::Nitric.Proto.Deployments.v1.ScheduleEvery subBuilder = new global::Nitric.Proto.Deployments.v1.ScheduleEvery(); + if (cadenceCase_ == CadenceOneofCase.Every) { + subBuilder.MergeFrom(Every); } - input.ReadMessage(DisconnectTarget); + input.ReadMessage(subBuilder); + Every = subBuilder; break; } - case 26: { - if (messageTarget_ == null) { - MessageTarget = new global::Nitric.Proto.Deploy.v1.WebsocketTarget(); + case 90: { + global::Nitric.Proto.Deployments.v1.ScheduleCron subBuilder = new global::Nitric.Proto.Deployments.v1.ScheduleCron(); + if (cadenceCase_ == CadenceOneofCase.Cron) { + subBuilder.MergeFrom(Cron); } - input.ReadMessage(MessageTarget); + input.ReadMessage(subBuilder); + Cron = subBuilder; break; } } @@ -4653,19 +6123,19 @@ public void MergeFrom(pb::CodedInputStream input) { } - public sealed partial class WebsocketTarget : pb::IMessage + public sealed partial class SqlDatabase : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new WebsocketTarget()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SqlDatabase()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Deploy.v1.DeployReflection.Descriptor.MessageTypes[22]; } + get { return global::Nitric.Proto.Deployments.v1.DeploymentsReflection.Descriptor.MessageTypes[26]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -4674,17 +6144,17 @@ public sealed partial class WebsocketTarget : pb::IMessage } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public WebsocketTarget() { + public SqlDatabase() { OnConstruction(); } partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public WebsocketTarget(WebsocketTarget other) : this() { - switch (other.TargetCase) { - case TargetOneofCase.ExecutionUnit: - ExecutionUnit = other.ExecutionUnit; + public SqlDatabase(SqlDatabase other) : this() { + switch (other.MigrationsCase) { + case MigrationsOneofCase.ImageUri: + ImageUri = other.ImageUri; break; } @@ -4692,65 +6162,65 @@ public WebsocketTarget(WebsocketTarget other) : this() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public WebsocketTarget Clone() { - return new WebsocketTarget(this); + public SqlDatabase Clone() { + return new SqlDatabase(this); } - /// Field number for the "execution_unit" field. - public const int ExecutionUnitFieldNumber = 1; + /// Field number for the "image_uri" field. + public const int ImageUriFieldNumber = 1; /// - /// The name of an execution unit to target + /// The URI of a docker image to use to execute the migrations for this database /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string ExecutionUnit { - get { return targetCase_ == TargetOneofCase.ExecutionUnit ? (string) target_ : ""; } + public string ImageUri { + get { return migrationsCase_ == MigrationsOneofCase.ImageUri ? (string) migrations_ : ""; } set { - target_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - targetCase_ = TargetOneofCase.ExecutionUnit; + migrations_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + migrationsCase_ = MigrationsOneofCase.ImageUri; } } - private object target_; - /// Enum of possible cases for the "target" oneof. - public enum TargetOneofCase { + private object migrations_; + /// Enum of possible cases for the "migrations" oneof. + public enum MigrationsOneofCase { None = 0, - ExecutionUnit = 1, + ImageUri = 1, } - private TargetOneofCase targetCase_ = TargetOneofCase.None; + private MigrationsOneofCase migrationsCase_ = MigrationsOneofCase.None; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public TargetOneofCase TargetCase { - get { return targetCase_; } + public MigrationsOneofCase MigrationsCase { + get { return migrationsCase_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearTarget() { - targetCase_ = TargetOneofCase.None; - target_ = null; + public void ClearMigrations() { + migrationsCase_ = MigrationsOneofCase.None; + migrations_ = null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { - return Equals(other as WebsocketTarget); + return Equals(other as SqlDatabase); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(WebsocketTarget other) { + public bool Equals(SqlDatabase other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } - if (ExecutionUnit != other.ExecutionUnit) return false; - if (TargetCase != other.TargetCase) return false; + if (ImageUri != other.ImageUri) return false; + if (MigrationsCase != other.MigrationsCase) return false; return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; - if (targetCase_ == TargetOneofCase.ExecutionUnit) hash ^= ExecutionUnit.GetHashCode(); - hash ^= (int) targetCase_; + if (migrationsCase_ == MigrationsOneofCase.ImageUri) hash ^= ImageUri.GetHashCode(); + hash ^= (int) migrationsCase_; if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -4767,9 +6237,9 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else - if (targetCase_ == TargetOneofCase.ExecutionUnit) { + if (migrationsCase_ == MigrationsOneofCase.ImageUri) { output.WriteRawTag(10); - output.WriteString(ExecutionUnit); + output.WriteString(ImageUri); } if (_unknownFields != null) { _unknownFields.WriteTo(output); @@ -4780,9 +6250,9 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (targetCase_ == TargetOneofCase.ExecutionUnit) { + if (migrationsCase_ == MigrationsOneofCase.ImageUri) { output.WriteRawTag(10); - output.WriteString(ExecutionUnit); + output.WriteString(ImageUri); } if (_unknownFields != null) { _unknownFields.WriteTo(ref output); @@ -4793,8 +6263,8 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; - if (targetCase_ == TargetOneofCase.ExecutionUnit) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(ExecutionUnit); + if (migrationsCase_ == MigrationsOneofCase.ImageUri) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(ImageUri); } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); @@ -4803,13 +6273,13 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(WebsocketTarget other) { + public void MergeFrom(SqlDatabase other) { if (other == null) { return; } - switch (other.TargetCase) { - case TargetOneofCase.ExecutionUnit: - ExecutionUnit = other.ExecutionUnit; + switch (other.MigrationsCase) { + case MigrationsOneofCase.ImageUri: + ImageUri = other.ImageUri; break; } @@ -4828,7 +6298,7 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { - ExecutionUnit = input.ReadString(); + ImageUri = input.ReadString(); break; } } @@ -4846,7 +6316,7 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; case 10: { - ExecutionUnit = input.ReadString(); + ImageUri = input.ReadString(); break; } } @@ -4856,19 +6326,19 @@ public void MergeFrom(pb::CodedInputStream input) { } - public sealed partial class ScheduleTarget : pb::IMessage + public sealed partial class ScheduleEvery : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ScheduleTarget()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ScheduleEvery()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Deploy.v1.DeployReflection.Descriptor.MessageTypes[23]; } + get { return global::Nitric.Proto.Deployments.v1.DeploymentsReflection.Descriptor.MessageTypes[27]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -4877,83 +6347,58 @@ public sealed partial class ScheduleTarget : pb::IMessage } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ScheduleTarget() { + public ScheduleEvery() { OnConstruction(); } partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ScheduleTarget(ScheduleTarget other) : this() { - switch (other.TargetCase) { - case TargetOneofCase.ExecutionUnit: - ExecutionUnit = other.ExecutionUnit; - break; - } - + public ScheduleEvery(ScheduleEvery other) : this() { + rate_ = other.rate_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ScheduleTarget Clone() { - return new ScheduleTarget(this); + public ScheduleEvery Clone() { + return new ScheduleEvery(this); } - /// Field number for the "execution_unit" field. - public const int ExecutionUnitFieldNumber = 1; + /// Field number for the "rate" field. + public const int RateFieldNumber = 1; + private string rate_ = ""; /// - /// The name of an execution unit to target + /// rate string e.g. '5 minutes'. Value frequencies are 'minutes', 'hours', 'days'. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string ExecutionUnit { - get { return targetCase_ == TargetOneofCase.ExecutionUnit ? (string) target_ : ""; } + public string Rate { + get { return rate_; } set { - target_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - targetCase_ = TargetOneofCase.ExecutionUnit; + rate_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); } } - private object target_; - /// Enum of possible cases for the "target" oneof. - public enum TargetOneofCase { - None = 0, - ExecutionUnit = 1, - } - private TargetOneofCase targetCase_ = TargetOneofCase.None; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public TargetOneofCase TargetCase { - get { return targetCase_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearTarget() { - targetCase_ = TargetOneofCase.None; - target_ = null; - } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { - return Equals(other as ScheduleTarget); + return Equals(other as ScheduleEvery); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(ScheduleTarget other) { + public bool Equals(ScheduleEvery other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } - if (ExecutionUnit != other.ExecutionUnit) return false; - if (TargetCase != other.TargetCase) return false; + if (Rate != other.Rate) return false; return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; - if (targetCase_ == TargetOneofCase.ExecutionUnit) hash ^= ExecutionUnit.GetHashCode(); - hash ^= (int) targetCase_; + if (Rate.Length != 0) hash ^= Rate.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -4970,9 +6415,9 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else - if (targetCase_ == TargetOneofCase.ExecutionUnit) { + if (Rate.Length != 0) { output.WriteRawTag(10); - output.WriteString(ExecutionUnit); + output.WriteString(Rate); } if (_unknownFields != null) { _unknownFields.WriteTo(output); @@ -4983,9 +6428,9 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (targetCase_ == TargetOneofCase.ExecutionUnit) { + if (Rate.Length != 0) { output.WriteRawTag(10); - output.WriteString(ExecutionUnit); + output.WriteString(Rate); } if (_unknownFields != null) { _unknownFields.WriteTo(ref output); @@ -4996,8 +6441,8 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; - if (targetCase_ == TargetOneofCase.ExecutionUnit) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(ExecutionUnit); + if (Rate.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Rate); } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); @@ -5006,16 +6451,13 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(ScheduleTarget other) { + public void MergeFrom(ScheduleEvery other) { if (other == null) { return; } - switch (other.TargetCase) { - case TargetOneofCase.ExecutionUnit: - ExecutionUnit = other.ExecutionUnit; - break; + if (other.Rate.Length != 0) { + Rate = other.Rate; } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } @@ -5031,7 +6473,7 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { - ExecutionUnit = input.ReadString(); + Rate = input.ReadString(); break; } } @@ -5049,7 +6491,7 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; case 10: { - ExecutionUnit = input.ReadString(); + Rate = input.ReadString(); break; } } @@ -5059,19 +6501,19 @@ public void MergeFrom(pb::CodedInputStream input) { } - public sealed partial class Schedule : pb::IMessage + public sealed partial class ScheduleCron : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Schedule()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ScheduleCron()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Deploy.v1.DeployReflection.Descriptor.MessageTypes[24]; } + get { return global::Nitric.Proto.Deployments.v1.DeploymentsReflection.Descriptor.MessageTypes[28]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -5080,69 +6522,58 @@ public sealed partial class Schedule : pb::IMessage } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Schedule() { + public ScheduleCron() { OnConstruction(); } partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Schedule(Schedule other) : this() { - cron_ = other.cron_; - target_ = other.target_ != null ? other.target_.Clone() : null; + public ScheduleCron(ScheduleCron other) : this() { + expression_ = other.expression_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Schedule Clone() { - return new Schedule(this); - } - - /// Field number for the "cron" field. - public const int CronFieldNumber = 1; - private string cron_ = ""; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string Cron { - get { return cron_; } - set { - cron_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } + public ScheduleCron Clone() { + return new ScheduleCron(this); } - /// Field number for the "target" field. - public const int TargetFieldNumber = 2; - private global::Nitric.Proto.Deploy.v1.ScheduleTarget target_; + /// Field number for the "expression" field. + public const int ExpressionFieldNumber = 1; + private string expression_ = ""; + /// + /// standard unix cron expression + /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Deploy.v1.ScheduleTarget Target { - get { return target_; } + public string Expression { + get { return expression_; } set { - target_ = value; + expression_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { - return Equals(other as Schedule); + return Equals(other as ScheduleCron); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(Schedule other) { + public bool Equals(ScheduleCron other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } - if (Cron != other.Cron) return false; - if (!object.Equals(Target, other.Target)) return false; + if (Expression != other.Expression) return false; return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; - if (Cron.Length != 0) hash ^= Cron.GetHashCode(); - if (target_ != null) hash ^= Target.GetHashCode(); + if (Expression.Length != 0) hash ^= Expression.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -5159,13 +6590,9 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else - if (Cron.Length != 0) { + if (Expression.Length != 0) { output.WriteRawTag(10); - output.WriteString(Cron); - } - if (target_ != null) { - output.WriteRawTag(18); - output.WriteMessage(Target); + output.WriteString(Expression); } if (_unknownFields != null) { _unknownFields.WriteTo(output); @@ -5176,13 +6603,9 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (Cron.Length != 0) { + if (Expression.Length != 0) { output.WriteRawTag(10); - output.WriteString(Cron); - } - if (target_ != null) { - output.WriteRawTag(18); - output.WriteMessage(Target); + output.WriteString(Expression); } if (_unknownFields != null) { _unknownFields.WriteTo(ref output); @@ -5193,11 +6616,8 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; - if (Cron.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Cron); - } - if (target_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Target); + if (Expression.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Expression); } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); @@ -5206,18 +6626,12 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(Schedule other) { + public void MergeFrom(ScheduleCron other) { if (other == null) { return; } - if (other.Cron.Length != 0) { - Cron = other.Cron; - } - if (other.target_ != null) { - if (target_ == null) { - Target = new global::Nitric.Proto.Deploy.v1.ScheduleTarget(); - } - Target.MergeFrom(other.Target); + if (other.Expression.Length != 0) { + Expression = other.Expression; } _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } @@ -5234,14 +6648,7 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { - Cron = input.ReadString(); - break; - } - case 18: { - if (target_ == null) { - Target = new global::Nitric.Proto.Deploy.v1.ScheduleTarget(); - } - input.ReadMessage(Target); + Expression = input.ReadString(); break; } } @@ -5259,14 +6666,7 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; case 10: { - Cron = input.ReadString(); - break; - } - case 18: { - if (target_ == null) { - Target = new global::Nitric.Proto.Deploy.v1.ScheduleTarget(); - } - input.ReadMessage(Target); + Expression = input.ReadString(); break; } } @@ -5288,7 +6688,7 @@ public sealed partial class Resource : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Deploy.v1.DeployReflection.Descriptor.MessageTypes[25]; } + get { return global::Nitric.Proto.Deployments.v1.DeploymentsReflection.Descriptor.MessageTypes[29]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -5305,11 +6705,10 @@ public Resource() { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public Resource(Resource other) : this() { - name_ = other.name_; - type_ = other.type_; + id_ = other.id_ != null ? other.id_.Clone() : null; switch (other.ConfigCase) { - case ConfigOneofCase.ExecutionUnit: - ExecutionUnit = other.ExecutionUnit.Clone(); + case ConfigOneofCase.Service: + Service = other.Service.Clone(); break; case ConfigOneofCase.Bucket: Bucket = other.Bucket.Clone(); @@ -5317,9 +6716,6 @@ public Resource(Resource other) : this() { case ConfigOneofCase.Topic: Topic = other.Topic.Clone(); break; - case ConfigOneofCase.Queue: - Queue = other.Queue.Clone(); - break; case ConfigOneofCase.Api: Api = other.Api.Clone(); break; @@ -5329,8 +6725,8 @@ public Resource(Resource other) : this() { case ConfigOneofCase.Schedule: Schedule = other.Schedule.Clone(); break; - case ConfigOneofCase.Collection: - Collection = other.Collection.Clone(); + case ConfigOneofCase.KeyValueStore: + KeyValueStore = other.KeyValueStore.Clone(); break; case ConfigOneofCase.Secret: Secret = other.Secret.Clone(); @@ -5341,6 +6737,15 @@ public Resource(Resource other) : this() { case ConfigOneofCase.Http: Http = other.Http.Clone(); break; + case ConfigOneofCase.Queue: + Queue = other.Queue.Clone(); + break; + case ConfigOneofCase.SqlDatabase: + SqlDatabase = other.SqlDatabase.Clone(); + break; + case ConfigOneofCase.Batch: + Batch = other.Batch.Clone(); + break; } _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); @@ -5351,44 +6756,33 @@ public Resource Clone() { return new Resource(this); } - /// Field number for the "name" field. - public const int NameFieldNumber = 1; - private string name_ = ""; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string Name { - get { return name_; } - set { - name_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "type" field. - public const int TypeFieldNumber = 2; - private global::Nitric.Proto.Resource.v1.ResourceType type_ = global::Nitric.Proto.Resource.v1.ResourceType.Api; + /// Field number for the "id" field. + public const int IdFieldNumber = 1; + private global::Nitric.Proto.Resources.v1.ResourceIdentifier id_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Resource.v1.ResourceType Type { - get { return type_; } + public global::Nitric.Proto.Resources.v1.ResourceIdentifier Id { + get { return id_; } set { - type_ = value; + id_ = value; } } - /// Field number for the "execution_unit" field. - public const int ExecutionUnitFieldNumber = 10; + /// Field number for the "service" field. + public const int ServiceFieldNumber = 10; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Deploy.v1.ExecutionUnit ExecutionUnit { - get { return configCase_ == ConfigOneofCase.ExecutionUnit ? (global::Nitric.Proto.Deploy.v1.ExecutionUnit) config_ : null; } + public global::Nitric.Proto.Deployments.v1.Service Service { + get { return configCase_ == ConfigOneofCase.Service ? (global::Nitric.Proto.Deployments.v1.Service) config_ : null; } set { config_ = value; - configCase_ = value == null ? ConfigOneofCase.None : ConfigOneofCase.ExecutionUnit; + configCase_ = value == null ? ConfigOneofCase.None : ConfigOneofCase.Service; } } /// Field number for the "bucket" field. public const int BucketFieldNumber = 11; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Deploy.v1.Bucket Bucket { - get { return configCase_ == ConfigOneofCase.Bucket ? (global::Nitric.Proto.Deploy.v1.Bucket) config_ : null; } + public global::Nitric.Proto.Deployments.v1.Bucket Bucket { + get { return configCase_ == ConfigOneofCase.Bucket ? (global::Nitric.Proto.Deployments.v1.Bucket) config_ : null; } set { config_ = value; configCase_ = value == null ? ConfigOneofCase.None : ConfigOneofCase.Bucket; @@ -5398,30 +6792,19 @@ public string Name { /// Field number for the "topic" field. public const int TopicFieldNumber = 12; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Deploy.v1.Topic Topic { - get { return configCase_ == ConfigOneofCase.Topic ? (global::Nitric.Proto.Deploy.v1.Topic) config_ : null; } + public global::Nitric.Proto.Deployments.v1.Topic Topic { + get { return configCase_ == ConfigOneofCase.Topic ? (global::Nitric.Proto.Deployments.v1.Topic) config_ : null; } set { config_ = value; configCase_ = value == null ? ConfigOneofCase.None : ConfigOneofCase.Topic; } } - /// Field number for the "queue" field. - public const int QueueFieldNumber = 13; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Deploy.v1.Queue Queue { - get { return configCase_ == ConfigOneofCase.Queue ? (global::Nitric.Proto.Deploy.v1.Queue) config_ : null; } - set { - config_ = value; - configCase_ = value == null ? ConfigOneofCase.None : ConfigOneofCase.Queue; - } - } - /// Field number for the "api" field. - public const int ApiFieldNumber = 14; + public const int ApiFieldNumber = 13; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Deploy.v1.Api Api { - get { return configCase_ == ConfigOneofCase.Api ? (global::Nitric.Proto.Deploy.v1.Api) config_ : null; } + public global::Nitric.Proto.Deployments.v1.Api Api { + get { return configCase_ == ConfigOneofCase.Api ? (global::Nitric.Proto.Deployments.v1.Api) config_ : null; } set { config_ = value; configCase_ = value == null ? ConfigOneofCase.None : ConfigOneofCase.Api; @@ -5429,10 +6812,10 @@ public string Name { } /// Field number for the "policy" field. - public const int PolicyFieldNumber = 15; + public const int PolicyFieldNumber = 14; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Deploy.v1.Policy Policy { - get { return configCase_ == ConfigOneofCase.Policy ? (global::Nitric.Proto.Deploy.v1.Policy) config_ : null; } + public global::Nitric.Proto.Deployments.v1.Policy Policy { + get { return configCase_ == ConfigOneofCase.Policy ? (global::Nitric.Proto.Deployments.v1.Policy) config_ : null; } set { config_ = value; configCase_ = value == null ? ConfigOneofCase.None : ConfigOneofCase.Policy; @@ -5440,32 +6823,32 @@ public string Name { } /// Field number for the "schedule" field. - public const int ScheduleFieldNumber = 16; + public const int ScheduleFieldNumber = 15; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Deploy.v1.Schedule Schedule { - get { return configCase_ == ConfigOneofCase.Schedule ? (global::Nitric.Proto.Deploy.v1.Schedule) config_ : null; } + public global::Nitric.Proto.Deployments.v1.Schedule Schedule { + get { return configCase_ == ConfigOneofCase.Schedule ? (global::Nitric.Proto.Deployments.v1.Schedule) config_ : null; } set { config_ = value; configCase_ = value == null ? ConfigOneofCase.None : ConfigOneofCase.Schedule; } } - /// Field number for the "collection" field. - public const int CollectionFieldNumber = 17; + /// Field number for the "key_value_store" field. + public const int KeyValueStoreFieldNumber = 16; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Deploy.v1.Collection Collection { - get { return configCase_ == ConfigOneofCase.Collection ? (global::Nitric.Proto.Deploy.v1.Collection) config_ : null; } + public global::Nitric.Proto.Deployments.v1.KeyValueStore KeyValueStore { + get { return configCase_ == ConfigOneofCase.KeyValueStore ? (global::Nitric.Proto.Deployments.v1.KeyValueStore) config_ : null; } set { config_ = value; - configCase_ = value == null ? ConfigOneofCase.None : ConfigOneofCase.Collection; + configCase_ = value == null ? ConfigOneofCase.None : ConfigOneofCase.KeyValueStore; } } /// Field number for the "secret" field. - public const int SecretFieldNumber = 18; + public const int SecretFieldNumber = 17; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Deploy.v1.Secret Secret { - get { return configCase_ == ConfigOneofCase.Secret ? (global::Nitric.Proto.Deploy.v1.Secret) config_ : null; } + public global::Nitric.Proto.Deployments.v1.Secret Secret { + get { return configCase_ == ConfigOneofCase.Secret ? (global::Nitric.Proto.Deployments.v1.Secret) config_ : null; } set { config_ = value; configCase_ = value == null ? ConfigOneofCase.None : ConfigOneofCase.Secret; @@ -5473,10 +6856,10 @@ public string Name { } /// Field number for the "websocket" field. - public const int WebsocketFieldNumber = 19; + public const int WebsocketFieldNumber = 18; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Deploy.v1.Websocket Websocket { - get { return configCase_ == ConfigOneofCase.Websocket ? (global::Nitric.Proto.Deploy.v1.Websocket) config_ : null; } + public global::Nitric.Proto.Deployments.v1.Websocket Websocket { + get { return configCase_ == ConfigOneofCase.Websocket ? (global::Nitric.Proto.Deployments.v1.Websocket) config_ : null; } set { config_ = value; configCase_ = value == null ? ConfigOneofCase.None : ConfigOneofCase.Websocket; @@ -5484,31 +6867,66 @@ public string Name { } /// Field number for the "http" field. - public const int HttpFieldNumber = 20; + public const int HttpFieldNumber = 19; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Deploy.v1.Http Http { - get { return configCase_ == ConfigOneofCase.Http ? (global::Nitric.Proto.Deploy.v1.Http) config_ : null; } + public global::Nitric.Proto.Deployments.v1.Http Http { + get { return configCase_ == ConfigOneofCase.Http ? (global::Nitric.Proto.Deployments.v1.Http) config_ : null; } set { config_ = value; configCase_ = value == null ? ConfigOneofCase.None : ConfigOneofCase.Http; } } + /// Field number for the "queue" field. + public const int QueueFieldNumber = 20; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Nitric.Proto.Deployments.v1.Queue Queue { + get { return configCase_ == ConfigOneofCase.Queue ? (global::Nitric.Proto.Deployments.v1.Queue) config_ : null; } + set { + config_ = value; + configCase_ = value == null ? ConfigOneofCase.None : ConfigOneofCase.Queue; + } + } + + /// Field number for the "sql_database" field. + public const int SqlDatabaseFieldNumber = 21; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Nitric.Proto.Deployments.v1.SqlDatabase SqlDatabase { + get { return configCase_ == ConfigOneofCase.SqlDatabase ? (global::Nitric.Proto.Deployments.v1.SqlDatabase) config_ : null; } + set { + config_ = value; + configCase_ = value == null ? ConfigOneofCase.None : ConfigOneofCase.SqlDatabase; + } + } + + /// Field number for the "batch" field. + public const int BatchFieldNumber = 22; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Nitric.Proto.Deployments.v1.Batch Batch { + get { return configCase_ == ConfigOneofCase.Batch ? (global::Nitric.Proto.Deployments.v1.Batch) config_ : null; } + set { + config_ = value; + configCase_ = value == null ? ConfigOneofCase.None : ConfigOneofCase.Batch; + } + } + private object config_; /// Enum of possible cases for the "config" oneof. public enum ConfigOneofCase { None = 0, - ExecutionUnit = 10, + Service = 10, Bucket = 11, Topic = 12, - Queue = 13, - Api = 14, - Policy = 15, - Schedule = 16, - Collection = 17, - Secret = 18, - Websocket = 19, - Http = 20, + Api = 13, + Policy = 14, + Schedule = 15, + KeyValueStore = 16, + Secret = 17, + Websocket = 18, + Http = 19, + Queue = 20, + SqlDatabase = 21, + Batch = 22, } private ConfigOneofCase configCase_ = ConfigOneofCase.None; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -5535,19 +6953,20 @@ public bool Equals(Resource other) { if (ReferenceEquals(other, this)) { return true; } - if (Name != other.Name) return false; - if (Type != other.Type) return false; - if (!object.Equals(ExecutionUnit, other.ExecutionUnit)) return false; + if (!object.Equals(Id, other.Id)) return false; + if (!object.Equals(Service, other.Service)) return false; if (!object.Equals(Bucket, other.Bucket)) return false; if (!object.Equals(Topic, other.Topic)) return false; - if (!object.Equals(Queue, other.Queue)) return false; if (!object.Equals(Api, other.Api)) return false; if (!object.Equals(Policy, other.Policy)) return false; if (!object.Equals(Schedule, other.Schedule)) return false; - if (!object.Equals(Collection, other.Collection)) return false; + if (!object.Equals(KeyValueStore, other.KeyValueStore)) return false; if (!object.Equals(Secret, other.Secret)) return false; if (!object.Equals(Websocket, other.Websocket)) return false; if (!object.Equals(Http, other.Http)) return false; + if (!object.Equals(Queue, other.Queue)) return false; + if (!object.Equals(SqlDatabase, other.SqlDatabase)) return false; + if (!object.Equals(Batch, other.Batch)) return false; if (ConfigCase != other.ConfigCase) return false; return Equals(_unknownFields, other._unknownFields); } @@ -5555,19 +6974,20 @@ public bool Equals(Resource other) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; - if (Name.Length != 0) hash ^= Name.GetHashCode(); - if (Type != global::Nitric.Proto.Resource.v1.ResourceType.Api) hash ^= Type.GetHashCode(); - if (configCase_ == ConfigOneofCase.ExecutionUnit) hash ^= ExecutionUnit.GetHashCode(); + if (id_ != null) hash ^= Id.GetHashCode(); + if (configCase_ == ConfigOneofCase.Service) hash ^= Service.GetHashCode(); if (configCase_ == ConfigOneofCase.Bucket) hash ^= Bucket.GetHashCode(); if (configCase_ == ConfigOneofCase.Topic) hash ^= Topic.GetHashCode(); - if (configCase_ == ConfigOneofCase.Queue) hash ^= Queue.GetHashCode(); if (configCase_ == ConfigOneofCase.Api) hash ^= Api.GetHashCode(); if (configCase_ == ConfigOneofCase.Policy) hash ^= Policy.GetHashCode(); if (configCase_ == ConfigOneofCase.Schedule) hash ^= Schedule.GetHashCode(); - if (configCase_ == ConfigOneofCase.Collection) hash ^= Collection.GetHashCode(); + if (configCase_ == ConfigOneofCase.KeyValueStore) hash ^= KeyValueStore.GetHashCode(); if (configCase_ == ConfigOneofCase.Secret) hash ^= Secret.GetHashCode(); if (configCase_ == ConfigOneofCase.Websocket) hash ^= Websocket.GetHashCode(); if (configCase_ == ConfigOneofCase.Http) hash ^= Http.GetHashCode(); + if (configCase_ == ConfigOneofCase.Queue) hash ^= Queue.GetHashCode(); + if (configCase_ == ConfigOneofCase.SqlDatabase) hash ^= SqlDatabase.GetHashCode(); + if (configCase_ == ConfigOneofCase.Batch) hash ^= Batch.GetHashCode(); hash ^= (int) configCase_; if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); @@ -5585,17 +7005,13 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else - if (Name.Length != 0) { + if (id_ != null) { output.WriteRawTag(10); - output.WriteString(Name); - } - if (Type != global::Nitric.Proto.Resource.v1.ResourceType.Api) { - output.WriteRawTag(16); - output.WriteEnum((int) Type); + output.WriteMessage(Id); } - if (configCase_ == ConfigOneofCase.ExecutionUnit) { + if (configCase_ == ConfigOneofCase.Service) { output.WriteRawTag(82); - output.WriteMessage(ExecutionUnit); + output.WriteMessage(Service); } if (configCase_ == ConfigOneofCase.Bucket) { output.WriteRawTag(90); @@ -5605,38 +7021,46 @@ public void WriteTo(pb::CodedOutputStream output) { output.WriteRawTag(98); output.WriteMessage(Topic); } - if (configCase_ == ConfigOneofCase.Queue) { - output.WriteRawTag(106); - output.WriteMessage(Queue); - } if (configCase_ == ConfigOneofCase.Api) { - output.WriteRawTag(114); + output.WriteRawTag(106); output.WriteMessage(Api); } if (configCase_ == ConfigOneofCase.Policy) { - output.WriteRawTag(122); + output.WriteRawTag(114); output.WriteMessage(Policy); } if (configCase_ == ConfigOneofCase.Schedule) { - output.WriteRawTag(130, 1); + output.WriteRawTag(122); output.WriteMessage(Schedule); } - if (configCase_ == ConfigOneofCase.Collection) { - output.WriteRawTag(138, 1); - output.WriteMessage(Collection); + if (configCase_ == ConfigOneofCase.KeyValueStore) { + output.WriteRawTag(130, 1); + output.WriteMessage(KeyValueStore); } if (configCase_ == ConfigOneofCase.Secret) { - output.WriteRawTag(146, 1); + output.WriteRawTag(138, 1); output.WriteMessage(Secret); } if (configCase_ == ConfigOneofCase.Websocket) { - output.WriteRawTag(154, 1); + output.WriteRawTag(146, 1); output.WriteMessage(Websocket); } if (configCase_ == ConfigOneofCase.Http) { - output.WriteRawTag(162, 1); + output.WriteRawTag(154, 1); output.WriteMessage(Http); } + if (configCase_ == ConfigOneofCase.Queue) { + output.WriteRawTag(162, 1); + output.WriteMessage(Queue); + } + if (configCase_ == ConfigOneofCase.SqlDatabase) { + output.WriteRawTag(170, 1); + output.WriteMessage(SqlDatabase); + } + if (configCase_ == ConfigOneofCase.Batch) { + output.WriteRawTag(178, 1); + output.WriteMessage(Batch); + } if (_unknownFields != null) { _unknownFields.WriteTo(output); } @@ -5646,17 +7070,13 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (Name.Length != 0) { + if (id_ != null) { output.WriteRawTag(10); - output.WriteString(Name); - } - if (Type != global::Nitric.Proto.Resource.v1.ResourceType.Api) { - output.WriteRawTag(16); - output.WriteEnum((int) Type); + output.WriteMessage(Id); } - if (configCase_ == ConfigOneofCase.ExecutionUnit) { + if (configCase_ == ConfigOneofCase.Service) { output.WriteRawTag(82); - output.WriteMessage(ExecutionUnit); + output.WriteMessage(Service); } if (configCase_ == ConfigOneofCase.Bucket) { output.WriteRawTag(90); @@ -5666,38 +7086,46 @@ public void WriteTo(pb::CodedOutputStream output) { output.WriteRawTag(98); output.WriteMessage(Topic); } - if (configCase_ == ConfigOneofCase.Queue) { - output.WriteRawTag(106); - output.WriteMessage(Queue); - } if (configCase_ == ConfigOneofCase.Api) { - output.WriteRawTag(114); + output.WriteRawTag(106); output.WriteMessage(Api); } if (configCase_ == ConfigOneofCase.Policy) { - output.WriteRawTag(122); + output.WriteRawTag(114); output.WriteMessage(Policy); } if (configCase_ == ConfigOneofCase.Schedule) { - output.WriteRawTag(130, 1); + output.WriteRawTag(122); output.WriteMessage(Schedule); } - if (configCase_ == ConfigOneofCase.Collection) { - output.WriteRawTag(138, 1); - output.WriteMessage(Collection); + if (configCase_ == ConfigOneofCase.KeyValueStore) { + output.WriteRawTag(130, 1); + output.WriteMessage(KeyValueStore); } if (configCase_ == ConfigOneofCase.Secret) { - output.WriteRawTag(146, 1); + output.WriteRawTag(138, 1); output.WriteMessage(Secret); } if (configCase_ == ConfigOneofCase.Websocket) { - output.WriteRawTag(154, 1); + output.WriteRawTag(146, 1); output.WriteMessage(Websocket); } if (configCase_ == ConfigOneofCase.Http) { - output.WriteRawTag(162, 1); + output.WriteRawTag(154, 1); output.WriteMessage(Http); } + if (configCase_ == ConfigOneofCase.Queue) { + output.WriteRawTag(162, 1); + output.WriteMessage(Queue); + } + if (configCase_ == ConfigOneofCase.SqlDatabase) { + output.WriteRawTag(170, 1); + output.WriteMessage(SqlDatabase); + } + if (configCase_ == ConfigOneofCase.Batch) { + output.WriteRawTag(178, 1); + output.WriteMessage(Batch); + } if (_unknownFields != null) { _unknownFields.WriteTo(ref output); } @@ -5707,14 +7135,11 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; - if (Name.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Name); + if (id_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Id); } - if (Type != global::Nitric.Proto.Resource.v1.ResourceType.Api) { - size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Type); - } - if (configCase_ == ConfigOneofCase.ExecutionUnit) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(ExecutionUnit); + if (configCase_ == ConfigOneofCase.Service) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Service); } if (configCase_ == ConfigOneofCase.Bucket) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(Bucket); @@ -5722,9 +7147,6 @@ public int CalculateSize() { if (configCase_ == ConfigOneofCase.Topic) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(Topic); } - if (configCase_ == ConfigOneofCase.Queue) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Queue); - } if (configCase_ == ConfigOneofCase.Api) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(Api); } @@ -5732,10 +7154,10 @@ public int CalculateSize() { size += 1 + pb::CodedOutputStream.ComputeMessageSize(Policy); } if (configCase_ == ConfigOneofCase.Schedule) { - size += 2 + pb::CodedOutputStream.ComputeMessageSize(Schedule); + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Schedule); } - if (configCase_ == ConfigOneofCase.Collection) { - size += 2 + pb::CodedOutputStream.ComputeMessageSize(Collection); + if (configCase_ == ConfigOneofCase.KeyValueStore) { + size += 2 + pb::CodedOutputStream.ComputeMessageSize(KeyValueStore); } if (configCase_ == ConfigOneofCase.Secret) { size += 2 + pb::CodedOutputStream.ComputeMessageSize(Secret); @@ -5746,6 +7168,15 @@ public int CalculateSize() { if (configCase_ == ConfigOneofCase.Http) { size += 2 + pb::CodedOutputStream.ComputeMessageSize(Http); } + if (configCase_ == ConfigOneofCase.Queue) { + size += 2 + pb::CodedOutputStream.ComputeMessageSize(Queue); + } + if (configCase_ == ConfigOneofCase.SqlDatabase) { + size += 2 + pb::CodedOutputStream.ComputeMessageSize(SqlDatabase); + } + if (configCase_ == ConfigOneofCase.Batch) { + size += 2 + pb::CodedOutputStream.ComputeMessageSize(Batch); + } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); } @@ -5757,79 +7188,91 @@ public void MergeFrom(Resource other) { if (other == null) { return; } - if (other.Name.Length != 0) { - Name = other.Name; - } - if (other.Type != global::Nitric.Proto.Resource.v1.ResourceType.Api) { - Type = other.Type; + if (other.id_ != null) { + if (id_ == null) { + Id = new global::Nitric.Proto.Resources.v1.ResourceIdentifier(); + } + Id.MergeFrom(other.Id); } switch (other.ConfigCase) { - case ConfigOneofCase.ExecutionUnit: - if (ExecutionUnit == null) { - ExecutionUnit = new global::Nitric.Proto.Deploy.v1.ExecutionUnit(); + case ConfigOneofCase.Service: + if (Service == null) { + Service = new global::Nitric.Proto.Deployments.v1.Service(); } - ExecutionUnit.MergeFrom(other.ExecutionUnit); + Service.MergeFrom(other.Service); break; case ConfigOneofCase.Bucket: if (Bucket == null) { - Bucket = new global::Nitric.Proto.Deploy.v1.Bucket(); + Bucket = new global::Nitric.Proto.Deployments.v1.Bucket(); } Bucket.MergeFrom(other.Bucket); break; case ConfigOneofCase.Topic: if (Topic == null) { - Topic = new global::Nitric.Proto.Deploy.v1.Topic(); + Topic = new global::Nitric.Proto.Deployments.v1.Topic(); } Topic.MergeFrom(other.Topic); break; - case ConfigOneofCase.Queue: - if (Queue == null) { - Queue = new global::Nitric.Proto.Deploy.v1.Queue(); - } - Queue.MergeFrom(other.Queue); - break; case ConfigOneofCase.Api: if (Api == null) { - Api = new global::Nitric.Proto.Deploy.v1.Api(); + Api = new global::Nitric.Proto.Deployments.v1.Api(); } Api.MergeFrom(other.Api); break; case ConfigOneofCase.Policy: if (Policy == null) { - Policy = new global::Nitric.Proto.Deploy.v1.Policy(); + Policy = new global::Nitric.Proto.Deployments.v1.Policy(); } Policy.MergeFrom(other.Policy); break; case ConfigOneofCase.Schedule: if (Schedule == null) { - Schedule = new global::Nitric.Proto.Deploy.v1.Schedule(); + Schedule = new global::Nitric.Proto.Deployments.v1.Schedule(); } Schedule.MergeFrom(other.Schedule); break; - case ConfigOneofCase.Collection: - if (Collection == null) { - Collection = new global::Nitric.Proto.Deploy.v1.Collection(); + case ConfigOneofCase.KeyValueStore: + if (KeyValueStore == null) { + KeyValueStore = new global::Nitric.Proto.Deployments.v1.KeyValueStore(); } - Collection.MergeFrom(other.Collection); + KeyValueStore.MergeFrom(other.KeyValueStore); break; case ConfigOneofCase.Secret: if (Secret == null) { - Secret = new global::Nitric.Proto.Deploy.v1.Secret(); + Secret = new global::Nitric.Proto.Deployments.v1.Secret(); } Secret.MergeFrom(other.Secret); break; case ConfigOneofCase.Websocket: if (Websocket == null) { - Websocket = new global::Nitric.Proto.Deploy.v1.Websocket(); + Websocket = new global::Nitric.Proto.Deployments.v1.Websocket(); } Websocket.MergeFrom(other.Websocket); break; case ConfigOneofCase.Http: if (Http == null) { - Http = new global::Nitric.Proto.Deploy.v1.Http(); + Http = new global::Nitric.Proto.Deployments.v1.Http(); } Http.MergeFrom(other.Http); break; + case ConfigOneofCase.Queue: + if (Queue == null) { + Queue = new global::Nitric.Proto.Deployments.v1.Queue(); + } + Queue.MergeFrom(other.Queue); + break; + case ConfigOneofCase.SqlDatabase: + if (SqlDatabase == null) { + SqlDatabase = new global::Nitric.Proto.Deployments.v1.SqlDatabase(); + } + SqlDatabase.MergeFrom(other.SqlDatabase); + break; + case ConfigOneofCase.Batch: + if (Batch == null) { + Batch = new global::Nitric.Proto.Deployments.v1.Batch(); + } + Batch.MergeFrom(other.Batch); + break; } _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); @@ -5847,24 +7290,23 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { - Name = input.ReadString(); - break; - } - case 16: { - Type = (global::Nitric.Proto.Resource.v1.ResourceType) input.ReadEnum(); + if (id_ == null) { + Id = new global::Nitric.Proto.Resources.v1.ResourceIdentifier(); + } + input.ReadMessage(Id); break; } case 82: { - global::Nitric.Proto.Deploy.v1.ExecutionUnit subBuilder = new global::Nitric.Proto.Deploy.v1.ExecutionUnit(); - if (configCase_ == ConfigOneofCase.ExecutionUnit) { - subBuilder.MergeFrom(ExecutionUnit); + global::Nitric.Proto.Deployments.v1.Service subBuilder = new global::Nitric.Proto.Deployments.v1.Service(); + if (configCase_ == ConfigOneofCase.Service) { + subBuilder.MergeFrom(Service); } input.ReadMessage(subBuilder); - ExecutionUnit = subBuilder; + Service = subBuilder; break; } case 90: { - global::Nitric.Proto.Deploy.v1.Bucket subBuilder = new global::Nitric.Proto.Deploy.v1.Bucket(); + global::Nitric.Proto.Deployments.v1.Bucket subBuilder = new global::Nitric.Proto.Deployments.v1.Bucket(); if (configCase_ == ConfigOneofCase.Bucket) { subBuilder.MergeFrom(Bucket); } @@ -5873,7 +7315,7 @@ public void MergeFrom(pb::CodedInputStream input) { break; } case 98: { - global::Nitric.Proto.Deploy.v1.Topic subBuilder = new global::Nitric.Proto.Deploy.v1.Topic(); + global::Nitric.Proto.Deployments.v1.Topic subBuilder = new global::Nitric.Proto.Deployments.v1.Topic(); if (configCase_ == ConfigOneofCase.Topic) { subBuilder.MergeFrom(Topic); } @@ -5882,16 +7324,7 @@ public void MergeFrom(pb::CodedInputStream input) { break; } case 106: { - global::Nitric.Proto.Deploy.v1.Queue subBuilder = new global::Nitric.Proto.Deploy.v1.Queue(); - if (configCase_ == ConfigOneofCase.Queue) { - subBuilder.MergeFrom(Queue); - } - input.ReadMessage(subBuilder); - Queue = subBuilder; - break; - } - case 114: { - global::Nitric.Proto.Deploy.v1.Api subBuilder = new global::Nitric.Proto.Deploy.v1.Api(); + global::Nitric.Proto.Deployments.v1.Api subBuilder = new global::Nitric.Proto.Deployments.v1.Api(); if (configCase_ == ConfigOneofCase.Api) { subBuilder.MergeFrom(Api); } @@ -5899,8 +7332,8 @@ public void MergeFrom(pb::CodedInputStream input) { Api = subBuilder; break; } - case 122: { - global::Nitric.Proto.Deploy.v1.Policy subBuilder = new global::Nitric.Proto.Deploy.v1.Policy(); + case 114: { + global::Nitric.Proto.Deployments.v1.Policy subBuilder = new global::Nitric.Proto.Deployments.v1.Policy(); if (configCase_ == ConfigOneofCase.Policy) { subBuilder.MergeFrom(Policy); } @@ -5908,8 +7341,8 @@ public void MergeFrom(pb::CodedInputStream input) { Policy = subBuilder; break; } - case 130: { - global::Nitric.Proto.Deploy.v1.Schedule subBuilder = new global::Nitric.Proto.Deploy.v1.Schedule(); + case 122: { + global::Nitric.Proto.Deployments.v1.Schedule subBuilder = new global::Nitric.Proto.Deployments.v1.Schedule(); if (configCase_ == ConfigOneofCase.Schedule) { subBuilder.MergeFrom(Schedule); } @@ -5917,17 +7350,17 @@ public void MergeFrom(pb::CodedInputStream input) { Schedule = subBuilder; break; } - case 138: { - global::Nitric.Proto.Deploy.v1.Collection subBuilder = new global::Nitric.Proto.Deploy.v1.Collection(); - if (configCase_ == ConfigOneofCase.Collection) { - subBuilder.MergeFrom(Collection); + case 130: { + global::Nitric.Proto.Deployments.v1.KeyValueStore subBuilder = new global::Nitric.Proto.Deployments.v1.KeyValueStore(); + if (configCase_ == ConfigOneofCase.KeyValueStore) { + subBuilder.MergeFrom(KeyValueStore); } input.ReadMessage(subBuilder); - Collection = subBuilder; + KeyValueStore = subBuilder; break; } - case 146: { - global::Nitric.Proto.Deploy.v1.Secret subBuilder = new global::Nitric.Proto.Deploy.v1.Secret(); + case 138: { + global::Nitric.Proto.Deployments.v1.Secret subBuilder = new global::Nitric.Proto.Deployments.v1.Secret(); if (configCase_ == ConfigOneofCase.Secret) { subBuilder.MergeFrom(Secret); } @@ -5935,8 +7368,8 @@ public void MergeFrom(pb::CodedInputStream input) { Secret = subBuilder; break; } - case 154: { - global::Nitric.Proto.Deploy.v1.Websocket subBuilder = new global::Nitric.Proto.Deploy.v1.Websocket(); + case 146: { + global::Nitric.Proto.Deployments.v1.Websocket subBuilder = new global::Nitric.Proto.Deployments.v1.Websocket(); if (configCase_ == ConfigOneofCase.Websocket) { subBuilder.MergeFrom(Websocket); } @@ -5944,8 +7377,8 @@ public void MergeFrom(pb::CodedInputStream input) { Websocket = subBuilder; break; } - case 162: { - global::Nitric.Proto.Deploy.v1.Http subBuilder = new global::Nitric.Proto.Deploy.v1.Http(); + case 154: { + global::Nitric.Proto.Deployments.v1.Http subBuilder = new global::Nitric.Proto.Deployments.v1.Http(); if (configCase_ == ConfigOneofCase.Http) { subBuilder.MergeFrom(Http); } @@ -5953,6 +7386,33 @@ public void MergeFrom(pb::CodedInputStream input) { Http = subBuilder; break; } + case 162: { + global::Nitric.Proto.Deployments.v1.Queue subBuilder = new global::Nitric.Proto.Deployments.v1.Queue(); + if (configCase_ == ConfigOneofCase.Queue) { + subBuilder.MergeFrom(Queue); + } + input.ReadMessage(subBuilder); + Queue = subBuilder; + break; + } + case 170: { + global::Nitric.Proto.Deployments.v1.SqlDatabase subBuilder = new global::Nitric.Proto.Deployments.v1.SqlDatabase(); + if (configCase_ == ConfigOneofCase.SqlDatabase) { + subBuilder.MergeFrom(SqlDatabase); + } + input.ReadMessage(subBuilder); + SqlDatabase = subBuilder; + break; + } + case 178: { + global::Nitric.Proto.Deployments.v1.Batch subBuilder = new global::Nitric.Proto.Deployments.v1.Batch(); + if (configCase_ == ConfigOneofCase.Batch) { + subBuilder.MergeFrom(Batch); + } + input.ReadMessage(subBuilder); + Batch = subBuilder; + break; + } } } #endif @@ -5968,24 +7428,23 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; case 10: { - Name = input.ReadString(); - break; - } - case 16: { - Type = (global::Nitric.Proto.Resource.v1.ResourceType) input.ReadEnum(); + if (id_ == null) { + Id = new global::Nitric.Proto.Resources.v1.ResourceIdentifier(); + } + input.ReadMessage(Id); break; } case 82: { - global::Nitric.Proto.Deploy.v1.ExecutionUnit subBuilder = new global::Nitric.Proto.Deploy.v1.ExecutionUnit(); - if (configCase_ == ConfigOneofCase.ExecutionUnit) { - subBuilder.MergeFrom(ExecutionUnit); + global::Nitric.Proto.Deployments.v1.Service subBuilder = new global::Nitric.Proto.Deployments.v1.Service(); + if (configCase_ == ConfigOneofCase.Service) { + subBuilder.MergeFrom(Service); } input.ReadMessage(subBuilder); - ExecutionUnit = subBuilder; + Service = subBuilder; break; } case 90: { - global::Nitric.Proto.Deploy.v1.Bucket subBuilder = new global::Nitric.Proto.Deploy.v1.Bucket(); + global::Nitric.Proto.Deployments.v1.Bucket subBuilder = new global::Nitric.Proto.Deployments.v1.Bucket(); if (configCase_ == ConfigOneofCase.Bucket) { subBuilder.MergeFrom(Bucket); } @@ -5994,7 +7453,7 @@ public void MergeFrom(pb::CodedInputStream input) { break; } case 98: { - global::Nitric.Proto.Deploy.v1.Topic subBuilder = new global::Nitric.Proto.Deploy.v1.Topic(); + global::Nitric.Proto.Deployments.v1.Topic subBuilder = new global::Nitric.Proto.Deployments.v1.Topic(); if (configCase_ == ConfigOneofCase.Topic) { subBuilder.MergeFrom(Topic); } @@ -6003,16 +7462,7 @@ public void MergeFrom(pb::CodedInputStream input) { break; } case 106: { - global::Nitric.Proto.Deploy.v1.Queue subBuilder = new global::Nitric.Proto.Deploy.v1.Queue(); - if (configCase_ == ConfigOneofCase.Queue) { - subBuilder.MergeFrom(Queue); - } - input.ReadMessage(subBuilder); - Queue = subBuilder; - break; - } - case 114: { - global::Nitric.Proto.Deploy.v1.Api subBuilder = new global::Nitric.Proto.Deploy.v1.Api(); + global::Nitric.Proto.Deployments.v1.Api subBuilder = new global::Nitric.Proto.Deployments.v1.Api(); if (configCase_ == ConfigOneofCase.Api) { subBuilder.MergeFrom(Api); } @@ -6020,8 +7470,8 @@ public void MergeFrom(pb::CodedInputStream input) { Api = subBuilder; break; } - case 122: { - global::Nitric.Proto.Deploy.v1.Policy subBuilder = new global::Nitric.Proto.Deploy.v1.Policy(); + case 114: { + global::Nitric.Proto.Deployments.v1.Policy subBuilder = new global::Nitric.Proto.Deployments.v1.Policy(); if (configCase_ == ConfigOneofCase.Policy) { subBuilder.MergeFrom(Policy); } @@ -6029,8 +7479,8 @@ public void MergeFrom(pb::CodedInputStream input) { Policy = subBuilder; break; } - case 130: { - global::Nitric.Proto.Deploy.v1.Schedule subBuilder = new global::Nitric.Proto.Deploy.v1.Schedule(); + case 122: { + global::Nitric.Proto.Deployments.v1.Schedule subBuilder = new global::Nitric.Proto.Deployments.v1.Schedule(); if (configCase_ == ConfigOneofCase.Schedule) { subBuilder.MergeFrom(Schedule); } @@ -6038,17 +7488,17 @@ public void MergeFrom(pb::CodedInputStream input) { Schedule = subBuilder; break; } - case 138: { - global::Nitric.Proto.Deploy.v1.Collection subBuilder = new global::Nitric.Proto.Deploy.v1.Collection(); - if (configCase_ == ConfigOneofCase.Collection) { - subBuilder.MergeFrom(Collection); + case 130: { + global::Nitric.Proto.Deployments.v1.KeyValueStore subBuilder = new global::Nitric.Proto.Deployments.v1.KeyValueStore(); + if (configCase_ == ConfigOneofCase.KeyValueStore) { + subBuilder.MergeFrom(KeyValueStore); } input.ReadMessage(subBuilder); - Collection = subBuilder; + KeyValueStore = subBuilder; break; } - case 146: { - global::Nitric.Proto.Deploy.v1.Secret subBuilder = new global::Nitric.Proto.Deploy.v1.Secret(); + case 138: { + global::Nitric.Proto.Deployments.v1.Secret subBuilder = new global::Nitric.Proto.Deployments.v1.Secret(); if (configCase_ == ConfigOneofCase.Secret) { subBuilder.MergeFrom(Secret); } @@ -6056,8 +7506,8 @@ public void MergeFrom(pb::CodedInputStream input) { Secret = subBuilder; break; } - case 154: { - global::Nitric.Proto.Deploy.v1.Websocket subBuilder = new global::Nitric.Proto.Deploy.v1.Websocket(); + case 146: { + global::Nitric.Proto.Deployments.v1.Websocket subBuilder = new global::Nitric.Proto.Deployments.v1.Websocket(); if (configCase_ == ConfigOneofCase.Websocket) { subBuilder.MergeFrom(Websocket); } @@ -6065,8 +7515,8 @@ public void MergeFrom(pb::CodedInputStream input) { Websocket = subBuilder; break; } - case 162: { - global::Nitric.Proto.Deploy.v1.Http subBuilder = new global::Nitric.Proto.Deploy.v1.Http(); + case 154: { + global::Nitric.Proto.Deployments.v1.Http subBuilder = new global::Nitric.Proto.Deployments.v1.Http(); if (configCase_ == ConfigOneofCase.Http) { subBuilder.MergeFrom(Http); } @@ -6074,6 +7524,33 @@ public void MergeFrom(pb::CodedInputStream input) { Http = subBuilder; break; } + case 162: { + global::Nitric.Proto.Deployments.v1.Queue subBuilder = new global::Nitric.Proto.Deployments.v1.Queue(); + if (configCase_ == ConfigOneofCase.Queue) { + subBuilder.MergeFrom(Queue); + } + input.ReadMessage(subBuilder); + Queue = subBuilder; + break; + } + case 170: { + global::Nitric.Proto.Deployments.v1.SqlDatabase subBuilder = new global::Nitric.Proto.Deployments.v1.SqlDatabase(); + if (configCase_ == ConfigOneofCase.SqlDatabase) { + subBuilder.MergeFrom(SqlDatabase); + } + input.ReadMessage(subBuilder); + SqlDatabase = subBuilder; + break; + } + case 178: { + global::Nitric.Proto.Deployments.v1.Batch subBuilder = new global::Nitric.Proto.Deployments.v1.Batch(); + if (configCase_ == ConfigOneofCase.Batch) { + subBuilder.MergeFrom(Batch); + } + input.ReadMessage(subBuilder); + Batch = subBuilder; + break; + } } } } @@ -6082,8 +7559,7 @@ public void MergeFrom(pb::CodedInputStream input) { } /// - /// TODO: This is already defined in our resource contracts... - /// Need to determine if it's worth re-using + /// This is already defined in the resource contracts, /// unfortunately there are parts we don't want to duplicate, such as API config /// public sealed partial class Policy : pb::IMessage @@ -6098,7 +7574,7 @@ public sealed partial class Policy : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Deploy.v1.DeployReflection.Descriptor.MessageTypes[26]; } + get { return global::Nitric.Proto.Deployments.v1.DeploymentsReflection.Descriptor.MessageTypes[30]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -6128,36 +7604,31 @@ public Policy Clone() { /// Field number for the "principals" field. public const int PrincipalsFieldNumber = 1; - private static readonly pb::FieldCodec _repeated_principals_codec - = pb::FieldCodec.ForMessage(10, global::Nitric.Proto.Deploy.v1.Resource.Parser); - private readonly pbc::RepeatedField principals_ = new pbc::RepeatedField(); + private static readonly pb::FieldCodec _repeated_principals_codec + = pb::FieldCodec.ForMessage(10, global::Nitric.Proto.Deployments.v1.Resource.Parser); + private readonly pbc::RepeatedField principals_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField Principals { + public pbc::RepeatedField Principals { get { return principals_; } } /// Field number for the "actions" field. public const int ActionsFieldNumber = 2; - private static readonly pb::FieldCodec _repeated_actions_codec - = pb::FieldCodec.ForEnum(18, x => (int) x, x => (global::Nitric.Proto.Resource.v1.Action) x); - private readonly pbc::RepeatedField actions_ = new pbc::RepeatedField(); - /// - /// TODO: Split out discrete action definitions from resources - /// Also need to allow custom action types as well - /// Should incorporate action re-use here... - /// + private static readonly pb::FieldCodec _repeated_actions_codec + = pb::FieldCodec.ForEnum(18, x => (int) x, x => (global::Nitric.Proto.Resources.v1.Action) x); + private readonly pbc::RepeatedField actions_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField Actions { + public pbc::RepeatedField Actions { get { return actions_; } } /// Field number for the "resources" field. public const int ResourcesFieldNumber = 3; - private static readonly pb::FieldCodec _repeated_resources_codec - = pb::FieldCodec.ForMessage(26, global::Nitric.Proto.Deploy.v1.Resource.Parser); - private readonly pbc::RepeatedField resources_ = new pbc::RepeatedField(); + private static readonly pb::FieldCodec _repeated_resources_codec + = pb::FieldCodec.ForMessage(26, global::Nitric.Proto.Deployments.v1.Resource.Parser); + private readonly pbc::RepeatedField resources_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField Resources { + public pbc::RepeatedField Resources { get { return resources_; } } @@ -6316,7 +7787,7 @@ public sealed partial class Spec : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Deploy.v1.DeployReflection.Descriptor.MessageTypes[27]; } + get { return global::Nitric.Proto.Deployments.v1.DeploymentsReflection.Descriptor.MessageTypes[31]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -6344,14 +7815,14 @@ public Spec Clone() { /// Field number for the "resources" field. public const int ResourcesFieldNumber = 1; - private static readonly pb::FieldCodec _repeated_resources_codec - = pb::FieldCodec.ForMessage(10, global::Nitric.Proto.Deploy.v1.Resource.Parser); - private readonly pbc::RepeatedField resources_ = new pbc::RepeatedField(); + private static readonly pb::FieldCodec _repeated_resources_codec + = pb::FieldCodec.ForMessage(10, global::Nitric.Proto.Deployments.v1.Resource.Parser); + private readonly pbc::RepeatedField resources_ = new pbc::RepeatedField(); /// /// list of resources to deploy /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField Resources { + public pbc::RepeatedField Resources { get { return resources_; } } diff --git a/src/Nitric.Sdk/Proto/proto/deploy/v1/DeployGrpc.cs b/src/Nitric.Sdk/Proto/nitric/proto/deployments/v1/DeploymentsGrpc.cs similarity index 63% rename from src/Nitric.Sdk/Proto/proto/deploy/v1/DeployGrpc.cs rename to src/Nitric.Sdk/Proto/nitric/proto/deployments/v1/DeploymentsGrpc.cs index f586e23..1d38c22 100644 --- a/src/Nitric.Sdk/Proto/proto/deploy/v1/DeployGrpc.cs +++ b/src/Nitric.Sdk/Proto/nitric/proto/deployments/v1/DeploymentsGrpc.cs @@ -1,19 +1,19 @@ // // Generated by the protocol buffer compiler. DO NOT EDIT! -// source: proto/deploy/v1/deploy.proto +// source: nitric/proto/deployments/v1/deployments.proto // #pragma warning disable 0414, 1591 #region Designer generated code using grpc = global::Grpc.Core; -namespace Nitric.Proto.Deploy.v1 { +namespace Nitric.Proto.Deployments.v1 { /// /// The Nitric Deloyment Service contract /// - public static partial class DeployService + public static partial class Deployment { - static readonly string __ServiceName = "nitric.deploy.v1.DeployService"; + static readonly string __ServiceName = "nitric.proto.deployments.v1.Deployment"; static void __Helper_SerializeMessage(global::Google.Protobuf.IMessage message, grpc::SerializationContext context) { @@ -45,34 +45,34 @@ static T __Helper_DeserializeMessage(grpc::DeserializationContext context, gl return parser.ParseFrom(context.PayloadAsNewBuffer()); } - static readonly grpc::Marshaller __Marshaller_nitric_deploy_v1_DeployUpRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Deploy.v1.DeployUpRequest.Parser)); - static readonly grpc::Marshaller __Marshaller_nitric_deploy_v1_DeployUpEvent = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Deploy.v1.DeployUpEvent.Parser)); - static readonly grpc::Marshaller __Marshaller_nitric_deploy_v1_DeployDownRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Deploy.v1.DeployDownRequest.Parser)); - static readonly grpc::Marshaller __Marshaller_nitric_deploy_v1_DeployDownEvent = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Deploy.v1.DeployDownEvent.Parser)); + static readonly grpc::Marshaller __Marshaller_nitric_proto_deployments_v1_DeploymentUpRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Deployments.v1.DeploymentUpRequest.Parser)); + static readonly grpc::Marshaller __Marshaller_nitric_proto_deployments_v1_DeploymentUpEvent = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Deployments.v1.DeploymentUpEvent.Parser)); + static readonly grpc::Marshaller __Marshaller_nitric_proto_deployments_v1_DeploymentDownRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Deployments.v1.DeploymentDownRequest.Parser)); + static readonly grpc::Marshaller __Marshaller_nitric_proto_deployments_v1_DeploymentDownEvent = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Deployments.v1.DeploymentDownEvent.Parser)); - static readonly grpc::Method __Method_Up = new grpc::Method( + static readonly grpc::Method __Method_Up = new grpc::Method( grpc::MethodType.ServerStreaming, __ServiceName, "Up", - __Marshaller_nitric_deploy_v1_DeployUpRequest, - __Marshaller_nitric_deploy_v1_DeployUpEvent); + __Marshaller_nitric_proto_deployments_v1_DeploymentUpRequest, + __Marshaller_nitric_proto_deployments_v1_DeploymentUpEvent); - static readonly grpc::Method __Method_Down = new grpc::Method( + static readonly grpc::Method __Method_Down = new grpc::Method( grpc::MethodType.ServerStreaming, __ServiceName, "Down", - __Marshaller_nitric_deploy_v1_DeployDownRequest, - __Marshaller_nitric_deploy_v1_DeployDownEvent); + __Marshaller_nitric_proto_deployments_v1_DeploymentDownRequest, + __Marshaller_nitric_proto_deployments_v1_DeploymentDownEvent); /// Service descriptor public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor { - get { return global::Nitric.Proto.Deploy.v1.DeployReflection.Descriptor.Services[0]; } + get { return global::Nitric.Proto.Deployments.v1.DeploymentsReflection.Descriptor.Services[0]; } } - /// Base class for server-side implementations of DeployService - [grpc::BindServiceMethod(typeof(DeployService), "BindService")] - public abstract partial class DeployServiceBase + /// Base class for server-side implementations of Deployment + [grpc::BindServiceMethod(typeof(Deployment), "BindService")] + public abstract partial class DeploymentBase { /// /// Begins a new deployment @@ -83,7 +83,7 @@ public abstract partial class DeployServiceBase /// Used for sending responses back to the client. /// The context of the server-side call handler being invoked. /// A task indicating completion of the handler. - public virtual global::System.Threading.Tasks.Task Up(global::Nitric.Proto.Deploy.v1.DeployUpRequest request, grpc::IServerStreamWriter responseStream, grpc::ServerCallContext context) + public virtual global::System.Threading.Tasks.Task Up(global::Nitric.Proto.Deployments.v1.DeploymentUpRequest request, grpc::IServerStreamWriter responseStream, grpc::ServerCallContext context) { throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); } @@ -97,33 +97,33 @@ public abstract partial class DeployServiceBase /// Used for sending responses back to the client. /// The context of the server-side call handler being invoked. /// A task indicating completion of the handler. - public virtual global::System.Threading.Tasks.Task Down(global::Nitric.Proto.Deploy.v1.DeployDownRequest request, grpc::IServerStreamWriter responseStream, grpc::ServerCallContext context) + public virtual global::System.Threading.Tasks.Task Down(global::Nitric.Proto.Deployments.v1.DeploymentDownRequest request, grpc::IServerStreamWriter responseStream, grpc::ServerCallContext context) { throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); } } - /// Client for DeployService - public partial class DeployServiceClient : grpc::ClientBase + /// Client for Deployment + public partial class DeploymentClient : grpc::ClientBase { - /// Creates a new client for DeployService + /// Creates a new client for Deployment /// The channel to use to make remote calls. - public DeployServiceClient(grpc::ChannelBase channel) : base(channel) + public DeploymentClient(grpc::ChannelBase channel) : base(channel) { } - /// Creates a new client for DeployService that uses a custom CallInvoker. + /// Creates a new client for Deployment that uses a custom CallInvoker. /// The callInvoker to use to make remote calls. - public DeployServiceClient(grpc::CallInvoker callInvoker) : base(callInvoker) + public DeploymentClient(grpc::CallInvoker callInvoker) : base(callInvoker) { } /// Protected parameterless constructor to allow creation of test doubles. - protected DeployServiceClient() : base() + protected DeploymentClient() : base() { } /// Protected constructor to allow creation of configured clients. /// The client configuration. - protected DeployServiceClient(ClientBaseConfiguration configuration) : base(configuration) + protected DeploymentClient(ClientBaseConfiguration configuration) : base(configuration) { } @@ -137,7 +137,7 @@ protected DeployServiceClient(ClientBaseConfiguration configuration) : base(conf /// An optional deadline for the call. The call will be cancelled if deadline is hit. /// An optional token for canceling the call. /// The call object. - public virtual grpc::AsyncServerStreamingCall Up(global::Nitric.Proto.Deploy.v1.DeployUpRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public virtual grpc::AsyncServerStreamingCall Up(global::Nitric.Proto.Deployments.v1.DeploymentUpRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { return Up(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } @@ -149,7 +149,7 @@ protected DeployServiceClient(ClientBaseConfiguration configuration) : base(conf /// The request to send to the server. /// The options for the call. /// The call object. - public virtual grpc::AsyncServerStreamingCall Up(global::Nitric.Proto.Deploy.v1.DeployUpRequest request, grpc::CallOptions options) + public virtual grpc::AsyncServerStreamingCall Up(global::Nitric.Proto.Deployments.v1.DeploymentUpRequest request, grpc::CallOptions options) { return CallInvoker.AsyncServerStreamingCall(__Method_Up, null, options, request); } @@ -163,7 +163,7 @@ protected DeployServiceClient(ClientBaseConfiguration configuration) : base(conf /// An optional deadline for the call. The call will be cancelled if deadline is hit. /// An optional token for canceling the call. /// The call object. - public virtual grpc::AsyncServerStreamingCall Down(global::Nitric.Proto.Deploy.v1.DeployDownRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public virtual grpc::AsyncServerStreamingCall Down(global::Nitric.Proto.Deployments.v1.DeploymentDownRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { return Down(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } @@ -175,20 +175,20 @@ protected DeployServiceClient(ClientBaseConfiguration configuration) : base(conf /// The request to send to the server. /// The options for the call. /// The call object. - public virtual grpc::AsyncServerStreamingCall Down(global::Nitric.Proto.Deploy.v1.DeployDownRequest request, grpc::CallOptions options) + public virtual grpc::AsyncServerStreamingCall Down(global::Nitric.Proto.Deployments.v1.DeploymentDownRequest request, grpc::CallOptions options) { return CallInvoker.AsyncServerStreamingCall(__Method_Down, null, options, request); } /// Creates a new instance of client from given ClientBaseConfiguration. - protected override DeployServiceClient NewInstance(ClientBaseConfiguration configuration) + protected override DeploymentClient NewInstance(ClientBaseConfiguration configuration) { - return new DeployServiceClient(configuration); + return new DeploymentClient(configuration); } } /// Creates service definition that can be registered with a server /// An object implementing the server-side handling logic. - public static grpc::ServerServiceDefinition BindService(DeployServiceBase serviceImpl) + public static grpc::ServerServiceDefinition BindService(DeploymentBase serviceImpl) { return grpc::ServerServiceDefinition.CreateBuilder() .AddMethod(__Method_Up, serviceImpl.Up) @@ -199,10 +199,10 @@ protected override DeployServiceClient NewInstance(ClientBaseConfiguration confi /// Note: this method is part of an experimental API that can change or be removed without any prior notice. /// Service methods will be bound by calling AddMethod on this object. /// An object implementing the server-side handling logic. - public static void BindService(grpc::ServiceBinderBase serviceBinder, DeployServiceBase serviceImpl) + public static void BindService(grpc::ServiceBinderBase serviceBinder, DeploymentBase serviceImpl) { - serviceBinder.AddMethod(__Method_Up, serviceImpl == null ? null : new grpc::ServerStreamingServerMethod(serviceImpl.Up)); - serviceBinder.AddMethod(__Method_Down, serviceImpl == null ? null : new grpc::ServerStreamingServerMethod(serviceImpl.Down)); + serviceBinder.AddMethod(__Method_Up, serviceImpl == null ? null : new grpc::ServerStreamingServerMethod(serviceImpl.Up)); + serviceBinder.AddMethod(__Method_Down, serviceImpl == null ? null : new grpc::ServerStreamingServerMethod(serviceImpl.Down)); } } diff --git a/src/Nitric.Sdk/Proto/proto/error/v1/Error.cs b/src/Nitric.Sdk/Proto/nitric/proto/http/v1/Http.cs similarity index 50% rename from src/Nitric.Sdk/Proto/proto/error/v1/Error.cs rename to src/Nitric.Sdk/Proto/nitric/proto/http/v1/Http.cs index f325a96..fec619a 100644 --- a/src/Nitric.Sdk/Proto/proto/error/v1/Error.cs +++ b/src/Nitric.Sdk/Proto/nitric/proto/http/v1/Http.cs @@ -1,6 +1,6 @@ // // Generated by the protocol buffer compiler. DO NOT EDIT! -// source: proto/error/v1/error.proto +// source: nitric/proto/http/v1/http.proto // #pragma warning disable 1591, 0612, 3021 #region Designer generated code @@ -9,55 +9,56 @@ using pbc = global::Google.Protobuf.Collections; using pbr = global::Google.Protobuf.Reflection; using scg = global::System.Collections.Generic; -namespace Nitric.Proto.Error.v1 { +namespace Nitric.Proto.Http.v1 { - /// Holder for reflection information generated from proto/error/v1/error.proto - public static partial class ErrorReflection { + /// Holder for reflection information generated from nitric/proto/http/v1/http.proto + public static partial class HttpReflection { #region Descriptor - /// File descriptor for proto/error/v1/error.proto + /// File descriptor for nitric/proto/http/v1/http.proto public static pbr::FileDescriptor Descriptor { get { return descriptor; } } private static pbr::FileDescriptor descriptor; - static ErrorReflection() { + static HttpReflection() { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( - "Chpwcm90by9lcnJvci92MS9lcnJvci5wcm90bxIPbml0cmljLmVycm9yLnYx", - "Io8BCgpFcnJvclNjb3BlEg8KB3NlcnZpY2UYASABKAkSDgoGcGx1Z2luGAIg", - "ASgJEjMKBGFyZ3MYAyADKAsyJS5uaXRyaWMuZXJyb3IudjEuRXJyb3JTY29w", - "ZS5BcmdzRW50cnkaKwoJQXJnc0VudHJ5EgsKA2tleRgBIAEoCRINCgV2YWx1", - "ZRgCIAEoCToCOAEiWgoMRXJyb3JEZXRhaWxzEg8KB21lc3NhZ2UYASABKAkS", - "DQoFY2F1c2UYAiABKAkSKgoFc2NvcGUYAyABKAsyGy5uaXRyaWMuZXJyb3Iu", - "djEuRXJyb3JTY29wZUKJAQoYaW8ubml0cmljLnByb3RvLmVycm9yLnYxQgZF", - "cnJvcnNQAVozZ2l0aHViLmNvbS9uaXRyaWN0ZWNoL25pdHJpYy9jb3JlL3Br", - "Zy9hcGkvbml0cmljL3YxqgIVTml0cmljLlByb3RvLkVycm9yLnYxygIVTml0", - "cmljXFByb3RvXEVycm9yXFYxYgZwcm90bzM=")); + "Ch9uaXRyaWMvcHJvdG8vaHR0cC92MS9odHRwLnByb3RvEhRuaXRyaWMucHJv", + "dG8uaHR0cC52MSJICg1DbGllbnRNZXNzYWdlEjcKB3JlcXVlc3QYASABKAsy", + "Ji5uaXRyaWMucHJvdG8uaHR0cC52MS5IdHRwUHJveHlSZXF1ZXN0Ig8KDVNl", + "cnZlck1lc3NhZ2UiIAoQSHR0cFByb3h5UmVxdWVzdBIMCgRob3N0GAEgASgJ", + "Ml0KBEh0dHASVQoFUHJveHkSIy5uaXRyaWMucHJvdG8uaHR0cC52MS5DbGll", + "bnRNZXNzYWdlGiMubml0cmljLnByb3RvLmh0dHAudjEuU2VydmVyTWVzc2Fn", + "ZSgBMAFCkgEKF2lvLm5pdHJpYy5wcm90by5odHRwLnYxQgtIdHRwU2Vydmlj", + "ZVABWjpnaXRodWIuY29tL25pdHJpY3RlY2gvbml0cmljL2NvcmUvcGtnL3By", + "b3RvL2h0dHAvdjE7aHR0cHBiqgIUTml0cmljLlByb3RvLkh0dHAudjHKAhRO", + "aXRyaWNcUHJvdG9cSHR0cFxWMWIGcHJvdG8z")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { }, new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Error.v1.ErrorScope), global::Nitric.Proto.Error.v1.ErrorScope.Parser, new[]{ "Service", "Plugin", "Args" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { null, }), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Error.v1.ErrorDetails), global::Nitric.Proto.Error.v1.ErrorDetails.Parser, new[]{ "Message", "Cause", "Scope" }, null, null, null, null) + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Http.v1.ClientMessage), global::Nitric.Proto.Http.v1.ClientMessage.Parser, new[]{ "Request" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Http.v1.ServerMessage), global::Nitric.Proto.Http.v1.ServerMessage.Parser, null, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Http.v1.HttpProxyRequest), global::Nitric.Proto.Http.v1.HttpProxyRequest.Parser, new[]{ "Host" }, null, null, null, null) })); } #endregion } #region Messages - public sealed partial class ErrorScope : pb::IMessage + public sealed partial class ClientMessage : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ErrorScope()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ClientMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Error.v1.ErrorReflection.Descriptor.MessageTypes[0]; } + get { return global::Nitric.Proto.Http.v1.HttpReflection.Descriptor.MessageTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -66,91 +67,58 @@ public sealed partial class ErrorScope : pb::IMessage } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ErrorScope() { + public ClientMessage() { OnConstruction(); } partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ErrorScope(ErrorScope other) : this() { - service_ = other.service_; - plugin_ = other.plugin_; - args_ = other.args_.Clone(); + public ClientMessage(ClientMessage other) : this() { + request_ = other.request_ != null ? other.request_.Clone() : null; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ErrorScope Clone() { - return new ErrorScope(this); + public ClientMessage Clone() { + return new ClientMessage(this); } - /// Field number for the "service" field. - public const int ServiceFieldNumber = 1; - private string service_ = ""; + /// Field number for the "request" field. + public const int RequestFieldNumber = 1; + private global::Nitric.Proto.Http.v1.HttpProxyRequest request_; /// - /// The API service invoked, e.g. 'Service.Method'. + /// Details of the HTTP server to proxy /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string Service { - get { return service_; } + public global::Nitric.Proto.Http.v1.HttpProxyRequest Request { + get { return request_; } set { - service_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + request_ = value; } } - /// Field number for the "plugin" field. - public const int PluginFieldNumber = 2; - private string plugin_ = ""; - /// - /// The plugin method invoked, e.g. 'PluginService.Method'. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string Plugin { - get { return plugin_; } - set { - plugin_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "args" field. - public const int ArgsFieldNumber = 3; - private static readonly pbc::MapField.Codec _map_args_codec - = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForString(18, ""), 26); - private readonly pbc::MapField args_ = new pbc::MapField(); - /// - /// The plugin method arguments, ensure only non-sensitive data is specified. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::MapField Args { - get { return args_; } - } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { - return Equals(other as ErrorScope); + return Equals(other as ClientMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(ErrorScope other) { + public bool Equals(ClientMessage other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } - if (Service != other.Service) return false; - if (Plugin != other.Plugin) return false; - if (!Args.Equals(other.Args)) return false; + if (!object.Equals(Request, other.Request)) return false; return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; - if (Service.Length != 0) hash ^= Service.GetHashCode(); - if (Plugin.Length != 0) hash ^= Plugin.GetHashCode(); - hash ^= Args.GetHashCode(); + if (request_ != null) hash ^= Request.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -167,15 +135,10 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else - if (Service.Length != 0) { + if (request_ != null) { output.WriteRawTag(10); - output.WriteString(Service); - } - if (Plugin.Length != 0) { - output.WriteRawTag(18); - output.WriteString(Plugin); + output.WriteMessage(Request); } - args_.WriteTo(output, _map_args_codec); if (_unknownFields != null) { _unknownFields.WriteTo(output); } @@ -185,15 +148,10 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (Service.Length != 0) { + if (request_ != null) { output.WriteRawTag(10); - output.WriteString(Service); - } - if (Plugin.Length != 0) { - output.WriteRawTag(18); - output.WriteString(Plugin); + output.WriteMessage(Request); } - args_.WriteTo(ref output, _map_args_codec); if (_unknownFields != null) { _unknownFields.WriteTo(ref output); } @@ -203,13 +161,9 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; - if (Service.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Service); + if (request_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Request); } - if (Plugin.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Plugin); - } - size += args_.CalculateSize(_map_args_codec); if (_unknownFields != null) { size += _unknownFields.CalculateSize(); } @@ -217,17 +171,16 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(ErrorScope other) { + public void MergeFrom(ClientMessage other) { if (other == null) { return; } - if (other.Service.Length != 0) { - Service = other.Service; - } - if (other.Plugin.Length != 0) { - Plugin = other.Plugin; + if (other.request_ != null) { + if (request_ == null) { + Request = new global::Nitric.Proto.Http.v1.HttpProxyRequest(); + } + Request.MergeFrom(other.Request); } - args_.Add(other.args_); _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } @@ -243,15 +196,10 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { - Service = input.ReadString(); - break; - } - case 18: { - Plugin = input.ReadString(); - break; - } - case 26: { - args_.AddEntriesFrom(input, _map_args_codec); + if (request_ == null) { + Request = new global::Nitric.Proto.Http.v1.HttpProxyRequest(); + } + input.ReadMessage(Request); break; } } @@ -269,15 +217,10 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; case 10: { - Service = input.ReadString(); - break; - } - case 18: { - Plugin = input.ReadString(); - break; - } - case 26: { - args_.AddEntriesFrom(ref input, _map_args_codec); + if (request_ == null) { + Request = new global::Nitric.Proto.Http.v1.HttpProxyRequest(); + } + input.ReadMessage(Request); break; } } @@ -287,19 +230,19 @@ public void MergeFrom(pb::CodedInputStream input) { } - public sealed partial class ErrorDetails : pb::IMessage + public sealed partial class ServerMessage : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ErrorDetails()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ServerMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Error.v1.ErrorReflection.Descriptor.MessageTypes[1]; } + get { return global::Nitric.Proto.Http.v1.HttpReflection.Descriptor.MessageTypes[1]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -308,92 +251,194 @@ public sealed partial class ErrorDetails : pb::IMessage } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ErrorDetails() { + public ServerMessage() { OnConstruction(); } partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ErrorDetails(ErrorDetails other) : this() { - message_ = other.message_; - cause_ = other.cause_; - scope_ = other.scope_ != null ? other.scope_.Clone() : null; + public ServerMessage(ServerMessage other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ErrorDetails Clone() { - return new ErrorDetails(this); + public ServerMessage Clone() { + return new ServerMessage(this); } - /// Field number for the "message" field. - public const int MessageFieldNumber = 1; - private string message_ = ""; - /// - /// The developer error message, explaining the error and ideally solution. - /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string Message { - get { return message_; } - set { - message_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + public override bool Equals(object other) { + return Equals(other as ServerMessage); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ServerMessage other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; } + return Equals(_unknownFields, other._unknownFields); } - /// Field number for the "cause" field. - public const int CauseFieldNumber = 2; - private string cause_ = ""; - /// - /// The error root cause. - /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string Cause { - get { return cause_; } - set { - cause_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + public override int GetHashCode() { + int hash = 1; + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); } } + #endif - /// Field number for the "scope" field. - public const int ScopeFieldNumber = 3; - private global::Nitric.Proto.Error.v1.ErrorScope scope_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(ServerMessage other) { + if (other == null) { + return; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + } + } + } + #endif + + } + + public sealed partial class HttpProxyRequest : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new HttpProxyRequest()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Nitric.Proto.Http.v1.HttpReflection.Descriptor.MessageTypes[2]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public HttpProxyRequest() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public HttpProxyRequest(HttpProxyRequest other) : this() { + host_ = other.host_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public HttpProxyRequest Clone() { + return new HttpProxyRequest(this); + } + + /// Field number for the "host" field. + public const int HostFieldNumber = 1; + private string host_ = ""; /// - /// The scope of the error. + /// The address the server can be accessed on /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Error.v1.ErrorScope Scope { - get { return scope_; } + public string Host { + get { return host_; } set { - scope_ = value; + host_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { - return Equals(other as ErrorDetails); + return Equals(other as HttpProxyRequest); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(ErrorDetails other) { + public bool Equals(HttpProxyRequest other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } - if (Message != other.Message) return false; - if (Cause != other.Cause) return false; - if (!object.Equals(Scope, other.Scope)) return false; + if (Host != other.Host) return false; return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; - if (Message.Length != 0) hash ^= Message.GetHashCode(); - if (Cause.Length != 0) hash ^= Cause.GetHashCode(); - if (scope_ != null) hash ^= Scope.GetHashCode(); + if (Host.Length != 0) hash ^= Host.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -410,17 +455,9 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else - if (Message.Length != 0) { + if (Host.Length != 0) { output.WriteRawTag(10); - output.WriteString(Message); - } - if (Cause.Length != 0) { - output.WriteRawTag(18); - output.WriteString(Cause); - } - if (scope_ != null) { - output.WriteRawTag(26); - output.WriteMessage(Scope); + output.WriteString(Host); } if (_unknownFields != null) { _unknownFields.WriteTo(output); @@ -431,17 +468,9 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (Message.Length != 0) { + if (Host.Length != 0) { output.WriteRawTag(10); - output.WriteString(Message); - } - if (Cause.Length != 0) { - output.WriteRawTag(18); - output.WriteString(Cause); - } - if (scope_ != null) { - output.WriteRawTag(26); - output.WriteMessage(Scope); + output.WriteString(Host); } if (_unknownFields != null) { _unknownFields.WriteTo(ref output); @@ -452,14 +481,8 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; - if (Message.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Message); - } - if (Cause.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Cause); - } - if (scope_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Scope); + if (Host.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Host); } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); @@ -468,21 +491,12 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(ErrorDetails other) { + public void MergeFrom(HttpProxyRequest other) { if (other == null) { return; } - if (other.Message.Length != 0) { - Message = other.Message; - } - if (other.Cause.Length != 0) { - Cause = other.Cause; - } - if (other.scope_ != null) { - if (scope_ == null) { - Scope = new global::Nitric.Proto.Error.v1.ErrorScope(); - } - Scope.MergeFrom(other.Scope); + if (other.Host.Length != 0) { + Host = other.Host; } _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } @@ -499,18 +513,7 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { - Message = input.ReadString(); - break; - } - case 18: { - Cause = input.ReadString(); - break; - } - case 26: { - if (scope_ == null) { - Scope = new global::Nitric.Proto.Error.v1.ErrorScope(); - } - input.ReadMessage(Scope); + Host = input.ReadString(); break; } } @@ -528,18 +531,7 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; case 10: { - Message = input.ReadString(); - break; - } - case 18: { - Cause = input.ReadString(); - break; - } - case 26: { - if (scope_ == null) { - Scope = new global::Nitric.Proto.Error.v1.ErrorScope(); - } - input.ReadMessage(Scope); + Host = input.ReadString(); break; } } diff --git a/src/Nitric.Sdk/Proto/proto/faas/v1/FaasGrpc.cs b/src/Nitric.Sdk/Proto/nitric/proto/http/v1/HttpGrpc.cs similarity index 54% rename from src/Nitric.Sdk/Proto/proto/faas/v1/FaasGrpc.cs rename to src/Nitric.Sdk/Proto/nitric/proto/http/v1/HttpGrpc.cs index 8e784e6..d8704fb 100644 --- a/src/Nitric.Sdk/Proto/proto/faas/v1/FaasGrpc.cs +++ b/src/Nitric.Sdk/Proto/nitric/proto/http/v1/HttpGrpc.cs @@ -1,19 +1,19 @@ // // Generated by the protocol buffer compiler. DO NOT EDIT! -// source: proto/faas/v1/faas.proto +// source: nitric/proto/http/v1/http.proto // #pragma warning disable 0414, 1591 #region Designer generated code using grpc = global::Grpc.Core; -namespace Nitric.Proto.Faas.v1 { +namespace Nitric.Proto.Http.v1 { /// - /// Service for streaming communication with gRPC FaaS implementations + /// Service for proxying HTTP requests /// - public static partial class FaasService + public static partial class Http { - static readonly string __ServiceName = "nitric.faas.v1.FaasService"; + static readonly string __ServiceName = "nitric.proto.http.v1.Http"; static void __Helper_SerializeMessage(global::Google.Protobuf.IMessage message, grpc::SerializationContext context) { @@ -45,105 +45,105 @@ static T __Helper_DeserializeMessage(grpc::DeserializationContext context, gl return parser.ParseFrom(context.PayloadAsNewBuffer()); } - static readonly grpc::Marshaller __Marshaller_nitric_faas_v1_ClientMessage = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Faas.v1.ClientMessage.Parser)); - static readonly grpc::Marshaller __Marshaller_nitric_faas_v1_ServerMessage = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Faas.v1.ServerMessage.Parser)); + static readonly grpc::Marshaller __Marshaller_nitric_proto_http_v1_ClientMessage = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Http.v1.ClientMessage.Parser)); + static readonly grpc::Marshaller __Marshaller_nitric_proto_http_v1_ServerMessage = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Http.v1.ServerMessage.Parser)); - static readonly grpc::Method __Method_TriggerStream = new grpc::Method( + static readonly grpc::Method __Method_Proxy = new grpc::Method( grpc::MethodType.DuplexStreaming, __ServiceName, - "TriggerStream", - __Marshaller_nitric_faas_v1_ClientMessage, - __Marshaller_nitric_faas_v1_ServerMessage); + "Proxy", + __Marshaller_nitric_proto_http_v1_ClientMessage, + __Marshaller_nitric_proto_http_v1_ServerMessage); /// Service descriptor public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor { - get { return global::Nitric.Proto.Faas.v1.FaasReflection.Descriptor.Services[0]; } + get { return global::Nitric.Proto.Http.v1.HttpReflection.Descriptor.Services[0]; } } - /// Base class for server-side implementations of FaasService - [grpc::BindServiceMethod(typeof(FaasService), "BindService")] - public abstract partial class FaasServiceBase + /// Base class for server-side implementations of Http + [grpc::BindServiceMethod(typeof(Http), "BindService")] + public abstract partial class HttpBase { /// - /// Begin streaming triggers/response to/from the membrane + /// Proxy an HTTP server /// /// Used for reading requests from the client. /// Used for sending responses back to the client. /// The context of the server-side call handler being invoked. /// A task indicating completion of the handler. - public virtual global::System.Threading.Tasks.Task TriggerStream(grpc::IAsyncStreamReader requestStream, grpc::IServerStreamWriter responseStream, grpc::ServerCallContext context) + public virtual global::System.Threading.Tasks.Task Proxy(grpc::IAsyncStreamReader requestStream, grpc::IServerStreamWriter responseStream, grpc::ServerCallContext context) { throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); } } - /// Client for FaasService - public partial class FaasServiceClient : grpc::ClientBase + /// Client for Http + public partial class HttpClient : grpc::ClientBase { - /// Creates a new client for FaasService + /// Creates a new client for Http /// The channel to use to make remote calls. - public FaasServiceClient(grpc::ChannelBase channel) : base(channel) + public HttpClient(grpc::ChannelBase channel) : base(channel) { } - /// Creates a new client for FaasService that uses a custom CallInvoker. + /// Creates a new client for Http that uses a custom CallInvoker. /// The callInvoker to use to make remote calls. - public FaasServiceClient(grpc::CallInvoker callInvoker) : base(callInvoker) + public HttpClient(grpc::CallInvoker callInvoker) : base(callInvoker) { } /// Protected parameterless constructor to allow creation of test doubles. - protected FaasServiceClient() : base() + protected HttpClient() : base() { } /// Protected constructor to allow creation of configured clients. /// The client configuration. - protected FaasServiceClient(ClientBaseConfiguration configuration) : base(configuration) + protected HttpClient(ClientBaseConfiguration configuration) : base(configuration) { } /// - /// Begin streaming triggers/response to/from the membrane + /// Proxy an HTTP server /// /// The initial metadata to send with the call. This parameter is optional. /// An optional deadline for the call. The call will be cancelled if deadline is hit. /// An optional token for canceling the call. /// The call object. - public virtual grpc::AsyncDuplexStreamingCall TriggerStream(grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public virtual grpc::AsyncDuplexStreamingCall Proxy(grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { - return TriggerStream(new grpc::CallOptions(headers, deadline, cancellationToken)); + return Proxy(new grpc::CallOptions(headers, deadline, cancellationToken)); } /// - /// Begin streaming triggers/response to/from the membrane + /// Proxy an HTTP server /// /// The options for the call. /// The call object. - public virtual grpc::AsyncDuplexStreamingCall TriggerStream(grpc::CallOptions options) + public virtual grpc::AsyncDuplexStreamingCall Proxy(grpc::CallOptions options) { - return CallInvoker.AsyncDuplexStreamingCall(__Method_TriggerStream, null, options); + return CallInvoker.AsyncDuplexStreamingCall(__Method_Proxy, null, options); } /// Creates a new instance of client from given ClientBaseConfiguration. - protected override FaasServiceClient NewInstance(ClientBaseConfiguration configuration) + protected override HttpClient NewInstance(ClientBaseConfiguration configuration) { - return new FaasServiceClient(configuration); + return new HttpClient(configuration); } } /// Creates service definition that can be registered with a server /// An object implementing the server-side handling logic. - public static grpc::ServerServiceDefinition BindService(FaasServiceBase serviceImpl) + public static grpc::ServerServiceDefinition BindService(HttpBase serviceImpl) { return grpc::ServerServiceDefinition.CreateBuilder() - .AddMethod(__Method_TriggerStream, serviceImpl.TriggerStream).Build(); + .AddMethod(__Method_Proxy, serviceImpl.Proxy).Build(); } /// Register service method with a service binder with or without implementation. Useful when customizing the service binding logic. /// Note: this method is part of an experimental API that can change or be removed without any prior notice. /// Service methods will be bound by calling AddMethod on this object. /// An object implementing the server-side handling logic. - public static void BindService(grpc::ServiceBinderBase serviceBinder, FaasServiceBase serviceImpl) + public static void BindService(grpc::ServiceBinderBase serviceBinder, HttpBase serviceImpl) { - serviceBinder.AddMethod(__Method_TriggerStream, serviceImpl == null ? null : new grpc::DuplexStreamingServerMethod(serviceImpl.TriggerStream)); + serviceBinder.AddMethod(__Method_Proxy, serviceImpl == null ? null : new grpc::DuplexStreamingServerMethod(serviceImpl.Proxy)); } } diff --git a/src/Nitric.Sdk/Proto/nitric/proto/keyvalue/v1/Keyvalue.cs b/src/Nitric.Sdk/Proto/nitric/proto/keyvalue/v1/Keyvalue.cs new file mode 100644 index 0000000..c914017 --- /dev/null +++ b/src/Nitric.Sdk/Proto/nitric/proto/keyvalue/v1/Keyvalue.cs @@ -0,0 +1,1761 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: nitric/proto/keyvalue/v1/keyvalue.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Nitric.Proto.KeyValue.v1 { + + /// Holder for reflection information generated from nitric/proto/keyvalue/v1/keyvalue.proto + public static partial class KeyvalueReflection { + + #region Descriptor + /// File descriptor for nitric/proto/keyvalue/v1/keyvalue.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static KeyvalueReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CiduaXRyaWMvcHJvdG8va2V5dmFsdWUvdjEva2V5dmFsdWUucHJvdG8SGG5p", + "dHJpYy5wcm90by5LZXlWYWx1ZS52MRocZ29vZ2xlL3Byb3RvYnVmL3N0cnVj", + "dC5wcm90byIVCgVTdG9yZRIMCgRuYW1lGAEgASgJIiYKCFZhbHVlUmVmEg0K", + "BXN0b3JlGAEgASgJEgsKA2tleRgCIAEoCSJiCgVWYWx1ZRIvCgNyZWYYASAB", + "KAsyIi5uaXRyaWMucHJvdG8uS2V5VmFsdWUudjEuVmFsdWVSZWYSKAoHY29u", + "dGVudBgCIAEoCzIXLmdvb2dsZS5wcm90b2J1Zi5TdHJ1Y3QiRQoSS2V5VmFs", + "dWVHZXRSZXF1ZXN0Ei8KA3JlZhgBIAEoCzIiLm5pdHJpYy5wcm90by5LZXlW", + "YWx1ZS52MS5WYWx1ZVJlZiJFChNLZXlWYWx1ZUdldFJlc3BvbnNlEi4KBXZh", + "bHVlGAEgASgLMh8ubml0cmljLnByb3RvLktleVZhbHVlLnYxLlZhbHVlIm8K", + "EktleVZhbHVlU2V0UmVxdWVzdBIvCgNyZWYYASABKAsyIi5uaXRyaWMucHJv", + "dG8uS2V5VmFsdWUudjEuVmFsdWVSZWYSKAoHY29udGVudBgDIAEoCzIXLmdv", + "b2dsZS5wcm90b2J1Zi5TdHJ1Y3QiFQoTS2V5VmFsdWVTZXRSZXNwb25zZSJI", + "ChVLZXlWYWx1ZURlbGV0ZVJlcXVlc3QSLwoDcmVmGAEgASgLMiIubml0cmlj", + "LnByb3RvLktleVZhbHVlLnYxLlZhbHVlUmVmIhgKFktleVZhbHVlRGVsZXRl", + "UmVzcG9uc2UyvwIKCEtleVZhbHVlEmIKA0dldBIsLm5pdHJpYy5wcm90by5L", + "ZXlWYWx1ZS52MS5LZXlWYWx1ZUdldFJlcXVlc3QaLS5uaXRyaWMucHJvdG8u", + "S2V5VmFsdWUudjEuS2V5VmFsdWVHZXRSZXNwb25zZRJiCgNTZXQSLC5uaXRy", + "aWMucHJvdG8uS2V5VmFsdWUudjEuS2V5VmFsdWVTZXRSZXF1ZXN0Gi0ubml0", + "cmljLnByb3RvLktleVZhbHVlLnYxLktleVZhbHVlU2V0UmVzcG9uc2USawoG", + "RGVsZXRlEi8ubml0cmljLnByb3RvLktleVZhbHVlLnYxLktleVZhbHVlRGVs", + "ZXRlUmVxdWVzdBowLm5pdHJpYy5wcm90by5LZXlWYWx1ZS52MS5LZXlWYWx1", + "ZURlbGV0ZVJlc3BvbnNlQqoBChtpby5uaXRyaWMucHJvdG8ua2V5dmFsdWUu", + "djFCD0tleVZhbHVlU2VydmljZVABWkJnaXRodWIuY29tL25pdHJpY3RlY2gv", + "bml0cmljL2NvcmUvcGtnL3Byb3RvL2tleXZhbHVlL3YxO0tleVZhbHVlcGKq", + "AhhOaXRyaWMuUHJvdG8uS2V5VmFsdWUudjHKAhhOaXRyaWNcUHJvdG9cS2V5", + "VmFsdWVcVjFiBnByb3RvMw==")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Google.Protobuf.WellKnownTypes.StructReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.KeyValue.v1.Store), global::Nitric.Proto.KeyValue.v1.Store.Parser, new[]{ "Name" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.KeyValue.v1.ValueRef), global::Nitric.Proto.KeyValue.v1.ValueRef.Parser, new[]{ "Store", "Key" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.KeyValue.v1.Value), global::Nitric.Proto.KeyValue.v1.Value.Parser, new[]{ "Ref", "Content" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.KeyValue.v1.KeyValueGetRequest), global::Nitric.Proto.KeyValue.v1.KeyValueGetRequest.Parser, new[]{ "Ref" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.KeyValue.v1.KeyValueGetResponse), global::Nitric.Proto.KeyValue.v1.KeyValueGetResponse.Parser, new[]{ "Value" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.KeyValue.v1.KeyValueSetRequest), global::Nitric.Proto.KeyValue.v1.KeyValueSetRequest.Parser, new[]{ "Ref", "Content" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.KeyValue.v1.KeyValueSetResponse), global::Nitric.Proto.KeyValue.v1.KeyValueSetResponse.Parser, null, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.KeyValue.v1.KeyValueDeleteRequest), global::Nitric.Proto.KeyValue.v1.KeyValueDeleteRequest.Parser, new[]{ "Ref" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.KeyValue.v1.KeyValueDeleteResponse), global::Nitric.Proto.KeyValue.v1.KeyValueDeleteResponse.Parser, null, null, null, null, null) + })); + } + #endregion + + } + #region Messages + /// + /// Provides a Key/Value Store + /// + public sealed partial class Store : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Store()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Nitric.Proto.KeyValue.v1.KeyvalueReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Store() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Store(Store other) : this() { + name_ = other.name_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Store Clone() { + return new Store(this); + } + + /// Field number for the "name" field. + public const int NameFieldNumber = 1; + private string name_ = ""; + /// + /// The store name + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Name { + get { return name_; } + set { + name_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as Store); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(Store other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Name != other.Name) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Name.Length != 0) hash ^= Name.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (Name.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Name); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Name.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Name); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Name.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Name); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(Store other) { + if (other == null) { + return; + } + if (other.Name.Length != 0) { + Name = other.Name; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Name = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Name = input.ReadString(); + break; + } + } + } + } + #endif + + } + + /// + /// ValueRef provides a unique identifier for a value + /// + public sealed partial class ValueRef : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ValueRef()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Nitric.Proto.KeyValue.v1.KeyvalueReflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ValueRef() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ValueRef(ValueRef other) : this() { + store_ = other.store_; + key_ = other.key_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ValueRef Clone() { + return new ValueRef(this); + } + + /// Field number for the "store" field. + public const int StoreFieldNumber = 1; + private string store_ = ""; + /// + /// The key/value store name + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Store { + get { return store_; } + set { + store_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "key" field. + public const int KeyFieldNumber = 2; + private string key_ = ""; + /// + /// The item's unique key within the store + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Key { + get { return key_; } + set { + key_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as ValueRef); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ValueRef other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Store != other.Store) return false; + if (Key != other.Key) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Store.Length != 0) hash ^= Store.GetHashCode(); + if (Key.Length != 0) hash ^= Key.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (Store.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Store); + } + if (Key.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Key); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Store.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Store); + } + if (Key.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Key); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Store.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Store); + } + if (Key.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Key); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(ValueRef other) { + if (other == null) { + return; + } + if (other.Store.Length != 0) { + Store = other.Store; + } + if (other.Key.Length != 0) { + Key = other.Key; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Store = input.ReadString(); + break; + } + case 18: { + Key = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Store = input.ReadString(); + break; + } + case 18: { + Key = input.ReadString(); + break; + } + } + } + } + #endif + + } + + /// + /// Value provides a return value type + /// + public sealed partial class Value : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Value()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Nitric.Proto.KeyValue.v1.KeyvalueReflection.Descriptor.MessageTypes[2]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Value() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Value(Value other) : this() { + ref_ = other.ref_ != null ? other.ref_.Clone() : null; + content_ = other.content_ != null ? other.content_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Value Clone() { + return new Value(this); + } + + /// Field number for the "ref" field. + public const int RefFieldNumber = 1; + private global::Nitric.Proto.KeyValue.v1.ValueRef ref_; + /// + /// ValueRef of the key/value pair, which includes the store and key + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Nitric.Proto.KeyValue.v1.ValueRef Ref { + get { return ref_; } + set { + ref_ = value; + } + } + + /// Field number for the "content" field. + public const int ContentFieldNumber = 2; + private global::Google.Protobuf.WellKnownTypes.Struct content_; + /// + /// The content (JSON object) + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Google.Protobuf.WellKnownTypes.Struct Content { + get { return content_; } + set { + content_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as Value); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(Value other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(Ref, other.Ref)) return false; + if (!object.Equals(Content, other.Content)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (ref_ != null) hash ^= Ref.GetHashCode(); + if (content_ != null) hash ^= Content.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (ref_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Ref); + } + if (content_ != null) { + output.WriteRawTag(18); + output.WriteMessage(Content); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (ref_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Ref); + } + if (content_ != null) { + output.WriteRawTag(18); + output.WriteMessage(Content); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (ref_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Ref); + } + if (content_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Content); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(Value other) { + if (other == null) { + return; + } + if (other.ref_ != null) { + if (ref_ == null) { + Ref = new global::Nitric.Proto.KeyValue.v1.ValueRef(); + } + Ref.MergeFrom(other.Ref); + } + if (other.content_ != null) { + if (content_ == null) { + Content = new global::Google.Protobuf.WellKnownTypes.Struct(); + } + Content.MergeFrom(other.Content); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (ref_ == null) { + Ref = new global::Nitric.Proto.KeyValue.v1.ValueRef(); + } + input.ReadMessage(Ref); + break; + } + case 18: { + if (content_ == null) { + Content = new global::Google.Protobuf.WellKnownTypes.Struct(); + } + input.ReadMessage(Content); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (ref_ == null) { + Ref = new global::Nitric.Proto.KeyValue.v1.ValueRef(); + } + input.ReadMessage(Ref); + break; + } + case 18: { + if (content_ == null) { + Content = new global::Google.Protobuf.WellKnownTypes.Struct(); + } + input.ReadMessage(Content); + break; + } + } + } + } + #endif + + } + + public sealed partial class KeyValueGetRequest : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new KeyValueGetRequest()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Nitric.Proto.KeyValue.v1.KeyvalueReflection.Descriptor.MessageTypes[3]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public KeyValueGetRequest() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public KeyValueGetRequest(KeyValueGetRequest other) : this() { + ref_ = other.ref_ != null ? other.ref_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public KeyValueGetRequest Clone() { + return new KeyValueGetRequest(this); + } + + /// Field number for the "ref" field. + public const int RefFieldNumber = 1; + private global::Nitric.Proto.KeyValue.v1.ValueRef ref_; + /// + /// ValueRef of the key/value pair to get, which includes the store and key + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Nitric.Proto.KeyValue.v1.ValueRef Ref { + get { return ref_; } + set { + ref_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as KeyValueGetRequest); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(KeyValueGetRequest other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(Ref, other.Ref)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (ref_ != null) hash ^= Ref.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (ref_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Ref); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (ref_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Ref); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (ref_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Ref); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(KeyValueGetRequest other) { + if (other == null) { + return; + } + if (other.ref_ != null) { + if (ref_ == null) { + Ref = new global::Nitric.Proto.KeyValue.v1.ValueRef(); + } + Ref.MergeFrom(other.Ref); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (ref_ == null) { + Ref = new global::Nitric.Proto.KeyValue.v1.ValueRef(); + } + input.ReadMessage(Ref); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (ref_ == null) { + Ref = new global::Nitric.Proto.KeyValue.v1.ValueRef(); + } + input.ReadMessage(Ref); + break; + } + } + } + } + #endif + + } + + public sealed partial class KeyValueGetResponse : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new KeyValueGetResponse()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Nitric.Proto.KeyValue.v1.KeyvalueReflection.Descriptor.MessageTypes[4]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public KeyValueGetResponse() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public KeyValueGetResponse(KeyValueGetResponse other) : this() { + value_ = other.value_ != null ? other.value_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public KeyValueGetResponse Clone() { + return new KeyValueGetResponse(this); + } + + /// Field number for the "value" field. + public const int ValueFieldNumber = 1; + private global::Nitric.Proto.KeyValue.v1.Value value_; + /// + /// The retrieved value + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Nitric.Proto.KeyValue.v1.Value Value { + get { return value_; } + set { + value_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as KeyValueGetResponse); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(KeyValueGetResponse other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(Value, other.Value)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (value_ != null) hash ^= Value.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (value_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Value); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (value_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Value); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (value_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Value); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(KeyValueGetResponse other) { + if (other == null) { + return; + } + if (other.value_ != null) { + if (value_ == null) { + Value = new global::Nitric.Proto.KeyValue.v1.Value(); + } + Value.MergeFrom(other.Value); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (value_ == null) { + Value = new global::Nitric.Proto.KeyValue.v1.Value(); + } + input.ReadMessage(Value); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (value_ == null) { + Value = new global::Nitric.Proto.KeyValue.v1.Value(); + } + input.ReadMessage(Value); + break; + } + } + } + } + #endif + + } + + public sealed partial class KeyValueSetRequest : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new KeyValueSetRequest()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Nitric.Proto.KeyValue.v1.KeyvalueReflection.Descriptor.MessageTypes[5]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public KeyValueSetRequest() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public KeyValueSetRequest(KeyValueSetRequest other) : this() { + ref_ = other.ref_ != null ? other.ref_.Clone() : null; + content_ = other.content_ != null ? other.content_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public KeyValueSetRequest Clone() { + return new KeyValueSetRequest(this); + } + + /// Field number for the "ref" field. + public const int RefFieldNumber = 1; + private global::Nitric.Proto.KeyValue.v1.ValueRef ref_; + /// + /// ValueRef of the key/value pair to set, which includes the store and key + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Nitric.Proto.KeyValue.v1.ValueRef Ref { + get { return ref_; } + set { + ref_ = value; + } + } + + /// Field number for the "content" field. + public const int ContentFieldNumber = 3; + private global::Google.Protobuf.WellKnownTypes.Struct content_; + /// + /// The value content to store (JSON object) + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Google.Protobuf.WellKnownTypes.Struct Content { + get { return content_; } + set { + content_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as KeyValueSetRequest); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(KeyValueSetRequest other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(Ref, other.Ref)) return false; + if (!object.Equals(Content, other.Content)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (ref_ != null) hash ^= Ref.GetHashCode(); + if (content_ != null) hash ^= Content.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (ref_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Ref); + } + if (content_ != null) { + output.WriteRawTag(26); + output.WriteMessage(Content); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (ref_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Ref); + } + if (content_ != null) { + output.WriteRawTag(26); + output.WriteMessage(Content); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (ref_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Ref); + } + if (content_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Content); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(KeyValueSetRequest other) { + if (other == null) { + return; + } + if (other.ref_ != null) { + if (ref_ == null) { + Ref = new global::Nitric.Proto.KeyValue.v1.ValueRef(); + } + Ref.MergeFrom(other.Ref); + } + if (other.content_ != null) { + if (content_ == null) { + Content = new global::Google.Protobuf.WellKnownTypes.Struct(); + } + Content.MergeFrom(other.Content); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (ref_ == null) { + Ref = new global::Nitric.Proto.KeyValue.v1.ValueRef(); + } + input.ReadMessage(Ref); + break; + } + case 26: { + if (content_ == null) { + Content = new global::Google.Protobuf.WellKnownTypes.Struct(); + } + input.ReadMessage(Content); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (ref_ == null) { + Ref = new global::Nitric.Proto.KeyValue.v1.ValueRef(); + } + input.ReadMessage(Ref); + break; + } + case 26: { + if (content_ == null) { + Content = new global::Google.Protobuf.WellKnownTypes.Struct(); + } + input.ReadMessage(Content); + break; + } + } + } + } + #endif + + } + + public sealed partial class KeyValueSetResponse : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new KeyValueSetResponse()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Nitric.Proto.KeyValue.v1.KeyvalueReflection.Descriptor.MessageTypes[6]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public KeyValueSetResponse() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public KeyValueSetResponse(KeyValueSetResponse other) : this() { + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public KeyValueSetResponse Clone() { + return new KeyValueSetResponse(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as KeyValueSetResponse); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(KeyValueSetResponse other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(KeyValueSetResponse other) { + if (other == null) { + return; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + } + } + } + #endif + + } + + public sealed partial class KeyValueDeleteRequest : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new KeyValueDeleteRequest()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Nitric.Proto.KeyValue.v1.KeyvalueReflection.Descriptor.MessageTypes[7]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public KeyValueDeleteRequest() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public KeyValueDeleteRequest(KeyValueDeleteRequest other) : this() { + ref_ = other.ref_ != null ? other.ref_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public KeyValueDeleteRequest Clone() { + return new KeyValueDeleteRequest(this); + } + + /// Field number for the "ref" field. + public const int RefFieldNumber = 1; + private global::Nitric.Proto.KeyValue.v1.ValueRef ref_; + /// + /// ValueRef of the key/value pair to delete, which includes the store and key + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Nitric.Proto.KeyValue.v1.ValueRef Ref { + get { return ref_; } + set { + ref_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as KeyValueDeleteRequest); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(KeyValueDeleteRequest other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(Ref, other.Ref)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (ref_ != null) hash ^= Ref.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (ref_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Ref); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (ref_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Ref); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (ref_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Ref); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(KeyValueDeleteRequest other) { + if (other == null) { + return; + } + if (other.ref_ != null) { + if (ref_ == null) { + Ref = new global::Nitric.Proto.KeyValue.v1.ValueRef(); + } + Ref.MergeFrom(other.Ref); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (ref_ == null) { + Ref = new global::Nitric.Proto.KeyValue.v1.ValueRef(); + } + input.ReadMessage(Ref); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (ref_ == null) { + Ref = new global::Nitric.Proto.KeyValue.v1.ValueRef(); + } + input.ReadMessage(Ref); + break; + } + } + } + } + #endif + + } + + public sealed partial class KeyValueDeleteResponse : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new KeyValueDeleteResponse()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Nitric.Proto.KeyValue.v1.KeyvalueReflection.Descriptor.MessageTypes[8]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public KeyValueDeleteResponse() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public KeyValueDeleteResponse(KeyValueDeleteResponse other) : this() { + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public KeyValueDeleteResponse Clone() { + return new KeyValueDeleteResponse(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as KeyValueDeleteResponse); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(KeyValueDeleteResponse other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(KeyValueDeleteResponse other) { + if (other == null) { + return; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + } + } + } + #endif + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/src/Nitric.Sdk/Proto/nitric/proto/keyvalue/v1/KeyvalueGrpc.cs b/src/Nitric.Sdk/Proto/nitric/proto/keyvalue/v1/KeyvalueGrpc.cs new file mode 100644 index 0000000..8f758b0 --- /dev/null +++ b/src/Nitric.Sdk/Proto/nitric/proto/keyvalue/v1/KeyvalueGrpc.cs @@ -0,0 +1,306 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: nitric/proto/keyvalue/v1/keyvalue.proto +// +#pragma warning disable 0414, 1591 +#region Designer generated code + +using grpc = global::Grpc.Core; + +namespace Nitric.Proto.KeyValue.v1 { + /// + /// Service for storage and retrieval of simple JSON keyValue + /// + public static partial class KeyValue + { + static readonly string __ServiceName = "nitric.proto.KeyValue.v1.KeyValue"; + + static void __Helper_SerializeMessage(global::Google.Protobuf.IMessage message, grpc::SerializationContext context) + { + #if !GRPC_DISABLE_PROTOBUF_BUFFER_SERIALIZATION + if (message is global::Google.Protobuf.IBufferMessage) + { + context.SetPayloadLength(message.CalculateSize()); + global::Google.Protobuf.MessageExtensions.WriteTo(message, context.GetBufferWriter()); + context.Complete(); + return; + } + #endif + context.Complete(global::Google.Protobuf.MessageExtensions.ToByteArray(message)); + } + + static class __Helper_MessageCache + { + public static readonly bool IsBufferMessage = global::System.Reflection.IntrospectionExtensions.GetTypeInfo(typeof(global::Google.Protobuf.IBufferMessage)).IsAssignableFrom(typeof(T)); + } + + static T __Helper_DeserializeMessage(grpc::DeserializationContext context, global::Google.Protobuf.MessageParser parser) where T : global::Google.Protobuf.IMessage + { + #if !GRPC_DISABLE_PROTOBUF_BUFFER_SERIALIZATION + if (__Helper_MessageCache.IsBufferMessage) + { + return parser.ParseFrom(context.PayloadAsReadOnlySequence()); + } + #endif + return parser.ParseFrom(context.PayloadAsNewBuffer()); + } + + static readonly grpc::Marshaller __Marshaller_nitric_proto_KeyValue_v1_KeyValueGetRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.KeyValue.v1.KeyValueGetRequest.Parser)); + static readonly grpc::Marshaller __Marshaller_nitric_proto_KeyValue_v1_KeyValueGetResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.KeyValue.v1.KeyValueGetResponse.Parser)); + static readonly grpc::Marshaller __Marshaller_nitric_proto_KeyValue_v1_KeyValueSetRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.KeyValue.v1.KeyValueSetRequest.Parser)); + static readonly grpc::Marshaller __Marshaller_nitric_proto_KeyValue_v1_KeyValueSetResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.KeyValue.v1.KeyValueSetResponse.Parser)); + static readonly grpc::Marshaller __Marshaller_nitric_proto_KeyValue_v1_KeyValueDeleteRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.KeyValue.v1.KeyValueDeleteRequest.Parser)); + static readonly grpc::Marshaller __Marshaller_nitric_proto_KeyValue_v1_KeyValueDeleteResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.KeyValue.v1.KeyValueDeleteResponse.Parser)); + + static readonly grpc::Method __Method_Get = new grpc::Method( + grpc::MethodType.Unary, + __ServiceName, + "Get", + __Marshaller_nitric_proto_KeyValue_v1_KeyValueGetRequest, + __Marshaller_nitric_proto_KeyValue_v1_KeyValueGetResponse); + + static readonly grpc::Method __Method_Set = new grpc::Method( + grpc::MethodType.Unary, + __ServiceName, + "Set", + __Marshaller_nitric_proto_KeyValue_v1_KeyValueSetRequest, + __Marshaller_nitric_proto_KeyValue_v1_KeyValueSetResponse); + + static readonly grpc::Method __Method_Delete = new grpc::Method( + grpc::MethodType.Unary, + __ServiceName, + "Delete", + __Marshaller_nitric_proto_KeyValue_v1_KeyValueDeleteRequest, + __Marshaller_nitric_proto_KeyValue_v1_KeyValueDeleteResponse); + + /// Service descriptor + public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor + { + get { return global::Nitric.Proto.KeyValue.v1.KeyvalueReflection.Descriptor.Services[0]; } + } + + /// Base class for server-side implementations of KeyValue + [grpc::BindServiceMethod(typeof(KeyValue), "BindService")] + public abstract partial class KeyValueBase + { + /// + /// Get an existing value + /// + /// The request received from the client. + /// The context of the server-side call handler being invoked. + /// The response to send back to the client (wrapped by a task). + public virtual global::System.Threading.Tasks.Task Get(global::Nitric.Proto.KeyValue.v1.KeyValueGetRequest request, grpc::ServerCallContext context) + { + throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); + } + + /// + /// Create a new or overwrite an existing value + /// + /// The request received from the client. + /// The context of the server-side call handler being invoked. + /// The response to send back to the client (wrapped by a task). + public virtual global::System.Threading.Tasks.Task Set(global::Nitric.Proto.KeyValue.v1.KeyValueSetRequest request, grpc::ServerCallContext context) + { + throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); + } + + /// + /// Delete a key and its value + /// + /// The request received from the client. + /// The context of the server-side call handler being invoked. + /// The response to send back to the client (wrapped by a task). + public virtual global::System.Threading.Tasks.Task Delete(global::Nitric.Proto.KeyValue.v1.KeyValueDeleteRequest request, grpc::ServerCallContext context) + { + throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); + } + + } + + /// Client for KeyValue + public partial class KeyValueClient : grpc::ClientBase + { + /// Creates a new client for KeyValue + /// The channel to use to make remote calls. + public KeyValueClient(grpc::ChannelBase channel) : base(channel) + { + } + /// Creates a new client for KeyValue that uses a custom CallInvoker. + /// The callInvoker to use to make remote calls. + public KeyValueClient(grpc::CallInvoker callInvoker) : base(callInvoker) + { + } + /// Protected parameterless constructor to allow creation of test doubles. + protected KeyValueClient() : base() + { + } + /// Protected constructor to allow creation of configured clients. + /// The client configuration. + protected KeyValueClient(ClientBaseConfiguration configuration) : base(configuration) + { + } + + /// + /// Get an existing value + /// + /// The request to send to the server. + /// The initial metadata to send with the call. This parameter is optional. + /// An optional deadline for the call. The call will be cancelled if deadline is hit. + /// An optional token for canceling the call. + /// The response received from the server. + public virtual global::Nitric.Proto.KeyValue.v1.KeyValueGetResponse Get(global::Nitric.Proto.KeyValue.v1.KeyValueGetRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return Get(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + /// + /// Get an existing value + /// + /// The request to send to the server. + /// The options for the call. + /// The response received from the server. + public virtual global::Nitric.Proto.KeyValue.v1.KeyValueGetResponse Get(global::Nitric.Proto.KeyValue.v1.KeyValueGetRequest request, grpc::CallOptions options) + { + return CallInvoker.BlockingUnaryCall(__Method_Get, null, options, request); + } + /// + /// Get an existing value + /// + /// The request to send to the server. + /// The initial metadata to send with the call. This parameter is optional. + /// An optional deadline for the call. The call will be cancelled if deadline is hit. + /// An optional token for canceling the call. + /// The call object. + public virtual grpc::AsyncUnaryCall GetAsync(global::Nitric.Proto.KeyValue.v1.KeyValueGetRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return GetAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + /// + /// Get an existing value + /// + /// The request to send to the server. + /// The options for the call. + /// The call object. + public virtual grpc::AsyncUnaryCall GetAsync(global::Nitric.Proto.KeyValue.v1.KeyValueGetRequest request, grpc::CallOptions options) + { + return CallInvoker.AsyncUnaryCall(__Method_Get, null, options, request); + } + /// + /// Create a new or overwrite an existing value + /// + /// The request to send to the server. + /// The initial metadata to send with the call. This parameter is optional. + /// An optional deadline for the call. The call will be cancelled if deadline is hit. + /// An optional token for canceling the call. + /// The response received from the server. + public virtual global::Nitric.Proto.KeyValue.v1.KeyValueSetResponse Set(global::Nitric.Proto.KeyValue.v1.KeyValueSetRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return Set(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + /// + /// Create a new or overwrite an existing value + /// + /// The request to send to the server. + /// The options for the call. + /// The response received from the server. + public virtual global::Nitric.Proto.KeyValue.v1.KeyValueSetResponse Set(global::Nitric.Proto.KeyValue.v1.KeyValueSetRequest request, grpc::CallOptions options) + { + return CallInvoker.BlockingUnaryCall(__Method_Set, null, options, request); + } + /// + /// Create a new or overwrite an existing value + /// + /// The request to send to the server. + /// The initial metadata to send with the call. This parameter is optional. + /// An optional deadline for the call. The call will be cancelled if deadline is hit. + /// An optional token for canceling the call. + /// The call object. + public virtual grpc::AsyncUnaryCall SetAsync(global::Nitric.Proto.KeyValue.v1.KeyValueSetRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return SetAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + /// + /// Create a new or overwrite an existing value + /// + /// The request to send to the server. + /// The options for the call. + /// The call object. + public virtual grpc::AsyncUnaryCall SetAsync(global::Nitric.Proto.KeyValue.v1.KeyValueSetRequest request, grpc::CallOptions options) + { + return CallInvoker.AsyncUnaryCall(__Method_Set, null, options, request); + } + /// + /// Delete a key and its value + /// + /// The request to send to the server. + /// The initial metadata to send with the call. This parameter is optional. + /// An optional deadline for the call. The call will be cancelled if deadline is hit. + /// An optional token for canceling the call. + /// The response received from the server. + public virtual global::Nitric.Proto.KeyValue.v1.KeyValueDeleteResponse Delete(global::Nitric.Proto.KeyValue.v1.KeyValueDeleteRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return Delete(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + /// + /// Delete a key and its value + /// + /// The request to send to the server. + /// The options for the call. + /// The response received from the server. + public virtual global::Nitric.Proto.KeyValue.v1.KeyValueDeleteResponse Delete(global::Nitric.Proto.KeyValue.v1.KeyValueDeleteRequest request, grpc::CallOptions options) + { + return CallInvoker.BlockingUnaryCall(__Method_Delete, null, options, request); + } + /// + /// Delete a key and its value + /// + /// The request to send to the server. + /// The initial metadata to send with the call. This parameter is optional. + /// An optional deadline for the call. The call will be cancelled if deadline is hit. + /// An optional token for canceling the call. + /// The call object. + public virtual grpc::AsyncUnaryCall DeleteAsync(global::Nitric.Proto.KeyValue.v1.KeyValueDeleteRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return DeleteAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + /// + /// Delete a key and its value + /// + /// The request to send to the server. + /// The options for the call. + /// The call object. + public virtual grpc::AsyncUnaryCall DeleteAsync(global::Nitric.Proto.KeyValue.v1.KeyValueDeleteRequest request, grpc::CallOptions options) + { + return CallInvoker.AsyncUnaryCall(__Method_Delete, null, options, request); + } + /// Creates a new instance of client from given ClientBaseConfiguration. + protected override KeyValueClient NewInstance(ClientBaseConfiguration configuration) + { + return new KeyValueClient(configuration); + } + } + + /// Creates service definition that can be registered with a server + /// An object implementing the server-side handling logic. + public static grpc::ServerServiceDefinition BindService(KeyValueBase serviceImpl) + { + return grpc::ServerServiceDefinition.CreateBuilder() + .AddMethod(__Method_Get, serviceImpl.Get) + .AddMethod(__Method_Set, serviceImpl.Set) + .AddMethod(__Method_Delete, serviceImpl.Delete).Build(); + } + + /// Register service method with a service binder with or without implementation. Useful when customizing the service binding logic. + /// Note: this method is part of an experimental API that can change or be removed without any prior notice. + /// Service methods will be bound by calling AddMethod on this object. + /// An object implementing the server-side handling logic. + public static void BindService(grpc::ServiceBinderBase serviceBinder, KeyValueBase serviceImpl) + { + serviceBinder.AddMethod(__Method_Get, serviceImpl == null ? null : new grpc::UnaryServerMethod(serviceImpl.Get)); + serviceBinder.AddMethod(__Method_Set, serviceImpl == null ? null : new grpc::UnaryServerMethod(serviceImpl.Set)); + serviceBinder.AddMethod(__Method_Delete, serviceImpl == null ? null : new grpc::UnaryServerMethod(serviceImpl.Delete)); + } + + } +} +#endregion diff --git a/src/Nitric.Sdk/Proto/nitric/proto/kvstore/v1/Kvstore.cs b/src/Nitric.Sdk/Proto/nitric/proto/kvstore/v1/Kvstore.cs new file mode 100644 index 0000000..23a64db --- /dev/null +++ b/src/Nitric.Sdk/Proto/nitric/proto/kvstore/v1/Kvstore.cs @@ -0,0 +1,2167 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: nitric/proto/kvstore/v1/kvstore.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Nitric.Proto.KvStore.v1 { + + /// Holder for reflection information generated from nitric/proto/kvstore/v1/kvstore.proto + public static partial class KvstoreReflection { + + #region Descriptor + /// File descriptor for nitric/proto/kvstore/v1/kvstore.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static KvstoreReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CiVuaXRyaWMvcHJvdG8va3ZzdG9yZS92MS9rdnN0b3JlLnByb3RvEhduaXRy", + "aWMucHJvdG8ua3ZzdG9yZS52MRocZ29vZ2xlL3Byb3RvYnVmL3N0cnVjdC5w", + "cm90byIVCgVTdG9yZRIMCgRuYW1lGAEgASgJIiYKCFZhbHVlUmVmEg0KBXN0", + "b3JlGAEgASgJEgsKA2tleRgCIAEoCSJhCgVWYWx1ZRIuCgNyZWYYASABKAsy", + "IS5uaXRyaWMucHJvdG8ua3ZzdG9yZS52MS5WYWx1ZVJlZhIoCgdjb250ZW50", + "GAIgASgLMhcuZ29vZ2xlLnByb3RvYnVmLlN0cnVjdCJIChZLdlN0b3JlR2V0", + "VmFsdWVSZXF1ZXN0Ei4KA3JlZhgBIAEoCzIhLm5pdHJpYy5wcm90by5rdnN0", + "b3JlLnYxLlZhbHVlUmVmIkgKF0t2U3RvcmVHZXRWYWx1ZVJlc3BvbnNlEi0K", + "BXZhbHVlGAEgASgLMh4ubml0cmljLnByb3RvLmt2c3RvcmUudjEuVmFsdWUi", + "cgoWS3ZTdG9yZVNldFZhbHVlUmVxdWVzdBIuCgNyZWYYASABKAsyIS5uaXRy", + "aWMucHJvdG8ua3ZzdG9yZS52MS5WYWx1ZVJlZhIoCgdjb250ZW50GAMgASgL", + "MhcuZ29vZ2xlLnByb3RvYnVmLlN0cnVjdCIZChdLdlN0b3JlU2V0VmFsdWVS", + "ZXNwb25zZSJJChdLdlN0b3JlRGVsZXRlS2V5UmVxdWVzdBIuCgNyZWYYASAB", + "KAsyIS5uaXRyaWMucHJvdG8ua3ZzdG9yZS52MS5WYWx1ZVJlZiIaChhLdlN0", + "b3JlRGVsZXRlS2V5UmVzcG9uc2UiVwoWS3ZTdG9yZVNjYW5LZXlzUmVxdWVz", + "dBItCgVzdG9yZRgBIAEoCzIeLm5pdHJpYy5wcm90by5rdnN0b3JlLnYxLlN0", + "b3JlEg4KBnByZWZpeBgCIAEoCSImChdLdlN0b3JlU2NhbktleXNSZXNwb25z", + "ZRILCgNrZXkYASABKAkyygMKB0t2U3RvcmUSbQoIR2V0VmFsdWUSLy5uaXRy", + "aWMucHJvdG8ua3ZzdG9yZS52MS5LdlN0b3JlR2V0VmFsdWVSZXF1ZXN0GjAu", + "bml0cmljLnByb3RvLmt2c3RvcmUudjEuS3ZTdG9yZUdldFZhbHVlUmVzcG9u", + "c2USbQoIU2V0VmFsdWUSLy5uaXRyaWMucHJvdG8ua3ZzdG9yZS52MS5LdlN0", + "b3JlU2V0VmFsdWVSZXF1ZXN0GjAubml0cmljLnByb3RvLmt2c3RvcmUudjEu", + "S3ZTdG9yZVNldFZhbHVlUmVzcG9uc2UScAoJRGVsZXRlS2V5EjAubml0cmlj", + "LnByb3RvLmt2c3RvcmUudjEuS3ZTdG9yZURlbGV0ZUtleVJlcXVlc3QaMS5u", + "aXRyaWMucHJvdG8ua3ZzdG9yZS52MS5LdlN0b3JlRGVsZXRlS2V5UmVzcG9u", + "c2USbwoIU2NhbktleXMSLy5uaXRyaWMucHJvdG8ua3ZzdG9yZS52MS5LdlN0", + "b3JlU2NhbktleXNSZXF1ZXN0GjAubml0cmljLnByb3RvLmt2c3RvcmUudjEu", + "S3ZTdG9yZVNjYW5LZXlzUmVzcG9uc2UwAUKkAQoaaW8ubml0cmljLnByb3Rv", + "Lmt2c3RvcmUudjFCDkt2U3RvcmVTZXJ2aWNlUAFaQGdpdGh1Yi5jb20vbml0", + "cmljdGVjaC9uaXRyaWMvY29yZS9wa2cvcHJvdG8va3ZzdG9yZS92MTtrdnN0", + "b3JlcGKqAhdOaXRyaWMuUHJvdG8uS3ZTdG9yZS52McoCF05pdHJpY1xQcm90", + "b1xLdlN0b3JlXFYxYgZwcm90bzM=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Google.Protobuf.WellKnownTypes.StructReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.KvStore.v1.Store), global::Nitric.Proto.KvStore.v1.Store.Parser, new[]{ "Name" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.KvStore.v1.ValueRef), global::Nitric.Proto.KvStore.v1.ValueRef.Parser, new[]{ "Store", "Key" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.KvStore.v1.Value), global::Nitric.Proto.KvStore.v1.Value.Parser, new[]{ "Ref", "Content" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.KvStore.v1.KvStoreGetValueRequest), global::Nitric.Proto.KvStore.v1.KvStoreGetValueRequest.Parser, new[]{ "Ref" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.KvStore.v1.KvStoreGetValueResponse), global::Nitric.Proto.KvStore.v1.KvStoreGetValueResponse.Parser, new[]{ "Value" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.KvStore.v1.KvStoreSetValueRequest), global::Nitric.Proto.KvStore.v1.KvStoreSetValueRequest.Parser, new[]{ "Ref", "Content" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.KvStore.v1.KvStoreSetValueResponse), global::Nitric.Proto.KvStore.v1.KvStoreSetValueResponse.Parser, null, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.KvStore.v1.KvStoreDeleteKeyRequest), global::Nitric.Proto.KvStore.v1.KvStoreDeleteKeyRequest.Parser, new[]{ "Ref" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.KvStore.v1.KvStoreDeleteKeyResponse), global::Nitric.Proto.KvStore.v1.KvStoreDeleteKeyResponse.Parser, null, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.KvStore.v1.KvStoreScanKeysRequest), global::Nitric.Proto.KvStore.v1.KvStoreScanKeysRequest.Parser, new[]{ "Store", "Prefix" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.KvStore.v1.KvStoreScanKeysResponse), global::Nitric.Proto.KvStore.v1.KvStoreScanKeysResponse.Parser, new[]{ "Key" }, null, null, null, null) + })); + } + #endregion + + } + #region Messages + /// + /// Provides a Key/Value Store + /// + public sealed partial class Store : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Store()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Nitric.Proto.KvStore.v1.KvstoreReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Store() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Store(Store other) : this() { + name_ = other.name_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Store Clone() { + return new Store(this); + } + + /// Field number for the "name" field. + public const int NameFieldNumber = 1; + private string name_ = ""; + /// + /// The store name + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Name { + get { return name_; } + set { + name_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as Store); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(Store other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Name != other.Name) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Name.Length != 0) hash ^= Name.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (Name.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Name); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Name.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Name); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Name.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Name); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(Store other) { + if (other == null) { + return; + } + if (other.Name.Length != 0) { + Name = other.Name; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Name = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Name = input.ReadString(); + break; + } + } + } + } + #endif + + } + + /// + /// ValueRef provides a unique identifier for a value + /// + public sealed partial class ValueRef : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ValueRef()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Nitric.Proto.KvStore.v1.KvstoreReflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ValueRef() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ValueRef(ValueRef other) : this() { + store_ = other.store_; + key_ = other.key_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ValueRef Clone() { + return new ValueRef(this); + } + + /// Field number for the "store" field. + public const int StoreFieldNumber = 1; + private string store_ = ""; + /// + /// The key/value store name + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Store { + get { return store_; } + set { + store_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "key" field. + public const int KeyFieldNumber = 2; + private string key_ = ""; + /// + /// The item's unique key within the store + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Key { + get { return key_; } + set { + key_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as ValueRef); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ValueRef other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Store != other.Store) return false; + if (Key != other.Key) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Store.Length != 0) hash ^= Store.GetHashCode(); + if (Key.Length != 0) hash ^= Key.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (Store.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Store); + } + if (Key.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Key); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Store.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Store); + } + if (Key.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Key); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Store.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Store); + } + if (Key.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Key); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(ValueRef other) { + if (other == null) { + return; + } + if (other.Store.Length != 0) { + Store = other.Store; + } + if (other.Key.Length != 0) { + Key = other.Key; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Store = input.ReadString(); + break; + } + case 18: { + Key = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Store = input.ReadString(); + break; + } + case 18: { + Key = input.ReadString(); + break; + } + } + } + } + #endif + + } + + /// + /// Value provides a return value type + /// + public sealed partial class Value : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Value()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Nitric.Proto.KvStore.v1.KvstoreReflection.Descriptor.MessageTypes[2]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Value() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Value(Value other) : this() { + ref_ = other.ref_ != null ? other.ref_.Clone() : null; + content_ = other.content_ != null ? other.content_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Value Clone() { + return new Value(this); + } + + /// Field number for the "ref" field. + public const int RefFieldNumber = 1; + private global::Nitric.Proto.KvStore.v1.ValueRef ref_; + /// + /// ValueRef of the key/value pair, which includes the store and key + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Nitric.Proto.KvStore.v1.ValueRef Ref { + get { return ref_; } + set { + ref_ = value; + } + } + + /// Field number for the "content" field. + public const int ContentFieldNumber = 2; + private global::Google.Protobuf.WellKnownTypes.Struct content_; + /// + /// The content (JSON object) + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Google.Protobuf.WellKnownTypes.Struct Content { + get { return content_; } + set { + content_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as Value); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(Value other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(Ref, other.Ref)) return false; + if (!object.Equals(Content, other.Content)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (ref_ != null) hash ^= Ref.GetHashCode(); + if (content_ != null) hash ^= Content.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (ref_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Ref); + } + if (content_ != null) { + output.WriteRawTag(18); + output.WriteMessage(Content); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (ref_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Ref); + } + if (content_ != null) { + output.WriteRawTag(18); + output.WriteMessage(Content); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (ref_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Ref); + } + if (content_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Content); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(Value other) { + if (other == null) { + return; + } + if (other.ref_ != null) { + if (ref_ == null) { + Ref = new global::Nitric.Proto.KvStore.v1.ValueRef(); + } + Ref.MergeFrom(other.Ref); + } + if (other.content_ != null) { + if (content_ == null) { + Content = new global::Google.Protobuf.WellKnownTypes.Struct(); + } + Content.MergeFrom(other.Content); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (ref_ == null) { + Ref = new global::Nitric.Proto.KvStore.v1.ValueRef(); + } + input.ReadMessage(Ref); + break; + } + case 18: { + if (content_ == null) { + Content = new global::Google.Protobuf.WellKnownTypes.Struct(); + } + input.ReadMessage(Content); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (ref_ == null) { + Ref = new global::Nitric.Proto.KvStore.v1.ValueRef(); + } + input.ReadMessage(Ref); + break; + } + case 18: { + if (content_ == null) { + Content = new global::Google.Protobuf.WellKnownTypes.Struct(); + } + input.ReadMessage(Content); + break; + } + } + } + } + #endif + + } + + public sealed partial class KvStoreGetValueRequest : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new KvStoreGetValueRequest()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Nitric.Proto.KvStore.v1.KvstoreReflection.Descriptor.MessageTypes[3]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public KvStoreGetValueRequest() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public KvStoreGetValueRequest(KvStoreGetValueRequest other) : this() { + ref_ = other.ref_ != null ? other.ref_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public KvStoreGetValueRequest Clone() { + return new KvStoreGetValueRequest(this); + } + + /// Field number for the "ref" field. + public const int RefFieldNumber = 1; + private global::Nitric.Proto.KvStore.v1.ValueRef ref_; + /// + /// ValueRef of the key/value pair to get, which includes the store and key + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Nitric.Proto.KvStore.v1.ValueRef Ref { + get { return ref_; } + set { + ref_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as KvStoreGetValueRequest); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(KvStoreGetValueRequest other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(Ref, other.Ref)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (ref_ != null) hash ^= Ref.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (ref_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Ref); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (ref_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Ref); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (ref_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Ref); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(KvStoreGetValueRequest other) { + if (other == null) { + return; + } + if (other.ref_ != null) { + if (ref_ == null) { + Ref = new global::Nitric.Proto.KvStore.v1.ValueRef(); + } + Ref.MergeFrom(other.Ref); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (ref_ == null) { + Ref = new global::Nitric.Proto.KvStore.v1.ValueRef(); + } + input.ReadMessage(Ref); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (ref_ == null) { + Ref = new global::Nitric.Proto.KvStore.v1.ValueRef(); + } + input.ReadMessage(Ref); + break; + } + } + } + } + #endif + + } + + public sealed partial class KvStoreGetValueResponse : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new KvStoreGetValueResponse()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Nitric.Proto.KvStore.v1.KvstoreReflection.Descriptor.MessageTypes[4]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public KvStoreGetValueResponse() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public KvStoreGetValueResponse(KvStoreGetValueResponse other) : this() { + value_ = other.value_ != null ? other.value_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public KvStoreGetValueResponse Clone() { + return new KvStoreGetValueResponse(this); + } + + /// Field number for the "value" field. + public const int ValueFieldNumber = 1; + private global::Nitric.Proto.KvStore.v1.Value value_; + /// + /// The retrieved value + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Nitric.Proto.KvStore.v1.Value Value { + get { return value_; } + set { + value_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as KvStoreGetValueResponse); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(KvStoreGetValueResponse other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(Value, other.Value)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (value_ != null) hash ^= Value.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (value_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Value); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (value_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Value); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (value_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Value); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(KvStoreGetValueResponse other) { + if (other == null) { + return; + } + if (other.value_ != null) { + if (value_ == null) { + Value = new global::Nitric.Proto.KvStore.v1.Value(); + } + Value.MergeFrom(other.Value); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (value_ == null) { + Value = new global::Nitric.Proto.KvStore.v1.Value(); + } + input.ReadMessage(Value); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (value_ == null) { + Value = new global::Nitric.Proto.KvStore.v1.Value(); + } + input.ReadMessage(Value); + break; + } + } + } + } + #endif + + } + + public sealed partial class KvStoreSetValueRequest : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new KvStoreSetValueRequest()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Nitric.Proto.KvStore.v1.KvstoreReflection.Descriptor.MessageTypes[5]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public KvStoreSetValueRequest() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public KvStoreSetValueRequest(KvStoreSetValueRequest other) : this() { + ref_ = other.ref_ != null ? other.ref_.Clone() : null; + content_ = other.content_ != null ? other.content_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public KvStoreSetValueRequest Clone() { + return new KvStoreSetValueRequest(this); + } + + /// Field number for the "ref" field. + public const int RefFieldNumber = 1; + private global::Nitric.Proto.KvStore.v1.ValueRef ref_; + /// + /// ValueRef of the key/value pair to set, which includes the store and key + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Nitric.Proto.KvStore.v1.ValueRef Ref { + get { return ref_; } + set { + ref_ = value; + } + } + + /// Field number for the "content" field. + public const int ContentFieldNumber = 3; + private global::Google.Protobuf.WellKnownTypes.Struct content_; + /// + /// The value content to store (JSON object) + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Google.Protobuf.WellKnownTypes.Struct Content { + get { return content_; } + set { + content_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as KvStoreSetValueRequest); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(KvStoreSetValueRequest other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(Ref, other.Ref)) return false; + if (!object.Equals(Content, other.Content)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (ref_ != null) hash ^= Ref.GetHashCode(); + if (content_ != null) hash ^= Content.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (ref_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Ref); + } + if (content_ != null) { + output.WriteRawTag(26); + output.WriteMessage(Content); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (ref_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Ref); + } + if (content_ != null) { + output.WriteRawTag(26); + output.WriteMessage(Content); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (ref_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Ref); + } + if (content_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Content); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(KvStoreSetValueRequest other) { + if (other == null) { + return; + } + if (other.ref_ != null) { + if (ref_ == null) { + Ref = new global::Nitric.Proto.KvStore.v1.ValueRef(); + } + Ref.MergeFrom(other.Ref); + } + if (other.content_ != null) { + if (content_ == null) { + Content = new global::Google.Protobuf.WellKnownTypes.Struct(); + } + Content.MergeFrom(other.Content); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (ref_ == null) { + Ref = new global::Nitric.Proto.KvStore.v1.ValueRef(); + } + input.ReadMessage(Ref); + break; + } + case 26: { + if (content_ == null) { + Content = new global::Google.Protobuf.WellKnownTypes.Struct(); + } + input.ReadMessage(Content); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (ref_ == null) { + Ref = new global::Nitric.Proto.KvStore.v1.ValueRef(); + } + input.ReadMessage(Ref); + break; + } + case 26: { + if (content_ == null) { + Content = new global::Google.Protobuf.WellKnownTypes.Struct(); + } + input.ReadMessage(Content); + break; + } + } + } + } + #endif + + } + + public sealed partial class KvStoreSetValueResponse : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new KvStoreSetValueResponse()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Nitric.Proto.KvStore.v1.KvstoreReflection.Descriptor.MessageTypes[6]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public KvStoreSetValueResponse() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public KvStoreSetValueResponse(KvStoreSetValueResponse other) : this() { + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public KvStoreSetValueResponse Clone() { + return new KvStoreSetValueResponse(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as KvStoreSetValueResponse); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(KvStoreSetValueResponse other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(KvStoreSetValueResponse other) { + if (other == null) { + return; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + } + } + } + #endif + + } + + public sealed partial class KvStoreDeleteKeyRequest : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new KvStoreDeleteKeyRequest()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Nitric.Proto.KvStore.v1.KvstoreReflection.Descriptor.MessageTypes[7]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public KvStoreDeleteKeyRequest() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public KvStoreDeleteKeyRequest(KvStoreDeleteKeyRequest other) : this() { + ref_ = other.ref_ != null ? other.ref_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public KvStoreDeleteKeyRequest Clone() { + return new KvStoreDeleteKeyRequest(this); + } + + /// Field number for the "ref" field. + public const int RefFieldNumber = 1; + private global::Nitric.Proto.KvStore.v1.ValueRef ref_; + /// + /// ValueRef of the key/value pair to delete, which includes the store and key + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Nitric.Proto.KvStore.v1.ValueRef Ref { + get { return ref_; } + set { + ref_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as KvStoreDeleteKeyRequest); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(KvStoreDeleteKeyRequest other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(Ref, other.Ref)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (ref_ != null) hash ^= Ref.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (ref_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Ref); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (ref_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Ref); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (ref_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Ref); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(KvStoreDeleteKeyRequest other) { + if (other == null) { + return; + } + if (other.ref_ != null) { + if (ref_ == null) { + Ref = new global::Nitric.Proto.KvStore.v1.ValueRef(); + } + Ref.MergeFrom(other.Ref); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (ref_ == null) { + Ref = new global::Nitric.Proto.KvStore.v1.ValueRef(); + } + input.ReadMessage(Ref); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (ref_ == null) { + Ref = new global::Nitric.Proto.KvStore.v1.ValueRef(); + } + input.ReadMessage(Ref); + break; + } + } + } + } + #endif + + } + + public sealed partial class KvStoreDeleteKeyResponse : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new KvStoreDeleteKeyResponse()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Nitric.Proto.KvStore.v1.KvstoreReflection.Descriptor.MessageTypes[8]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public KvStoreDeleteKeyResponse() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public KvStoreDeleteKeyResponse(KvStoreDeleteKeyResponse other) : this() { + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public KvStoreDeleteKeyResponse Clone() { + return new KvStoreDeleteKeyResponse(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as KvStoreDeleteKeyResponse); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(KvStoreDeleteKeyResponse other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(KvStoreDeleteKeyResponse other) { + if (other == null) { + return; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + } + } + } + #endif + + } + + public sealed partial class KvStoreScanKeysRequest : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new KvStoreScanKeysRequest()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Nitric.Proto.KvStore.v1.KvstoreReflection.Descriptor.MessageTypes[9]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public KvStoreScanKeysRequest() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public KvStoreScanKeysRequest(KvStoreScanKeysRequest other) : this() { + store_ = other.store_ != null ? other.store_.Clone() : null; + prefix_ = other.prefix_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public KvStoreScanKeysRequest Clone() { + return new KvStoreScanKeysRequest(this); + } + + /// Field number for the "store" field. + public const int StoreFieldNumber = 1; + private global::Nitric.Proto.KvStore.v1.Store store_; + /// + /// The store to iterate over + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Nitric.Proto.KvStore.v1.Store Store { + get { return store_; } + set { + store_ = value; + } + } + + /// Field number for the "prefix" field. + public const int PrefixFieldNumber = 2; + private string prefix_ = ""; + /// + /// The prefix to filter keys by + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Prefix { + get { return prefix_; } + set { + prefix_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as KvStoreScanKeysRequest); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(KvStoreScanKeysRequest other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(Store, other.Store)) return false; + if (Prefix != other.Prefix) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (store_ != null) hash ^= Store.GetHashCode(); + if (Prefix.Length != 0) hash ^= Prefix.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (store_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Store); + } + if (Prefix.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Prefix); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (store_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Store); + } + if (Prefix.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Prefix); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (store_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Store); + } + if (Prefix.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Prefix); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(KvStoreScanKeysRequest other) { + if (other == null) { + return; + } + if (other.store_ != null) { + if (store_ == null) { + Store = new global::Nitric.Proto.KvStore.v1.Store(); + } + Store.MergeFrom(other.Store); + } + if (other.Prefix.Length != 0) { + Prefix = other.Prefix; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (store_ == null) { + Store = new global::Nitric.Proto.KvStore.v1.Store(); + } + input.ReadMessage(Store); + break; + } + case 18: { + Prefix = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (store_ == null) { + Store = new global::Nitric.Proto.KvStore.v1.Store(); + } + input.ReadMessage(Store); + break; + } + case 18: { + Prefix = input.ReadString(); + break; + } + } + } + } + #endif + + } + + public sealed partial class KvStoreScanKeysResponse : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new KvStoreScanKeysResponse()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Nitric.Proto.KvStore.v1.KvstoreReflection.Descriptor.MessageTypes[10]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public KvStoreScanKeysResponse() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public KvStoreScanKeysResponse(KvStoreScanKeysResponse other) : this() { + key_ = other.key_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public KvStoreScanKeysResponse Clone() { + return new KvStoreScanKeysResponse(this); + } + + /// Field number for the "key" field. + public const int KeyFieldNumber = 1; + private string key_ = ""; + /// + /// The key of the key/value pair + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Key { + get { return key_; } + set { + key_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as KvStoreScanKeysResponse); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(KvStoreScanKeysResponse other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Key != other.Key) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Key.Length != 0) hash ^= Key.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (Key.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Key); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Key.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Key); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Key.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Key); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(KvStoreScanKeysResponse other) { + if (other == null) { + return; + } + if (other.Key.Length != 0) { + Key = other.Key; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Key = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Key = input.ReadString(); + break; + } + } + } + } + #endif + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/src/Nitric.Sdk/Proto/nitric/proto/kvstore/v1/KvstoreGrpc.cs b/src/Nitric.Sdk/Proto/nitric/proto/kvstore/v1/KvstoreGrpc.cs new file mode 100644 index 0000000..b153b17 --- /dev/null +++ b/src/Nitric.Sdk/Proto/nitric/proto/kvstore/v1/KvstoreGrpc.cs @@ -0,0 +1,351 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: nitric/proto/kvstore/v1/kvstore.proto +// +#pragma warning disable 0414, 1591 +#region Designer generated code + +using grpc = global::Grpc.Core; + +namespace Nitric.Proto.KvStore.v1 { + /// + /// Service for storage and retrieval of simple JSON keyValue + /// + public static partial class KvStore + { + static readonly string __ServiceName = "nitric.proto.kvstore.v1.KvStore"; + + static void __Helper_SerializeMessage(global::Google.Protobuf.IMessage message, grpc::SerializationContext context) + { + #if !GRPC_DISABLE_PROTOBUF_BUFFER_SERIALIZATION + if (message is global::Google.Protobuf.IBufferMessage) + { + context.SetPayloadLength(message.CalculateSize()); + global::Google.Protobuf.MessageExtensions.WriteTo(message, context.GetBufferWriter()); + context.Complete(); + return; + } + #endif + context.Complete(global::Google.Protobuf.MessageExtensions.ToByteArray(message)); + } + + static class __Helper_MessageCache + { + public static readonly bool IsBufferMessage = global::System.Reflection.IntrospectionExtensions.GetTypeInfo(typeof(global::Google.Protobuf.IBufferMessage)).IsAssignableFrom(typeof(T)); + } + + static T __Helper_DeserializeMessage(grpc::DeserializationContext context, global::Google.Protobuf.MessageParser parser) where T : global::Google.Protobuf.IMessage + { + #if !GRPC_DISABLE_PROTOBUF_BUFFER_SERIALIZATION + if (__Helper_MessageCache.IsBufferMessage) + { + return parser.ParseFrom(context.PayloadAsReadOnlySequence()); + } + #endif + return parser.ParseFrom(context.PayloadAsNewBuffer()); + } + + static readonly grpc::Marshaller __Marshaller_nitric_proto_kvstore_v1_KvStoreGetValueRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.KvStore.v1.KvStoreGetValueRequest.Parser)); + static readonly grpc::Marshaller __Marshaller_nitric_proto_kvstore_v1_KvStoreGetValueResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.KvStore.v1.KvStoreGetValueResponse.Parser)); + static readonly grpc::Marshaller __Marshaller_nitric_proto_kvstore_v1_KvStoreSetValueRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.KvStore.v1.KvStoreSetValueRequest.Parser)); + static readonly grpc::Marshaller __Marshaller_nitric_proto_kvstore_v1_KvStoreSetValueResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.KvStore.v1.KvStoreSetValueResponse.Parser)); + static readonly grpc::Marshaller __Marshaller_nitric_proto_kvstore_v1_KvStoreDeleteKeyRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.KvStore.v1.KvStoreDeleteKeyRequest.Parser)); + static readonly grpc::Marshaller __Marshaller_nitric_proto_kvstore_v1_KvStoreDeleteKeyResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.KvStore.v1.KvStoreDeleteKeyResponse.Parser)); + static readonly grpc::Marshaller __Marshaller_nitric_proto_kvstore_v1_KvStoreScanKeysRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.KvStore.v1.KvStoreScanKeysRequest.Parser)); + static readonly grpc::Marshaller __Marshaller_nitric_proto_kvstore_v1_KvStoreScanKeysResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.KvStore.v1.KvStoreScanKeysResponse.Parser)); + + static readonly grpc::Method __Method_GetValue = new grpc::Method( + grpc::MethodType.Unary, + __ServiceName, + "GetValue", + __Marshaller_nitric_proto_kvstore_v1_KvStoreGetValueRequest, + __Marshaller_nitric_proto_kvstore_v1_KvStoreGetValueResponse); + + static readonly grpc::Method __Method_SetValue = new grpc::Method( + grpc::MethodType.Unary, + __ServiceName, + "SetValue", + __Marshaller_nitric_proto_kvstore_v1_KvStoreSetValueRequest, + __Marshaller_nitric_proto_kvstore_v1_KvStoreSetValueResponse); + + static readonly grpc::Method __Method_DeleteKey = new grpc::Method( + grpc::MethodType.Unary, + __ServiceName, + "DeleteKey", + __Marshaller_nitric_proto_kvstore_v1_KvStoreDeleteKeyRequest, + __Marshaller_nitric_proto_kvstore_v1_KvStoreDeleteKeyResponse); + + static readonly grpc::Method __Method_ScanKeys = new grpc::Method( + grpc::MethodType.ServerStreaming, + __ServiceName, + "ScanKeys", + __Marshaller_nitric_proto_kvstore_v1_KvStoreScanKeysRequest, + __Marshaller_nitric_proto_kvstore_v1_KvStoreScanKeysResponse); + + /// Service descriptor + public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor + { + get { return global::Nitric.Proto.KvStore.v1.KvstoreReflection.Descriptor.Services[0]; } + } + + /// Base class for server-side implementations of KvStore + [grpc::BindServiceMethod(typeof(KvStore), "BindService")] + public abstract partial class KvStoreBase + { + /// + /// Get an existing value + /// + /// The request received from the client. + /// The context of the server-side call handler being invoked. + /// The response to send back to the client (wrapped by a task). + public virtual global::System.Threading.Tasks.Task GetValue(global::Nitric.Proto.KvStore.v1.KvStoreGetValueRequest request, grpc::ServerCallContext context) + { + throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); + } + + /// + /// Create a new or overwrite an existing value + /// + /// The request received from the client. + /// The context of the server-side call handler being invoked. + /// The response to send back to the client (wrapped by a task). + public virtual global::System.Threading.Tasks.Task SetValue(global::Nitric.Proto.KvStore.v1.KvStoreSetValueRequest request, grpc::ServerCallContext context) + { + throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); + } + + /// + /// Delete a key and its value + /// + /// The request received from the client. + /// The context of the server-side call handler being invoked. + /// The response to send back to the client (wrapped by a task). + public virtual global::System.Threading.Tasks.Task DeleteKey(global::Nitric.Proto.KvStore.v1.KvStoreDeleteKeyRequest request, grpc::ServerCallContext context) + { + throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); + } + + /// + /// Iterate over all keys in a store + /// + /// The request received from the client. + /// Used for sending responses back to the client. + /// The context of the server-side call handler being invoked. + /// A task indicating completion of the handler. + public virtual global::System.Threading.Tasks.Task ScanKeys(global::Nitric.Proto.KvStore.v1.KvStoreScanKeysRequest request, grpc::IServerStreamWriter responseStream, grpc::ServerCallContext context) + { + throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); + } + + } + + /// Client for KvStore + public partial class KvStoreClient : grpc::ClientBase + { + /// Creates a new client for KvStore + /// The channel to use to make remote calls. + public KvStoreClient(grpc::ChannelBase channel) : base(channel) + { + } + /// Creates a new client for KvStore that uses a custom CallInvoker. + /// The callInvoker to use to make remote calls. + public KvStoreClient(grpc::CallInvoker callInvoker) : base(callInvoker) + { + } + /// Protected parameterless constructor to allow creation of test doubles. + protected KvStoreClient() : base() + { + } + /// Protected constructor to allow creation of configured clients. + /// The client configuration. + protected KvStoreClient(ClientBaseConfiguration configuration) : base(configuration) + { + } + + /// + /// Get an existing value + /// + /// The request to send to the server. + /// The initial metadata to send with the call. This parameter is optional. + /// An optional deadline for the call. The call will be cancelled if deadline is hit. + /// An optional token for canceling the call. + /// The response received from the server. + public virtual global::Nitric.Proto.KvStore.v1.KvStoreGetValueResponse GetValue(global::Nitric.Proto.KvStore.v1.KvStoreGetValueRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return GetValue(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + /// + /// Get an existing value + /// + /// The request to send to the server. + /// The options for the call. + /// The response received from the server. + public virtual global::Nitric.Proto.KvStore.v1.KvStoreGetValueResponse GetValue(global::Nitric.Proto.KvStore.v1.KvStoreGetValueRequest request, grpc::CallOptions options) + { + return CallInvoker.BlockingUnaryCall(__Method_GetValue, null, options, request); + } + /// + /// Get an existing value + /// + /// The request to send to the server. + /// The initial metadata to send with the call. This parameter is optional. + /// An optional deadline for the call. The call will be cancelled if deadline is hit. + /// An optional token for canceling the call. + /// The call object. + public virtual grpc::AsyncUnaryCall GetValueAsync(global::Nitric.Proto.KvStore.v1.KvStoreGetValueRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return GetValueAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + /// + /// Get an existing value + /// + /// The request to send to the server. + /// The options for the call. + /// The call object. + public virtual grpc::AsyncUnaryCall GetValueAsync(global::Nitric.Proto.KvStore.v1.KvStoreGetValueRequest request, grpc::CallOptions options) + { + return CallInvoker.AsyncUnaryCall(__Method_GetValue, null, options, request); + } + /// + /// Create a new or overwrite an existing value + /// + /// The request to send to the server. + /// The initial metadata to send with the call. This parameter is optional. + /// An optional deadline for the call. The call will be cancelled if deadline is hit. + /// An optional token for canceling the call. + /// The response received from the server. + public virtual global::Nitric.Proto.KvStore.v1.KvStoreSetValueResponse SetValue(global::Nitric.Proto.KvStore.v1.KvStoreSetValueRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return SetValue(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + /// + /// Create a new or overwrite an existing value + /// + /// The request to send to the server. + /// The options for the call. + /// The response received from the server. + public virtual global::Nitric.Proto.KvStore.v1.KvStoreSetValueResponse SetValue(global::Nitric.Proto.KvStore.v1.KvStoreSetValueRequest request, grpc::CallOptions options) + { + return CallInvoker.BlockingUnaryCall(__Method_SetValue, null, options, request); + } + /// + /// Create a new or overwrite an existing value + /// + /// The request to send to the server. + /// The initial metadata to send with the call. This parameter is optional. + /// An optional deadline for the call. The call will be cancelled if deadline is hit. + /// An optional token for canceling the call. + /// The call object. + public virtual grpc::AsyncUnaryCall SetValueAsync(global::Nitric.Proto.KvStore.v1.KvStoreSetValueRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return SetValueAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + /// + /// Create a new or overwrite an existing value + /// + /// The request to send to the server. + /// The options for the call. + /// The call object. + public virtual grpc::AsyncUnaryCall SetValueAsync(global::Nitric.Proto.KvStore.v1.KvStoreSetValueRequest request, grpc::CallOptions options) + { + return CallInvoker.AsyncUnaryCall(__Method_SetValue, null, options, request); + } + /// + /// Delete a key and its value + /// + /// The request to send to the server. + /// The initial metadata to send with the call. This parameter is optional. + /// An optional deadline for the call. The call will be cancelled if deadline is hit. + /// An optional token for canceling the call. + /// The response received from the server. + public virtual global::Nitric.Proto.KvStore.v1.KvStoreDeleteKeyResponse DeleteKey(global::Nitric.Proto.KvStore.v1.KvStoreDeleteKeyRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return DeleteKey(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + /// + /// Delete a key and its value + /// + /// The request to send to the server. + /// The options for the call. + /// The response received from the server. + public virtual global::Nitric.Proto.KvStore.v1.KvStoreDeleteKeyResponse DeleteKey(global::Nitric.Proto.KvStore.v1.KvStoreDeleteKeyRequest request, grpc::CallOptions options) + { + return CallInvoker.BlockingUnaryCall(__Method_DeleteKey, null, options, request); + } + /// + /// Delete a key and its value + /// + /// The request to send to the server. + /// The initial metadata to send with the call. This parameter is optional. + /// An optional deadline for the call. The call will be cancelled if deadline is hit. + /// An optional token for canceling the call. + /// The call object. + public virtual grpc::AsyncUnaryCall DeleteKeyAsync(global::Nitric.Proto.KvStore.v1.KvStoreDeleteKeyRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return DeleteKeyAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + /// + /// Delete a key and its value + /// + /// The request to send to the server. + /// The options for the call. + /// The call object. + public virtual grpc::AsyncUnaryCall DeleteKeyAsync(global::Nitric.Proto.KvStore.v1.KvStoreDeleteKeyRequest request, grpc::CallOptions options) + { + return CallInvoker.AsyncUnaryCall(__Method_DeleteKey, null, options, request); + } + /// + /// Iterate over all keys in a store + /// + /// The request to send to the server. + /// The initial metadata to send with the call. This parameter is optional. + /// An optional deadline for the call. The call will be cancelled if deadline is hit. + /// An optional token for canceling the call. + /// The call object. + public virtual grpc::AsyncServerStreamingCall ScanKeys(global::Nitric.Proto.KvStore.v1.KvStoreScanKeysRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return ScanKeys(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + /// + /// Iterate over all keys in a store + /// + /// The request to send to the server. + /// The options for the call. + /// The call object. + public virtual grpc::AsyncServerStreamingCall ScanKeys(global::Nitric.Proto.KvStore.v1.KvStoreScanKeysRequest request, grpc::CallOptions options) + { + return CallInvoker.AsyncServerStreamingCall(__Method_ScanKeys, null, options, request); + } + /// Creates a new instance of client from given ClientBaseConfiguration. + protected override KvStoreClient NewInstance(ClientBaseConfiguration configuration) + { + return new KvStoreClient(configuration); + } + } + + /// Creates service definition that can be registered with a server + /// An object implementing the server-side handling logic. + public static grpc::ServerServiceDefinition BindService(KvStoreBase serviceImpl) + { + return grpc::ServerServiceDefinition.CreateBuilder() + .AddMethod(__Method_GetValue, serviceImpl.GetValue) + .AddMethod(__Method_SetValue, serviceImpl.SetValue) + .AddMethod(__Method_DeleteKey, serviceImpl.DeleteKey) + .AddMethod(__Method_ScanKeys, serviceImpl.ScanKeys).Build(); + } + + /// Register service method with a service binder with or without implementation. Useful when customizing the service binding logic. + /// Note: this method is part of an experimental API that can change or be removed without any prior notice. + /// Service methods will be bound by calling AddMethod on this object. + /// An object implementing the server-side handling logic. + public static void BindService(grpc::ServiceBinderBase serviceBinder, KvStoreBase serviceImpl) + { + serviceBinder.AddMethod(__Method_GetValue, serviceImpl == null ? null : new grpc::UnaryServerMethod(serviceImpl.GetValue)); + serviceBinder.AddMethod(__Method_SetValue, serviceImpl == null ? null : new grpc::UnaryServerMethod(serviceImpl.SetValue)); + serviceBinder.AddMethod(__Method_DeleteKey, serviceImpl == null ? null : new grpc::UnaryServerMethod(serviceImpl.DeleteKey)); + serviceBinder.AddMethod(__Method_ScanKeys, serviceImpl == null ? null : new grpc::ServerStreamingServerMethod(serviceImpl.ScanKeys)); + } + + } +} +#endregion diff --git a/src/Nitric.Sdk/Proto/proto/queue/v1/Queue.cs b/src/Nitric.Sdk/Proto/nitric/proto/queues/v1/Queues.cs similarity index 61% rename from src/Nitric.Sdk/Proto/proto/queue/v1/Queue.cs rename to src/Nitric.Sdk/Proto/nitric/proto/queues/v1/Queues.cs index 44bd32a..48a0e37 100644 --- a/src/Nitric.Sdk/Proto/proto/queue/v1/Queue.cs +++ b/src/Nitric.Sdk/Proto/nitric/proto/queues/v1/Queues.cs @@ -1,6 +1,6 @@ // // Generated by the protocol buffer compiler. DO NOT EDIT! -// source: proto/queue/v1/queue.proto +// source: nitric/proto/queues/v1/queues.proto // #pragma warning disable 1591, 0612, 3021 #region Designer generated code @@ -9,86 +9,81 @@ using pbc = global::Google.Protobuf.Collections; using pbr = global::Google.Protobuf.Reflection; using scg = global::System.Collections.Generic; -namespace Nitric.Proto.Queue.v1 { +namespace Nitric.Proto.Queues.v1 { - /// Holder for reflection information generated from proto/queue/v1/queue.proto - public static partial class QueueReflection { + /// Holder for reflection information generated from nitric/proto/queues/v1/queues.proto + public static partial class QueuesReflection { #region Descriptor - /// File descriptor for proto/queue/v1/queue.proto + /// File descriptor for nitric/proto/queues/v1/queues.proto public static pbr::FileDescriptor Descriptor { get { return descriptor; } } private static pbr::FileDescriptor descriptor; - static QueueReflection() { + static QueuesReflection() { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( - "Chpwcm90by9xdWV1ZS92MS9xdWV1ZS5wcm90bxIPbml0cmljLnF1ZXVlLnYx", - "Ghxnb29nbGUvcHJvdG9idWYvc3RydWN0LnByb3RvGhd2YWxpZGF0ZS92YWxp", - "ZGF0ZS5wcm90byJyChBRdWV1ZVNlbmRSZXF1ZXN0EikKBXF1ZXVlGAEgASgJ", - "Qhr6QhdyFSiAAjIQXlx3KyhbLlwtXVx3KykqJBIzCgR0YXNrGAIgASgLMhsu", - "bml0cmljLnF1ZXVlLnYxLk5pdHJpY1Rhc2tCCPpCBYoBAhABIhMKEVF1ZXVl", - "U2VuZFJlc3BvbnNlIlwKFVF1ZXVlU2VuZEJhdGNoUmVxdWVzdBINCgVxdWV1", - "ZRgBIAEoCRI0CgV0YXNrcxgCIAMoCzIbLm5pdHJpYy5xdWV1ZS52MS5OaXRy", - "aWNUYXNrQgj6QgWSAQIIASJKChZRdWV1ZVNlbmRCYXRjaFJlc3BvbnNlEjAK", - "C2ZhaWxlZFRhc2tzGAEgAygLMhsubml0cmljLnF1ZXVlLnYxLkZhaWxlZFRh", - "c2siMwoTUXVldWVSZWNlaXZlUmVxdWVzdBINCgVxdWV1ZRgBIAEoCRINCgVk", - "ZXB0aBgCIAEoBSJCChRRdWV1ZVJlY2VpdmVSZXNwb25zZRIqCgV0YXNrcxgB", - "IAMoCzIbLm5pdHJpYy5xdWV1ZS52MS5OaXRyaWNUYXNrIkAKFFF1ZXVlQ29t", - "cGxldGVSZXF1ZXN0Eg0KBXF1ZXVlGAEgASgJEhkKCGxlYXNlX2lkGAIgASgJ", - "Qgf6QgRyAhABIhcKFVF1ZXVlQ29tcGxldGVSZXNwb25zZSJICgpGYWlsZWRU", - "YXNrEikKBHRhc2sYASABKAsyGy5uaXRyaWMucXVldWUudjEuTml0cmljVGFz", - "axIPCgdtZXNzYWdlGAIgASgJImoKCk5pdHJpY1Rhc2sSCgoCaWQYASABKAkS", - "EAoIbGVhc2VfaWQYAiABKAkSFAoMcGF5bG9hZF90eXBlGAMgASgJEigKB3Bh", - "eWxvYWQYBCABKAsyFy5nb29nbGUucHJvdG9idWYuU3RydWN0Mu4CCgxRdWV1", - "ZVNlcnZpY2USTQoEU2VuZBIhLm5pdHJpYy5xdWV1ZS52MS5RdWV1ZVNlbmRS", - "ZXF1ZXN0GiIubml0cmljLnF1ZXVlLnYxLlF1ZXVlU2VuZFJlc3BvbnNlElwK", - "CVNlbmRCYXRjaBImLm5pdHJpYy5xdWV1ZS52MS5RdWV1ZVNlbmRCYXRjaFJl", - "cXVlc3QaJy5uaXRyaWMucXVldWUudjEuUXVldWVTZW5kQmF0Y2hSZXNwb25z", - "ZRJWCgdSZWNlaXZlEiQubml0cmljLnF1ZXVlLnYxLlF1ZXVlUmVjZWl2ZVJl", - "cXVlc3QaJS5uaXRyaWMucXVldWUudjEuUXVldWVSZWNlaXZlUmVzcG9uc2US", - "WQoIQ29tcGxldGUSJS5uaXRyaWMucXVldWUudjEuUXVldWVDb21wbGV0ZVJl", - "cXVlc3QaJi5uaXRyaWMucXVldWUudjEuUXVldWVDb21wbGV0ZVJlc3BvbnNl", - "QokBChhpby5uaXRyaWMucHJvdG8ucXVldWUudjFCBlF1ZXVlc1ABWjNnaXRo", - "dWIuY29tL25pdHJpY3RlY2gvbml0cmljL2NvcmUvcGtnL2FwaS9uaXRyaWMv", - "djGqAhVOaXRyaWMuUHJvdG8uUXVldWUudjHKAhVOaXRyaWNcUHJvdG9cUXVl", - "dWVcVjFiBnByb3RvMw==")); + "CiNuaXRyaWMvcHJvdG8vcXVldWVzL3YxL3F1ZXVlcy5wcm90bxIWbml0cmlj", + "LnByb3RvLnF1ZXVlcy52MRocZ29vZ2xlL3Byb3RvYnVmL3N0cnVjdC5wcm90", + "byJhChNRdWV1ZUVucXVldWVSZXF1ZXN0EhIKCnF1ZXVlX25hbWUYASABKAkS", + "NgoIbWVzc2FnZXMYAiADKAsyJC5uaXRyaWMucHJvdG8ucXVldWVzLnYxLlF1", + "ZXVlTWVzc2FnZSJdChRRdWV1ZUVucXVldWVSZXNwb25zZRJFCg9mYWlsZWRf", + "bWVzc2FnZXMYASADKAsyLC5uaXRyaWMucHJvdG8ucXVldWVzLnYxLkZhaWxl", + "ZEVucXVldWVNZXNzYWdlIjgKE1F1ZXVlRGVxdWV1ZVJlcXVlc3QSEgoKcXVl", + "dWVfbmFtZRgBIAEoCRINCgVkZXB0aBgCIAEoBSJRChRRdWV1ZURlcXVldWVS", + "ZXNwb25zZRI5CghtZXNzYWdlcxgBIAMoCzInLm5pdHJpYy5wcm90by5xdWV1", + "ZXMudjEuRGVxdWV1ZWRNZXNzYWdlIjwKFFF1ZXVlQ29tcGxldGVSZXF1ZXN0", + "EhIKCnF1ZXVlX25hbWUYASABKAkSEAoIbGVhc2VfaWQYAiABKAkiFwoVUXVl", + "dWVDb21wbGV0ZVJlc3BvbnNlIkwKDFF1ZXVlTWVzc2FnZRIxCg5zdHJ1Y3Rf", + "cGF5bG9hZBgBIAEoCzIXLmdvb2dsZS5wcm90b2J1Zi5TdHJ1Y3RIAEIJCgdj", + "b250ZW50IloKD0RlcXVldWVkTWVzc2FnZRIQCghsZWFzZV9pZBgBIAEoCRI1", + "CgdtZXNzYWdlGAIgASgLMiQubml0cmljLnByb3RvLnF1ZXVlcy52MS5RdWV1", + "ZU1lc3NhZ2UiXgoURmFpbGVkRW5xdWV1ZU1lc3NhZ2USNQoHbWVzc2FnZRgB", + "IAEoCzIkLm5pdHJpYy5wcm90by5xdWV1ZXMudjEuUXVldWVNZXNzYWdlEg8K", + "B2RldGFpbHMYAiABKAkyvQIKBlF1ZXVlcxJkCgdFbnF1ZXVlEisubml0cmlj", + "LnByb3RvLnF1ZXVlcy52MS5RdWV1ZUVucXVldWVSZXF1ZXN0Giwubml0cmlj", + "LnByb3RvLnF1ZXVlcy52MS5RdWV1ZUVucXVldWVSZXNwb25zZRJkCgdEZXF1", + "ZXVlEisubml0cmljLnByb3RvLnF1ZXVlcy52MS5RdWV1ZURlcXVldWVSZXF1", + "ZXN0Giwubml0cmljLnByb3RvLnF1ZXVlcy52MS5RdWV1ZURlcXVldWVSZXNw", + "b25zZRJnCghDb21wbGV0ZRIsLm5pdHJpYy5wcm90by5xdWV1ZXMudjEuUXVl", + "dWVDb21wbGV0ZVJlcXVlc3QaLS5uaXRyaWMucHJvdG8ucXVldWVzLnYxLlF1", + "ZXVlQ29tcGxldGVSZXNwb25zZUKeAQoZaW8ubml0cmljLnByb3RvLnF1ZXVl", + "cy52MUINUXVldWVzU2VydmljZVABWj5naXRodWIuY29tL25pdHJpY3RlY2gv", + "bml0cmljL2NvcmUvcGtnL3Byb3RvL3F1ZXVlcy92MTtxdWV1ZXNwYqoCFk5p", + "dHJpYy5Qcm90by5RdWV1ZXMudjHKAhZOaXRyaWNcUHJvdG9cUXVldWVzXFYx", + "YgZwcm90bzM=")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, - new pbr::FileDescriptor[] { global::Google.Protobuf.WellKnownTypes.StructReflection.Descriptor, global::Validate.ValidateReflection.Descriptor, }, + new pbr::FileDescriptor[] { global::Google.Protobuf.WellKnownTypes.StructReflection.Descriptor, }, new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Queue.v1.QueueSendRequest), global::Nitric.Proto.Queue.v1.QueueSendRequest.Parser, new[]{ "Queue", "Task" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Queue.v1.QueueSendResponse), global::Nitric.Proto.Queue.v1.QueueSendResponse.Parser, null, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Queue.v1.QueueSendBatchRequest), global::Nitric.Proto.Queue.v1.QueueSendBatchRequest.Parser, new[]{ "Queue", "Tasks" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Queue.v1.QueueSendBatchResponse), global::Nitric.Proto.Queue.v1.QueueSendBatchResponse.Parser, new[]{ "FailedTasks" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Queue.v1.QueueReceiveRequest), global::Nitric.Proto.Queue.v1.QueueReceiveRequest.Parser, new[]{ "Queue", "Depth" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Queue.v1.QueueReceiveResponse), global::Nitric.Proto.Queue.v1.QueueReceiveResponse.Parser, new[]{ "Tasks" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Queue.v1.QueueCompleteRequest), global::Nitric.Proto.Queue.v1.QueueCompleteRequest.Parser, new[]{ "Queue", "LeaseId" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Queue.v1.QueueCompleteResponse), global::Nitric.Proto.Queue.v1.QueueCompleteResponse.Parser, null, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Queue.v1.FailedTask), global::Nitric.Proto.Queue.v1.FailedTask.Parser, new[]{ "Task", "Message" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Queue.v1.NitricTask), global::Nitric.Proto.Queue.v1.NitricTask.Parser, new[]{ "Id", "LeaseId", "PayloadType", "Payload" }, null, null, null, null) + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Queues.v1.QueueEnqueueRequest), global::Nitric.Proto.Queues.v1.QueueEnqueueRequest.Parser, new[]{ "QueueName", "Messages" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Queues.v1.QueueEnqueueResponse), global::Nitric.Proto.Queues.v1.QueueEnqueueResponse.Parser, new[]{ "FailedMessages" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Queues.v1.QueueDequeueRequest), global::Nitric.Proto.Queues.v1.QueueDequeueRequest.Parser, new[]{ "QueueName", "Depth" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Queues.v1.QueueDequeueResponse), global::Nitric.Proto.Queues.v1.QueueDequeueResponse.Parser, new[]{ "Messages" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Queues.v1.QueueCompleteRequest), global::Nitric.Proto.Queues.v1.QueueCompleteRequest.Parser, new[]{ "QueueName", "LeaseId" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Queues.v1.QueueCompleteResponse), global::Nitric.Proto.Queues.v1.QueueCompleteResponse.Parser, null, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Queues.v1.QueueMessage), global::Nitric.Proto.Queues.v1.QueueMessage.Parser, new[]{ "StructPayload" }, new[]{ "Content" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Queues.v1.DequeuedMessage), global::Nitric.Proto.Queues.v1.DequeuedMessage.Parser, new[]{ "LeaseId", "Message" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Queues.v1.FailedEnqueueMessage), global::Nitric.Proto.Queues.v1.FailedEnqueueMessage.Parser, new[]{ "Message", "Details" }, null, null, null, null) })); } #endregion } #region Messages - /// - /// Request to push a single event to a queue - /// - public sealed partial class QueueSendRequest : pb::IMessage + public sealed partial class QueueEnqueueRequest : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new QueueSendRequest()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new QueueEnqueueRequest()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Queue.v1.QueueReflection.Descriptor.MessageTypes[0]; } + get { return global::Nitric.Proto.Queues.v1.QueuesReflection.Descriptor.MessageTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -97,76 +92,75 @@ public sealed partial class QueueSendRequest : pb::IMessage } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public QueueSendRequest() { + public QueueEnqueueRequest() { OnConstruction(); } partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public QueueSendRequest(QueueSendRequest other) : this() { - queue_ = other.queue_; - task_ = other.task_ != null ? other.task_.Clone() : null; + public QueueEnqueueRequest(QueueEnqueueRequest other) : this() { + queueName_ = other.queueName_; + messages_ = other.messages_.Clone(); _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public QueueSendRequest Clone() { - return new QueueSendRequest(this); + public QueueEnqueueRequest Clone() { + return new QueueEnqueueRequest(this); } - /// Field number for the "queue" field. - public const int QueueFieldNumber = 1; - private string queue_ = ""; + /// Field number for the "queue_name" field. + public const int QueueNameFieldNumber = 1; + private string queueName_ = ""; /// /// The Nitric name for the queue /// this will automatically be resolved to the provider specific queue identifier. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string Queue { - get { return queue_; } + public string QueueName { + get { return queueName_; } set { - queue_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + queueName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); } } - /// Field number for the "task" field. - public const int TaskFieldNumber = 2; - private global::Nitric.Proto.Queue.v1.NitricTask task_; + /// Field number for the "messages" field. + public const int MessagesFieldNumber = 2; + private static readonly pb::FieldCodec _repeated_messages_codec + = pb::FieldCodec.ForMessage(18, global::Nitric.Proto.Queues.v1.QueueMessage.Parser); + private readonly pbc::RepeatedField messages_ = new pbc::RepeatedField(); /// - /// The task to push to the queue + /// Array of messages to push to the queue /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Queue.v1.NitricTask Task { - get { return task_; } - set { - task_ = value; - } + public pbc::RepeatedField Messages { + get { return messages_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { - return Equals(other as QueueSendRequest); + return Equals(other as QueueEnqueueRequest); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(QueueSendRequest other) { + public bool Equals(QueueEnqueueRequest other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } - if (Queue != other.Queue) return false; - if (!object.Equals(Task, other.Task)) return false; + if (QueueName != other.QueueName) return false; + if(!messages_.Equals(other.messages_)) return false; return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; - if (Queue.Length != 0) hash ^= Queue.GetHashCode(); - if (task_ != null) hash ^= Task.GetHashCode(); + if (QueueName.Length != 0) hash ^= QueueName.GetHashCode(); + hash ^= messages_.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -183,14 +177,11 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else - if (Queue.Length != 0) { + if (QueueName.Length != 0) { output.WriteRawTag(10); - output.WriteString(Queue); - } - if (task_ != null) { - output.WriteRawTag(18); - output.WriteMessage(Task); + output.WriteString(QueueName); } + messages_.WriteTo(output, _repeated_messages_codec); if (_unknownFields != null) { _unknownFields.WriteTo(output); } @@ -200,14 +191,11 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (Queue.Length != 0) { + if (QueueName.Length != 0) { output.WriteRawTag(10); - output.WriteString(Queue); - } - if (task_ != null) { - output.WriteRawTag(18); - output.WriteMessage(Task); + output.WriteString(QueueName); } + messages_.WriteTo(ref output, _repeated_messages_codec); if (_unknownFields != null) { _unknownFields.WriteTo(ref output); } @@ -217,12 +205,10 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; - if (Queue.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Queue); - } - if (task_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Task); + if (QueueName.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(QueueName); } + size += messages_.CalculateSize(_repeated_messages_codec); if (_unknownFields != null) { size += _unknownFields.CalculateSize(); } @@ -230,19 +216,14 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(QueueSendRequest other) { + public void MergeFrom(QueueEnqueueRequest other) { if (other == null) { return; } - if (other.Queue.Length != 0) { - Queue = other.Queue; - } - if (other.task_ != null) { - if (task_ == null) { - Task = new global::Nitric.Proto.Queue.v1.NitricTask(); - } - Task.MergeFrom(other.Task); + if (other.QueueName.Length != 0) { + QueueName = other.QueueName; } + messages_.Add(other.messages_); _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } @@ -258,14 +239,11 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { - Queue = input.ReadString(); + QueueName = input.ReadString(); break; } case 18: { - if (task_ == null) { - Task = new global::Nitric.Proto.Queue.v1.NitricTask(); - } - input.ReadMessage(Task); + messages_.AddEntriesFrom(input, _repeated_messages_codec); break; } } @@ -283,14 +261,11 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; case 10: { - Queue = input.ReadString(); + QueueName = input.ReadString(); break; } case 18: { - if (task_ == null) { - Task = new global::Nitric.Proto.Queue.v1.NitricTask(); - } - input.ReadMessage(Task); + messages_.AddEntriesFrom(ref input, _repeated_messages_codec); break; } } @@ -301,21 +276,21 @@ public void MergeFrom(pb::CodedInputStream input) { } /// - /// Result of pushing a single task to a queue + /// Response for sending messages to a queue /// - public sealed partial class QueueSendResponse : pb::IMessage + public sealed partial class QueueEnqueueResponse : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new QueueSendResponse()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new QueueEnqueueResponse()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Queue.v1.QueueReflection.Descriptor.MessageTypes[1]; } + get { return global::Nitric.Proto.Queues.v1.QueuesReflection.Descriptor.MessageTypes[1]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -324,41 +299,57 @@ public sealed partial class QueueSendResponse : pb::IMessage } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public QueueSendResponse() { + public QueueEnqueueResponse() { OnConstruction(); } partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public QueueSendResponse(QueueSendResponse other) : this() { + public QueueEnqueueResponse(QueueEnqueueResponse other) : this() { + failedMessages_ = other.failedMessages_.Clone(); _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public QueueSendResponse Clone() { - return new QueueSendResponse(this); + public QueueEnqueueResponse Clone() { + return new QueueEnqueueResponse(this); + } + + /// Field number for the "failed_messages" field. + public const int FailedMessagesFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_failedMessages_codec + = pb::FieldCodec.ForMessage(10, global::Nitric.Proto.Queues.v1.FailedEnqueueMessage.Parser); + private readonly pbc::RepeatedField failedMessages_ = new pbc::RepeatedField(); + /// + /// A list of messages that failed to be queued + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField FailedMessages { + get { return failedMessages_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { - return Equals(other as QueueSendResponse); + return Equals(other as QueueEnqueueResponse); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(QueueSendResponse other) { + public bool Equals(QueueEnqueueResponse other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } + if(!failedMessages_.Equals(other.failedMessages_)) return false; return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; + hash ^= failedMessages_.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -375,6 +366,7 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else + failedMessages_.WriteTo(output, _repeated_failedMessages_codec); if (_unknownFields != null) { _unknownFields.WriteTo(output); } @@ -384,6 +376,7 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + failedMessages_.WriteTo(ref output, _repeated_failedMessages_codec); if (_unknownFields != null) { _unknownFields.WriteTo(ref output); } @@ -393,6 +386,7 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; + size += failedMessages_.CalculateSize(_repeated_failedMessages_codec); if (_unknownFields != null) { size += _unknownFields.CalculateSize(); } @@ -400,10 +394,11 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(QueueSendResponse other) { + public void MergeFrom(QueueEnqueueResponse other) { if (other == null) { return; } + failedMessages_.Add(other.failedMessages_); _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } @@ -418,6 +413,10 @@ public void MergeFrom(pb::CodedInputStream input) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; + case 10: { + failedMessages_.AddEntriesFrom(input, _repeated_failedMessages_codec); + break; + } } } #endif @@ -432,6 +431,10 @@ public void MergeFrom(pb::CodedInputStream input) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; + case 10: { + failedMessages_.AddEntriesFrom(ref input, _repeated_failedMessages_codec); + break; + } } } } @@ -439,19 +442,19 @@ public void MergeFrom(pb::CodedInputStream input) { } - public sealed partial class QueueSendBatchRequest : pb::IMessage + public sealed partial class QueueDequeueRequest : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new QueueSendBatchRequest()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new QueueDequeueRequest()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Queue.v1.QueueReflection.Descriptor.MessageTypes[2]; } + get { return global::Nitric.Proto.Queues.v1.QueuesReflection.Descriptor.MessageTypes[2]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -460,75 +463,76 @@ public sealed partial class QueueSendBatchRequest : pb::IMessageField number for the "queue" field. - public const int QueueFieldNumber = 1; - private string queue_ = ""; + /// Field number for the "queue_name" field. + public const int QueueNameFieldNumber = 1; + private string queueName_ = ""; /// - /// The Nitric name for the queue + /// The nitric name for the queue /// this will automatically be resolved to the provider specific queue identifier. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string Queue { - get { return queue_; } + public string QueueName { + get { return queueName_; } set { - queue_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + queueName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); } } - /// Field number for the "tasks" field. - public const int TasksFieldNumber = 2; - private static readonly pb::FieldCodec _repeated_tasks_codec - = pb::FieldCodec.ForMessage(18, global::Nitric.Proto.Queue.v1.NitricTask.Parser); - private readonly pbc::RepeatedField tasks_ = new pbc::RepeatedField(); + /// Field number for the "depth" field. + public const int DepthFieldNumber = 2; + private int depth_; /// - /// Array of tasks to push to the queue + /// The max number of messages to pop off the queue, may be capped by provider specific limitations /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField Tasks { - get { return tasks_; } + public int Depth { + get { return depth_; } + set { + depth_ = value; + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { - return Equals(other as QueueSendBatchRequest); + return Equals(other as QueueDequeueRequest); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(QueueSendBatchRequest other) { + public bool Equals(QueueDequeueRequest other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } - if (Queue != other.Queue) return false; - if(!tasks_.Equals(other.tasks_)) return false; + if (QueueName != other.QueueName) return false; + if (Depth != other.Depth) return false; return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; - if (Queue.Length != 0) hash ^= Queue.GetHashCode(); - hash ^= tasks_.GetHashCode(); + if (QueueName.Length != 0) hash ^= QueueName.GetHashCode(); + if (Depth != 0) hash ^= Depth.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -545,11 +549,14 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else - if (Queue.Length != 0) { + if (QueueName.Length != 0) { output.WriteRawTag(10); - output.WriteString(Queue); + output.WriteString(QueueName); + } + if (Depth != 0) { + output.WriteRawTag(16); + output.WriteInt32(Depth); } - tasks_.WriteTo(output, _repeated_tasks_codec); if (_unknownFields != null) { _unknownFields.WriteTo(output); } @@ -559,11 +566,14 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (Queue.Length != 0) { + if (QueueName.Length != 0) { output.WriteRawTag(10); - output.WriteString(Queue); + output.WriteString(QueueName); + } + if (Depth != 0) { + output.WriteRawTag(16); + output.WriteInt32(Depth); } - tasks_.WriteTo(ref output, _repeated_tasks_codec); if (_unknownFields != null) { _unknownFields.WriteTo(ref output); } @@ -573,10 +583,12 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; - if (Queue.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Queue); + if (QueueName.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(QueueName); + } + if (Depth != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Depth); } - size += tasks_.CalculateSize(_repeated_tasks_codec); if (_unknownFields != null) { size += _unknownFields.CalculateSize(); } @@ -584,14 +596,16 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(QueueSendBatchRequest other) { + public void MergeFrom(QueueDequeueRequest other) { if (other == null) { return; } - if (other.Queue.Length != 0) { - Queue = other.Queue; + if (other.QueueName.Length != 0) { + QueueName = other.QueueName; + } + if (other.Depth != 0) { + Depth = other.Depth; } - tasks_.Add(other.tasks_); _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } @@ -607,11 +621,11 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { - Queue = input.ReadString(); + QueueName = input.ReadString(); break; } - case 18: { - tasks_.AddEntriesFrom(input, _repeated_tasks_codec); + case 16: { + Depth = input.ReadInt32(); break; } } @@ -629,11 +643,11 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; case 10: { - Queue = input.ReadString(); + QueueName = input.ReadString(); break; } - case 18: { - tasks_.AddEntriesFrom(ref input, _repeated_tasks_codec); + case 16: { + Depth = input.ReadInt32(); break; } } @@ -643,22 +657,19 @@ public void MergeFrom(pb::CodedInputStream input) { } - /// - /// Response for sending a collection of tasks - /// - public sealed partial class QueueSendBatchResponse : pb::IMessage + public sealed partial class QueueDequeueResponse : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new QueueSendBatchResponse()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new QueueDequeueResponse()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Queue.v1.QueueReflection.Descriptor.MessageTypes[3]; } + get { return global::Nitric.Proto.Queues.v1.QueuesReflection.Descriptor.MessageTypes[3]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -667,57 +678,57 @@ public sealed partial class QueueSendBatchResponse : pb::IMessageField number for the "failedTasks" field. - public const int FailedTasksFieldNumber = 1; - private static readonly pb::FieldCodec _repeated_failedTasks_codec - = pb::FieldCodec.ForMessage(10, global::Nitric.Proto.Queue.v1.FailedTask.Parser); - private readonly pbc::RepeatedField failedTasks_ = new pbc::RepeatedField(); + /// Field number for the "messages" field. + public const int MessagesFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_messages_codec + = pb::FieldCodec.ForMessage(10, global::Nitric.Proto.Queues.v1.DequeuedMessage.Parser); + private readonly pbc::RepeatedField messages_ = new pbc::RepeatedField(); /// - /// A list of tasks that failed to be queued + /// Array of messages popped off the queue /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField FailedTasks { - get { return failedTasks_; } + public pbc::RepeatedField Messages { + get { return messages_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { - return Equals(other as QueueSendBatchResponse); + return Equals(other as QueueDequeueResponse); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(QueueSendBatchResponse other) { + public bool Equals(QueueDequeueResponse other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } - if(!failedTasks_.Equals(other.failedTasks_)) return false; + if(!messages_.Equals(other.messages_)) return false; return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; - hash ^= failedTasks_.GetHashCode(); + hash ^= messages_.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -734,7 +745,7 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else - failedTasks_.WriteTo(output, _repeated_failedTasks_codec); + messages_.WriteTo(output, _repeated_messages_codec); if (_unknownFields != null) { _unknownFields.WriteTo(output); } @@ -744,7 +755,7 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - failedTasks_.WriteTo(ref output, _repeated_failedTasks_codec); + messages_.WriteTo(ref output, _repeated_messages_codec); if (_unknownFields != null) { _unknownFields.WriteTo(ref output); } @@ -754,7 +765,7 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; - size += failedTasks_.CalculateSize(_repeated_failedTasks_codec); + size += messages_.CalculateSize(_repeated_messages_codec); if (_unknownFields != null) { size += _unknownFields.CalculateSize(); } @@ -762,11 +773,11 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(QueueSendBatchResponse other) { + public void MergeFrom(QueueDequeueResponse other) { if (other == null) { return; } - failedTasks_.Add(other.failedTasks_); + messages_.Add(other.messages_); _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } @@ -782,7 +793,7 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { - failedTasks_.AddEntriesFrom(input, _repeated_failedTasks_codec); + messages_.AddEntriesFrom(input, _repeated_messages_codec); break; } } @@ -800,7 +811,7 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; case 10: { - failedTasks_.AddEntriesFrom(ref input, _repeated_failedTasks_codec); + messages_.AddEntriesFrom(ref input, _repeated_messages_codec); break; } } @@ -810,19 +821,19 @@ public void MergeFrom(pb::CodedInputStream input) { } - public sealed partial class QueueReceiveRequest : pb::IMessage + public sealed partial class QueueCompleteRequest : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new QueueReceiveRequest()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new QueueCompleteRequest()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Queue.v1.QueueReflection.Descriptor.MessageTypes[4]; } + get { return global::Nitric.Proto.Queues.v1.QueuesReflection.Descriptor.MessageTypes[4]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -831,76 +842,76 @@ public sealed partial class QueueReceiveRequest : pb::IMessageField number for the "queue" field. - public const int QueueFieldNumber = 1; - private string queue_ = ""; + /// Field number for the "queue_name" field. + public const int QueueNameFieldNumber = 1; + private string queueName_ = ""; /// /// The nitric name for the queue - /// this will automatically be resolved to the provider specific queue identifier. + /// this will automatically be resolved to the provider specific queue identifier. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string Queue { - get { return queue_; } + public string QueueName { + get { return queueName_; } set { - queue_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + queueName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); } } - /// Field number for the "depth" field. - public const int DepthFieldNumber = 2; - private int depth_; + /// Field number for the "lease_id" field. + public const int LeaseIdFieldNumber = 2; + private string leaseId_ = ""; /// - /// The max number of items to pop off the queue, may be capped by provider specific limitations + /// Lease id of the message to be completed /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int Depth { - get { return depth_; } + public string LeaseId { + get { return leaseId_; } set { - depth_ = value; + leaseId_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { - return Equals(other as QueueReceiveRequest); + return Equals(other as QueueCompleteRequest); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(QueueReceiveRequest other) { + public bool Equals(QueueCompleteRequest other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } - if (Queue != other.Queue) return false; - if (Depth != other.Depth) return false; + if (QueueName != other.QueueName) return false; + if (LeaseId != other.LeaseId) return false; return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; - if (Queue.Length != 0) hash ^= Queue.GetHashCode(); - if (Depth != 0) hash ^= Depth.GetHashCode(); + if (QueueName.Length != 0) hash ^= QueueName.GetHashCode(); + if (LeaseId.Length != 0) hash ^= LeaseId.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -917,13 +928,13 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else - if (Queue.Length != 0) { + if (QueueName.Length != 0) { output.WriteRawTag(10); - output.WriteString(Queue); + output.WriteString(QueueName); } - if (Depth != 0) { - output.WriteRawTag(16); - output.WriteInt32(Depth); + if (LeaseId.Length != 0) { + output.WriteRawTag(18); + output.WriteString(LeaseId); } if (_unknownFields != null) { _unknownFields.WriteTo(output); @@ -934,13 +945,13 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (Queue.Length != 0) { + if (QueueName.Length != 0) { output.WriteRawTag(10); - output.WriteString(Queue); + output.WriteString(QueueName); } - if (Depth != 0) { - output.WriteRawTag(16); - output.WriteInt32(Depth); + if (LeaseId.Length != 0) { + output.WriteRawTag(18); + output.WriteString(LeaseId); } if (_unknownFields != null) { _unknownFields.WriteTo(ref output); @@ -951,11 +962,11 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; - if (Queue.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Queue); + if (QueueName.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(QueueName); } - if (Depth != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(Depth); + if (LeaseId.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(LeaseId); } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); @@ -964,15 +975,15 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(QueueReceiveRequest other) { + public void MergeFrom(QueueCompleteRequest other) { if (other == null) { return; } - if (other.Queue.Length != 0) { - Queue = other.Queue; + if (other.QueueName.Length != 0) { + QueueName = other.QueueName; } - if (other.Depth != 0) { - Depth = other.Depth; + if (other.LeaseId.Length != 0) { + LeaseId = other.LeaseId; } _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } @@ -989,11 +1000,11 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { - Queue = input.ReadString(); + QueueName = input.ReadString(); break; } - case 16: { - Depth = input.ReadInt32(); + case 18: { + LeaseId = input.ReadString(); break; } } @@ -1011,11 +1022,11 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; case 10: { - Queue = input.ReadString(); + QueueName = input.ReadString(); break; } - case 16: { - Depth = input.ReadInt32(); + case 18: { + LeaseId = input.ReadString(); break; } } @@ -1025,19 +1036,19 @@ public void MergeFrom(pb::CodedInputStream input) { } - public sealed partial class QueueReceiveResponse : pb::IMessage + public sealed partial class QueueCompleteResponse : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new QueueReceiveResponse()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new QueueCompleteResponse()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Queue.v1.QueueReflection.Descriptor.MessageTypes[5]; } + get { return global::Nitric.Proto.Queues.v1.QueuesReflection.Descriptor.MessageTypes[5]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1046,57 +1057,41 @@ public sealed partial class QueueReceiveResponse : pb::IMessageField number for the "tasks" field. - public const int TasksFieldNumber = 1; - private static readonly pb::FieldCodec _repeated_tasks_codec - = pb::FieldCodec.ForMessage(10, global::Nitric.Proto.Queue.v1.NitricTask.Parser); - private readonly pbc::RepeatedField tasks_ = new pbc::RepeatedField(); - /// - /// Array of tasks popped off the queue - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField Tasks { - get { return tasks_; } + public QueueCompleteResponse Clone() { + return new QueueCompleteResponse(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { - return Equals(other as QueueReceiveResponse); + return Equals(other as QueueCompleteResponse); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(QueueReceiveResponse other) { + public bool Equals(QueueCompleteResponse other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } - if(!tasks_.Equals(other.tasks_)) return false; return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; - hash ^= tasks_.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -1113,7 +1108,6 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else - tasks_.WriteTo(output, _repeated_tasks_codec); if (_unknownFields != null) { _unknownFields.WriteTo(output); } @@ -1123,7 +1117,6 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - tasks_.WriteTo(ref output, _repeated_tasks_codec); if (_unknownFields != null) { _unknownFields.WriteTo(ref output); } @@ -1133,7 +1126,6 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; - size += tasks_.CalculateSize(_repeated_tasks_codec); if (_unknownFields != null) { size += _unknownFields.CalculateSize(); } @@ -1141,11 +1133,10 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(QueueReceiveResponse other) { + public void MergeFrom(QueueCompleteResponse other) { if (other == null) { return; } - tasks_.Add(other.tasks_); _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } @@ -1160,10 +1151,6 @@ public void MergeFrom(pb::CodedInputStream input) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; - case 10: { - tasks_.AddEntriesFrom(input, _repeated_tasks_codec); - break; - } } } #endif @@ -1178,10 +1165,6 @@ public void MergeFrom(pb::CodedInputStream input) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; - case 10: { - tasks_.AddEntriesFrom(ref input, _repeated_tasks_codec); - break; - } } } } @@ -1189,19 +1172,22 @@ public void MergeFrom(pb::CodedInputStream input) { } - public sealed partial class QueueCompleteRequest : pb::IMessage + /// + /// An message to be sent to a queue. + /// + public sealed partial class QueueMessage : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new QueueCompleteRequest()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new QueueMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Queue.v1.QueueReflection.Descriptor.MessageTypes[6]; } + get { return global::Nitric.Proto.Queues.v1.QueuesReflection.Descriptor.MessageTypes[6]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1210,76 +1196,80 @@ public sealed partial class QueueCompleteRequest : pb::IMessageField number for the "queue" field. - public const int QueueFieldNumber = 1; - private string queue_ = ""; - /// - /// The nitric name for the queue - /// this will automatically be resolved to the provider specific queue identifier. - /// + /// Field number for the "struct_payload" field. + public const int StructPayloadFieldNumber = 1; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string Queue { - get { return queue_; } + public global::Google.Protobuf.WellKnownTypes.Struct StructPayload { + get { return contentCase_ == ContentOneofCase.StructPayload ? (global::Google.Protobuf.WellKnownTypes.Struct) content_ : null; } set { - queue_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + content_ = value; + contentCase_ = value == null ? ContentOneofCase.None : ContentOneofCase.StructPayload; } } - /// Field number for the "lease_id" field. - public const int LeaseIdFieldNumber = 2; - private string leaseId_ = ""; - /// - /// Lease id of the task to be completed - /// + private object content_; + /// Enum of possible cases for the "content" oneof. + public enum ContentOneofCase { + None = 0, + StructPayload = 1, + } + private ContentOneofCase contentCase_ = ContentOneofCase.None; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string LeaseId { - get { return leaseId_; } - set { - leaseId_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } + public ContentOneofCase ContentCase { + get { return contentCase_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void ClearContent() { + contentCase_ = ContentOneofCase.None; + content_ = null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { - return Equals(other as QueueCompleteRequest); + return Equals(other as QueueMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(QueueCompleteRequest other) { + public bool Equals(QueueMessage other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } - if (Queue != other.Queue) return false; - if (LeaseId != other.LeaseId) return false; + if (!object.Equals(StructPayload, other.StructPayload)) return false; + if (ContentCase != other.ContentCase) return false; return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; - if (Queue.Length != 0) hash ^= Queue.GetHashCode(); - if (LeaseId.Length != 0) hash ^= LeaseId.GetHashCode(); + if (contentCase_ == ContentOneofCase.StructPayload) hash ^= StructPayload.GetHashCode(); + hash ^= (int) contentCase_; if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -1296,13 +1286,9 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else - if (Queue.Length != 0) { + if (contentCase_ == ContentOneofCase.StructPayload) { output.WriteRawTag(10); - output.WriteString(Queue); - } - if (LeaseId.Length != 0) { - output.WriteRawTag(18); - output.WriteString(LeaseId); + output.WriteMessage(StructPayload); } if (_unknownFields != null) { _unknownFields.WriteTo(output); @@ -1313,13 +1299,9 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (Queue.Length != 0) { + if (contentCase_ == ContentOneofCase.StructPayload) { output.WriteRawTag(10); - output.WriteString(Queue); - } - if (LeaseId.Length != 0) { - output.WriteRawTag(18); - output.WriteString(LeaseId); + output.WriteMessage(StructPayload); } if (_unknownFields != null) { _unknownFields.WriteTo(ref output); @@ -1330,11 +1312,8 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; - if (Queue.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Queue); - } - if (LeaseId.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(LeaseId); + if (contentCase_ == ContentOneofCase.StructPayload) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(StructPayload); } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); @@ -1343,16 +1322,19 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(QueueCompleteRequest other) { + public void MergeFrom(QueueMessage other) { if (other == null) { return; } - if (other.Queue.Length != 0) { - Queue = other.Queue; - } - if (other.LeaseId.Length != 0) { - LeaseId = other.LeaseId; + switch (other.ContentCase) { + case ContentOneofCase.StructPayload: + if (StructPayload == null) { + StructPayload = new global::Google.Protobuf.WellKnownTypes.Struct(); + } + StructPayload.MergeFrom(other.StructPayload); + break; } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } @@ -1368,11 +1350,12 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { - Queue = input.ReadString(); - break; - } - case 18: { - LeaseId = input.ReadString(); + global::Google.Protobuf.WellKnownTypes.Struct subBuilder = new global::Google.Protobuf.WellKnownTypes.Struct(); + if (contentCase_ == ContentOneofCase.StructPayload) { + subBuilder.MergeFrom(StructPayload); + } + input.ReadMessage(subBuilder); + StructPayload = subBuilder; break; } } @@ -1390,11 +1373,12 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; case 10: { - Queue = input.ReadString(); - break; - } - case 18: { - LeaseId = input.ReadString(); + global::Google.Protobuf.WellKnownTypes.Struct subBuilder = new global::Google.Protobuf.WellKnownTypes.Struct(); + if (contentCase_ == ContentOneofCase.StructPayload) { + subBuilder.MergeFrom(StructPayload); + } + input.ReadMessage(subBuilder); + StructPayload = subBuilder; break; } } @@ -1404,19 +1388,19 @@ public void MergeFrom(pb::CodedInputStream input) { } - public sealed partial class QueueCompleteResponse : pb::IMessage + public sealed partial class DequeuedMessage : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new QueueCompleteResponse()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DequeuedMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Queue.v1.QueueReflection.Descriptor.MessageTypes[7]; } + get { return global::Nitric.Proto.Queues.v1.QueuesReflection.Descriptor.MessageTypes[7]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1425,211 +1409,69 @@ public sealed partial class QueueCompleteResponse : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FailedTask()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Queue.v1.QueueReflection.Descriptor.MessageTypes[8]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public FailedTask() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public FailedTask(FailedTask other) : this() { - task_ = other.task_ != null ? other.task_.Clone() : null; - message_ = other.message_; + public DequeuedMessage(DequeuedMessage other) : this() { + leaseId_ = other.leaseId_; + message_ = other.message_ != null ? other.message_.Clone() : null; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public FailedTask Clone() { - return new FailedTask(this); + public DequeuedMessage Clone() { + return new DequeuedMessage(this); } - /// Field number for the "task" field. - public const int TaskFieldNumber = 1; - private global::Nitric.Proto.Queue.v1.NitricTask task_; - /// - /// The task that failed to be pushed - /// + /// Field number for the "lease_id" field. + public const int LeaseIdFieldNumber = 1; + private string leaseId_ = ""; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Queue.v1.NitricTask Task { - get { return task_; } + public string LeaseId { + get { return leaseId_; } set { - task_ = value; + leaseId_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); } } /// Field number for the "message" field. public const int MessageFieldNumber = 2; - private string message_ = ""; - /// - /// A message describing the failure - /// + private global::Nitric.Proto.Queues.v1.QueueMessage message_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string Message { + public global::Nitric.Proto.Queues.v1.QueueMessage Message { get { return message_; } set { - message_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + message_ = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { - return Equals(other as FailedTask); + return Equals(other as DequeuedMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(FailedTask other) { + public bool Equals(DequeuedMessage other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } - if (!object.Equals(Task, other.Task)) return false; - if (Message != other.Message) return false; + if (LeaseId != other.LeaseId) return false; + if (!object.Equals(Message, other.Message)) return false; return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; - if (task_ != null) hash ^= Task.GetHashCode(); - if (Message.Length != 0) hash ^= Message.GetHashCode(); + if (LeaseId.Length != 0) hash ^= LeaseId.GetHashCode(); + if (message_ != null) hash ^= Message.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -1646,13 +1488,13 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else - if (task_ != null) { + if (LeaseId.Length != 0) { output.WriteRawTag(10); - output.WriteMessage(Task); + output.WriteString(LeaseId); } - if (Message.Length != 0) { + if (message_ != null) { output.WriteRawTag(18); - output.WriteString(Message); + output.WriteMessage(Message); } if (_unknownFields != null) { _unknownFields.WriteTo(output); @@ -1663,13 +1505,13 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (task_ != null) { + if (LeaseId.Length != 0) { output.WriteRawTag(10); - output.WriteMessage(Task); + output.WriteString(LeaseId); } - if (Message.Length != 0) { + if (message_ != null) { output.WriteRawTag(18); - output.WriteString(Message); + output.WriteMessage(Message); } if (_unknownFields != null) { _unknownFields.WriteTo(ref output); @@ -1680,11 +1522,11 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; - if (task_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Task); + if (LeaseId.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(LeaseId); } - if (Message.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Message); + if (message_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Message); } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); @@ -1693,18 +1535,18 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(FailedTask other) { + public void MergeFrom(DequeuedMessage other) { if (other == null) { return; } - if (other.task_ != null) { - if (task_ == null) { - Task = new global::Nitric.Proto.Queue.v1.NitricTask(); - } - Task.MergeFrom(other.Task); + if (other.LeaseId.Length != 0) { + LeaseId = other.LeaseId; } - if (other.Message.Length != 0) { - Message = other.Message; + if (other.message_ != null) { + if (message_ == null) { + Message = new global::Nitric.Proto.Queues.v1.QueueMessage(); + } + Message.MergeFrom(other.Message); } _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } @@ -1721,14 +1563,14 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { - if (task_ == null) { - Task = new global::Nitric.Proto.Queue.v1.NitricTask(); - } - input.ReadMessage(Task); + LeaseId = input.ReadString(); break; } case 18: { - Message = input.ReadString(); + if (message_ == null) { + Message = new global::Nitric.Proto.Queues.v1.QueueMessage(); + } + input.ReadMessage(Message); break; } } @@ -1746,14 +1588,14 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; case 10: { - if (task_ == null) { - Task = new global::Nitric.Proto.Queue.v1.NitricTask(); - } - input.ReadMessage(Task); + LeaseId = input.ReadString(); break; } case 18: { - Message = input.ReadString(); + if (message_ == null) { + Message = new global::Nitric.Proto.Queues.v1.QueueMessage(); + } + input.ReadMessage(Message); break; } } @@ -1763,22 +1605,19 @@ public void MergeFrom(pb::CodedInputStream input) { } - /// - /// A task to be sent or received from a queue. - /// - public sealed partial class NitricTask : pb::IMessage + public sealed partial class FailedEnqueueMessage : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NitricTask()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FailedEnqueueMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Queue.v1.QueueReflection.Descriptor.MessageTypes[9]; } + get { return global::Nitric.Proto.Queues.v1.QueuesReflection.Descriptor.MessageTypes[8]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1787,109 +1626,75 @@ public sealed partial class NitricTask : pb::IMessage } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public NitricTask() { + public FailedEnqueueMessage() { OnConstruction(); } partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public NitricTask(NitricTask other) : this() { - id_ = other.id_; - leaseId_ = other.leaseId_; - payloadType_ = other.payloadType_; - payload_ = other.payload_ != null ? other.payload_.Clone() : null; + public FailedEnqueueMessage(FailedEnqueueMessage other) : this() { + message_ = other.message_ != null ? other.message_.Clone() : null; + details_ = other.details_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public NitricTask Clone() { - return new NitricTask(this); + public FailedEnqueueMessage Clone() { + return new FailedEnqueueMessage(this); } - /// Field number for the "id" field. - public const int IdFieldNumber = 1; - private string id_ = ""; - /// - /// A unique id for the task - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string Id { - get { return id_; } - set { - id_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "lease_id" field. - public const int LeaseIdFieldNumber = 2; - private string leaseId_ = ""; - /// - /// The lease id unique to the pop request, this must be used to complete, extend the lease or release the task. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string LeaseId { - get { return leaseId_; } - set { - leaseId_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "payload_type" field. - public const int PayloadTypeFieldNumber = 3; - private string payloadType_ = ""; + /// Field number for the "message" field. + public const int MessageFieldNumber = 1; + private global::Nitric.Proto.Queues.v1.QueueMessage message_; /// - /// A content hint for the tasks payload + /// The message that failed to be pushed /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string PayloadType { - get { return payloadType_; } + public global::Nitric.Proto.Queues.v1.QueueMessage Message { + get { return message_; } set { - payloadType_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + message_ = value; } } - /// Field number for the "payload" field. - public const int PayloadFieldNumber = 4; - private global::Google.Protobuf.WellKnownTypes.Struct payload_; + /// Field number for the "details" field. + public const int DetailsFieldNumber = 2; + private string details_ = ""; /// - /// The payload of the task + /// A description of the failure /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Google.Protobuf.WellKnownTypes.Struct Payload { - get { return payload_; } + public string Details { + get { return details_; } set { - payload_ = value; + details_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { - return Equals(other as NitricTask); + return Equals(other as FailedEnqueueMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(NitricTask other) { + public bool Equals(FailedEnqueueMessage other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } - if (Id != other.Id) return false; - if (LeaseId != other.LeaseId) return false; - if (PayloadType != other.PayloadType) return false; - if (!object.Equals(Payload, other.Payload)) return false; + if (!object.Equals(Message, other.Message)) return false; + if (Details != other.Details) return false; return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; - if (Id.Length != 0) hash ^= Id.GetHashCode(); - if (LeaseId.Length != 0) hash ^= LeaseId.GetHashCode(); - if (PayloadType.Length != 0) hash ^= PayloadType.GetHashCode(); - if (payload_ != null) hash ^= Payload.GetHashCode(); + if (message_ != null) hash ^= Message.GetHashCode(); + if (Details.Length != 0) hash ^= Details.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -1906,21 +1711,13 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else - if (Id.Length != 0) { + if (message_ != null) { output.WriteRawTag(10); - output.WriteString(Id); + output.WriteMessage(Message); } - if (LeaseId.Length != 0) { + if (Details.Length != 0) { output.WriteRawTag(18); - output.WriteString(LeaseId); - } - if (PayloadType.Length != 0) { - output.WriteRawTag(26); - output.WriteString(PayloadType); - } - if (payload_ != null) { - output.WriteRawTag(34); - output.WriteMessage(Payload); + output.WriteString(Details); } if (_unknownFields != null) { _unknownFields.WriteTo(output); @@ -1931,21 +1728,13 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (Id.Length != 0) { + if (message_ != null) { output.WriteRawTag(10); - output.WriteString(Id); + output.WriteMessage(Message); } - if (LeaseId.Length != 0) { + if (Details.Length != 0) { output.WriteRawTag(18); - output.WriteString(LeaseId); - } - if (PayloadType.Length != 0) { - output.WriteRawTag(26); - output.WriteString(PayloadType); - } - if (payload_ != null) { - output.WriteRawTag(34); - output.WriteMessage(Payload); + output.WriteString(Details); } if (_unknownFields != null) { _unknownFields.WriteTo(ref output); @@ -1956,17 +1745,11 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; - if (Id.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Id); + if (message_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Message); } - if (LeaseId.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(LeaseId); - } - if (PayloadType.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(PayloadType); - } - if (payload_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Payload); + if (Details.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Details); } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); @@ -1975,24 +1758,18 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(NitricTask other) { + public void MergeFrom(FailedEnqueueMessage other) { if (other == null) { return; } - if (other.Id.Length != 0) { - Id = other.Id; - } - if (other.LeaseId.Length != 0) { - LeaseId = other.LeaseId; - } - if (other.PayloadType.Length != 0) { - PayloadType = other.PayloadType; - } - if (other.payload_ != null) { - if (payload_ == null) { - Payload = new global::Google.Protobuf.WellKnownTypes.Struct(); + if (other.message_ != null) { + if (message_ == null) { + Message = new global::Nitric.Proto.Queues.v1.QueueMessage(); } - Payload.MergeFrom(other.Payload); + Message.MergeFrom(other.Message); + } + if (other.Details.Length != 0) { + Details = other.Details; } _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } @@ -2009,22 +1786,14 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { - Id = input.ReadString(); + if (message_ == null) { + Message = new global::Nitric.Proto.Queues.v1.QueueMessage(); + } + input.ReadMessage(Message); break; } case 18: { - LeaseId = input.ReadString(); - break; - } - case 26: { - PayloadType = input.ReadString(); - break; - } - case 34: { - if (payload_ == null) { - Payload = new global::Google.Protobuf.WellKnownTypes.Struct(); - } - input.ReadMessage(Payload); + Details = input.ReadString(); break; } } @@ -2042,22 +1811,14 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; case 10: { - Id = input.ReadString(); + if (message_ == null) { + Message = new global::Nitric.Proto.Queues.v1.QueueMessage(); + } + input.ReadMessage(Message); break; } case 18: { - LeaseId = input.ReadString(); - break; - } - case 26: { - PayloadType = input.ReadString(); - break; - } - case 34: { - if (payload_ == null) { - Payload = new global::Google.Protobuf.WellKnownTypes.Struct(); - } - input.ReadMessage(Payload); + Details = input.ReadString(); break; } } diff --git a/src/Nitric.Sdk/Proto/nitric/proto/queues/v1/QueuesGrpc.cs b/src/Nitric.Sdk/Proto/nitric/proto/queues/v1/QueuesGrpc.cs new file mode 100644 index 0000000..3279787 --- /dev/null +++ b/src/Nitric.Sdk/Proto/nitric/proto/queues/v1/QueuesGrpc.cs @@ -0,0 +1,306 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: nitric/proto/queues/v1/queues.proto +// +#pragma warning disable 0414, 1591 +#region Designer generated code + +using grpc = global::Grpc.Core; + +namespace Nitric.Proto.Queues.v1 { + /// + /// The Nitric Queue Service contract + /// + public static partial class Queues + { + static readonly string __ServiceName = "nitric.proto.queues.v1.Queues"; + + static void __Helper_SerializeMessage(global::Google.Protobuf.IMessage message, grpc::SerializationContext context) + { + #if !GRPC_DISABLE_PROTOBUF_BUFFER_SERIALIZATION + if (message is global::Google.Protobuf.IBufferMessage) + { + context.SetPayloadLength(message.CalculateSize()); + global::Google.Protobuf.MessageExtensions.WriteTo(message, context.GetBufferWriter()); + context.Complete(); + return; + } + #endif + context.Complete(global::Google.Protobuf.MessageExtensions.ToByteArray(message)); + } + + static class __Helper_MessageCache + { + public static readonly bool IsBufferMessage = global::System.Reflection.IntrospectionExtensions.GetTypeInfo(typeof(global::Google.Protobuf.IBufferMessage)).IsAssignableFrom(typeof(T)); + } + + static T __Helper_DeserializeMessage(grpc::DeserializationContext context, global::Google.Protobuf.MessageParser parser) where T : global::Google.Protobuf.IMessage + { + #if !GRPC_DISABLE_PROTOBUF_BUFFER_SERIALIZATION + if (__Helper_MessageCache.IsBufferMessage) + { + return parser.ParseFrom(context.PayloadAsReadOnlySequence()); + } + #endif + return parser.ParseFrom(context.PayloadAsNewBuffer()); + } + + static readonly grpc::Marshaller __Marshaller_nitric_proto_queues_v1_QueueEnqueueRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Queues.v1.QueueEnqueueRequest.Parser)); + static readonly grpc::Marshaller __Marshaller_nitric_proto_queues_v1_QueueEnqueueResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Queues.v1.QueueEnqueueResponse.Parser)); + static readonly grpc::Marshaller __Marshaller_nitric_proto_queues_v1_QueueDequeueRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Queues.v1.QueueDequeueRequest.Parser)); + static readonly grpc::Marshaller __Marshaller_nitric_proto_queues_v1_QueueDequeueResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Queues.v1.QueueDequeueResponse.Parser)); + static readonly grpc::Marshaller __Marshaller_nitric_proto_queues_v1_QueueCompleteRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Queues.v1.QueueCompleteRequest.Parser)); + static readonly grpc::Marshaller __Marshaller_nitric_proto_queues_v1_QueueCompleteResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Queues.v1.QueueCompleteResponse.Parser)); + + static readonly grpc::Method __Method_Enqueue = new grpc::Method( + grpc::MethodType.Unary, + __ServiceName, + "Enqueue", + __Marshaller_nitric_proto_queues_v1_QueueEnqueueRequest, + __Marshaller_nitric_proto_queues_v1_QueueEnqueueResponse); + + static readonly grpc::Method __Method_Dequeue = new grpc::Method( + grpc::MethodType.Unary, + __ServiceName, + "Dequeue", + __Marshaller_nitric_proto_queues_v1_QueueDequeueRequest, + __Marshaller_nitric_proto_queues_v1_QueueDequeueResponse); + + static readonly grpc::Method __Method_Complete = new grpc::Method( + grpc::MethodType.Unary, + __ServiceName, + "Complete", + __Marshaller_nitric_proto_queues_v1_QueueCompleteRequest, + __Marshaller_nitric_proto_queues_v1_QueueCompleteResponse); + + /// Service descriptor + public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor + { + get { return global::Nitric.Proto.Queues.v1.QueuesReflection.Descriptor.Services[0]; } + } + + /// Base class for server-side implementations of Queues + [grpc::BindServiceMethod(typeof(Queues), "BindService")] + public abstract partial class QueuesBase + { + /// + /// Send message(s) to a queue + /// + /// The request received from the client. + /// The context of the server-side call handler being invoked. + /// The response to send back to the client (wrapped by a task). + public virtual global::System.Threading.Tasks.Task Enqueue(global::Nitric.Proto.Queues.v1.QueueEnqueueRequest request, grpc::ServerCallContext context) + { + throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); + } + + /// + /// Receive message(s) from a queue + /// + /// The request received from the client. + /// The context of the server-side call handler being invoked. + /// The response to send back to the client (wrapped by a task). + public virtual global::System.Threading.Tasks.Task Dequeue(global::Nitric.Proto.Queues.v1.QueueDequeueRequest request, grpc::ServerCallContext context) + { + throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); + } + + /// + /// Complete an message previously popped from a queue + /// + /// The request received from the client. + /// The context of the server-side call handler being invoked. + /// The response to send back to the client (wrapped by a task). + public virtual global::System.Threading.Tasks.Task Complete(global::Nitric.Proto.Queues.v1.QueueCompleteRequest request, grpc::ServerCallContext context) + { + throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); + } + + } + + /// Client for Queues + public partial class QueuesClient : grpc::ClientBase + { + /// Creates a new client for Queues + /// The channel to use to make remote calls. + public QueuesClient(grpc::ChannelBase channel) : base(channel) + { + } + /// Creates a new client for Queues that uses a custom CallInvoker. + /// The callInvoker to use to make remote calls. + public QueuesClient(grpc::CallInvoker callInvoker) : base(callInvoker) + { + } + /// Protected parameterless constructor to allow creation of test doubles. + protected QueuesClient() : base() + { + } + /// Protected constructor to allow creation of configured clients. + /// The client configuration. + protected QueuesClient(ClientBaseConfiguration configuration) : base(configuration) + { + } + + /// + /// Send message(s) to a queue + /// + /// The request to send to the server. + /// The initial metadata to send with the call. This parameter is optional. + /// An optional deadline for the call. The call will be cancelled if deadline is hit. + /// An optional token for canceling the call. + /// The response received from the server. + public virtual global::Nitric.Proto.Queues.v1.QueueEnqueueResponse Enqueue(global::Nitric.Proto.Queues.v1.QueueEnqueueRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return Enqueue(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + /// + /// Send message(s) to a queue + /// + /// The request to send to the server. + /// The options for the call. + /// The response received from the server. + public virtual global::Nitric.Proto.Queues.v1.QueueEnqueueResponse Enqueue(global::Nitric.Proto.Queues.v1.QueueEnqueueRequest request, grpc::CallOptions options) + { + return CallInvoker.BlockingUnaryCall(__Method_Enqueue, null, options, request); + } + /// + /// Send message(s) to a queue + /// + /// The request to send to the server. + /// The initial metadata to send with the call. This parameter is optional. + /// An optional deadline for the call. The call will be cancelled if deadline is hit. + /// An optional token for canceling the call. + /// The call object. + public virtual grpc::AsyncUnaryCall EnqueueAsync(global::Nitric.Proto.Queues.v1.QueueEnqueueRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return EnqueueAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + /// + /// Send message(s) to a queue + /// + /// The request to send to the server. + /// The options for the call. + /// The call object. + public virtual grpc::AsyncUnaryCall EnqueueAsync(global::Nitric.Proto.Queues.v1.QueueEnqueueRequest request, grpc::CallOptions options) + { + return CallInvoker.AsyncUnaryCall(__Method_Enqueue, null, options, request); + } + /// + /// Receive message(s) from a queue + /// + /// The request to send to the server. + /// The initial metadata to send with the call. This parameter is optional. + /// An optional deadline for the call. The call will be cancelled if deadline is hit. + /// An optional token for canceling the call. + /// The response received from the server. + public virtual global::Nitric.Proto.Queues.v1.QueueDequeueResponse Dequeue(global::Nitric.Proto.Queues.v1.QueueDequeueRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return Dequeue(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + /// + /// Receive message(s) from a queue + /// + /// The request to send to the server. + /// The options for the call. + /// The response received from the server. + public virtual global::Nitric.Proto.Queues.v1.QueueDequeueResponse Dequeue(global::Nitric.Proto.Queues.v1.QueueDequeueRequest request, grpc::CallOptions options) + { + return CallInvoker.BlockingUnaryCall(__Method_Dequeue, null, options, request); + } + /// + /// Receive message(s) from a queue + /// + /// The request to send to the server. + /// The initial metadata to send with the call. This parameter is optional. + /// An optional deadline for the call. The call will be cancelled if deadline is hit. + /// An optional token for canceling the call. + /// The call object. + public virtual grpc::AsyncUnaryCall DequeueAsync(global::Nitric.Proto.Queues.v1.QueueDequeueRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return DequeueAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + /// + /// Receive message(s) from a queue + /// + /// The request to send to the server. + /// The options for the call. + /// The call object. + public virtual grpc::AsyncUnaryCall DequeueAsync(global::Nitric.Proto.Queues.v1.QueueDequeueRequest request, grpc::CallOptions options) + { + return CallInvoker.AsyncUnaryCall(__Method_Dequeue, null, options, request); + } + /// + /// Complete an message previously popped from a queue + /// + /// The request to send to the server. + /// The initial metadata to send with the call. This parameter is optional. + /// An optional deadline for the call. The call will be cancelled if deadline is hit. + /// An optional token for canceling the call. + /// The response received from the server. + public virtual global::Nitric.Proto.Queues.v1.QueueCompleteResponse Complete(global::Nitric.Proto.Queues.v1.QueueCompleteRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return Complete(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + /// + /// Complete an message previously popped from a queue + /// + /// The request to send to the server. + /// The options for the call. + /// The response received from the server. + public virtual global::Nitric.Proto.Queues.v1.QueueCompleteResponse Complete(global::Nitric.Proto.Queues.v1.QueueCompleteRequest request, grpc::CallOptions options) + { + return CallInvoker.BlockingUnaryCall(__Method_Complete, null, options, request); + } + /// + /// Complete an message previously popped from a queue + /// + /// The request to send to the server. + /// The initial metadata to send with the call. This parameter is optional. + /// An optional deadline for the call. The call will be cancelled if deadline is hit. + /// An optional token for canceling the call. + /// The call object. + public virtual grpc::AsyncUnaryCall CompleteAsync(global::Nitric.Proto.Queues.v1.QueueCompleteRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return CompleteAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + /// + /// Complete an message previously popped from a queue + /// + /// The request to send to the server. + /// The options for the call. + /// The call object. + public virtual grpc::AsyncUnaryCall CompleteAsync(global::Nitric.Proto.Queues.v1.QueueCompleteRequest request, grpc::CallOptions options) + { + return CallInvoker.AsyncUnaryCall(__Method_Complete, null, options, request); + } + /// Creates a new instance of client from given ClientBaseConfiguration. + protected override QueuesClient NewInstance(ClientBaseConfiguration configuration) + { + return new QueuesClient(configuration); + } + } + + /// Creates service definition that can be registered with a server + /// An object implementing the server-side handling logic. + public static grpc::ServerServiceDefinition BindService(QueuesBase serviceImpl) + { + return grpc::ServerServiceDefinition.CreateBuilder() + .AddMethod(__Method_Enqueue, serviceImpl.Enqueue) + .AddMethod(__Method_Dequeue, serviceImpl.Dequeue) + .AddMethod(__Method_Complete, serviceImpl.Complete).Build(); + } + + /// Register service method with a service binder with or without implementation. Useful when customizing the service binding logic. + /// Note: this method is part of an experimental API that can change or be removed without any prior notice. + /// Service methods will be bound by calling AddMethod on this object. + /// An object implementing the server-side handling logic. + public static void BindService(grpc::ServiceBinderBase serviceBinder, QueuesBase serviceImpl) + { + serviceBinder.AddMethod(__Method_Enqueue, serviceImpl == null ? null : new grpc::UnaryServerMethod(serviceImpl.Enqueue)); + serviceBinder.AddMethod(__Method_Dequeue, serviceImpl == null ? null : new grpc::UnaryServerMethod(serviceImpl.Dequeue)); + serviceBinder.AddMethod(__Method_Complete, serviceImpl == null ? null : new grpc::UnaryServerMethod(serviceImpl.Complete)); + } + + } +} +#endregion diff --git a/src/Nitric.Sdk/Proto/proto/resource/v1/Resource.cs b/src/Nitric.Sdk/Proto/nitric/proto/resources/v1/Resources.cs similarity index 68% rename from src/Nitric.Sdk/Proto/proto/resource/v1/Resource.cs rename to src/Nitric.Sdk/Proto/nitric/proto/resources/v1/Resources.cs index 618071c..5f1ad06 100644 --- a/src/Nitric.Sdk/Proto/proto/resource/v1/Resource.cs +++ b/src/Nitric.Sdk/Proto/nitric/proto/resources/v1/Resources.cs @@ -1,6 +1,6 @@ // // Generated by the protocol buffer compiler. DO NOT EDIT! -// source: proto/resource/v1/resource.proto +// source: nitric/proto/resources/v1/resources.proto // #pragma warning disable 1591, 0612, 3021 #region Designer generated code @@ -9,103 +9,100 @@ using pbc = global::Google.Protobuf.Collections; using pbr = global::Google.Protobuf.Reflection; using scg = global::System.Collections.Generic; -namespace Nitric.Proto.Resource.v1 { +namespace Nitric.Proto.Resources.v1 { - /// Holder for reflection information generated from proto/resource/v1/resource.proto - public static partial class ResourceReflection { + /// Holder for reflection information generated from nitric/proto/resources/v1/resources.proto + public static partial class ResourcesReflection { #region Descriptor - /// File descriptor for proto/resource/v1/resource.proto + /// File descriptor for nitric/proto/resources/v1/resources.proto public static pbr::FileDescriptor Descriptor { get { return descriptor; } } private static pbr::FileDescriptor descriptor; - static ResourceReflection() { + static ResourcesReflection() { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( - "CiBwcm90by9yZXNvdXJjZS92MS9yZXNvdXJjZS5wcm90bxISbml0cmljLnJl", - "c291cmNlLnYxIqABCg5Qb2xpY3lSZXNvdXJjZRIwCgpwcmluY2lwYWxzGAEg", - "AygLMhwubml0cmljLnJlc291cmNlLnYxLlJlc291cmNlEisKB2FjdGlvbnMY", - "AiADKA4yGi5uaXRyaWMucmVzb3VyY2UudjEuQWN0aW9uEi8KCXJlc291cmNl", - "cxgDIAMoCzIcLm5pdHJpYy5yZXNvdXJjZS52MS5SZXNvdXJjZSJICghSZXNv", - "dXJjZRIuCgR0eXBlGAEgASgOMiAubml0cmljLnJlc291cmNlLnYxLlJlc291", - "cmNlVHlwZRIMCgRuYW1lGAIgASgJIsoDChZSZXNvdXJjZURlY2xhcmVSZXF1", - "ZXN0Ei4KCHJlc291cmNlGAEgASgLMhwubml0cmljLnJlc291cmNlLnYxLlJl", - "c291cmNlEjQKBnBvbGljeRgKIAEoCzIiLm5pdHJpYy5yZXNvdXJjZS52MS5Q", - "b2xpY3lSZXNvdXJjZUgAEjQKBmJ1Y2tldBgLIAEoCzIiLm5pdHJpYy5yZXNv", - "dXJjZS52MS5CdWNrZXRSZXNvdXJjZUgAEjIKBXF1ZXVlGAwgASgLMiEubml0", - "cmljLnJlc291cmNlLnYxLlF1ZXVlUmVzb3VyY2VIABIyCgV0b3BpYxgNIAEo", - "CzIhLm5pdHJpYy5yZXNvdXJjZS52MS5Ub3BpY1Jlc291cmNlSAASPAoKY29s", - "bGVjdGlvbhgOIAEoCzImLm5pdHJpYy5yZXNvdXJjZS52MS5Db2xsZWN0aW9u", - "UmVzb3VyY2VIABI0CgZzZWNyZXQYDyABKAsyIi5uaXRyaWMucmVzb3VyY2Uu", - "djEuU2VjcmV0UmVzb3VyY2VIABIuCgNhcGkYECABKAsyHy5uaXRyaWMucmVz", - "b3VyY2UudjEuQXBpUmVzb3VyY2VIAEIICgZjb25maWciEAoOQnVja2V0UmVz", - "b3VyY2UiDwoNUXVldWVSZXNvdXJjZSIPCg1Ub3BpY1Jlc291cmNlIhQKEkNv", - "bGxlY3Rpb25SZXNvdXJjZSIQCg5TZWNyZXRSZXNvdXJjZSI9ChhBcGlTZWN1", - "cml0eURlZmluaXRpb25Kd3QSDgoGaXNzdWVyGAEgASgJEhEKCWF1ZGllbmNl", - "cxgCIAMoCSJiChVBcGlTZWN1cml0eURlZmluaXRpb24SOwoDand0GAEgASgL", - "Miwubml0cmljLnJlc291cmNlLnYxLkFwaVNlY3VyaXR5RGVmaW5pdGlvbkp3", - "dEgAQgwKCmRlZmluaXRpb24iGwoJQXBpU2NvcGVzEg4KBnNjb3BlcxgBIAMo", - "CSLdAgoLQXBpUmVzb3VyY2USVgoUc2VjdXJpdHlfZGVmaW5pdGlvbnMYASAD", - "KAsyOC5uaXRyaWMucmVzb3VyY2UudjEuQXBpUmVzb3VyY2UuU2VjdXJpdHlE", - "ZWZpbml0aW9uc0VudHJ5Ej8KCHNlY3VyaXR5GAIgAygLMi0ubml0cmljLnJl", - "c291cmNlLnYxLkFwaVJlc291cmNlLlNlY3VyaXR5RW50cnkaZQoYU2VjdXJp", - "dHlEZWZpbml0aW9uc0VudHJ5EgsKA2tleRgBIAEoCRI4CgV2YWx1ZRgCIAEo", - "CzIpLm5pdHJpYy5yZXNvdXJjZS52MS5BcGlTZWN1cml0eURlZmluaXRpb246", - "AjgBGk4KDVNlY3VyaXR5RW50cnkSCwoDa2V5GAEgASgJEiwKBXZhbHVlGAIg", - "ASgLMh0ubml0cmljLnJlc291cmNlLnYxLkFwaVNjb3BlczoCOAEiGQoXUmVz", - "b3VyY2VEZWNsYXJlUmVzcG9uc2UiIQoSQXBpUmVzb3VyY2VEZXRhaWxzEgsK", - "A3VybBgBIAEoCSInChhXZWJzb2NrZXRSZXNvdXJjZURldGFpbHMSCwoDdXJs", - "GAEgASgJIkgKFlJlc291cmNlRGV0YWlsc1JlcXVlc3QSLgoIcmVzb3VyY2UY", - "ASABKAsyHC5uaXRyaWMucmVzb3VyY2UudjEuUmVzb3VyY2UizQEKF1Jlc291", - "cmNlRGV0YWlsc1Jlc3BvbnNlEgoKAmlkGAEgASgJEhAKCHByb3ZpZGVyGAIg", - "ASgJEg8KB3NlcnZpY2UYAyABKAkSNQoDYXBpGAogASgLMiYubml0cmljLnJl", - "c291cmNlLnYxLkFwaVJlc291cmNlRGV0YWlsc0gAEkEKCXdlYnNvY2tldBgL", - "IAEoCzIsLm5pdHJpYy5yZXNvdXJjZS52MS5XZWJzb2NrZXRSZXNvdXJjZURl", - "dGFpbHNIAEIJCgdkZXRhaWxzKroBCgxSZXNvdXJjZVR5cGUSBwoDQXBpEAAS", - "DAoIRnVuY3Rpb24QARIKCgZCdWNrZXQQAhIJCgVRdWV1ZRADEgkKBVRvcGlj", - "EAQSDAoIU2NoZWR1bGUQBRIQCgxTdWJzY3JpcHRpb24QBhIOCgpDb2xsZWN0", - "aW9uEAcSCgoGUG9saWN5EAgSCgoGU2VjcmV0EAkSEAoMTm90aWZpY2F0aW9u", - "EAoSDQoJV2Vic29ja2V0EAsSCAoESHR0cBAMKpUDCgZBY3Rpb24SEgoOQnVj", - "a2V0RmlsZUxpc3QQABIRCg1CdWNrZXRGaWxlR2V0EAESEQoNQnVja2V0Rmls", - "ZVB1dBACEhQKEEJ1Y2tldEZpbGVEZWxldGUQAxIOCglUb3BpY0xpc3QQyAES", - "EAoLVG9waWNEZXRhaWwQyQESFgoRVG9waWNFdmVudFB1Ymxpc2gQygESDgoJ", - "UXVldWVTZW5kEKwCEhEKDFF1ZXVlUmVjZWl2ZRCtAhIOCglRdWV1ZUxpc3QQ", - "rgISEAoLUXVldWVEZXRhaWwQrwISGwoWQ29sbGVjdGlvbkRvY3VtZW50UmVh", - "ZBCQAxIcChdDb2xsZWN0aW9uRG9jdW1lbnRXcml0ZRCRAxIdChhDb2xsZWN0", - "aW9uRG9jdW1lbnREZWxldGUQkgMSFAoPQ29sbGVjdGlvblF1ZXJ5EJMDEhMK", - "DkNvbGxlY3Rpb25MaXN0EJQDEg4KCVNlY3JldFB1dBD0AxIRCgxTZWNyZXRB", - "Y2Nlc3MQ9QMSFAoPV2Vic29ja2V0TWFuYWdlENgEMtkBCg9SZXNvdXJjZVNl", - "cnZpY2USYgoHRGVjbGFyZRIqLm5pdHJpYy5yZXNvdXJjZS52MS5SZXNvdXJj", - "ZURlY2xhcmVSZXF1ZXN0Gisubml0cmljLnJlc291cmNlLnYxLlJlc291cmNl", - "RGVjbGFyZVJlc3BvbnNlEmIKB0RldGFpbHMSKi5uaXRyaWMucmVzb3VyY2Uu", - "djEuUmVzb3VyY2VEZXRhaWxzUmVxdWVzdBorLm5pdHJpYy5yZXNvdXJjZS52", - "MS5SZXNvdXJjZURldGFpbHNSZXNwb25zZUKVAQobaW8ubml0cmljLnByb3Rv", - "LnJlc291cmNlLnYxQglSZXNvdXJjZXNQAVozZ2l0aHViLmNvbS9uaXRyaWN0", - "ZWNoL25pdHJpYy9jb3JlL3BrZy9hcGkvbml0cmljL3YxqgIYTml0cmljLlBy", - "b3RvLlJlc291cmNlLnYxygIYTml0cmljXFByb3RvXFJlc291cmNlXFYxYgZw", - "cm90bzM=")); + "CiluaXRyaWMvcHJvdG8vcmVzb3VyY2VzL3YxL3Jlc291cmNlcy5wcm90bxIZ", + "bml0cmljLnByb3RvLnJlc291cmNlcy52MSLJAQoOUG9saWN5UmVzb3VyY2US", + "QQoKcHJpbmNpcGFscxgBIAMoCzItLm5pdHJpYy5wcm90by5yZXNvdXJjZXMu", + "djEuUmVzb3VyY2VJZGVudGlmaWVyEjIKB2FjdGlvbnMYAiADKA4yIS5uaXRy", + "aWMucHJvdG8ucmVzb3VyY2VzLnYxLkFjdGlvbhJACglyZXNvdXJjZXMYAyAD", + "KAsyLS5uaXRyaWMucHJvdG8ucmVzb3VyY2VzLnYxLlJlc291cmNlSWRlbnRp", + "ZmllciJZChJSZXNvdXJjZUlkZW50aWZpZXISNQoEdHlwZRgBIAEoDjInLm5p", + "dHJpYy5wcm90by5yZXNvdXJjZXMudjEuUmVzb3VyY2VUeXBlEgwKBG5hbWUY", + "AiABKAki6gUKFlJlc291cmNlRGVjbGFyZVJlcXVlc3QSOQoCaWQYASABKAsy", + "LS5uaXRyaWMucHJvdG8ucmVzb3VyY2VzLnYxLlJlc291cmNlSWRlbnRpZmll", + "chI7CgZwb2xpY3kYCiABKAsyKS5uaXRyaWMucHJvdG8ucmVzb3VyY2VzLnYx", + "LlBvbGljeVJlc291cmNlSAASOwoGYnVja2V0GAsgASgLMikubml0cmljLnBy", + "b3RvLnJlc291cmNlcy52MS5CdWNrZXRSZXNvdXJjZUgAEjkKBXRvcGljGAwg", + "ASgLMigubml0cmljLnByb3RvLnJlc291cmNlcy52MS5Ub3BpY1Jlc291cmNl", + "SAASSwoPa2V5X3ZhbHVlX3N0b3JlGA0gASgLMjAubml0cmljLnByb3RvLnJl", + "c291cmNlcy52MS5LZXlWYWx1ZVN0b3JlUmVzb3VyY2VIABI7CgZzZWNyZXQY", + "DiABKAsyKS5uaXRyaWMucHJvdG8ucmVzb3VyY2VzLnYxLlNlY3JldFJlc291", + "cmNlSAASNQoDYXBpGA8gASgLMiYubml0cmljLnByb3RvLnJlc291cmNlcy52", + "MS5BcGlSZXNvdXJjZUgAElsKF2FwaV9zZWN1cml0eV9kZWZpbml0aW9uGBAg", + "ASgLMjgubml0cmljLnByb3RvLnJlc291cmNlcy52MS5BcGlTZWN1cml0eURl", + "ZmluaXRpb25SZXNvdXJjZUgAEjkKBXF1ZXVlGBEgASgLMigubml0cmljLnBy", + "b3RvLnJlc291cmNlcy52MS5RdWV1ZVJlc291cmNlSAASRgoMc3FsX2RhdGFi", + "YXNlGBIgASgLMi4ubml0cmljLnByb3RvLnJlc291cmNlcy52MS5TcWxEYXRh", + "YmFzZVJlc291cmNlSAASNQoDam9iGBMgASgLMiYubml0cmljLnByb3RvLnJl", + "c291cmNlcy52MS5Kb2JSZXNvdXJjZUgAQggKBmNvbmZpZyIQCg5CdWNrZXRS", + "ZXNvdXJjZSIPCg1Ub3BpY1Jlc291cmNlIg8KDVF1ZXVlUmVzb3VyY2UiFwoV", + "S2V5VmFsdWVTdG9yZVJlc291cmNlIhAKDlNlY3JldFJlc291cmNlIg0KC0pv", + "YlJlc291cmNlIkAKFVNxbERhdGFiYXNlTWlncmF0aW9ucxIZCg9taWdyYXRp", + "b25zX3BhdGgYASABKAlIAEIMCgptaWdyYXRpb25zIlsKE1NxbERhdGFiYXNl", + "UmVzb3VyY2USRAoKbWlncmF0aW9ucxgBIAEoCzIwLm5pdHJpYy5wcm90by5y", + "ZXNvdXJjZXMudjEuU3FsRGF0YWJhc2VNaWdyYXRpb25zIkIKHUFwaU9wZW5J", + "ZENvbm5lY3Rpb25EZWZpbml0aW9uEg4KBmlzc3VlchgBIAEoCRIRCglhdWRp", + "ZW5jZXMYAiADKAkiiQEKHUFwaVNlY3VyaXR5RGVmaW5pdGlvblJlc291cmNl", + "EhAKCGFwaV9uYW1lGAEgASgJEkgKBG9pZGMYAiABKAsyOC5uaXRyaWMucHJv", + "dG8ucmVzb3VyY2VzLnYxLkFwaU9wZW5JZENvbm5lY3Rpb25EZWZpbml0aW9u", + "SABCDAoKZGVmaW5pdGlvbiIbCglBcGlTY29wZXMSDgoGc2NvcGVzGAEgAygJ", + "IqwBCgtBcGlSZXNvdXJjZRJGCghzZWN1cml0eRgBIAMoCzI0Lm5pdHJpYy5w", + "cm90by5yZXNvdXJjZXMudjEuQXBpUmVzb3VyY2UuU2VjdXJpdHlFbnRyeRpV", + "Cg1TZWN1cml0eUVudHJ5EgsKA2tleRgBIAEoCRIzCgV2YWx1ZRgCIAEoCzIk", + "Lm5pdHJpYy5wcm90by5yZXNvdXJjZXMudjEuQXBpU2NvcGVzOgI4ASIZChdS", + "ZXNvdXJjZURlY2xhcmVSZXNwb25zZSr+AQoMUmVzb3VyY2VUeXBlEgcKA0Fw", + "aRAAEgsKB1NlcnZpY2UQARIKCgZCdWNrZXQQAhIJCgVUb3BpYxADEgwKCFNj", + "aGVkdWxlEAQSEAoMU3Vic2NyaXB0aW9uEAUSEQoNS2V5VmFsdWVTdG9yZRAG", + "EgoKBlBvbGljeRAHEgoKBlNlY3JldBAIEhIKDkJ1Y2tldExpc3RlbmVyEAkS", + "DQoJV2Vic29ja2V0EAoSCAoESHR0cBALEhkKFUFwaVNlY3VyaXR5RGVmaW5p", + "dGlvbhAMEgkKBVF1ZXVlEA0SDwoLU3FsRGF0YWJhc2UQDhIJCgVCYXRjaBAP", + "EgcKA0pvYhAQKqUCCgZBY3Rpb24SEgoOQnVja2V0RmlsZUxpc3QQABIRCg1C", + "dWNrZXRGaWxlR2V0EAESEQoNQnVja2V0RmlsZVB1dBACEhQKEEJ1Y2tldEZp", + "bGVEZWxldGUQAxIRCgxUb3BpY1B1Ymxpc2gQyAESFgoRS2V5VmFsdWVTdG9y", + "ZVJlYWQQrAISFwoSS2V5VmFsdWVTdG9yZVdyaXRlEK0CEhgKE0tleVZhbHVl", + "U3RvcmVEZWxldGUQrgISDgoJU2VjcmV0UHV0EJADEhEKDFNlY3JldEFjY2Vz", + "cxCRAxIUCg9XZWJzb2NrZXRNYW5hZ2UQ9AMSEQoMUXVldWVFbnF1ZXVlENgE", + "EhEKDFF1ZXVlRGVxdWV1ZRDZBBIOCglKb2JTdWJtaXQQvAUyfQoJUmVzb3Vy", + "Y2VzEnAKB0RlY2xhcmUSMS5uaXRyaWMucHJvdG8ucmVzb3VyY2VzLnYxLlJl", + "c291cmNlRGVjbGFyZVJlcXVlc3QaMi5uaXRyaWMucHJvdG8ucmVzb3VyY2Vz", + "LnYxLlJlc291cmNlRGVjbGFyZVJlc3BvbnNlQrABChxpby5uaXRyaWMucHJv", + "dG8ucmVzb3VyY2VzLnYxQhBSZXNvdXJjZXNTZXJ2aWNlUAFaRGdpdGh1Yi5j", + "b20vbml0cmljdGVjaC9uaXRyaWMvY29yZS9wa2cvcHJvdG8vcmVzb3VyY2Vz", + "L3YxO3Jlc291cmNlc3BiqgIZTml0cmljLlByb3RvLlJlc291cmNlcy52McoC", + "GU5pdHJpY1xQcm90b1xSZXNvdXJjZXNcVjFiBnByb3RvMw==")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { }, - new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Nitric.Proto.Resource.v1.ResourceType), typeof(global::Nitric.Proto.Resource.v1.Action), }, null, new pbr::GeneratedClrTypeInfo[] { - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Resource.v1.PolicyResource), global::Nitric.Proto.Resource.v1.PolicyResource.Parser, new[]{ "Principals", "Actions", "Resources" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Resource.v1.Resource), global::Nitric.Proto.Resource.v1.Resource.Parser, new[]{ "Type", "Name" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Resource.v1.ResourceDeclareRequest), global::Nitric.Proto.Resource.v1.ResourceDeclareRequest.Parser, new[]{ "Resource", "Policy", "Bucket", "Queue", "Topic", "Collection", "Secret", "Api" }, new[]{ "Config" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Resource.v1.BucketResource), global::Nitric.Proto.Resource.v1.BucketResource.Parser, null, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Resource.v1.QueueResource), global::Nitric.Proto.Resource.v1.QueueResource.Parser, null, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Resource.v1.TopicResource), global::Nitric.Proto.Resource.v1.TopicResource.Parser, null, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Resource.v1.CollectionResource), global::Nitric.Proto.Resource.v1.CollectionResource.Parser, null, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Resource.v1.SecretResource), global::Nitric.Proto.Resource.v1.SecretResource.Parser, null, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Resource.v1.ApiSecurityDefinitionJwt), global::Nitric.Proto.Resource.v1.ApiSecurityDefinitionJwt.Parser, new[]{ "Issuer", "Audiences" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Resource.v1.ApiSecurityDefinition), global::Nitric.Proto.Resource.v1.ApiSecurityDefinition.Parser, new[]{ "Jwt" }, new[]{ "Definition" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Resource.v1.ApiScopes), global::Nitric.Proto.Resource.v1.ApiScopes.Parser, new[]{ "Scopes" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Resource.v1.ApiResource), global::Nitric.Proto.Resource.v1.ApiResource.Parser, new[]{ "SecurityDefinitions", "Security" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { null, null, }), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Resource.v1.ResourceDeclareResponse), global::Nitric.Proto.Resource.v1.ResourceDeclareResponse.Parser, null, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Resource.v1.ApiResourceDetails), global::Nitric.Proto.Resource.v1.ApiResourceDetails.Parser, new[]{ "Url" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Resource.v1.WebsocketResourceDetails), global::Nitric.Proto.Resource.v1.WebsocketResourceDetails.Parser, new[]{ "Url" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Resource.v1.ResourceDetailsRequest), global::Nitric.Proto.Resource.v1.ResourceDetailsRequest.Parser, new[]{ "Resource" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Resource.v1.ResourceDetailsResponse), global::Nitric.Proto.Resource.v1.ResourceDetailsResponse.Parser, new[]{ "Id", "Provider", "Service", "Api", "Websocket" }, new[]{ "Details" }, null, null, null) + new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Nitric.Proto.Resources.v1.ResourceType), typeof(global::Nitric.Proto.Resources.v1.Action), }, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Resources.v1.PolicyResource), global::Nitric.Proto.Resources.v1.PolicyResource.Parser, new[]{ "Principals", "Actions", "Resources" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Resources.v1.ResourceIdentifier), global::Nitric.Proto.Resources.v1.ResourceIdentifier.Parser, new[]{ "Type", "Name" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Resources.v1.ResourceDeclareRequest), global::Nitric.Proto.Resources.v1.ResourceDeclareRequest.Parser, new[]{ "Id", "Policy", "Bucket", "Topic", "KeyValueStore", "Secret", "Api", "ApiSecurityDefinition", "Queue", "SqlDatabase", "Job" }, new[]{ "Config" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Resources.v1.BucketResource), global::Nitric.Proto.Resources.v1.BucketResource.Parser, null, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Resources.v1.TopicResource), global::Nitric.Proto.Resources.v1.TopicResource.Parser, null, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Resources.v1.QueueResource), global::Nitric.Proto.Resources.v1.QueueResource.Parser, null, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Resources.v1.KeyValueStoreResource), global::Nitric.Proto.Resources.v1.KeyValueStoreResource.Parser, null, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Resources.v1.SecretResource), global::Nitric.Proto.Resources.v1.SecretResource.Parser, null, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Resources.v1.JobResource), global::Nitric.Proto.Resources.v1.JobResource.Parser, null, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Resources.v1.SqlDatabaseMigrations), global::Nitric.Proto.Resources.v1.SqlDatabaseMigrations.Parser, new[]{ "MigrationsPath" }, new[]{ "Migrations" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Resources.v1.SqlDatabaseResource), global::Nitric.Proto.Resources.v1.SqlDatabaseResource.Parser, new[]{ "Migrations" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Resources.v1.ApiOpenIdConnectionDefinition), global::Nitric.Proto.Resources.v1.ApiOpenIdConnectionDefinition.Parser, new[]{ "Issuer", "Audiences" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Resources.v1.ApiSecurityDefinitionResource), global::Nitric.Proto.Resources.v1.ApiSecurityDefinitionResource.Parser, new[]{ "ApiName", "Oidc" }, new[]{ "Definition" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Resources.v1.ApiScopes), global::Nitric.Proto.Resources.v1.ApiScopes.Parser, new[]{ "Scopes" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Resources.v1.ApiResource), global::Nitric.Proto.Resources.v1.ApiResource.Parser, new[]{ "Security" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { null, }), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Resources.v1.ResourceDeclareResponse), global::Nitric.Proto.Resources.v1.ResourceDeclareResponse.Parser, null, null, null, null, null) })); } #endregion @@ -114,18 +111,25 @@ static ResourceReflection() { #region Enums public enum ResourceType { [pbr::OriginalName("Api")] Api = 0, - [pbr::OriginalName("Function")] Function = 1, + [pbr::OriginalName("Service")] Service = 1, [pbr::OriginalName("Bucket")] Bucket = 2, - [pbr::OriginalName("Queue")] Queue = 3, - [pbr::OriginalName("Topic")] Topic = 4, - [pbr::OriginalName("Schedule")] Schedule = 5, - [pbr::OriginalName("Subscription")] Subscription = 6, - [pbr::OriginalName("Collection")] Collection = 7, - [pbr::OriginalName("Policy")] Policy = 8, - [pbr::OriginalName("Secret")] Secret = 9, - [pbr::OriginalName("Notification")] Notification = 10, - [pbr::OriginalName("Websocket")] Websocket = 11, - [pbr::OriginalName("Http")] Http = 12, + [pbr::OriginalName("Topic")] Topic = 3, + [pbr::OriginalName("Schedule")] Schedule = 4, + [pbr::OriginalName("Subscription")] Subscription = 5, + [pbr::OriginalName("KeyValueStore")] KeyValueStore = 6, + [pbr::OriginalName("Policy")] Policy = 7, + [pbr::OriginalName("Secret")] Secret = 8, + [pbr::OriginalName("BucketListener")] BucketListener = 9, + [pbr::OriginalName("Websocket")] Websocket = 10, + [pbr::OriginalName("Http")] Http = 11, + [pbr::OriginalName("ApiSecurityDefinition")] ApiSecurityDefinition = 12, + [pbr::OriginalName("Queue")] Queue = 13, + [pbr::OriginalName("SqlDatabase")] SqlDatabase = 14, + /// + /// Batches represent a collection of jobs + /// + [pbr::OriginalName("Batch")] Batch = 15, + [pbr::OriginalName("Job")] Job = 16, } public enum Action { @@ -139,33 +143,31 @@ public enum Action { /// /// Topic Permissions: 2XX /// - [pbr::OriginalName("TopicList")] TopicList = 200, - [pbr::OriginalName("TopicDetail")] TopicDetail = 201, - [pbr::OriginalName("TopicEventPublish")] TopicEventPublish = 202, + [pbr::OriginalName("TopicPublish")] TopicPublish = 200, + /// + /// KeyValue Store Permissions: 3XX + /// + [pbr::OriginalName("KeyValueStoreRead")] KeyValueStoreRead = 300, + [pbr::OriginalName("KeyValueStoreWrite")] KeyValueStoreWrite = 301, + [pbr::OriginalName("KeyValueStoreDelete")] KeyValueStoreDelete = 302, /// - /// Queue Permissions: 3XX + /// Secret Permissions: 4XX /// - [pbr::OriginalName("QueueSend")] QueueSend = 300, - [pbr::OriginalName("QueueReceive")] QueueReceive = 301, - [pbr::OriginalName("QueueList")] QueueList = 302, - [pbr::OriginalName("QueueDetail")] QueueDetail = 303, + [pbr::OriginalName("SecretPut")] SecretPut = 400, + [pbr::OriginalName("SecretAccess")] SecretAccess = 401, /// - /// Collection Permissions: 4XX + /// Websocket Permissions: 5XX /// - [pbr::OriginalName("CollectionDocumentRead")] CollectionDocumentRead = 400, - [pbr::OriginalName("CollectionDocumentWrite")] CollectionDocumentWrite = 401, - [pbr::OriginalName("CollectionDocumentDelete")] CollectionDocumentDelete = 402, - [pbr::OriginalName("CollectionQuery")] CollectionQuery = 403, - [pbr::OriginalName("CollectionList")] CollectionList = 404, + [pbr::OriginalName("WebsocketManage")] WebsocketManage = 500, /// - /// Secret Permissions: 5XX + /// Queue Permissions: 6XX /// - [pbr::OriginalName("SecretPut")] SecretPut = 500, - [pbr::OriginalName("SecretAccess")] SecretAccess = 501, + [pbr::OriginalName("QueueEnqueue")] QueueEnqueue = 600, + [pbr::OriginalName("QueueDequeue")] QueueDequeue = 601, /// - /// Websocket Permissions: 6XX + /// Job Permissions: 7XX /// - [pbr::OriginalName("WebsocketManage")] WebsocketManage = 600, + [pbr::OriginalName("JobSubmit")] JobSubmit = 700, } #endregion @@ -183,7 +185,7 @@ public sealed partial class PolicyResource : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Resource.v1.ResourceReflection.Descriptor.MessageTypes[0]; } + get { return global::Nitric.Proto.Resources.v1.ResourcesReflection.Descriptor.MessageTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -213,31 +215,31 @@ public PolicyResource Clone() { /// Field number for the "principals" field. public const int PrincipalsFieldNumber = 1; - private static readonly pb::FieldCodec _repeated_principals_codec - = pb::FieldCodec.ForMessage(10, global::Nitric.Proto.Resource.v1.Resource.Parser); - private readonly pbc::RepeatedField principals_ = new pbc::RepeatedField(); + private static readonly pb::FieldCodec _repeated_principals_codec + = pb::FieldCodec.ForMessage(10, global::Nitric.Proto.Resources.v1.ResourceIdentifier.Parser); + private readonly pbc::RepeatedField principals_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField Principals { + public pbc::RepeatedField Principals { get { return principals_; } } /// Field number for the "actions" field. public const int ActionsFieldNumber = 2; - private static readonly pb::FieldCodec _repeated_actions_codec - = pb::FieldCodec.ForEnum(18, x => (int) x, x => (global::Nitric.Proto.Resource.v1.Action) x); - private readonly pbc::RepeatedField actions_ = new pbc::RepeatedField(); + private static readonly pb::FieldCodec _repeated_actions_codec + = pb::FieldCodec.ForEnum(18, x => (int) x, x => (global::Nitric.Proto.Resources.v1.Action) x); + private readonly pbc::RepeatedField actions_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField Actions { + public pbc::RepeatedField Actions { get { return actions_; } } /// Field number for the "resources" field. public const int ResourcesFieldNumber = 3; - private static readonly pb::FieldCodec _repeated_resources_codec - = pb::FieldCodec.ForMessage(26, global::Nitric.Proto.Resource.v1.Resource.Parser); - private readonly pbc::RepeatedField resources_ = new pbc::RepeatedField(); + private static readonly pb::FieldCodec _repeated_resources_codec + = pb::FieldCodec.ForMessage(26, global::Nitric.Proto.Resources.v1.ResourceIdentifier.Parser); + private readonly pbc::RepeatedField resources_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField Resources { + public pbc::RepeatedField Resources { get { return resources_; } } @@ -384,19 +386,22 @@ public void MergeFrom(pb::CodedInputStream input) { } - public sealed partial class Resource : pb::IMessage + /// + /// Unique identifier for a resource within a nitric application. + /// + public sealed partial class ResourceIdentifier : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Resource()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ResourceIdentifier()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Resource.v1.ResourceReflection.Descriptor.MessageTypes[1]; } + get { return global::Nitric.Proto.Resources.v1.ResourcesReflection.Descriptor.MessageTypes[1]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -405,29 +410,29 @@ public sealed partial class Resource : pb::IMessage } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Resource() { + public ResourceIdentifier() { OnConstruction(); } partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Resource(Resource other) : this() { + public ResourceIdentifier(ResourceIdentifier other) : this() { type_ = other.type_; name_ = other.name_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Resource Clone() { - return new Resource(this); + public ResourceIdentifier Clone() { + return new ResourceIdentifier(this); } /// Field number for the "type" field. public const int TypeFieldNumber = 1; - private global::Nitric.Proto.Resource.v1.ResourceType type_ = global::Nitric.Proto.Resource.v1.ResourceType.Api; + private global::Nitric.Proto.Resources.v1.ResourceType type_ = global::Nitric.Proto.Resources.v1.ResourceType.Api; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Resource.v1.ResourceType Type { + public global::Nitric.Proto.Resources.v1.ResourceType Type { get { return type_; } set { type_ = value; @@ -447,11 +452,11 @@ public string Name { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { - return Equals(other as Resource); + return Equals(other as ResourceIdentifier); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(Resource other) { + public bool Equals(ResourceIdentifier other) { if (ReferenceEquals(other, null)) { return false; } @@ -466,7 +471,7 @@ public bool Equals(Resource other) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; - if (Type != global::Nitric.Proto.Resource.v1.ResourceType.Api) hash ^= Type.GetHashCode(); + if (Type != global::Nitric.Proto.Resources.v1.ResourceType.Api) hash ^= Type.GetHashCode(); if (Name.Length != 0) hash ^= Name.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); @@ -484,7 +489,7 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else - if (Type != global::Nitric.Proto.Resource.v1.ResourceType.Api) { + if (Type != global::Nitric.Proto.Resources.v1.ResourceType.Api) { output.WriteRawTag(8); output.WriteEnum((int) Type); } @@ -501,7 +506,7 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (Type != global::Nitric.Proto.Resource.v1.ResourceType.Api) { + if (Type != global::Nitric.Proto.Resources.v1.ResourceType.Api) { output.WriteRawTag(8); output.WriteEnum((int) Type); } @@ -518,7 +523,7 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; - if (Type != global::Nitric.Proto.Resource.v1.ResourceType.Api) { + if (Type != global::Nitric.Proto.Resources.v1.ResourceType.Api) { size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Type); } if (Name.Length != 0) { @@ -531,11 +536,11 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(Resource other) { + public void MergeFrom(ResourceIdentifier other) { if (other == null) { return; } - if (other.Type != global::Nitric.Proto.Resource.v1.ResourceType.Api) { + if (other.Type != global::Nitric.Proto.Resources.v1.ResourceType.Api) { Type = other.Type; } if (other.Name.Length != 0) { @@ -556,7 +561,7 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 8: { - Type = (global::Nitric.Proto.Resource.v1.ResourceType) input.ReadEnum(); + Type = (global::Nitric.Proto.Resources.v1.ResourceType) input.ReadEnum(); break; } case 18: { @@ -578,7 +583,7 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; case 8: { - Type = (global::Nitric.Proto.Resource.v1.ResourceType) input.ReadEnum(); + Type = (global::Nitric.Proto.Resources.v1.ResourceType) input.ReadEnum(); break; } case 18: { @@ -604,7 +609,7 @@ public sealed partial class ResourceDeclareRequest : pb::IMessageField number for the "resource" field. - public const int ResourceFieldNumber = 1; - private global::Nitric.Proto.Resource.v1.Resource resource_; + /// Field number for the "id" field. + public const int IdFieldNumber = 1; + private global::Nitric.Proto.Resources.v1.ResourceIdentifier id_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Resource.v1.Resource Resource { - get { return resource_; } + public global::Nitric.Proto.Resources.v1.ResourceIdentifier Id { + get { return id_; } set { - resource_ = value; + id_ = value; } } /// Field number for the "policy" field. public const int PolicyFieldNumber = 10; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Resource.v1.PolicyResource Policy { - get { return configCase_ == ConfigOneofCase.Policy ? (global::Nitric.Proto.Resource.v1.PolicyResource) config_ : null; } + public global::Nitric.Proto.Resources.v1.PolicyResource Policy { + get { return configCase_ == ConfigOneofCase.Policy ? (global::Nitric.Proto.Resources.v1.PolicyResource) config_ : null; } set { config_ = value; configCase_ = value == null ? ConfigOneofCase.None : ConfigOneofCase.Policy; @@ -679,52 +693,41 @@ public ResourceDeclareRequest Clone() { /// Field number for the "bucket" field. public const int BucketFieldNumber = 11; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Resource.v1.BucketResource Bucket { - get { return configCase_ == ConfigOneofCase.Bucket ? (global::Nitric.Proto.Resource.v1.BucketResource) config_ : null; } + public global::Nitric.Proto.Resources.v1.BucketResource Bucket { + get { return configCase_ == ConfigOneofCase.Bucket ? (global::Nitric.Proto.Resources.v1.BucketResource) config_ : null; } set { config_ = value; configCase_ = value == null ? ConfigOneofCase.None : ConfigOneofCase.Bucket; } } - /// Field number for the "queue" field. - public const int QueueFieldNumber = 12; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Resource.v1.QueueResource Queue { - get { return configCase_ == ConfigOneofCase.Queue ? (global::Nitric.Proto.Resource.v1.QueueResource) config_ : null; } - set { - config_ = value; - configCase_ = value == null ? ConfigOneofCase.None : ConfigOneofCase.Queue; - } - } - /// Field number for the "topic" field. - public const int TopicFieldNumber = 13; + public const int TopicFieldNumber = 12; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Resource.v1.TopicResource Topic { - get { return configCase_ == ConfigOneofCase.Topic ? (global::Nitric.Proto.Resource.v1.TopicResource) config_ : null; } + public global::Nitric.Proto.Resources.v1.TopicResource Topic { + get { return configCase_ == ConfigOneofCase.Topic ? (global::Nitric.Proto.Resources.v1.TopicResource) config_ : null; } set { config_ = value; configCase_ = value == null ? ConfigOneofCase.None : ConfigOneofCase.Topic; } } - /// Field number for the "collection" field. - public const int CollectionFieldNumber = 14; + /// Field number for the "key_value_store" field. + public const int KeyValueStoreFieldNumber = 13; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Resource.v1.CollectionResource Collection { - get { return configCase_ == ConfigOneofCase.Collection ? (global::Nitric.Proto.Resource.v1.CollectionResource) config_ : null; } + public global::Nitric.Proto.Resources.v1.KeyValueStoreResource KeyValueStore { + get { return configCase_ == ConfigOneofCase.KeyValueStore ? (global::Nitric.Proto.Resources.v1.KeyValueStoreResource) config_ : null; } set { config_ = value; - configCase_ = value == null ? ConfigOneofCase.None : ConfigOneofCase.Collection; + configCase_ = value == null ? ConfigOneofCase.None : ConfigOneofCase.KeyValueStore; } } /// Field number for the "secret" field. - public const int SecretFieldNumber = 15; + public const int SecretFieldNumber = 14; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Resource.v1.SecretResource Secret { - get { return configCase_ == ConfigOneofCase.Secret ? (global::Nitric.Proto.Resource.v1.SecretResource) config_ : null; } + public global::Nitric.Proto.Resources.v1.SecretResource Secret { + get { return configCase_ == ConfigOneofCase.Secret ? (global::Nitric.Proto.Resources.v1.SecretResource) config_ : null; } set { config_ = value; configCase_ = value == null ? ConfigOneofCase.None : ConfigOneofCase.Secret; @@ -732,27 +735,74 @@ public ResourceDeclareRequest Clone() { } /// Field number for the "api" field. - public const int ApiFieldNumber = 16; + public const int ApiFieldNumber = 15; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Resource.v1.ApiResource Api { - get { return configCase_ == ConfigOneofCase.Api ? (global::Nitric.Proto.Resource.v1.ApiResource) config_ : null; } + public global::Nitric.Proto.Resources.v1.ApiResource Api { + get { return configCase_ == ConfigOneofCase.Api ? (global::Nitric.Proto.Resources.v1.ApiResource) config_ : null; } set { config_ = value; configCase_ = value == null ? ConfigOneofCase.None : ConfigOneofCase.Api; } } + /// Field number for the "api_security_definition" field. + public const int ApiSecurityDefinitionFieldNumber = 16; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Nitric.Proto.Resources.v1.ApiSecurityDefinitionResource ApiSecurityDefinition { + get { return configCase_ == ConfigOneofCase.ApiSecurityDefinition ? (global::Nitric.Proto.Resources.v1.ApiSecurityDefinitionResource) config_ : null; } + set { + config_ = value; + configCase_ = value == null ? ConfigOneofCase.None : ConfigOneofCase.ApiSecurityDefinition; + } + } + + /// Field number for the "queue" field. + public const int QueueFieldNumber = 17; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Nitric.Proto.Resources.v1.QueueResource Queue { + get { return configCase_ == ConfigOneofCase.Queue ? (global::Nitric.Proto.Resources.v1.QueueResource) config_ : null; } + set { + config_ = value; + configCase_ = value == null ? ConfigOneofCase.None : ConfigOneofCase.Queue; + } + } + + /// Field number for the "sql_database" field. + public const int SqlDatabaseFieldNumber = 18; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Nitric.Proto.Resources.v1.SqlDatabaseResource SqlDatabase { + get { return configCase_ == ConfigOneofCase.SqlDatabase ? (global::Nitric.Proto.Resources.v1.SqlDatabaseResource) config_ : null; } + set { + config_ = value; + configCase_ = value == null ? ConfigOneofCase.None : ConfigOneofCase.SqlDatabase; + } + } + + /// Field number for the "job" field. + public const int JobFieldNumber = 19; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Nitric.Proto.Resources.v1.JobResource Job { + get { return configCase_ == ConfigOneofCase.Job ? (global::Nitric.Proto.Resources.v1.JobResource) config_ : null; } + set { + config_ = value; + configCase_ = value == null ? ConfigOneofCase.None : ConfigOneofCase.Job; + } + } + private object config_; /// Enum of possible cases for the "config" oneof. public enum ConfigOneofCase { None = 0, Policy = 10, Bucket = 11, - Queue = 12, - Topic = 13, - Collection = 14, - Secret = 15, - Api = 16, + Topic = 12, + KeyValueStore = 13, + Secret = 14, + Api = 15, + ApiSecurityDefinition = 16, + Queue = 17, + SqlDatabase = 18, + Job = 19, } private ConfigOneofCase configCase_ = ConfigOneofCase.None; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -779,14 +829,17 @@ public bool Equals(ResourceDeclareRequest other) { if (ReferenceEquals(other, this)) { return true; } - if (!object.Equals(Resource, other.Resource)) return false; + if (!object.Equals(Id, other.Id)) return false; if (!object.Equals(Policy, other.Policy)) return false; if (!object.Equals(Bucket, other.Bucket)) return false; - if (!object.Equals(Queue, other.Queue)) return false; if (!object.Equals(Topic, other.Topic)) return false; - if (!object.Equals(Collection, other.Collection)) return false; + if (!object.Equals(KeyValueStore, other.KeyValueStore)) return false; if (!object.Equals(Secret, other.Secret)) return false; if (!object.Equals(Api, other.Api)) return false; + if (!object.Equals(ApiSecurityDefinition, other.ApiSecurityDefinition)) return false; + if (!object.Equals(Queue, other.Queue)) return false; + if (!object.Equals(SqlDatabase, other.SqlDatabase)) return false; + if (!object.Equals(Job, other.Job)) return false; if (ConfigCase != other.ConfigCase) return false; return Equals(_unknownFields, other._unknownFields); } @@ -794,14 +847,17 @@ public bool Equals(ResourceDeclareRequest other) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; - if (resource_ != null) hash ^= Resource.GetHashCode(); + if (id_ != null) hash ^= Id.GetHashCode(); if (configCase_ == ConfigOneofCase.Policy) hash ^= Policy.GetHashCode(); if (configCase_ == ConfigOneofCase.Bucket) hash ^= Bucket.GetHashCode(); - if (configCase_ == ConfigOneofCase.Queue) hash ^= Queue.GetHashCode(); if (configCase_ == ConfigOneofCase.Topic) hash ^= Topic.GetHashCode(); - if (configCase_ == ConfigOneofCase.Collection) hash ^= Collection.GetHashCode(); + if (configCase_ == ConfigOneofCase.KeyValueStore) hash ^= KeyValueStore.GetHashCode(); if (configCase_ == ConfigOneofCase.Secret) hash ^= Secret.GetHashCode(); if (configCase_ == ConfigOneofCase.Api) hash ^= Api.GetHashCode(); + if (configCase_ == ConfigOneofCase.ApiSecurityDefinition) hash ^= ApiSecurityDefinition.GetHashCode(); + if (configCase_ == ConfigOneofCase.Queue) hash ^= Queue.GetHashCode(); + if (configCase_ == ConfigOneofCase.SqlDatabase) hash ^= SqlDatabase.GetHashCode(); + if (configCase_ == ConfigOneofCase.Job) hash ^= Job.GetHashCode(); hash ^= (int) configCase_; if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); @@ -819,9 +875,9 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else - if (resource_ != null) { + if (id_ != null) { output.WriteRawTag(10); - output.WriteMessage(Resource); + output.WriteMessage(Id); } if (configCase_ == ConfigOneofCase.Policy) { output.WriteRawTag(82); @@ -831,26 +887,38 @@ public void WriteTo(pb::CodedOutputStream output) { output.WriteRawTag(90); output.WriteMessage(Bucket); } - if (configCase_ == ConfigOneofCase.Queue) { - output.WriteRawTag(98); - output.WriteMessage(Queue); - } if (configCase_ == ConfigOneofCase.Topic) { - output.WriteRawTag(106); + output.WriteRawTag(98); output.WriteMessage(Topic); } - if (configCase_ == ConfigOneofCase.Collection) { - output.WriteRawTag(114); - output.WriteMessage(Collection); + if (configCase_ == ConfigOneofCase.KeyValueStore) { + output.WriteRawTag(106); + output.WriteMessage(KeyValueStore); } if (configCase_ == ConfigOneofCase.Secret) { - output.WriteRawTag(122); + output.WriteRawTag(114); output.WriteMessage(Secret); } if (configCase_ == ConfigOneofCase.Api) { - output.WriteRawTag(130, 1); + output.WriteRawTag(122); output.WriteMessage(Api); } + if (configCase_ == ConfigOneofCase.ApiSecurityDefinition) { + output.WriteRawTag(130, 1); + output.WriteMessage(ApiSecurityDefinition); + } + if (configCase_ == ConfigOneofCase.Queue) { + output.WriteRawTag(138, 1); + output.WriteMessage(Queue); + } + if (configCase_ == ConfigOneofCase.SqlDatabase) { + output.WriteRawTag(146, 1); + output.WriteMessage(SqlDatabase); + } + if (configCase_ == ConfigOneofCase.Job) { + output.WriteRawTag(154, 1); + output.WriteMessage(Job); + } if (_unknownFields != null) { _unknownFields.WriteTo(output); } @@ -860,9 +928,9 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (resource_ != null) { + if (id_ != null) { output.WriteRawTag(10); - output.WriteMessage(Resource); + output.WriteMessage(Id); } if (configCase_ == ConfigOneofCase.Policy) { output.WriteRawTag(82); @@ -872,26 +940,38 @@ public void WriteTo(pb::CodedOutputStream output) { output.WriteRawTag(90); output.WriteMessage(Bucket); } - if (configCase_ == ConfigOneofCase.Queue) { - output.WriteRawTag(98); - output.WriteMessage(Queue); - } if (configCase_ == ConfigOneofCase.Topic) { - output.WriteRawTag(106); + output.WriteRawTag(98); output.WriteMessage(Topic); } - if (configCase_ == ConfigOneofCase.Collection) { - output.WriteRawTag(114); - output.WriteMessage(Collection); + if (configCase_ == ConfigOneofCase.KeyValueStore) { + output.WriteRawTag(106); + output.WriteMessage(KeyValueStore); } if (configCase_ == ConfigOneofCase.Secret) { - output.WriteRawTag(122); + output.WriteRawTag(114); output.WriteMessage(Secret); } if (configCase_ == ConfigOneofCase.Api) { - output.WriteRawTag(130, 1); + output.WriteRawTag(122); output.WriteMessage(Api); } + if (configCase_ == ConfigOneofCase.ApiSecurityDefinition) { + output.WriteRawTag(130, 1); + output.WriteMessage(ApiSecurityDefinition); + } + if (configCase_ == ConfigOneofCase.Queue) { + output.WriteRawTag(138, 1); + output.WriteMessage(Queue); + } + if (configCase_ == ConfigOneofCase.SqlDatabase) { + output.WriteRawTag(146, 1); + output.WriteMessage(SqlDatabase); + } + if (configCase_ == ConfigOneofCase.Job) { + output.WriteRawTag(154, 1); + output.WriteMessage(Job); + } if (_unknownFields != null) { _unknownFields.WriteTo(ref output); } @@ -901,8 +981,8 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; - if (resource_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Resource); + if (id_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Id); } if (configCase_ == ConfigOneofCase.Policy) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(Policy); @@ -910,20 +990,29 @@ public int CalculateSize() { if (configCase_ == ConfigOneofCase.Bucket) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(Bucket); } - if (configCase_ == ConfigOneofCase.Queue) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Queue); - } if (configCase_ == ConfigOneofCase.Topic) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(Topic); } - if (configCase_ == ConfigOneofCase.Collection) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Collection); + if (configCase_ == ConfigOneofCase.KeyValueStore) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(KeyValueStore); } if (configCase_ == ConfigOneofCase.Secret) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(Secret); } if (configCase_ == ConfigOneofCase.Api) { - size += 2 + pb::CodedOutputStream.ComputeMessageSize(Api); + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Api); + } + if (configCase_ == ConfigOneofCase.ApiSecurityDefinition) { + size += 2 + pb::CodedOutputStream.ComputeMessageSize(ApiSecurityDefinition); + } + if (configCase_ == ConfigOneofCase.Queue) { + size += 2 + pb::CodedOutputStream.ComputeMessageSize(Queue); + } + if (configCase_ == ConfigOneofCase.SqlDatabase) { + size += 2 + pb::CodedOutputStream.ComputeMessageSize(SqlDatabase); + } + if (configCase_ == ConfigOneofCase.Job) { + size += 2 + pb::CodedOutputStream.ComputeMessageSize(Job); } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); @@ -936,55 +1025,73 @@ public void MergeFrom(ResourceDeclareRequest other) { if (other == null) { return; } - if (other.resource_ != null) { - if (resource_ == null) { - Resource = new global::Nitric.Proto.Resource.v1.Resource(); + if (other.id_ != null) { + if (id_ == null) { + Id = new global::Nitric.Proto.Resources.v1.ResourceIdentifier(); } - Resource.MergeFrom(other.Resource); + Id.MergeFrom(other.Id); } switch (other.ConfigCase) { case ConfigOneofCase.Policy: if (Policy == null) { - Policy = new global::Nitric.Proto.Resource.v1.PolicyResource(); + Policy = new global::Nitric.Proto.Resources.v1.PolicyResource(); } Policy.MergeFrom(other.Policy); break; case ConfigOneofCase.Bucket: if (Bucket == null) { - Bucket = new global::Nitric.Proto.Resource.v1.BucketResource(); + Bucket = new global::Nitric.Proto.Resources.v1.BucketResource(); } Bucket.MergeFrom(other.Bucket); break; - case ConfigOneofCase.Queue: - if (Queue == null) { - Queue = new global::Nitric.Proto.Resource.v1.QueueResource(); - } - Queue.MergeFrom(other.Queue); - break; case ConfigOneofCase.Topic: if (Topic == null) { - Topic = new global::Nitric.Proto.Resource.v1.TopicResource(); + Topic = new global::Nitric.Proto.Resources.v1.TopicResource(); } Topic.MergeFrom(other.Topic); break; - case ConfigOneofCase.Collection: - if (Collection == null) { - Collection = new global::Nitric.Proto.Resource.v1.CollectionResource(); + case ConfigOneofCase.KeyValueStore: + if (KeyValueStore == null) { + KeyValueStore = new global::Nitric.Proto.Resources.v1.KeyValueStoreResource(); } - Collection.MergeFrom(other.Collection); + KeyValueStore.MergeFrom(other.KeyValueStore); break; case ConfigOneofCase.Secret: if (Secret == null) { - Secret = new global::Nitric.Proto.Resource.v1.SecretResource(); + Secret = new global::Nitric.Proto.Resources.v1.SecretResource(); } Secret.MergeFrom(other.Secret); break; case ConfigOneofCase.Api: if (Api == null) { - Api = new global::Nitric.Proto.Resource.v1.ApiResource(); + Api = new global::Nitric.Proto.Resources.v1.ApiResource(); } Api.MergeFrom(other.Api); break; + case ConfigOneofCase.ApiSecurityDefinition: + if (ApiSecurityDefinition == null) { + ApiSecurityDefinition = new global::Nitric.Proto.Resources.v1.ApiSecurityDefinitionResource(); + } + ApiSecurityDefinition.MergeFrom(other.ApiSecurityDefinition); + break; + case ConfigOneofCase.Queue: + if (Queue == null) { + Queue = new global::Nitric.Proto.Resources.v1.QueueResource(); + } + Queue.MergeFrom(other.Queue); + break; + case ConfigOneofCase.SqlDatabase: + if (SqlDatabase == null) { + SqlDatabase = new global::Nitric.Proto.Resources.v1.SqlDatabaseResource(); + } + SqlDatabase.MergeFrom(other.SqlDatabase); + break; + case ConfigOneofCase.Job: + if (Job == null) { + Job = new global::Nitric.Proto.Resources.v1.JobResource(); + } + Job.MergeFrom(other.Job); + break; } _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); @@ -1002,14 +1109,14 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { - if (resource_ == null) { - Resource = new global::Nitric.Proto.Resource.v1.Resource(); + if (id_ == null) { + Id = new global::Nitric.Proto.Resources.v1.ResourceIdentifier(); } - input.ReadMessage(Resource); + input.ReadMessage(Id); break; } case 82: { - global::Nitric.Proto.Resource.v1.PolicyResource subBuilder = new global::Nitric.Proto.Resource.v1.PolicyResource(); + global::Nitric.Proto.Resources.v1.PolicyResource subBuilder = new global::Nitric.Proto.Resources.v1.PolicyResource(); if (configCase_ == ConfigOneofCase.Policy) { subBuilder.MergeFrom(Policy); } @@ -1018,7 +1125,7 @@ public void MergeFrom(pb::CodedInputStream input) { break; } case 90: { - global::Nitric.Proto.Resource.v1.BucketResource subBuilder = new global::Nitric.Proto.Resource.v1.BucketResource(); + global::Nitric.Proto.Resources.v1.BucketResource subBuilder = new global::Nitric.Proto.Resources.v1.BucketResource(); if (configCase_ == ConfigOneofCase.Bucket) { subBuilder.MergeFrom(Bucket); } @@ -1027,16 +1134,7 @@ public void MergeFrom(pb::CodedInputStream input) { break; } case 98: { - global::Nitric.Proto.Resource.v1.QueueResource subBuilder = new global::Nitric.Proto.Resource.v1.QueueResource(); - if (configCase_ == ConfigOneofCase.Queue) { - subBuilder.MergeFrom(Queue); - } - input.ReadMessage(subBuilder); - Queue = subBuilder; - break; - } - case 106: { - global::Nitric.Proto.Resource.v1.TopicResource subBuilder = new global::Nitric.Proto.Resource.v1.TopicResource(); + global::Nitric.Proto.Resources.v1.TopicResource subBuilder = new global::Nitric.Proto.Resources.v1.TopicResource(); if (configCase_ == ConfigOneofCase.Topic) { subBuilder.MergeFrom(Topic); } @@ -1044,17 +1142,17 @@ public void MergeFrom(pb::CodedInputStream input) { Topic = subBuilder; break; } - case 114: { - global::Nitric.Proto.Resource.v1.CollectionResource subBuilder = new global::Nitric.Proto.Resource.v1.CollectionResource(); - if (configCase_ == ConfigOneofCase.Collection) { - subBuilder.MergeFrom(Collection); + case 106: { + global::Nitric.Proto.Resources.v1.KeyValueStoreResource subBuilder = new global::Nitric.Proto.Resources.v1.KeyValueStoreResource(); + if (configCase_ == ConfigOneofCase.KeyValueStore) { + subBuilder.MergeFrom(KeyValueStore); } input.ReadMessage(subBuilder); - Collection = subBuilder; + KeyValueStore = subBuilder; break; } - case 122: { - global::Nitric.Proto.Resource.v1.SecretResource subBuilder = new global::Nitric.Proto.Resource.v1.SecretResource(); + case 114: { + global::Nitric.Proto.Resources.v1.SecretResource subBuilder = new global::Nitric.Proto.Resources.v1.SecretResource(); if (configCase_ == ConfigOneofCase.Secret) { subBuilder.MergeFrom(Secret); } @@ -1062,8 +1160,8 @@ public void MergeFrom(pb::CodedInputStream input) { Secret = subBuilder; break; } - case 130: { - global::Nitric.Proto.Resource.v1.ApiResource subBuilder = new global::Nitric.Proto.Resource.v1.ApiResource(); + case 122: { + global::Nitric.Proto.Resources.v1.ApiResource subBuilder = new global::Nitric.Proto.Resources.v1.ApiResource(); if (configCase_ == ConfigOneofCase.Api) { subBuilder.MergeFrom(Api); } @@ -1071,6 +1169,42 @@ public void MergeFrom(pb::CodedInputStream input) { Api = subBuilder; break; } + case 130: { + global::Nitric.Proto.Resources.v1.ApiSecurityDefinitionResource subBuilder = new global::Nitric.Proto.Resources.v1.ApiSecurityDefinitionResource(); + if (configCase_ == ConfigOneofCase.ApiSecurityDefinition) { + subBuilder.MergeFrom(ApiSecurityDefinition); + } + input.ReadMessage(subBuilder); + ApiSecurityDefinition = subBuilder; + break; + } + case 138: { + global::Nitric.Proto.Resources.v1.QueueResource subBuilder = new global::Nitric.Proto.Resources.v1.QueueResource(); + if (configCase_ == ConfigOneofCase.Queue) { + subBuilder.MergeFrom(Queue); + } + input.ReadMessage(subBuilder); + Queue = subBuilder; + break; + } + case 146: { + global::Nitric.Proto.Resources.v1.SqlDatabaseResource subBuilder = new global::Nitric.Proto.Resources.v1.SqlDatabaseResource(); + if (configCase_ == ConfigOneofCase.SqlDatabase) { + subBuilder.MergeFrom(SqlDatabase); + } + input.ReadMessage(subBuilder); + SqlDatabase = subBuilder; + break; + } + case 154: { + global::Nitric.Proto.Resources.v1.JobResource subBuilder = new global::Nitric.Proto.Resources.v1.JobResource(); + if (configCase_ == ConfigOneofCase.Job) { + subBuilder.MergeFrom(Job); + } + input.ReadMessage(subBuilder); + Job = subBuilder; + break; + } } } #endif @@ -1086,14 +1220,14 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; case 10: { - if (resource_ == null) { - Resource = new global::Nitric.Proto.Resource.v1.Resource(); + if (id_ == null) { + Id = new global::Nitric.Proto.Resources.v1.ResourceIdentifier(); } - input.ReadMessage(Resource); + input.ReadMessage(Id); break; } case 82: { - global::Nitric.Proto.Resource.v1.PolicyResource subBuilder = new global::Nitric.Proto.Resource.v1.PolicyResource(); + global::Nitric.Proto.Resources.v1.PolicyResource subBuilder = new global::Nitric.Proto.Resources.v1.PolicyResource(); if (configCase_ == ConfigOneofCase.Policy) { subBuilder.MergeFrom(Policy); } @@ -1102,7 +1236,7 @@ public void MergeFrom(pb::CodedInputStream input) { break; } case 90: { - global::Nitric.Proto.Resource.v1.BucketResource subBuilder = new global::Nitric.Proto.Resource.v1.BucketResource(); + global::Nitric.Proto.Resources.v1.BucketResource subBuilder = new global::Nitric.Proto.Resources.v1.BucketResource(); if (configCase_ == ConfigOneofCase.Bucket) { subBuilder.MergeFrom(Bucket); } @@ -1111,16 +1245,7 @@ public void MergeFrom(pb::CodedInputStream input) { break; } case 98: { - global::Nitric.Proto.Resource.v1.QueueResource subBuilder = new global::Nitric.Proto.Resource.v1.QueueResource(); - if (configCase_ == ConfigOneofCase.Queue) { - subBuilder.MergeFrom(Queue); - } - input.ReadMessage(subBuilder); - Queue = subBuilder; - break; - } - case 106: { - global::Nitric.Proto.Resource.v1.TopicResource subBuilder = new global::Nitric.Proto.Resource.v1.TopicResource(); + global::Nitric.Proto.Resources.v1.TopicResource subBuilder = new global::Nitric.Proto.Resources.v1.TopicResource(); if (configCase_ == ConfigOneofCase.Topic) { subBuilder.MergeFrom(Topic); } @@ -1128,17 +1253,17 @@ public void MergeFrom(pb::CodedInputStream input) { Topic = subBuilder; break; } - case 114: { - global::Nitric.Proto.Resource.v1.CollectionResource subBuilder = new global::Nitric.Proto.Resource.v1.CollectionResource(); - if (configCase_ == ConfigOneofCase.Collection) { - subBuilder.MergeFrom(Collection); + case 106: { + global::Nitric.Proto.Resources.v1.KeyValueStoreResource subBuilder = new global::Nitric.Proto.Resources.v1.KeyValueStoreResource(); + if (configCase_ == ConfigOneofCase.KeyValueStore) { + subBuilder.MergeFrom(KeyValueStore); } input.ReadMessage(subBuilder); - Collection = subBuilder; + KeyValueStore = subBuilder; break; } - case 122: { - global::Nitric.Proto.Resource.v1.SecretResource subBuilder = new global::Nitric.Proto.Resource.v1.SecretResource(); + case 114: { + global::Nitric.Proto.Resources.v1.SecretResource subBuilder = new global::Nitric.Proto.Resources.v1.SecretResource(); if (configCase_ == ConfigOneofCase.Secret) { subBuilder.MergeFrom(Secret); } @@ -1146,8 +1271,8 @@ public void MergeFrom(pb::CodedInputStream input) { Secret = subBuilder; break; } - case 130: { - global::Nitric.Proto.Resource.v1.ApiResource subBuilder = new global::Nitric.Proto.Resource.v1.ApiResource(); + case 122: { + global::Nitric.Proto.Resources.v1.ApiResource subBuilder = new global::Nitric.Proto.Resources.v1.ApiResource(); if (configCase_ == ConfigOneofCase.Api) { subBuilder.MergeFrom(Api); } @@ -1155,6 +1280,42 @@ public void MergeFrom(pb::CodedInputStream input) { Api = subBuilder; break; } + case 130: { + global::Nitric.Proto.Resources.v1.ApiSecurityDefinitionResource subBuilder = new global::Nitric.Proto.Resources.v1.ApiSecurityDefinitionResource(); + if (configCase_ == ConfigOneofCase.ApiSecurityDefinition) { + subBuilder.MergeFrom(ApiSecurityDefinition); + } + input.ReadMessage(subBuilder); + ApiSecurityDefinition = subBuilder; + break; + } + case 138: { + global::Nitric.Proto.Resources.v1.QueueResource subBuilder = new global::Nitric.Proto.Resources.v1.QueueResource(); + if (configCase_ == ConfigOneofCase.Queue) { + subBuilder.MergeFrom(Queue); + } + input.ReadMessage(subBuilder); + Queue = subBuilder; + break; + } + case 146: { + global::Nitric.Proto.Resources.v1.SqlDatabaseResource subBuilder = new global::Nitric.Proto.Resources.v1.SqlDatabaseResource(); + if (configCase_ == ConfigOneofCase.SqlDatabase) { + subBuilder.MergeFrom(SqlDatabase); + } + input.ReadMessage(subBuilder); + SqlDatabase = subBuilder; + break; + } + case 154: { + global::Nitric.Proto.Resources.v1.JobResource subBuilder = new global::Nitric.Proto.Resources.v1.JobResource(); + if (configCase_ == ConfigOneofCase.Job) { + subBuilder.MergeFrom(Job); + } + input.ReadMessage(subBuilder); + Job = subBuilder; + break; + } } } } @@ -1174,7 +1335,7 @@ public sealed partial class BucketResource : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Resource.v1.ResourceReflection.Descriptor.MessageTypes[3]; } + get { return global::Nitric.Proto.Resources.v1.ResourcesReflection.Descriptor.MessageTypes[3]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1298,19 +1459,19 @@ public void MergeFrom(pb::CodedInputStream input) { } - public sealed partial class QueueResource : pb::IMessage + public sealed partial class TopicResource : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new QueueResource()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TopicResource()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Resource.v1.ResourceReflection.Descriptor.MessageTypes[4]; } + get { return global::Nitric.Proto.Resources.v1.ResourcesReflection.Descriptor.MessageTypes[4]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1319,29 +1480,29 @@ public sealed partial class QueueResource : pb::IMessage } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public QueueResource() { + public TopicResource() { OnConstruction(); } partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public QueueResource(QueueResource other) : this() { + public TopicResource(TopicResource other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public QueueResource Clone() { - return new QueueResource(this); + public TopicResource Clone() { + return new TopicResource(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { - return Equals(other as QueueResource); + return Equals(other as TopicResource); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(QueueResource other) { + public bool Equals(TopicResource other) { if (ReferenceEquals(other, null)) { return false; } @@ -1395,7 +1556,7 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(QueueResource other) { + public void MergeFrom(TopicResource other) { if (other == null) { return; } @@ -1434,19 +1595,19 @@ public void MergeFrom(pb::CodedInputStream input) { } - public sealed partial class TopicResource : pb::IMessage + public sealed partial class QueueResource : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TopicResource()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new QueueResource()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Resource.v1.ResourceReflection.Descriptor.MessageTypes[5]; } + get { return global::Nitric.Proto.Resources.v1.ResourcesReflection.Descriptor.MessageTypes[5]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1455,29 +1616,29 @@ public sealed partial class TopicResource : pb::IMessage } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public TopicResource() { + public QueueResource() { OnConstruction(); } partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public TopicResource(TopicResource other) : this() { + public QueueResource(QueueResource other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public TopicResource Clone() { - return new TopicResource(this); + public QueueResource Clone() { + return new QueueResource(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { - return Equals(other as TopicResource); + return Equals(other as QueueResource); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(TopicResource other) { + public bool Equals(QueueResource other) { if (ReferenceEquals(other, null)) { return false; } @@ -1531,7 +1692,7 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(TopicResource other) { + public void MergeFrom(QueueResource other) { if (other == null) { return; } @@ -1570,19 +1731,19 @@ public void MergeFrom(pb::CodedInputStream input) { } - public sealed partial class CollectionResource : pb::IMessage + public sealed partial class KeyValueStoreResource : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CollectionResource()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new KeyValueStoreResource()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Resource.v1.ResourceReflection.Descriptor.MessageTypes[6]; } + get { return global::Nitric.Proto.Resources.v1.ResourcesReflection.Descriptor.MessageTypes[6]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1591,29 +1752,29 @@ public sealed partial class CollectionResource : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Resource.v1.ResourceReflection.Descriptor.MessageTypes[7]; } + get { return global::Nitric.Proto.Resources.v1.ResourcesReflection.Descriptor.MessageTypes[7]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1842,22 +2003,19 @@ public void MergeFrom(pb::CodedInputStream input) { } - /// - /// protect your API with JWT authentication - /// - public sealed partial class ApiSecurityDefinitionJwt : pb::IMessage + public sealed partial class JobResource : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ApiSecurityDefinitionJwt()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new JobResource()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Resource.v1.ResourceReflection.Descriptor.MessageTypes[8]; } + get { return global::Nitric.Proto.Resources.v1.ResourcesReflection.Descriptor.MessageTypes[8]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1866,68 +2024,41 @@ public sealed partial class ApiSecurityDefinitionJwt : pb::IMessageField number for the "issuer" field. - public const int IssuerFieldNumber = 1; - private string issuer_ = ""; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string Issuer { - get { return issuer_; } - set { - issuer_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "audiences" field. - public const int AudiencesFieldNumber = 2; - private static readonly pb::FieldCodec _repeated_audiences_codec - = pb::FieldCodec.ForString(18); - private readonly pbc::RepeatedField audiences_ = new pbc::RepeatedField(); - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField Audiences { - get { return audiences_; } + public JobResource Clone() { + return new JobResource(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { - return Equals(other as ApiSecurityDefinitionJwt); + return Equals(other as JobResource); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(ApiSecurityDefinitionJwt other) { + public bool Equals(JobResource other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } - if (Issuer != other.Issuer) return false; - if(!audiences_.Equals(other.audiences_)) return false; return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; - if (Issuer.Length != 0) hash ^= Issuer.GetHashCode(); - hash ^= audiences_.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -1944,11 +2075,6 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else - if (Issuer.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Issuer); - } - audiences_.WriteTo(output, _repeated_audiences_codec); if (_unknownFields != null) { _unknownFields.WriteTo(output); } @@ -1958,11 +2084,6 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (Issuer.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Issuer); - } - audiences_.WriteTo(ref output, _repeated_audiences_codec); if (_unknownFields != null) { _unknownFields.WriteTo(ref output); } @@ -1972,10 +2093,6 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; - if (Issuer.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Issuer); - } - size += audiences_.CalculateSize(_repeated_audiences_codec); if (_unknownFields != null) { size += _unknownFields.CalculateSize(); } @@ -1983,14 +2100,10 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(ApiSecurityDefinitionJwt other) { + public void MergeFrom(JobResource other) { if (other == null) { return; } - if (other.Issuer.Length != 0) { - Issuer = other.Issuer; - } - audiences_.Add(other.audiences_); _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } @@ -2005,14 +2118,6 @@ public void MergeFrom(pb::CodedInputStream input) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; - case 10: { - Issuer = input.ReadString(); - break; - } - case 18: { - audiences_.AddEntriesFrom(input, _repeated_audiences_codec); - break; - } } } #endif @@ -2027,14 +2132,6 @@ public void MergeFrom(pb::CodedInputStream input) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; - case 10: { - Issuer = input.ReadString(); - break; - } - case 18: { - audiences_.AddEntriesFrom(ref input, _repeated_audiences_codec); - break; - } } } } @@ -2042,19 +2139,19 @@ public void MergeFrom(pb::CodedInputStream input) { } - public sealed partial class ApiSecurityDefinition : pb::IMessage + public sealed partial class SqlDatabaseMigrations : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ApiSecurityDefinition()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SqlDatabaseMigrations()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Resource.v1.ResourceReflection.Descriptor.MessageTypes[9]; } + get { return global::Nitric.Proto.Resources.v1.ResourcesReflection.Descriptor.MessageTypes[9]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -2063,17 +2160,17 @@ public sealed partial class ApiSecurityDefinition : pb::IMessageField number for the "jwt" field. - public const int JwtFieldNumber = 1; + /// Field number for the "migrations_path" field. + public const int MigrationsPathFieldNumber = 1; + /// + /// The path to this databases SQL migrations + /// Valid values are file://relative/path/to/migrations as a directory or dockerfile://path/to/migrations.dockerfile to hint at a docker image build + /// Paths should be relative to the root of the application (nitric.yaml file location) + /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Resource.v1.ApiSecurityDefinitionJwt Jwt { - get { return definitionCase_ == DefinitionOneofCase.Jwt ? (global::Nitric.Proto.Resource.v1.ApiSecurityDefinitionJwt) definition_ : null; } + public string MigrationsPath { + get { return migrationsCase_ == MigrationsOneofCase.MigrationsPath ? (string) migrations_ : ""; } set { - definition_ = value; - definitionCase_ = value == null ? DefinitionOneofCase.None : DefinitionOneofCase.Jwt; + migrations_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + migrationsCase_ = MigrationsOneofCase.MigrationsPath; } } - private object definition_; - /// Enum of possible cases for the "definition" oneof. - public enum DefinitionOneofCase { + private object migrations_; + /// Enum of possible cases for the "migrations" oneof. + public enum MigrationsOneofCase { None = 0, - Jwt = 1, + MigrationsPath = 1, } - private DefinitionOneofCase definitionCase_ = DefinitionOneofCase.None; + private MigrationsOneofCase migrationsCase_ = MigrationsOneofCase.None; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public DefinitionOneofCase DefinitionCase { - get { return definitionCase_; } + public MigrationsOneofCase MigrationsCase { + get { return migrationsCase_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearDefinition() { - definitionCase_ = DefinitionOneofCase.None; - definition_ = null; + public void ClearMigrations() { + migrationsCase_ = MigrationsOneofCase.None; + migrations_ = null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { - return Equals(other as ApiSecurityDefinition); + return Equals(other as SqlDatabaseMigrations); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(ApiSecurityDefinition other) { + public bool Equals(SqlDatabaseMigrations other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } - if (!object.Equals(Jwt, other.Jwt)) return false; - if (DefinitionCase != other.DefinitionCase) return false; + if (MigrationsPath != other.MigrationsPath) return false; + if (MigrationsCase != other.MigrationsCase) return false; return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; - if (definitionCase_ == DefinitionOneofCase.Jwt) hash ^= Jwt.GetHashCode(); - hash ^= (int) definitionCase_; + if (migrationsCase_ == MigrationsOneofCase.MigrationsPath) hash ^= MigrationsPath.GetHashCode(); + hash ^= (int) migrationsCase_; if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -2153,9 +2255,9 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else - if (definitionCase_ == DefinitionOneofCase.Jwt) { + if (migrationsCase_ == MigrationsOneofCase.MigrationsPath) { output.WriteRawTag(10); - output.WriteMessage(Jwt); + output.WriteString(MigrationsPath); } if (_unknownFields != null) { _unknownFields.WriteTo(output); @@ -2166,9 +2268,9 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (definitionCase_ == DefinitionOneofCase.Jwt) { + if (migrationsCase_ == MigrationsOneofCase.MigrationsPath) { output.WriteRawTag(10); - output.WriteMessage(Jwt); + output.WriteString(MigrationsPath); } if (_unknownFields != null) { _unknownFields.WriteTo(ref output); @@ -2179,8 +2281,8 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; - if (definitionCase_ == DefinitionOneofCase.Jwt) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Jwt); + if (migrationsCase_ == MigrationsOneofCase.MigrationsPath) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(MigrationsPath); } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); @@ -2189,16 +2291,13 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(ApiSecurityDefinition other) { + public void MergeFrom(SqlDatabaseMigrations other) { if (other == null) { return; } - switch (other.DefinitionCase) { - case DefinitionOneofCase.Jwt: - if (Jwt == null) { - Jwt = new global::Nitric.Proto.Resource.v1.ApiSecurityDefinitionJwt(); - } - Jwt.MergeFrom(other.Jwt); + switch (other.MigrationsCase) { + case MigrationsOneofCase.MigrationsPath: + MigrationsPath = other.MigrationsPath; break; } @@ -2217,12 +2316,7 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { - global::Nitric.Proto.Resource.v1.ApiSecurityDefinitionJwt subBuilder = new global::Nitric.Proto.Resource.v1.ApiSecurityDefinitionJwt(); - if (definitionCase_ == DefinitionOneofCase.Jwt) { - subBuilder.MergeFrom(Jwt); - } - input.ReadMessage(subBuilder); - Jwt = subBuilder; + MigrationsPath = input.ReadString(); break; } } @@ -2240,12 +2334,7 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; case 10: { - global::Nitric.Proto.Resource.v1.ApiSecurityDefinitionJwt subBuilder = new global::Nitric.Proto.Resource.v1.ApiSecurityDefinitionJwt(); - if (definitionCase_ == DefinitionOneofCase.Jwt) { - subBuilder.MergeFrom(Jwt); - } - input.ReadMessage(subBuilder); - Jwt = subBuilder; + MigrationsPath = input.ReadString(); break; } } @@ -2255,19 +2344,19 @@ public void MergeFrom(pb::CodedInputStream input) { } - public sealed partial class ApiScopes : pb::IMessage + public sealed partial class SqlDatabaseResource : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ApiScopes()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SqlDatabaseResource()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Resource.v1.ResourceReflection.Descriptor.MessageTypes[10]; } + get { return global::Nitric.Proto.Resources.v1.ResourcesReflection.Descriptor.MessageTypes[10]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -2276,54 +2365,55 @@ public sealed partial class ApiScopes : pb::IMessage } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ApiScopes() { + public SqlDatabaseResource() { OnConstruction(); } partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ApiScopes(ApiScopes other) : this() { - scopes_ = other.scopes_.Clone(); + public SqlDatabaseResource(SqlDatabaseResource other) : this() { + migrations_ = other.migrations_ != null ? other.migrations_.Clone() : null; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ApiScopes Clone() { - return new ApiScopes(this); + public SqlDatabaseResource Clone() { + return new SqlDatabaseResource(this); } - /// Field number for the "scopes" field. - public const int ScopesFieldNumber = 1; - private static readonly pb::FieldCodec _repeated_scopes_codec - = pb::FieldCodec.ForString(10); - private readonly pbc::RepeatedField scopes_ = new pbc::RepeatedField(); + /// Field number for the "migrations" field. + public const int MigrationsFieldNumber = 1; + private global::Nitric.Proto.Resources.v1.SqlDatabaseMigrations migrations_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField Scopes { - get { return scopes_; } + public global::Nitric.Proto.Resources.v1.SqlDatabaseMigrations Migrations { + get { return migrations_; } + set { + migrations_ = value; + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { - return Equals(other as ApiScopes); + return Equals(other as SqlDatabaseResource); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(ApiScopes other) { + public bool Equals(SqlDatabaseResource other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } - if(!scopes_.Equals(other.scopes_)) return false; + if (!object.Equals(Migrations, other.Migrations)) return false; return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; - hash ^= scopes_.GetHashCode(); + if (migrations_ != null) hash ^= Migrations.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -2340,7 +2430,10 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else - scopes_.WriteTo(output, _repeated_scopes_codec); + if (migrations_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Migrations); + } if (_unknownFields != null) { _unknownFields.WriteTo(output); } @@ -2350,7 +2443,10 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - scopes_.WriteTo(ref output, _repeated_scopes_codec); + if (migrations_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Migrations); + } if (_unknownFields != null) { _unknownFields.WriteTo(ref output); } @@ -2360,7 +2456,9 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; - size += scopes_.CalculateSize(_repeated_scopes_codec); + if (migrations_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Migrations); + } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); } @@ -2368,11 +2466,16 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(ApiScopes other) { + public void MergeFrom(SqlDatabaseResource other) { if (other == null) { return; } - scopes_.Add(other.scopes_); + if (other.migrations_ != null) { + if (migrations_ == null) { + Migrations = new global::Nitric.Proto.Resources.v1.SqlDatabaseMigrations(); + } + Migrations.MergeFrom(other.Migrations); + } _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } @@ -2388,7 +2491,10 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { - scopes_.AddEntriesFrom(input, _repeated_scopes_codec); + if (migrations_ == null) { + Migrations = new global::Nitric.Proto.Resources.v1.SqlDatabaseMigrations(); + } + input.ReadMessage(Migrations); break; } } @@ -2406,7 +2512,10 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; case 10: { - scopes_.AddEntriesFrom(ref input, _repeated_scopes_codec); + if (migrations_ == null) { + Migrations = new global::Nitric.Proto.Resources.v1.SqlDatabaseMigrations(); + } + input.ReadMessage(Migrations); break; } } @@ -2416,19 +2525,19 @@ public void MergeFrom(pb::CodedInputStream input) { } - public sealed partial class ApiResource : pb::IMessage + public sealed partial class ApiOpenIdConnectionDefinition : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ApiResource()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ApiOpenIdConnectionDefinition()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Resource.v1.ResourceReflection.Descriptor.MessageTypes[11]; } + get { return global::Nitric.Proto.Resources.v1.ResourcesReflection.Descriptor.MessageTypes[11]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -2437,74 +2546,68 @@ public sealed partial class ApiResource : pb::IMessage } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ApiResource() { + public ApiOpenIdConnectionDefinition() { OnConstruction(); } partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ApiResource(ApiResource other) : this() { - securityDefinitions_ = other.securityDefinitions_.Clone(); - security_ = other.security_.Clone(); + public ApiOpenIdConnectionDefinition(ApiOpenIdConnectionDefinition other) : this() { + issuer_ = other.issuer_; + audiences_ = other.audiences_.Clone(); _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ApiResource Clone() { - return new ApiResource(this); + public ApiOpenIdConnectionDefinition Clone() { + return new ApiOpenIdConnectionDefinition(this); } - /// Field number for the "security_definitions" field. - public const int SecurityDefinitionsFieldNumber = 1; - private static readonly pbc::MapField.Codec _map_securityDefinitions_codec - = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForMessage(18, global::Nitric.Proto.Resource.v1.ApiSecurityDefinition.Parser), 10); - private readonly pbc::MapField securityDefinitions_ = new pbc::MapField(); - /// - /// Security definitions for the api - /// These may be used by registered routes and operations on the API - /// + /// Field number for the "issuer" field. + public const int IssuerFieldNumber = 1; + private string issuer_ = ""; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::MapField SecurityDefinitions { - get { return securityDefinitions_; } + public string Issuer { + get { return issuer_; } + set { + issuer_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } } - /// Field number for the "security" field. - public const int SecurityFieldNumber = 2; - private static readonly pbc::MapField.Codec _map_security_codec - = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForMessage(18, global::Nitric.Proto.Resource.v1.ApiScopes.Parser), 18); - private readonly pbc::MapField security_ = new pbc::MapField(); - /// - /// root level security for this api - /// + /// Field number for the "audiences" field. + public const int AudiencesFieldNumber = 2; + private static readonly pb::FieldCodec _repeated_audiences_codec + = pb::FieldCodec.ForString(18); + private readonly pbc::RepeatedField audiences_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::MapField Security { - get { return security_; } + public pbc::RepeatedField Audiences { + get { return audiences_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { - return Equals(other as ApiResource); + return Equals(other as ApiOpenIdConnectionDefinition); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(ApiResource other) { + public bool Equals(ApiOpenIdConnectionDefinition other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } - if (!SecurityDefinitions.Equals(other.SecurityDefinitions)) return false; - if (!Security.Equals(other.Security)) return false; + if (Issuer != other.Issuer) return false; + if(!audiences_.Equals(other.audiences_)) return false; return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; - hash ^= SecurityDefinitions.GetHashCode(); - hash ^= Security.GetHashCode(); + if (Issuer.Length != 0) hash ^= Issuer.GetHashCode(); + hash ^= audiences_.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -2521,8 +2624,11 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else - securityDefinitions_.WriteTo(output, _map_securityDefinitions_codec); - security_.WriteTo(output, _map_security_codec); + if (Issuer.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Issuer); + } + audiences_.WriteTo(output, _repeated_audiences_codec); if (_unknownFields != null) { _unknownFields.WriteTo(output); } @@ -2532,8 +2638,11 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - securityDefinitions_.WriteTo(ref output, _map_securityDefinitions_codec); - security_.WriteTo(ref output, _map_security_codec); + if (Issuer.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Issuer); + } + audiences_.WriteTo(ref output, _repeated_audiences_codec); if (_unknownFields != null) { _unknownFields.WriteTo(ref output); } @@ -2543,8 +2652,10 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; - size += securityDefinitions_.CalculateSize(_map_securityDefinitions_codec); - size += security_.CalculateSize(_map_security_codec); + if (Issuer.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Issuer); + } + size += audiences_.CalculateSize(_repeated_audiences_codec); if (_unknownFields != null) { size += _unknownFields.CalculateSize(); } @@ -2552,12 +2663,14 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(ApiResource other) { + public void MergeFrom(ApiOpenIdConnectionDefinition other) { if (other == null) { return; } - securityDefinitions_.Add(other.securityDefinitions_); - security_.Add(other.security_); + if (other.Issuer.Length != 0) { + Issuer = other.Issuer; + } + audiences_.Add(other.audiences_); _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } @@ -2573,11 +2686,11 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { - securityDefinitions_.AddEntriesFrom(input, _map_securityDefinitions_codec); + Issuer = input.ReadString(); break; } case 18: { - security_.AddEntriesFrom(input, _map_security_codec); + audiences_.AddEntriesFrom(input, _repeated_audiences_codec); break; } } @@ -2595,11 +2708,11 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; case 10: { - securityDefinitions_.AddEntriesFrom(ref input, _map_securityDefinitions_codec); + Issuer = input.ReadString(); break; } case 18: { - security_.AddEntriesFrom(ref input, _map_security_codec); + audiences_.AddEntriesFrom(ref input, _repeated_audiences_codec); break; } } @@ -2609,19 +2722,19 @@ public void MergeFrom(pb::CodedInputStream input) { } - public sealed partial class ResourceDeclareResponse : pb::IMessage + public sealed partial class ApiSecurityDefinitionResource : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ResourceDeclareResponse()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ApiSecurityDefinitionResource()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Resource.v1.ResourceReflection.Descriptor.MessageTypes[12]; } + get { return global::Nitric.Proto.Resources.v1.ResourcesReflection.Descriptor.MessageTypes[12]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -2630,41 +2743,94 @@ public sealed partial class ResourceDeclareResponse : pb::IMessageField number for the "api_name" field. + public const int ApiNameFieldNumber = 1; + private string apiName_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string ApiName { + get { return apiName_; } + set { + apiName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "oidc" field. + public const int OidcFieldNumber = 2; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Nitric.Proto.Resources.v1.ApiOpenIdConnectionDefinition Oidc { + get { return definitionCase_ == DefinitionOneofCase.Oidc ? (global::Nitric.Proto.Resources.v1.ApiOpenIdConnectionDefinition) definition_ : null; } + set { + definition_ = value; + definitionCase_ = value == null ? DefinitionOneofCase.None : DefinitionOneofCase.Oidc; + } + } + + private object definition_; + /// Enum of possible cases for the "definition" oneof. + public enum DefinitionOneofCase { + None = 0, + Oidc = 2, + } + private DefinitionOneofCase definitionCase_ = DefinitionOneofCase.None; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public DefinitionOneofCase DefinitionCase { + get { return definitionCase_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void ClearDefinition() { + definitionCase_ = DefinitionOneofCase.None; + definition_ = null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { - return Equals(other as ResourceDeclareResponse); + return Equals(other as ApiSecurityDefinitionResource); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(ResourceDeclareResponse other) { + public bool Equals(ApiSecurityDefinitionResource other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } + if (ApiName != other.ApiName) return false; + if (!object.Equals(Oidc, other.Oidc)) return false; + if (DefinitionCase != other.DefinitionCase) return false; return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; + if (ApiName.Length != 0) hash ^= ApiName.GetHashCode(); + if (definitionCase_ == DefinitionOneofCase.Oidc) hash ^= Oidc.GetHashCode(); + hash ^= (int) definitionCase_; if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -2681,6 +2847,14 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else + if (ApiName.Length != 0) { + output.WriteRawTag(10); + output.WriteString(ApiName); + } + if (definitionCase_ == DefinitionOneofCase.Oidc) { + output.WriteRawTag(18); + output.WriteMessage(Oidc); + } if (_unknownFields != null) { _unknownFields.WriteTo(output); } @@ -2690,6 +2864,14 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (ApiName.Length != 0) { + output.WriteRawTag(10); + output.WriteString(ApiName); + } + if (definitionCase_ == DefinitionOneofCase.Oidc) { + output.WriteRawTag(18); + output.WriteMessage(Oidc); + } if (_unknownFields != null) { _unknownFields.WriteTo(ref output); } @@ -2699,6 +2881,12 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; + if (ApiName.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(ApiName); + } + if (definitionCase_ == DefinitionOneofCase.Oidc) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Oidc); + } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); } @@ -2706,10 +2894,22 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(ResourceDeclareResponse other) { + public void MergeFrom(ApiSecurityDefinitionResource other) { if (other == null) { return; } + if (other.ApiName.Length != 0) { + ApiName = other.ApiName; + } + switch (other.DefinitionCase) { + case DefinitionOneofCase.Oidc: + if (Oidc == null) { + Oidc = new global::Nitric.Proto.Resources.v1.ApiOpenIdConnectionDefinition(); + } + Oidc.MergeFrom(other.Oidc); + break; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } @@ -2724,6 +2924,19 @@ public void MergeFrom(pb::CodedInputStream input) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; + case 10: { + ApiName = input.ReadString(); + break; + } + case 18: { + global::Nitric.Proto.Resources.v1.ApiOpenIdConnectionDefinition subBuilder = new global::Nitric.Proto.Resources.v1.ApiOpenIdConnectionDefinition(); + if (definitionCase_ == DefinitionOneofCase.Oidc) { + subBuilder.MergeFrom(Oidc); + } + input.ReadMessage(subBuilder); + Oidc = subBuilder; + break; + } } } #endif @@ -2738,6 +2951,19 @@ public void MergeFrom(pb::CodedInputStream input) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; + case 10: { + ApiName = input.ReadString(); + break; + } + case 18: { + global::Nitric.Proto.Resources.v1.ApiOpenIdConnectionDefinition subBuilder = new global::Nitric.Proto.Resources.v1.ApiOpenIdConnectionDefinition(); + if (definitionCase_ == DefinitionOneofCase.Oidc) { + subBuilder.MergeFrom(Oidc); + } + input.ReadMessage(subBuilder); + Oidc = subBuilder; + break; + } } } } @@ -2745,19 +2971,19 @@ public void MergeFrom(pb::CodedInputStream input) { } - public sealed partial class ApiResourceDetails : pb::IMessage + public sealed partial class ApiScopes : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ApiResourceDetails()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ApiScopes()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Resource.v1.ResourceReflection.Descriptor.MessageTypes[13]; } + get { return global::Nitric.Proto.Resources.v1.ResourcesReflection.Descriptor.MessageTypes[13]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -2766,55 +2992,54 @@ public sealed partial class ApiResourceDetails : pb::IMessageField number for the "url" field. - public const int UrlFieldNumber = 1; - private string url_ = ""; + /// Field number for the "scopes" field. + public const int ScopesFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_scopes_codec + = pb::FieldCodec.ForString(10); + private readonly pbc::RepeatedField scopes_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string Url { - get { return url_; } - set { - url_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } + public pbc::RepeatedField Scopes { + get { return scopes_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { - return Equals(other as ApiResourceDetails); + return Equals(other as ApiScopes); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(ApiResourceDetails other) { + public bool Equals(ApiScopes other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } - if (Url != other.Url) return false; + if(!scopes_.Equals(other.scopes_)) return false; return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; - if (Url.Length != 0) hash ^= Url.GetHashCode(); + hash ^= scopes_.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -2831,182 +3056,7 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else - if (Url.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Url); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (Url.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Url); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (Url.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Url); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(ApiResourceDetails other) { - if (other == null) { - return; - } - if (other.Url.Length != 0) { - Url = other.Url; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - Url = input.ReadString(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - Url = input.ReadString(); - break; - } - } - } - } - #endif - - } - - public sealed partial class WebsocketResourceDetails : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new WebsocketResourceDetails()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Resource.v1.ResourceReflection.Descriptor.MessageTypes[14]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public WebsocketResourceDetails() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public WebsocketResourceDetails(WebsocketResourceDetails other) : this() { - url_ = other.url_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public WebsocketResourceDetails Clone() { - return new WebsocketResourceDetails(this); - } - - /// Field number for the "url" field. - public const int UrlFieldNumber = 1; - private string url_ = ""; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string Url { - get { return url_; } - set { - url_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as WebsocketResourceDetails); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(WebsocketResourceDetails other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Url != other.Url) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (Url.Length != 0) hash ^= Url.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (Url.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Url); - } + scopes_.WriteTo(output, _repeated_scopes_codec); if (_unknownFields != null) { _unknownFields.WriteTo(output); } @@ -3016,10 +3066,7 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (Url.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Url); - } + scopes_.WriteTo(ref output, _repeated_scopes_codec); if (_unknownFields != null) { _unknownFields.WriteTo(ref output); } @@ -3029,9 +3076,7 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; - if (Url.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Url); - } + size += scopes_.CalculateSize(_repeated_scopes_codec); if (_unknownFields != null) { size += _unknownFields.CalculateSize(); } @@ -3039,13 +3084,11 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(WebsocketResourceDetails other) { + public void MergeFrom(ApiScopes other) { if (other == null) { return; } - if (other.Url.Length != 0) { - Url = other.Url; - } + scopes_.Add(other.scopes_); _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } @@ -3061,7 +3104,7 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { - Url = input.ReadString(); + scopes_.AddEntriesFrom(input, _repeated_scopes_codec); break; } } @@ -3079,7 +3122,7 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; case 10: { - Url = input.ReadString(); + scopes_.AddEntriesFrom(ref input, _repeated_scopes_codec); break; } } @@ -3089,19 +3132,19 @@ public void MergeFrom(pb::CodedInputStream input) { } - public sealed partial class ResourceDetailsRequest : pb::IMessage + public sealed partial class ApiResource : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ResourceDetailsRequest()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ApiResource()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Resource.v1.ResourceReflection.Descriptor.MessageTypes[15]; } + get { return global::Nitric.Proto.Resources.v1.ResourcesReflection.Descriptor.MessageTypes[14]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -3110,55 +3153,58 @@ public sealed partial class ResourceDetailsRequest : pb::IMessageField number for the "resource" field. - public const int ResourceFieldNumber = 1; - private global::Nitric.Proto.Resource.v1.Resource resource_; + /// Field number for the "security" field. + public const int SecurityFieldNumber = 1; + private static readonly pbc::MapField.Codec _map_security_codec + = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForMessage(18, global::Nitric.Proto.Resources.v1.ApiScopes.Parser), 10); + private readonly pbc::MapField security_ = new pbc::MapField(); + /// + /// root level security map for this api + /// references ApiSecurityDefinitionResource(s) + /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Resource.v1.Resource Resource { - get { return resource_; } - set { - resource_ = value; - } + public pbc::MapField Security { + get { return security_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { - return Equals(other as ResourceDetailsRequest); + return Equals(other as ApiResource); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(ResourceDetailsRequest other) { + public bool Equals(ApiResource other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } - if (!object.Equals(Resource, other.Resource)) return false; + if (!Security.Equals(other.Security)) return false; return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; - if (resource_ != null) hash ^= Resource.GetHashCode(); + hash ^= Security.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -3175,10 +3221,7 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else - if (resource_ != null) { - output.WriteRawTag(10); - output.WriteMessage(Resource); - } + security_.WriteTo(output, _map_security_codec); if (_unknownFields != null) { _unknownFields.WriteTo(output); } @@ -3188,10 +3231,7 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (resource_ != null) { - output.WriteRawTag(10); - output.WriteMessage(Resource); - } + security_.WriteTo(ref output, _map_security_codec); if (_unknownFields != null) { _unknownFields.WriteTo(ref output); } @@ -3201,9 +3241,7 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; - if (resource_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Resource); - } + size += security_.CalculateSize(_map_security_codec); if (_unknownFields != null) { size += _unknownFields.CalculateSize(); } @@ -3211,16 +3249,11 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(ResourceDetailsRequest other) { + public void MergeFrom(ApiResource other) { if (other == null) { return; } - if (other.resource_ != null) { - if (resource_ == null) { - Resource = new global::Nitric.Proto.Resource.v1.Resource(); - } - Resource.MergeFrom(other.Resource); - } + security_.Add(other.security_); _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } @@ -3236,10 +3269,7 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { - if (resource_ == null) { - Resource = new global::Nitric.Proto.Resource.v1.Resource(); - } - input.ReadMessage(Resource); + security_.AddEntriesFrom(input, _map_security_codec); break; } } @@ -3257,10 +3287,7 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; case 10: { - if (resource_ == null) { - Resource = new global::Nitric.Proto.Resource.v1.Resource(); - } - input.ReadMessage(Resource); + security_.AddEntriesFrom(ref input, _map_security_codec); break; } } @@ -3270,19 +3297,19 @@ public void MergeFrom(pb::CodedInputStream input) { } - public sealed partial class ResourceDetailsResponse : pb::IMessage + public sealed partial class ResourceDeclareResponse : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ResourceDetailsResponse()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ResourceDeclareResponse()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Resource.v1.ResourceReflection.Descriptor.MessageTypes[16]; } + get { return global::Nitric.Proto.Resources.v1.ResourcesReflection.Descriptor.MessageTypes[15]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -3291,148 +3318,41 @@ public sealed partial class ResourceDetailsResponse : pb::IMessageField number for the "id" field. - public const int IdFieldNumber = 1; - private string id_ = ""; - /// - /// The identifier of the resource - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string Id { - get { return id_; } - set { - id_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "provider" field. - public const int ProviderFieldNumber = 2; - private string provider_ = ""; - /// - /// The provider this resource is deployed with (e.g. aws) - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string Provider { - get { return provider_; } - set { - provider_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "service" field. - public const int ServiceFieldNumber = 3; - private string service_ = ""; - /// - /// The service this resource is deployed on (e.g. ApiGateway) - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string Service { - get { return service_; } - set { - service_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "api" field. - public const int ApiFieldNumber = 10; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Resource.v1.ApiResourceDetails Api { - get { return detailsCase_ == DetailsOneofCase.Api ? (global::Nitric.Proto.Resource.v1.ApiResourceDetails) details_ : null; } - set { - details_ = value; - detailsCase_ = value == null ? DetailsOneofCase.None : DetailsOneofCase.Api; - } - } - - /// Field number for the "websocket" field. - public const int WebsocketFieldNumber = 11; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Resource.v1.WebsocketResourceDetails Websocket { - get { return detailsCase_ == DetailsOneofCase.Websocket ? (global::Nitric.Proto.Resource.v1.WebsocketResourceDetails) details_ : null; } - set { - details_ = value; - detailsCase_ = value == null ? DetailsOneofCase.None : DetailsOneofCase.Websocket; - } - } - - private object details_; - /// Enum of possible cases for the "details" oneof. - public enum DetailsOneofCase { - None = 0, - Api = 10, - Websocket = 11, - } - private DetailsOneofCase detailsCase_ = DetailsOneofCase.None; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public DetailsOneofCase DetailsCase { - get { return detailsCase_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearDetails() { - detailsCase_ = DetailsOneofCase.None; - details_ = null; + public ResourceDeclareResponse Clone() { + return new ResourceDeclareResponse(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { - return Equals(other as ResourceDetailsResponse); + return Equals(other as ResourceDeclareResponse); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(ResourceDetailsResponse other) { + public bool Equals(ResourceDeclareResponse other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } - if (Id != other.Id) return false; - if (Provider != other.Provider) return false; - if (Service != other.Service) return false; - if (!object.Equals(Api, other.Api)) return false; - if (!object.Equals(Websocket, other.Websocket)) return false; - if (DetailsCase != other.DetailsCase) return false; return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; - if (Id.Length != 0) hash ^= Id.GetHashCode(); - if (Provider.Length != 0) hash ^= Provider.GetHashCode(); - if (Service.Length != 0) hash ^= Service.GetHashCode(); - if (detailsCase_ == DetailsOneofCase.Api) hash ^= Api.GetHashCode(); - if (detailsCase_ == DetailsOneofCase.Websocket) hash ^= Websocket.GetHashCode(); - hash ^= (int) detailsCase_; if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -3449,26 +3369,6 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else - if (Id.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Id); - } - if (Provider.Length != 0) { - output.WriteRawTag(18); - output.WriteString(Provider); - } - if (Service.Length != 0) { - output.WriteRawTag(26); - output.WriteString(Service); - } - if (detailsCase_ == DetailsOneofCase.Api) { - output.WriteRawTag(82); - output.WriteMessage(Api); - } - if (detailsCase_ == DetailsOneofCase.Websocket) { - output.WriteRawTag(90); - output.WriteMessage(Websocket); - } if (_unknownFields != null) { _unknownFields.WriteTo(output); } @@ -3478,26 +3378,6 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (Id.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Id); - } - if (Provider.Length != 0) { - output.WriteRawTag(18); - output.WriteString(Provider); - } - if (Service.Length != 0) { - output.WriteRawTag(26); - output.WriteString(Service); - } - if (detailsCase_ == DetailsOneofCase.Api) { - output.WriteRawTag(82); - output.WriteMessage(Api); - } - if (detailsCase_ == DetailsOneofCase.Websocket) { - output.WriteRawTag(90); - output.WriteMessage(Websocket); - } if (_unknownFields != null) { _unknownFields.WriteTo(ref output); } @@ -3507,21 +3387,6 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; - if (Id.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Id); - } - if (Provider.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Provider); - } - if (Service.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Service); - } - if (detailsCase_ == DetailsOneofCase.Api) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Api); - } - if (detailsCase_ == DetailsOneofCase.Websocket) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Websocket); - } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); } @@ -3529,34 +3394,10 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(ResourceDetailsResponse other) { + public void MergeFrom(ResourceDeclareResponse other) { if (other == null) { return; } - if (other.Id.Length != 0) { - Id = other.Id; - } - if (other.Provider.Length != 0) { - Provider = other.Provider; - } - if (other.Service.Length != 0) { - Service = other.Service; - } - switch (other.DetailsCase) { - case DetailsOneofCase.Api: - if (Api == null) { - Api = new global::Nitric.Proto.Resource.v1.ApiResourceDetails(); - } - Api.MergeFrom(other.Api); - break; - case DetailsOneofCase.Websocket: - if (Websocket == null) { - Websocket = new global::Nitric.Proto.Resource.v1.WebsocketResourceDetails(); - } - Websocket.MergeFrom(other.Websocket); - break; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } @@ -3571,36 +3412,6 @@ public void MergeFrom(pb::CodedInputStream input) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; - case 10: { - Id = input.ReadString(); - break; - } - case 18: { - Provider = input.ReadString(); - break; - } - case 26: { - Service = input.ReadString(); - break; - } - case 82: { - global::Nitric.Proto.Resource.v1.ApiResourceDetails subBuilder = new global::Nitric.Proto.Resource.v1.ApiResourceDetails(); - if (detailsCase_ == DetailsOneofCase.Api) { - subBuilder.MergeFrom(Api); - } - input.ReadMessage(subBuilder); - Api = subBuilder; - break; - } - case 90: { - global::Nitric.Proto.Resource.v1.WebsocketResourceDetails subBuilder = new global::Nitric.Proto.Resource.v1.WebsocketResourceDetails(); - if (detailsCase_ == DetailsOneofCase.Websocket) { - subBuilder.MergeFrom(Websocket); - } - input.ReadMessage(subBuilder); - Websocket = subBuilder; - break; - } } } #endif @@ -3615,36 +3426,6 @@ public void MergeFrom(pb::CodedInputStream input) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; - case 10: { - Id = input.ReadString(); - break; - } - case 18: { - Provider = input.ReadString(); - break; - } - case 26: { - Service = input.ReadString(); - break; - } - case 82: { - global::Nitric.Proto.Resource.v1.ApiResourceDetails subBuilder = new global::Nitric.Proto.Resource.v1.ApiResourceDetails(); - if (detailsCase_ == DetailsOneofCase.Api) { - subBuilder.MergeFrom(Api); - } - input.ReadMessage(subBuilder); - Api = subBuilder; - break; - } - case 90: { - global::Nitric.Proto.Resource.v1.WebsocketResourceDetails subBuilder = new global::Nitric.Proto.Resource.v1.WebsocketResourceDetails(); - if (detailsCase_ == DetailsOneofCase.Websocket) { - subBuilder.MergeFrom(Websocket); - } - input.ReadMessage(subBuilder); - Websocket = subBuilder; - break; - } } } } diff --git a/src/Nitric.Sdk/Proto/nitric/proto/resources/v1/ResourcesGrpc.cs b/src/Nitric.Sdk/Proto/nitric/proto/resources/v1/ResourcesGrpc.cs new file mode 100644 index 0000000..c3abb6d --- /dev/null +++ b/src/Nitric.Sdk/Proto/nitric/proto/resources/v1/ResourcesGrpc.cs @@ -0,0 +1,185 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: nitric/proto/resources/v1/resources.proto +// +#pragma warning disable 0414, 1591 +#region Designer generated code + +using grpc = global::Grpc.Core; + +namespace Nitric.Proto.Resources.v1 { + /// + /// Nitric Resource Service + /// The service definition exists to allow a nitric application to declare peripheral dependencies + /// + public static partial class Resources + { + static readonly string __ServiceName = "nitric.proto.resources.v1.Resources"; + + static void __Helper_SerializeMessage(global::Google.Protobuf.IMessage message, grpc::SerializationContext context) + { + #if !GRPC_DISABLE_PROTOBUF_BUFFER_SERIALIZATION + if (message is global::Google.Protobuf.IBufferMessage) + { + context.SetPayloadLength(message.CalculateSize()); + global::Google.Protobuf.MessageExtensions.WriteTo(message, context.GetBufferWriter()); + context.Complete(); + return; + } + #endif + context.Complete(global::Google.Protobuf.MessageExtensions.ToByteArray(message)); + } + + static class __Helper_MessageCache + { + public static readonly bool IsBufferMessage = global::System.Reflection.IntrospectionExtensions.GetTypeInfo(typeof(global::Google.Protobuf.IBufferMessage)).IsAssignableFrom(typeof(T)); + } + + static T __Helper_DeserializeMessage(grpc::DeserializationContext context, global::Google.Protobuf.MessageParser parser) where T : global::Google.Protobuf.IMessage + { + #if !GRPC_DISABLE_PROTOBUF_BUFFER_SERIALIZATION + if (__Helper_MessageCache.IsBufferMessage) + { + return parser.ParseFrom(context.PayloadAsReadOnlySequence()); + } + #endif + return parser.ParseFrom(context.PayloadAsNewBuffer()); + } + + static readonly grpc::Marshaller __Marshaller_nitric_proto_resources_v1_ResourceDeclareRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Resources.v1.ResourceDeclareRequest.Parser)); + static readonly grpc::Marshaller __Marshaller_nitric_proto_resources_v1_ResourceDeclareResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Resources.v1.ResourceDeclareResponse.Parser)); + + static readonly grpc::Method __Method_Declare = new grpc::Method( + grpc::MethodType.Unary, + __ServiceName, + "Declare", + __Marshaller_nitric_proto_resources_v1_ResourceDeclareRequest, + __Marshaller_nitric_proto_resources_v1_ResourceDeclareResponse); + + /// Service descriptor + public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor + { + get { return global::Nitric.Proto.Resources.v1.ResourcesReflection.Descriptor.Services[0]; } + } + + /// Base class for server-side implementations of Resources + [grpc::BindServiceMethod(typeof(Resources), "BindService")] + public abstract partial class ResourcesBase + { + /// + /// Declare a resource for the nitric application + /// At Deploy time this will create resources as part of the nitric stacks dependency graph + /// At runtime + /// + /// The request received from the client. + /// The context of the server-side call handler being invoked. + /// The response to send back to the client (wrapped by a task). + public virtual global::System.Threading.Tasks.Task Declare(global::Nitric.Proto.Resources.v1.ResourceDeclareRequest request, grpc::ServerCallContext context) + { + throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); + } + + } + + /// Client for Resources + public partial class ResourcesClient : grpc::ClientBase + { + /// Creates a new client for Resources + /// The channel to use to make remote calls. + public ResourcesClient(grpc::ChannelBase channel) : base(channel) + { + } + /// Creates a new client for Resources that uses a custom CallInvoker. + /// The callInvoker to use to make remote calls. + public ResourcesClient(grpc::CallInvoker callInvoker) : base(callInvoker) + { + } + /// Protected parameterless constructor to allow creation of test doubles. + protected ResourcesClient() : base() + { + } + /// Protected constructor to allow creation of configured clients. + /// The client configuration. + protected ResourcesClient(ClientBaseConfiguration configuration) : base(configuration) + { + } + + /// + /// Declare a resource for the nitric application + /// At Deploy time this will create resources as part of the nitric stacks dependency graph + /// At runtime + /// + /// The request to send to the server. + /// The initial metadata to send with the call. This parameter is optional. + /// An optional deadline for the call. The call will be cancelled if deadline is hit. + /// An optional token for canceling the call. + /// The response received from the server. + public virtual global::Nitric.Proto.Resources.v1.ResourceDeclareResponse Declare(global::Nitric.Proto.Resources.v1.ResourceDeclareRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return Declare(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + /// + /// Declare a resource for the nitric application + /// At Deploy time this will create resources as part of the nitric stacks dependency graph + /// At runtime + /// + /// The request to send to the server. + /// The options for the call. + /// The response received from the server. + public virtual global::Nitric.Proto.Resources.v1.ResourceDeclareResponse Declare(global::Nitric.Proto.Resources.v1.ResourceDeclareRequest request, grpc::CallOptions options) + { + return CallInvoker.BlockingUnaryCall(__Method_Declare, null, options, request); + } + /// + /// Declare a resource for the nitric application + /// At Deploy time this will create resources as part of the nitric stacks dependency graph + /// At runtime + /// + /// The request to send to the server. + /// The initial metadata to send with the call. This parameter is optional. + /// An optional deadline for the call. The call will be cancelled if deadline is hit. + /// An optional token for canceling the call. + /// The call object. + public virtual grpc::AsyncUnaryCall DeclareAsync(global::Nitric.Proto.Resources.v1.ResourceDeclareRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return DeclareAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + /// + /// Declare a resource for the nitric application + /// At Deploy time this will create resources as part of the nitric stacks dependency graph + /// At runtime + /// + /// The request to send to the server. + /// The options for the call. + /// The call object. + public virtual grpc::AsyncUnaryCall DeclareAsync(global::Nitric.Proto.Resources.v1.ResourceDeclareRequest request, grpc::CallOptions options) + { + return CallInvoker.AsyncUnaryCall(__Method_Declare, null, options, request); + } + /// Creates a new instance of client from given ClientBaseConfiguration. + protected override ResourcesClient NewInstance(ClientBaseConfiguration configuration) + { + return new ResourcesClient(configuration); + } + } + + /// Creates service definition that can be registered with a server + /// An object implementing the server-side handling logic. + public static grpc::ServerServiceDefinition BindService(ResourcesBase serviceImpl) + { + return grpc::ServerServiceDefinition.CreateBuilder() + .AddMethod(__Method_Declare, serviceImpl.Declare).Build(); + } + + /// Register service method with a service binder with or without implementation. Useful when customizing the service binding logic. + /// Note: this method is part of an experimental API that can change or be removed without any prior notice. + /// Service methods will be bound by calling AddMethod on this object. + /// An object implementing the server-side handling logic. + public static void BindService(grpc::ServiceBinderBase serviceBinder, ResourcesBase serviceImpl) + { + serviceBinder.AddMethod(__Method_Declare, serviceImpl == null ? null : new grpc::UnaryServerMethod(serviceImpl.Declare)); + } + + } +} +#endregion diff --git a/src/Nitric.Sdk/Proto/nitric/proto/schedules/v1/Schedules.cs b/src/Nitric.Sdk/Proto/nitric/proto/schedules/v1/Schedules.cs new file mode 100644 index 0000000..a2866c0 --- /dev/null +++ b/src/Nitric.Sdk/Proto/nitric/proto/schedules/v1/Schedules.cs @@ -0,0 +1,1788 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: nitric/proto/schedules/v1/schedules.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Nitric.Proto.Schedules.v1 { + + /// Holder for reflection information generated from nitric/proto/schedules/v1/schedules.proto + public static partial class SchedulesReflection { + + #region Descriptor + /// File descriptor for nitric/proto/schedules/v1/schedules.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static SchedulesReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CiluaXRyaWMvcHJvdG8vc2NoZWR1bGVzL3YxL3NjaGVkdWxlcy5wcm90bxIZ", + "bml0cmljLnByb3RvLnNjaGVkdWxlcy52MSLAAQoNQ2xpZW50TWVzc2FnZRIK", + "CgJpZBgBIAEoCRJOChRyZWdpc3RyYXRpb25fcmVxdWVzdBgCIAEoCzIuLm5p", + "dHJpYy5wcm90by5zY2hlZHVsZXMudjEuUmVnaXN0cmF0aW9uUmVxdWVzdEgA", + "EkgKEWludGVydmFsX3Jlc3BvbnNlGAMgASgLMisubml0cmljLnByb3RvLnNj", + "aGVkdWxlcy52MS5JbnRlcnZhbFJlc3BvbnNlSABCCQoHY29udGVudCIoCg9J", + "bnRlcnZhbFJlcXVlc3QSFQoNc2NoZWR1bGVfbmFtZRgBIAEoCSLAAQoNU2Vy", + "dmVyTWVzc2FnZRIKCgJpZBgBIAEoCRJQChVyZWdpc3RyYXRpb25fcmVzcG9u", + "c2UYAiABKAsyLy5uaXRyaWMucHJvdG8uc2NoZWR1bGVzLnYxLlJlZ2lzdHJh", + "dGlvblJlc3BvbnNlSAASRgoQaW50ZXJ2YWxfcmVxdWVzdBgDIAEoCzIqLm5p", + "dHJpYy5wcm90by5zY2hlZHVsZXMudjEuSW50ZXJ2YWxSZXF1ZXN0SABCCQoH", + "Y29udGVudCKrAQoTUmVnaXN0cmF0aW9uUmVxdWVzdBIVCg1zY2hlZHVsZV9u", + "YW1lGAEgASgJEjkKBWV2ZXJ5GAogASgLMigubml0cmljLnByb3RvLnNjaGVk", + "dWxlcy52MS5TY2hlZHVsZUV2ZXJ5SAASNwoEY3JvbhgLIAEoCzInLm5pdHJp", + "Yy5wcm90by5zY2hlZHVsZXMudjEuU2NoZWR1bGVDcm9uSABCCQoHY2FkZW5j", + "ZSIdCg1TY2hlZHVsZUV2ZXJ5EgwKBHJhdGUYASABKAkiIgoMU2NoZWR1bGVD", + "cm9uEhIKCmV4cHJlc3Npb24YASABKAkiFgoUUmVnaXN0cmF0aW9uUmVzcG9u", + "c2UiEgoQSW50ZXJ2YWxSZXNwb25zZTJvCglTY2hlZHVsZXMSYgoIU2NoZWR1", + "bGUSKC5uaXRyaWMucHJvdG8uc2NoZWR1bGVzLnYxLkNsaWVudE1lc3NhZ2Ua", + "KC5uaXRyaWMucHJvdG8uc2NoZWR1bGVzLnYxLlNlcnZlck1lc3NhZ2UoATAB", + "QrABChxpby5uaXRyaWMucHJvdG8uc2NoZWR1bGVzLnYxQhBTY2hlZHVsZXNT", + "ZXJ2aWNlUAFaRGdpdGh1Yi5jb20vbml0cmljdGVjaC9uaXRyaWMvY29yZS9w", + "a2cvcHJvdG8vc2NoZWR1bGVzL3YxO3NjaGVkdWxlc3BiqgIZTml0cmljLlBy", + "b3RvLlNjaGVkdWxlcy52McoCGU5pdHJpY1xQcm90b1xTY2hlZHVsZXNcVjFi", + "BnByb3RvMw==")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Schedules.v1.ClientMessage), global::Nitric.Proto.Schedules.v1.ClientMessage.Parser, new[]{ "Id", "RegistrationRequest", "IntervalResponse" }, new[]{ "Content" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Schedules.v1.IntervalRequest), global::Nitric.Proto.Schedules.v1.IntervalRequest.Parser, new[]{ "ScheduleName" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Schedules.v1.ServerMessage), global::Nitric.Proto.Schedules.v1.ServerMessage.Parser, new[]{ "Id", "RegistrationResponse", "IntervalRequest" }, new[]{ "Content" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Schedules.v1.RegistrationRequest), global::Nitric.Proto.Schedules.v1.RegistrationRequest.Parser, new[]{ "ScheduleName", "Every", "Cron" }, new[]{ "Cadence" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Schedules.v1.ScheduleEvery), global::Nitric.Proto.Schedules.v1.ScheduleEvery.Parser, new[]{ "Rate" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Schedules.v1.ScheduleCron), global::Nitric.Proto.Schedules.v1.ScheduleCron.Parser, new[]{ "Expression" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Schedules.v1.RegistrationResponse), global::Nitric.Proto.Schedules.v1.RegistrationResponse.Parser, null, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Schedules.v1.IntervalResponse), global::Nitric.Proto.Schedules.v1.IntervalResponse.Parser, null, null, null, null, null) + })); + } + #endregion + + } + #region Messages + /// + /// ClientMessages are sent from the service to the nitric server + /// + public sealed partial class ClientMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ClientMessage()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Nitric.Proto.Schedules.v1.SchedulesReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ClientMessage() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ClientMessage(ClientMessage other) : this() { + id_ = other.id_; + switch (other.ContentCase) { + case ContentOneofCase.RegistrationRequest: + RegistrationRequest = other.RegistrationRequest.Clone(); + break; + case ContentOneofCase.IntervalResponse: + IntervalResponse = other.IntervalResponse.Clone(); + break; + } + + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ClientMessage Clone() { + return new ClientMessage(this); + } + + /// Field number for the "id" field. + public const int IdFieldNumber = 1; + private string id_ = ""; + /// + /// globally unique ID of the request/response pair + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Id { + get { return id_; } + set { + id_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "registration_request" field. + public const int RegistrationRequestFieldNumber = 2; + /// + /// Register new a schedule + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Nitric.Proto.Schedules.v1.RegistrationRequest RegistrationRequest { + get { return contentCase_ == ContentOneofCase.RegistrationRequest ? (global::Nitric.Proto.Schedules.v1.RegistrationRequest) content_ : null; } + set { + content_ = value; + contentCase_ = value == null ? ContentOneofCase.None : ContentOneofCase.RegistrationRequest; + } + } + + /// Field number for the "interval_response" field. + public const int IntervalResponseFieldNumber = 3; + /// + /// Response to a schedule interval (i.e. response from callback function) + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Nitric.Proto.Schedules.v1.IntervalResponse IntervalResponse { + get { return contentCase_ == ContentOneofCase.IntervalResponse ? (global::Nitric.Proto.Schedules.v1.IntervalResponse) content_ : null; } + set { + content_ = value; + contentCase_ = value == null ? ContentOneofCase.None : ContentOneofCase.IntervalResponse; + } + } + + private object content_; + /// Enum of possible cases for the "content" oneof. + public enum ContentOneofCase { + None = 0, + RegistrationRequest = 2, + IntervalResponse = 3, + } + private ContentOneofCase contentCase_ = ContentOneofCase.None; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ContentOneofCase ContentCase { + get { return contentCase_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void ClearContent() { + contentCase_ = ContentOneofCase.None; + content_ = null; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as ClientMessage); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ClientMessage other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Id != other.Id) return false; + if (!object.Equals(RegistrationRequest, other.RegistrationRequest)) return false; + if (!object.Equals(IntervalResponse, other.IntervalResponse)) return false; + if (ContentCase != other.ContentCase) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Id.Length != 0) hash ^= Id.GetHashCode(); + if (contentCase_ == ContentOneofCase.RegistrationRequest) hash ^= RegistrationRequest.GetHashCode(); + if (contentCase_ == ContentOneofCase.IntervalResponse) hash ^= IntervalResponse.GetHashCode(); + hash ^= (int) contentCase_; + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (Id.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Id); + } + if (contentCase_ == ContentOneofCase.RegistrationRequest) { + output.WriteRawTag(18); + output.WriteMessage(RegistrationRequest); + } + if (contentCase_ == ContentOneofCase.IntervalResponse) { + output.WriteRawTag(26); + output.WriteMessage(IntervalResponse); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Id.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Id); + } + if (contentCase_ == ContentOneofCase.RegistrationRequest) { + output.WriteRawTag(18); + output.WriteMessage(RegistrationRequest); + } + if (contentCase_ == ContentOneofCase.IntervalResponse) { + output.WriteRawTag(26); + output.WriteMessage(IntervalResponse); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Id.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Id); + } + if (contentCase_ == ContentOneofCase.RegistrationRequest) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(RegistrationRequest); + } + if (contentCase_ == ContentOneofCase.IntervalResponse) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(IntervalResponse); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(ClientMessage other) { + if (other == null) { + return; + } + if (other.Id.Length != 0) { + Id = other.Id; + } + switch (other.ContentCase) { + case ContentOneofCase.RegistrationRequest: + if (RegistrationRequest == null) { + RegistrationRequest = new global::Nitric.Proto.Schedules.v1.RegistrationRequest(); + } + RegistrationRequest.MergeFrom(other.RegistrationRequest); + break; + case ContentOneofCase.IntervalResponse: + if (IntervalResponse == null) { + IntervalResponse = new global::Nitric.Proto.Schedules.v1.IntervalResponse(); + } + IntervalResponse.MergeFrom(other.IntervalResponse); + break; + } + + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Id = input.ReadString(); + break; + } + case 18: { + global::Nitric.Proto.Schedules.v1.RegistrationRequest subBuilder = new global::Nitric.Proto.Schedules.v1.RegistrationRequest(); + if (contentCase_ == ContentOneofCase.RegistrationRequest) { + subBuilder.MergeFrom(RegistrationRequest); + } + input.ReadMessage(subBuilder); + RegistrationRequest = subBuilder; + break; + } + case 26: { + global::Nitric.Proto.Schedules.v1.IntervalResponse subBuilder = new global::Nitric.Proto.Schedules.v1.IntervalResponse(); + if (contentCase_ == ContentOneofCase.IntervalResponse) { + subBuilder.MergeFrom(IntervalResponse); + } + input.ReadMessage(subBuilder); + IntervalResponse = subBuilder; + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Id = input.ReadString(); + break; + } + case 18: { + global::Nitric.Proto.Schedules.v1.RegistrationRequest subBuilder = new global::Nitric.Proto.Schedules.v1.RegistrationRequest(); + if (contentCase_ == ContentOneofCase.RegistrationRequest) { + subBuilder.MergeFrom(RegistrationRequest); + } + input.ReadMessage(subBuilder); + RegistrationRequest = subBuilder; + break; + } + case 26: { + global::Nitric.Proto.Schedules.v1.IntervalResponse subBuilder = new global::Nitric.Proto.Schedules.v1.IntervalResponse(); + if (contentCase_ == ContentOneofCase.IntervalResponse) { + subBuilder.MergeFrom(IntervalResponse); + } + input.ReadMessage(subBuilder); + IntervalResponse = subBuilder; + break; + } + } + } + } + #endif + + } + + public sealed partial class IntervalRequest : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new IntervalRequest()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Nitric.Proto.Schedules.v1.SchedulesReflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public IntervalRequest() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public IntervalRequest(IntervalRequest other) : this() { + scheduleName_ = other.scheduleName_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public IntervalRequest Clone() { + return new IntervalRequest(this); + } + + /// Field number for the "schedule_name" field. + public const int ScheduleNameFieldNumber = 1; + private string scheduleName_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string ScheduleName { + get { return scheduleName_; } + set { + scheduleName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as IntervalRequest); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(IntervalRequest other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (ScheduleName != other.ScheduleName) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (ScheduleName.Length != 0) hash ^= ScheduleName.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (ScheduleName.Length != 0) { + output.WriteRawTag(10); + output.WriteString(ScheduleName); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (ScheduleName.Length != 0) { + output.WriteRawTag(10); + output.WriteString(ScheduleName); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (ScheduleName.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(ScheduleName); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(IntervalRequest other) { + if (other == null) { + return; + } + if (other.ScheduleName.Length != 0) { + ScheduleName = other.ScheduleName; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + ScheduleName = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + ScheduleName = input.ReadString(); + break; + } + } + } + } + #endif + + } + + /// + /// ServerMessages are sent from the nitric server to the service + /// + public sealed partial class ServerMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ServerMessage()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Nitric.Proto.Schedules.v1.SchedulesReflection.Descriptor.MessageTypes[2]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ServerMessage() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ServerMessage(ServerMessage other) : this() { + id_ = other.id_; + switch (other.ContentCase) { + case ContentOneofCase.RegistrationResponse: + RegistrationResponse = other.RegistrationResponse.Clone(); + break; + case ContentOneofCase.IntervalRequest: + IntervalRequest = other.IntervalRequest.Clone(); + break; + } + + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ServerMessage Clone() { + return new ServerMessage(this); + } + + /// Field number for the "id" field. + public const int IdFieldNumber = 1; + private string id_ = ""; + /// + /// globally unique ID of the request/response pair + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Id { + get { return id_; } + set { + id_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "registration_response" field. + public const int RegistrationResponseFieldNumber = 2; + /// + /// Response to a schedule subscription request + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Nitric.Proto.Schedules.v1.RegistrationResponse RegistrationResponse { + get { return contentCase_ == ContentOneofCase.RegistrationResponse ? (global::Nitric.Proto.Schedules.v1.RegistrationResponse) content_ : null; } + set { + content_ = value; + contentCase_ = value == null ? ContentOneofCase.None : ContentOneofCase.RegistrationResponse; + } + } + + /// Field number for the "interval_request" field. + public const int IntervalRequestFieldNumber = 3; + /// + /// A schedule interval trigger request (i.e. call the callback) + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Nitric.Proto.Schedules.v1.IntervalRequest IntervalRequest { + get { return contentCase_ == ContentOneofCase.IntervalRequest ? (global::Nitric.Proto.Schedules.v1.IntervalRequest) content_ : null; } + set { + content_ = value; + contentCase_ = value == null ? ContentOneofCase.None : ContentOneofCase.IntervalRequest; + } + } + + private object content_; + /// Enum of possible cases for the "content" oneof. + public enum ContentOneofCase { + None = 0, + RegistrationResponse = 2, + IntervalRequest = 3, + } + private ContentOneofCase contentCase_ = ContentOneofCase.None; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ContentOneofCase ContentCase { + get { return contentCase_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void ClearContent() { + contentCase_ = ContentOneofCase.None; + content_ = null; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as ServerMessage); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ServerMessage other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Id != other.Id) return false; + if (!object.Equals(RegistrationResponse, other.RegistrationResponse)) return false; + if (!object.Equals(IntervalRequest, other.IntervalRequest)) return false; + if (ContentCase != other.ContentCase) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Id.Length != 0) hash ^= Id.GetHashCode(); + if (contentCase_ == ContentOneofCase.RegistrationResponse) hash ^= RegistrationResponse.GetHashCode(); + if (contentCase_ == ContentOneofCase.IntervalRequest) hash ^= IntervalRequest.GetHashCode(); + hash ^= (int) contentCase_; + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (Id.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Id); + } + if (contentCase_ == ContentOneofCase.RegistrationResponse) { + output.WriteRawTag(18); + output.WriteMessage(RegistrationResponse); + } + if (contentCase_ == ContentOneofCase.IntervalRequest) { + output.WriteRawTag(26); + output.WriteMessage(IntervalRequest); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Id.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Id); + } + if (contentCase_ == ContentOneofCase.RegistrationResponse) { + output.WriteRawTag(18); + output.WriteMessage(RegistrationResponse); + } + if (contentCase_ == ContentOneofCase.IntervalRequest) { + output.WriteRawTag(26); + output.WriteMessage(IntervalRequest); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Id.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Id); + } + if (contentCase_ == ContentOneofCase.RegistrationResponse) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(RegistrationResponse); + } + if (contentCase_ == ContentOneofCase.IntervalRequest) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(IntervalRequest); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(ServerMessage other) { + if (other == null) { + return; + } + if (other.Id.Length != 0) { + Id = other.Id; + } + switch (other.ContentCase) { + case ContentOneofCase.RegistrationResponse: + if (RegistrationResponse == null) { + RegistrationResponse = new global::Nitric.Proto.Schedules.v1.RegistrationResponse(); + } + RegistrationResponse.MergeFrom(other.RegistrationResponse); + break; + case ContentOneofCase.IntervalRequest: + if (IntervalRequest == null) { + IntervalRequest = new global::Nitric.Proto.Schedules.v1.IntervalRequest(); + } + IntervalRequest.MergeFrom(other.IntervalRequest); + break; + } + + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Id = input.ReadString(); + break; + } + case 18: { + global::Nitric.Proto.Schedules.v1.RegistrationResponse subBuilder = new global::Nitric.Proto.Schedules.v1.RegistrationResponse(); + if (contentCase_ == ContentOneofCase.RegistrationResponse) { + subBuilder.MergeFrom(RegistrationResponse); + } + input.ReadMessage(subBuilder); + RegistrationResponse = subBuilder; + break; + } + case 26: { + global::Nitric.Proto.Schedules.v1.IntervalRequest subBuilder = new global::Nitric.Proto.Schedules.v1.IntervalRequest(); + if (contentCase_ == ContentOneofCase.IntervalRequest) { + subBuilder.MergeFrom(IntervalRequest); + } + input.ReadMessage(subBuilder); + IntervalRequest = subBuilder; + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Id = input.ReadString(); + break; + } + case 18: { + global::Nitric.Proto.Schedules.v1.RegistrationResponse subBuilder = new global::Nitric.Proto.Schedules.v1.RegistrationResponse(); + if (contentCase_ == ContentOneofCase.RegistrationResponse) { + subBuilder.MergeFrom(RegistrationResponse); + } + input.ReadMessage(subBuilder); + RegistrationResponse = subBuilder; + break; + } + case 26: { + global::Nitric.Proto.Schedules.v1.IntervalRequest subBuilder = new global::Nitric.Proto.Schedules.v1.IntervalRequest(); + if (contentCase_ == ContentOneofCase.IntervalRequest) { + subBuilder.MergeFrom(IntervalRequest); + } + input.ReadMessage(subBuilder); + IntervalRequest = subBuilder; + break; + } + } + } + } + #endif + + } + + public sealed partial class RegistrationRequest : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RegistrationRequest()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Nitric.Proto.Schedules.v1.SchedulesReflection.Descriptor.MessageTypes[3]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public RegistrationRequest() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public RegistrationRequest(RegistrationRequest other) : this() { + scheduleName_ = other.scheduleName_; + switch (other.CadenceCase) { + case CadenceOneofCase.Every: + Every = other.Every.Clone(); + break; + case CadenceOneofCase.Cron: + Cron = other.Cron.Clone(); + break; + } + + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public RegistrationRequest Clone() { + return new RegistrationRequest(this); + } + + /// Field number for the "schedule_name" field. + public const int ScheduleNameFieldNumber = 1; + private string scheduleName_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string ScheduleName { + get { return scheduleName_; } + set { + scheduleName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "every" field. + public const int EveryFieldNumber = 10; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Nitric.Proto.Schedules.v1.ScheduleEvery Every { + get { return cadenceCase_ == CadenceOneofCase.Every ? (global::Nitric.Proto.Schedules.v1.ScheduleEvery) cadence_ : null; } + set { + cadence_ = value; + cadenceCase_ = value == null ? CadenceOneofCase.None : CadenceOneofCase.Every; + } + } + + /// Field number for the "cron" field. + public const int CronFieldNumber = 11; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Nitric.Proto.Schedules.v1.ScheduleCron Cron { + get { return cadenceCase_ == CadenceOneofCase.Cron ? (global::Nitric.Proto.Schedules.v1.ScheduleCron) cadence_ : null; } + set { + cadence_ = value; + cadenceCase_ = value == null ? CadenceOneofCase.None : CadenceOneofCase.Cron; + } + } + + private object cadence_; + /// Enum of possible cases for the "cadence" oneof. + public enum CadenceOneofCase { + None = 0, + Every = 10, + Cron = 11, + } + private CadenceOneofCase cadenceCase_ = CadenceOneofCase.None; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CadenceOneofCase CadenceCase { + get { return cadenceCase_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void ClearCadence() { + cadenceCase_ = CadenceOneofCase.None; + cadence_ = null; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as RegistrationRequest); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(RegistrationRequest other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (ScheduleName != other.ScheduleName) return false; + if (!object.Equals(Every, other.Every)) return false; + if (!object.Equals(Cron, other.Cron)) return false; + if (CadenceCase != other.CadenceCase) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (ScheduleName.Length != 0) hash ^= ScheduleName.GetHashCode(); + if (cadenceCase_ == CadenceOneofCase.Every) hash ^= Every.GetHashCode(); + if (cadenceCase_ == CadenceOneofCase.Cron) hash ^= Cron.GetHashCode(); + hash ^= (int) cadenceCase_; + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (ScheduleName.Length != 0) { + output.WriteRawTag(10); + output.WriteString(ScheduleName); + } + if (cadenceCase_ == CadenceOneofCase.Every) { + output.WriteRawTag(82); + output.WriteMessage(Every); + } + if (cadenceCase_ == CadenceOneofCase.Cron) { + output.WriteRawTag(90); + output.WriteMessage(Cron); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (ScheduleName.Length != 0) { + output.WriteRawTag(10); + output.WriteString(ScheduleName); + } + if (cadenceCase_ == CadenceOneofCase.Every) { + output.WriteRawTag(82); + output.WriteMessage(Every); + } + if (cadenceCase_ == CadenceOneofCase.Cron) { + output.WriteRawTag(90); + output.WriteMessage(Cron); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (ScheduleName.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(ScheduleName); + } + if (cadenceCase_ == CadenceOneofCase.Every) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Every); + } + if (cadenceCase_ == CadenceOneofCase.Cron) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Cron); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(RegistrationRequest other) { + if (other == null) { + return; + } + if (other.ScheduleName.Length != 0) { + ScheduleName = other.ScheduleName; + } + switch (other.CadenceCase) { + case CadenceOneofCase.Every: + if (Every == null) { + Every = new global::Nitric.Proto.Schedules.v1.ScheduleEvery(); + } + Every.MergeFrom(other.Every); + break; + case CadenceOneofCase.Cron: + if (Cron == null) { + Cron = new global::Nitric.Proto.Schedules.v1.ScheduleCron(); + } + Cron.MergeFrom(other.Cron); + break; + } + + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + ScheduleName = input.ReadString(); + break; + } + case 82: { + global::Nitric.Proto.Schedules.v1.ScheduleEvery subBuilder = new global::Nitric.Proto.Schedules.v1.ScheduleEvery(); + if (cadenceCase_ == CadenceOneofCase.Every) { + subBuilder.MergeFrom(Every); + } + input.ReadMessage(subBuilder); + Every = subBuilder; + break; + } + case 90: { + global::Nitric.Proto.Schedules.v1.ScheduleCron subBuilder = new global::Nitric.Proto.Schedules.v1.ScheduleCron(); + if (cadenceCase_ == CadenceOneofCase.Cron) { + subBuilder.MergeFrom(Cron); + } + input.ReadMessage(subBuilder); + Cron = subBuilder; + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + ScheduleName = input.ReadString(); + break; + } + case 82: { + global::Nitric.Proto.Schedules.v1.ScheduleEvery subBuilder = new global::Nitric.Proto.Schedules.v1.ScheduleEvery(); + if (cadenceCase_ == CadenceOneofCase.Every) { + subBuilder.MergeFrom(Every); + } + input.ReadMessage(subBuilder); + Every = subBuilder; + break; + } + case 90: { + global::Nitric.Proto.Schedules.v1.ScheduleCron subBuilder = new global::Nitric.Proto.Schedules.v1.ScheduleCron(); + if (cadenceCase_ == CadenceOneofCase.Cron) { + subBuilder.MergeFrom(Cron); + } + input.ReadMessage(subBuilder); + Cron = subBuilder; + break; + } + } + } + } + #endif + + } + + public sealed partial class ScheduleEvery : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ScheduleEvery()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Nitric.Proto.Schedules.v1.SchedulesReflection.Descriptor.MessageTypes[4]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ScheduleEvery() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ScheduleEvery(ScheduleEvery other) : this() { + rate_ = other.rate_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ScheduleEvery Clone() { + return new ScheduleEvery(this); + } + + /// Field number for the "rate" field. + public const int RateFieldNumber = 1; + private string rate_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Rate { + get { return rate_; } + set { + rate_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as ScheduleEvery); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ScheduleEvery other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Rate != other.Rate) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Rate.Length != 0) hash ^= Rate.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (Rate.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Rate); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Rate.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Rate); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Rate.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Rate); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(ScheduleEvery other) { + if (other == null) { + return; + } + if (other.Rate.Length != 0) { + Rate = other.Rate; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Rate = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Rate = input.ReadString(); + break; + } + } + } + } + #endif + + } + + public sealed partial class ScheduleCron : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ScheduleCron()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Nitric.Proto.Schedules.v1.SchedulesReflection.Descriptor.MessageTypes[5]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ScheduleCron() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ScheduleCron(ScheduleCron other) : this() { + expression_ = other.expression_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ScheduleCron Clone() { + return new ScheduleCron(this); + } + + /// Field number for the "expression" field. + public const int ExpressionFieldNumber = 1; + private string expression_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Expression { + get { return expression_; } + set { + expression_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as ScheduleCron); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ScheduleCron other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Expression != other.Expression) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Expression.Length != 0) hash ^= Expression.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (Expression.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Expression); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Expression.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Expression); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Expression.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Expression); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(ScheduleCron other) { + if (other == null) { + return; + } + if (other.Expression.Length != 0) { + Expression = other.Expression; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Expression = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Expression = input.ReadString(); + break; + } + } + } + } + #endif + + } + + public sealed partial class RegistrationResponse : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RegistrationResponse()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Nitric.Proto.Schedules.v1.SchedulesReflection.Descriptor.MessageTypes[6]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public RegistrationResponse() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public RegistrationResponse(RegistrationResponse other) : this() { + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public RegistrationResponse Clone() { + return new RegistrationResponse(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as RegistrationResponse); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(RegistrationResponse other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(RegistrationResponse other) { + if (other == null) { + return; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + } + } + } + #endif + + } + + public sealed partial class IntervalResponse : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new IntervalResponse()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Nitric.Proto.Schedules.v1.SchedulesReflection.Descriptor.MessageTypes[7]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public IntervalResponse() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public IntervalResponse(IntervalResponse other) : this() { + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public IntervalResponse Clone() { + return new IntervalResponse(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as IntervalResponse); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(IntervalResponse other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(IntervalResponse other) { + if (other == null) { + return; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + } + } + } + #endif + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/src/Nitric.Sdk/Proto/nitric/proto/schedules/v1/SchedulesGrpc.cs b/src/Nitric.Sdk/Proto/nitric/proto/schedules/v1/SchedulesGrpc.cs new file mode 100644 index 0000000..a941e6e --- /dev/null +++ b/src/Nitric.Sdk/Proto/nitric/proto/schedules/v1/SchedulesGrpc.cs @@ -0,0 +1,132 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: nitric/proto/schedules/v1/schedules.proto +// +#pragma warning disable 0414, 1591 +#region Designer generated code + +using grpc = global::Grpc.Core; + +namespace Nitric.Proto.Schedules.v1 { + /// + /// Service for scheduling callbacks on a cadence + /// + public static partial class Schedules + { + static readonly string __ServiceName = "nitric.proto.schedules.v1.Schedules"; + + static void __Helper_SerializeMessage(global::Google.Protobuf.IMessage message, grpc::SerializationContext context) + { + #if !GRPC_DISABLE_PROTOBUF_BUFFER_SERIALIZATION + if (message is global::Google.Protobuf.IBufferMessage) + { + context.SetPayloadLength(message.CalculateSize()); + global::Google.Protobuf.MessageExtensions.WriteTo(message, context.GetBufferWriter()); + context.Complete(); + return; + } + #endif + context.Complete(global::Google.Protobuf.MessageExtensions.ToByteArray(message)); + } + + static class __Helper_MessageCache + { + public static readonly bool IsBufferMessage = global::System.Reflection.IntrospectionExtensions.GetTypeInfo(typeof(global::Google.Protobuf.IBufferMessage)).IsAssignableFrom(typeof(T)); + } + + static T __Helper_DeserializeMessage(grpc::DeserializationContext context, global::Google.Protobuf.MessageParser parser) where T : global::Google.Protobuf.IMessage + { + #if !GRPC_DISABLE_PROTOBUF_BUFFER_SERIALIZATION + if (__Helper_MessageCache.IsBufferMessage) + { + return parser.ParseFrom(context.PayloadAsReadOnlySequence()); + } + #endif + return parser.ParseFrom(context.PayloadAsNewBuffer()); + } + + static readonly grpc::Marshaller __Marshaller_nitric_proto_schedules_v1_ClientMessage = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Schedules.v1.ClientMessage.Parser)); + static readonly grpc::Marshaller __Marshaller_nitric_proto_schedules_v1_ServerMessage = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Schedules.v1.ServerMessage.Parser)); + + static readonly grpc::Method __Method_Schedule = new grpc::Method( + grpc::MethodType.DuplexStreaming, + __ServiceName, + "Schedule", + __Marshaller_nitric_proto_schedules_v1_ClientMessage, + __Marshaller_nitric_proto_schedules_v1_ServerMessage); + + /// Service descriptor + public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor + { + get { return global::Nitric.Proto.Schedules.v1.SchedulesReflection.Descriptor.Services[0]; } + } + + /// Base class for server-side implementations of Schedules + [grpc::BindServiceMethod(typeof(Schedules), "BindService")] + public abstract partial class SchedulesBase + { + public virtual global::System.Threading.Tasks.Task Schedule(grpc::IAsyncStreamReader requestStream, grpc::IServerStreamWriter responseStream, grpc::ServerCallContext context) + { + throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); + } + + } + + /// Client for Schedules + public partial class SchedulesClient : grpc::ClientBase + { + /// Creates a new client for Schedules + /// The channel to use to make remote calls. + public SchedulesClient(grpc::ChannelBase channel) : base(channel) + { + } + /// Creates a new client for Schedules that uses a custom CallInvoker. + /// The callInvoker to use to make remote calls. + public SchedulesClient(grpc::CallInvoker callInvoker) : base(callInvoker) + { + } + /// Protected parameterless constructor to allow creation of test doubles. + protected SchedulesClient() : base() + { + } + /// Protected constructor to allow creation of configured clients. + /// The client configuration. + protected SchedulesClient(ClientBaseConfiguration configuration) : base(configuration) + { + } + + public virtual grpc::AsyncDuplexStreamingCall Schedule(grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return Schedule(new grpc::CallOptions(headers, deadline, cancellationToken)); + } + public virtual grpc::AsyncDuplexStreamingCall Schedule(grpc::CallOptions options) + { + return CallInvoker.AsyncDuplexStreamingCall(__Method_Schedule, null, options); + } + /// Creates a new instance of client from given ClientBaseConfiguration. + protected override SchedulesClient NewInstance(ClientBaseConfiguration configuration) + { + return new SchedulesClient(configuration); + } + } + + /// Creates service definition that can be registered with a server + /// An object implementing the server-side handling logic. + public static grpc::ServerServiceDefinition BindService(SchedulesBase serviceImpl) + { + return grpc::ServerServiceDefinition.CreateBuilder() + .AddMethod(__Method_Schedule, serviceImpl.Schedule).Build(); + } + + /// Register service method with a service binder with or without implementation. Useful when customizing the service binding logic. + /// Note: this method is part of an experimental API that can change or be removed without any prior notice. + /// Service methods will be bound by calling AddMethod on this object. + /// An object implementing the server-side handling logic. + public static void BindService(grpc::ServiceBinderBase serviceBinder, SchedulesBase serviceImpl) + { + serviceBinder.AddMethod(__Method_Schedule, serviceImpl == null ? null : new grpc::DuplexStreamingServerMethod(serviceImpl.Schedule)); + } + + } +} +#endregion diff --git a/src/Nitric.Sdk/Proto/proto/secret/v1/Secret.cs b/src/Nitric.Sdk/Proto/nitric/proto/secrets/v1/Secrets.cs similarity index 88% rename from src/Nitric.Sdk/Proto/proto/secret/v1/Secret.cs rename to src/Nitric.Sdk/Proto/nitric/proto/secrets/v1/Secrets.cs index 4f3368d..ca76a39 100644 --- a/src/Nitric.Sdk/Proto/proto/secret/v1/Secret.cs +++ b/src/Nitric.Sdk/Proto/nitric/proto/secrets/v1/Secrets.cs @@ -1,6 +1,6 @@ // // Generated by the protocol buffer compiler. DO NOT EDIT! -// source: proto/secret/v1/secret.proto +// source: nitric/proto/secrets/v1/secrets.proto // #pragma warning disable 1591, 0612, 3021 #region Designer generated code @@ -9,51 +9,51 @@ using pbc = global::Google.Protobuf.Collections; using pbr = global::Google.Protobuf.Reflection; using scg = global::System.Collections.Generic; -namespace Nitric.Proto.Secret.v1 { +namespace Nitric.Proto.Secrets.v1 { - /// Holder for reflection information generated from proto/secret/v1/secret.proto - public static partial class SecretReflection { + /// Holder for reflection information generated from nitric/proto/secrets/v1/secrets.proto + public static partial class SecretsReflection { #region Descriptor - /// File descriptor for proto/secret/v1/secret.proto + /// File descriptor for nitric/proto/secrets/v1/secrets.proto public static pbr::FileDescriptor Descriptor { get { return descriptor; } } private static pbr::FileDescriptor descriptor; - static SecretReflection() { + static SecretsReflection() { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( - "Chxwcm90by9zZWNyZXQvdjEvc2VjcmV0LnByb3RvEhBuaXRyaWMuc2VjcmV0", - "LnYxGhd2YWxpZGF0ZS92YWxpZGF0ZS5wcm90byJVChBTZWNyZXRQdXRSZXF1", - "ZXN0EjIKBnNlY3JldBgBIAEoCzIYLm5pdHJpYy5zZWNyZXQudjEuU2VjcmV0", - "Qgj6QgWKAQIQARINCgV2YWx1ZRgCIAEoDCJMChFTZWNyZXRQdXRSZXNwb25z", - "ZRI3Cg5zZWNyZXRfdmVyc2lvbhgBIAEoCzIfLm5pdHJpYy5zZWNyZXQudjEu", - "U2VjcmV0VmVyc2lvbiJYChNTZWNyZXRBY2Nlc3NSZXF1ZXN0EkEKDnNlY3Jl", - "dF92ZXJzaW9uGAEgASgLMh8ubml0cmljLnNlY3JldC52MS5TZWNyZXRWZXJz", - "aW9uQgj6QgWKAQIQASJzChRTZWNyZXRBY2Nlc3NSZXNwb25zZRJBCg5zZWNy", - "ZXRfdmVyc2lvbhgBIAEoCzIfLm5pdHJpYy5zZWNyZXQudjEuU2VjcmV0VmVy", - "c2lvbkII+kIFigECEAESGAoFdmFsdWUYAiABKAxCCfpCBnoEGMC7ASIWCgZT", - "ZWNyZXQSDAoEbmFtZRgBIAEoCSJdCg1TZWNyZXRWZXJzaW9uEjIKBnNlY3Jl", - "dBgBIAEoCzIYLm5pdHJpYy5zZWNyZXQudjEuU2VjcmV0Qgj6QgWKAQIQARIY", - "Cgd2ZXJzaW9uGAIgASgJQgf6QgRyAhABMrgBCg1TZWNyZXRTZXJ2aWNlEk4K", - "A1B1dBIiLm5pdHJpYy5zZWNyZXQudjEuU2VjcmV0UHV0UmVxdWVzdBojLm5p", - "dHJpYy5zZWNyZXQudjEuU2VjcmV0UHV0UmVzcG9uc2USVwoGQWNjZXNzEiUu", - "bml0cmljLnNlY3JldC52MS5TZWNyZXRBY2Nlc3NSZXF1ZXN0GiYubml0cmlj", - "LnNlY3JldC52MS5TZWNyZXRBY2Nlc3NSZXNwb25zZUKNAQoZaW8ubml0cmlj", - "LnByb3RvLnNlY3JldC52MUIHU2VjcmV0c1ABWjNnaXRodWIuY29tL25pdHJp", - "Y3RlY2gvbml0cmljL2NvcmUvcGtnL2FwaS9uaXRyaWMvdjGqAhZOaXRyaWMu", - "UHJvdG8uU2VjcmV0LnYxygIWTml0cmljXFByb3RvXFNlY3JldFxWMWIGcHJv", - "dG8z")); + "CiVuaXRyaWMvcHJvdG8vc2VjcmV0cy92MS9zZWNyZXRzLnByb3RvEhduaXRy", + "aWMucHJvdG8uc2VjcmV0cy52MSJSChBTZWNyZXRQdXRSZXF1ZXN0Ei8KBnNl", + "Y3JldBgBIAEoCzIfLm5pdHJpYy5wcm90by5zZWNyZXRzLnYxLlNlY3JldBIN", + "CgV2YWx1ZRgCIAEoDCJTChFTZWNyZXRQdXRSZXNwb25zZRI+Cg5zZWNyZXRf", + "dmVyc2lvbhgBIAEoCzImLm5pdHJpYy5wcm90by5zZWNyZXRzLnYxLlNlY3Jl", + "dFZlcnNpb24iVQoTU2VjcmV0QWNjZXNzUmVxdWVzdBI+Cg5zZWNyZXRfdmVy", + "c2lvbhgBIAEoCzImLm5pdHJpYy5wcm90by5zZWNyZXRzLnYxLlNlY3JldFZl", + "cnNpb24iZQoUU2VjcmV0QWNjZXNzUmVzcG9uc2USPgoOc2VjcmV0X3ZlcnNp", + "b24YASABKAsyJi5uaXRyaWMucHJvdG8uc2VjcmV0cy52MS5TZWNyZXRWZXJz", + "aW9uEg0KBXZhbHVlGAIgASgMIhYKBlNlY3JldBIMCgRuYW1lGAEgASgJIlEK", + "DVNlY3JldFZlcnNpb24SLwoGc2VjcmV0GAEgASgLMh8ubml0cmljLnByb3Rv", + "LnNlY3JldHMudjEuU2VjcmV0Eg8KB3ZlcnNpb24YAiABKAky1AEKDVNlY3Jl", + "dE1hbmFnZXISXAoDUHV0Eikubml0cmljLnByb3RvLnNlY3JldHMudjEuU2Vj", + "cmV0UHV0UmVxdWVzdBoqLm5pdHJpYy5wcm90by5zZWNyZXRzLnYxLlNlY3Jl", + "dFB1dFJlc3BvbnNlEmUKBkFjY2VzcxIsLm5pdHJpYy5wcm90by5zZWNyZXRz", + "LnYxLlNlY3JldEFjY2Vzc1JlcXVlc3QaLS5uaXRyaWMucHJvdG8uc2VjcmV0", + "cy52MS5TZWNyZXRBY2Nlc3NSZXNwb25zZUKkAQoaaW8ubml0cmljLnByb3Rv", + "LnNlY3JldHMudjFCDlNlY3JldHNTZXJ2aWNlUAFaQGdpdGh1Yi5jb20vbml0", + "cmljdGVjaC9uaXRyaWMvY29yZS9wa2cvcHJvdG8vc2VjcmV0cy92MTtzZWNy", + "ZXRzcGKqAhdOaXRyaWMuUHJvdG8uU2VjcmV0cy52McoCF05pdHJpY1xQcm90", + "b1xTZWNyZXRzXFYxYgZwcm90bzM=")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, - new pbr::FileDescriptor[] { global::Validate.ValidateReflection.Descriptor, }, + new pbr::FileDescriptor[] { }, new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Secret.v1.SecretPutRequest), global::Nitric.Proto.Secret.v1.SecretPutRequest.Parser, new[]{ "Secret", "Value" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Secret.v1.SecretPutResponse), global::Nitric.Proto.Secret.v1.SecretPutResponse.Parser, new[]{ "SecretVersion" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Secret.v1.SecretAccessRequest), global::Nitric.Proto.Secret.v1.SecretAccessRequest.Parser, new[]{ "SecretVersion" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Secret.v1.SecretAccessResponse), global::Nitric.Proto.Secret.v1.SecretAccessResponse.Parser, new[]{ "SecretVersion", "Value" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Secret.v1.Secret), global::Nitric.Proto.Secret.v1.Secret.Parser, new[]{ "Name" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Secret.v1.SecretVersion), global::Nitric.Proto.Secret.v1.SecretVersion.Parser, new[]{ "Secret", "Version" }, null, null, null, null) + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Secrets.v1.SecretPutRequest), global::Nitric.Proto.Secrets.v1.SecretPutRequest.Parser, new[]{ "Secret", "Value" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Secrets.v1.SecretPutResponse), global::Nitric.Proto.Secrets.v1.SecretPutResponse.Parser, new[]{ "SecretVersion" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Secrets.v1.SecretAccessRequest), global::Nitric.Proto.Secrets.v1.SecretAccessRequest.Parser, new[]{ "SecretVersion" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Secrets.v1.SecretAccessResponse), global::Nitric.Proto.Secrets.v1.SecretAccessResponse.Parser, new[]{ "SecretVersion", "Value" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Secrets.v1.Secret), global::Nitric.Proto.Secrets.v1.Secret.Parser, new[]{ "Name" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Secrets.v1.SecretVersion), global::Nitric.Proto.Secrets.v1.SecretVersion.Parser, new[]{ "Secret", "Version" }, null, null, null, null) })); } #endregion @@ -75,7 +75,7 @@ public sealed partial class SecretPutRequest : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Secret.v1.SecretReflection.Descriptor.MessageTypes[0]; } + get { return global::Nitric.Proto.Secrets.v1.SecretsReflection.Descriptor.MessageTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -104,12 +104,12 @@ public SecretPutRequest Clone() { /// Field number for the "secret" field. public const int SecretFieldNumber = 1; - private global::Nitric.Proto.Secret.v1.Secret secret_; + private global::Nitric.Proto.Secrets.v1.Secret secret_; /// /// The Secret to put to the Secret store /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Secret.v1.Secret Secret { + public global::Nitric.Proto.Secrets.v1.Secret Secret { get { return secret_; } set { secret_ = value; @@ -222,7 +222,7 @@ public void MergeFrom(SecretPutRequest other) { } if (other.secret_ != null) { if (secret_ == null) { - Secret = new global::Nitric.Proto.Secret.v1.Secret(); + Secret = new global::Nitric.Proto.Secrets.v1.Secret(); } Secret.MergeFrom(other.Secret); } @@ -245,7 +245,7 @@ public void MergeFrom(pb::CodedInputStream input) { break; case 10: { if (secret_ == null) { - Secret = new global::Nitric.Proto.Secret.v1.Secret(); + Secret = new global::Nitric.Proto.Secrets.v1.Secret(); } input.ReadMessage(Secret); break; @@ -270,7 +270,7 @@ public void MergeFrom(pb::CodedInputStream input) { break; case 10: { if (secret_ == null) { - Secret = new global::Nitric.Proto.Secret.v1.Secret(); + Secret = new global::Nitric.Proto.Secrets.v1.Secret(); } input.ReadMessage(Secret); break; @@ -301,7 +301,7 @@ public sealed partial class SecretPutResponse : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Secret.v1.SecretReflection.Descriptor.MessageTypes[1]; } + get { return global::Nitric.Proto.Secrets.v1.SecretsReflection.Descriptor.MessageTypes[1]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -329,12 +329,12 @@ public SecretPutResponse Clone() { /// Field number for the "secret_version" field. public const int SecretVersionFieldNumber = 1; - private global::Nitric.Proto.Secret.v1.SecretVersion secretVersion_; + private global::Nitric.Proto.Secrets.v1.SecretVersion secretVersion_; /// /// The id of the secret /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Secret.v1.SecretVersion SecretVersion { + public global::Nitric.Proto.Secrets.v1.SecretVersion SecretVersion { get { return secretVersion_; } set { secretVersion_ = value; @@ -420,7 +420,7 @@ public void MergeFrom(SecretPutResponse other) { } if (other.secretVersion_ != null) { if (secretVersion_ == null) { - SecretVersion = new global::Nitric.Proto.Secret.v1.SecretVersion(); + SecretVersion = new global::Nitric.Proto.Secrets.v1.SecretVersion(); } SecretVersion.MergeFrom(other.SecretVersion); } @@ -440,7 +440,7 @@ public void MergeFrom(pb::CodedInputStream input) { break; case 10: { if (secretVersion_ == null) { - SecretVersion = new global::Nitric.Proto.Secret.v1.SecretVersion(); + SecretVersion = new global::Nitric.Proto.Secrets.v1.SecretVersion(); } input.ReadMessage(SecretVersion); break; @@ -461,7 +461,7 @@ public void MergeFrom(pb::CodedInputStream input) { break; case 10: { if (secretVersion_ == null) { - SecretVersion = new global::Nitric.Proto.Secret.v1.SecretVersion(); + SecretVersion = new global::Nitric.Proto.Secrets.v1.SecretVersion(); } input.ReadMessage(SecretVersion); break; @@ -488,7 +488,7 @@ public sealed partial class SecretAccessRequest : pb::IMessageField number for the "secret_version" field. public const int SecretVersionFieldNumber = 1; - private global::Nitric.Proto.Secret.v1.SecretVersion secretVersion_; + private global::Nitric.Proto.Secrets.v1.SecretVersion secretVersion_; /// /// The id of the secret /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Secret.v1.SecretVersion SecretVersion { + public global::Nitric.Proto.Secrets.v1.SecretVersion SecretVersion { get { return secretVersion_; } set { secretVersion_ = value; @@ -607,7 +607,7 @@ public void MergeFrom(SecretAccessRequest other) { } if (other.secretVersion_ != null) { if (secretVersion_ == null) { - SecretVersion = new global::Nitric.Proto.Secret.v1.SecretVersion(); + SecretVersion = new global::Nitric.Proto.Secrets.v1.SecretVersion(); } SecretVersion.MergeFrom(other.SecretVersion); } @@ -627,7 +627,7 @@ public void MergeFrom(pb::CodedInputStream input) { break; case 10: { if (secretVersion_ == null) { - SecretVersion = new global::Nitric.Proto.Secret.v1.SecretVersion(); + SecretVersion = new global::Nitric.Proto.Secrets.v1.SecretVersion(); } input.ReadMessage(SecretVersion); break; @@ -648,7 +648,7 @@ public void MergeFrom(pb::CodedInputStream input) { break; case 10: { if (secretVersion_ == null) { - SecretVersion = new global::Nitric.Proto.Secret.v1.SecretVersion(); + SecretVersion = new global::Nitric.Proto.Secrets.v1.SecretVersion(); } input.ReadMessage(SecretVersion); break; @@ -675,7 +675,7 @@ public sealed partial class SecretAccessResponse : pb::IMessageField number for the "secret_version" field. public const int SecretVersionFieldNumber = 1; - private global::Nitric.Proto.Secret.v1.SecretVersion secretVersion_; + private global::Nitric.Proto.Secrets.v1.SecretVersion secretVersion_; /// /// The version of the secret that was requested /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Secret.v1.SecretVersion SecretVersion { + public global::Nitric.Proto.Secrets.v1.SecretVersion SecretVersion { get { return secretVersion_; } set { secretVersion_ = value; @@ -822,7 +822,7 @@ public void MergeFrom(SecretAccessResponse other) { } if (other.secretVersion_ != null) { if (secretVersion_ == null) { - SecretVersion = new global::Nitric.Proto.Secret.v1.SecretVersion(); + SecretVersion = new global::Nitric.Proto.Secrets.v1.SecretVersion(); } SecretVersion.MergeFrom(other.SecretVersion); } @@ -845,7 +845,7 @@ public void MergeFrom(pb::CodedInputStream input) { break; case 10: { if (secretVersion_ == null) { - SecretVersion = new global::Nitric.Proto.Secret.v1.SecretVersion(); + SecretVersion = new global::Nitric.Proto.Secrets.v1.SecretVersion(); } input.ReadMessage(SecretVersion); break; @@ -870,7 +870,7 @@ public void MergeFrom(pb::CodedInputStream input) { break; case 10: { if (secretVersion_ == null) { - SecretVersion = new global::Nitric.Proto.Secret.v1.SecretVersion(); + SecretVersion = new global::Nitric.Proto.Secrets.v1.SecretVersion(); } input.ReadMessage(SecretVersion); break; @@ -901,7 +901,7 @@ public sealed partial class Secret : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Secret.v1.SecretReflection.Descriptor.MessageTypes[4]; } + get { return global::Nitric.Proto.Secrets.v1.SecretsReflection.Descriptor.MessageTypes[4]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1079,7 +1079,7 @@ public sealed partial class SecretVersion : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Secret.v1.SecretReflection.Descriptor.MessageTypes[5]; } + get { return global::Nitric.Proto.Secrets.v1.SecretsReflection.Descriptor.MessageTypes[5]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1108,12 +1108,12 @@ public SecretVersion Clone() { /// Field number for the "secret" field. public const int SecretFieldNumber = 1; - private global::Nitric.Proto.Secret.v1.Secret secret_; + private global::Nitric.Proto.Secrets.v1.Secret secret_; /// /// Reference to the secret container /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Secret.v1.Secret Secret { + public global::Nitric.Proto.Secrets.v1.Secret Secret { get { return secret_; } set { secret_ = value; @@ -1226,7 +1226,7 @@ public void MergeFrom(SecretVersion other) { } if (other.secret_ != null) { if (secret_ == null) { - Secret = new global::Nitric.Proto.Secret.v1.Secret(); + Secret = new global::Nitric.Proto.Secrets.v1.Secret(); } Secret.MergeFrom(other.Secret); } @@ -1249,7 +1249,7 @@ public void MergeFrom(pb::CodedInputStream input) { break; case 10: { if (secret_ == null) { - Secret = new global::Nitric.Proto.Secret.v1.Secret(); + Secret = new global::Nitric.Proto.Secrets.v1.Secret(); } input.ReadMessage(Secret); break; @@ -1274,7 +1274,7 @@ public void MergeFrom(pb::CodedInputStream input) { break; case 10: { if (secret_ == null) { - Secret = new global::Nitric.Proto.Secret.v1.Secret(); + Secret = new global::Nitric.Proto.Secrets.v1.Secret(); } input.ReadMessage(Secret); break; diff --git a/src/Nitric.Sdk/Proto/proto/secret/v1/SecretGrpc.cs b/src/Nitric.Sdk/Proto/nitric/proto/secrets/v1/SecretsGrpc.cs similarity index 65% rename from src/Nitric.Sdk/Proto/proto/secret/v1/SecretGrpc.cs rename to src/Nitric.Sdk/Proto/nitric/proto/secrets/v1/SecretsGrpc.cs index 210e5d7..d9d223d 100644 --- a/src/Nitric.Sdk/Proto/proto/secret/v1/SecretGrpc.cs +++ b/src/Nitric.Sdk/Proto/nitric/proto/secrets/v1/SecretsGrpc.cs @@ -1,19 +1,19 @@ // // Generated by the protocol buffer compiler. DO NOT EDIT! -// source: proto/secret/v1/secret.proto +// source: nitric/proto/secrets/v1/secrets.proto // #pragma warning disable 0414, 1591 #region Designer generated code using grpc = global::Grpc.Core; -namespace Nitric.Proto.Secret.v1 { +namespace Nitric.Proto.Secrets.v1 { /// - /// The Nitric Secret Service contract + /// The Nitric Secret Service /// - public static partial class SecretService + public static partial class SecretManager { - static readonly string __ServiceName = "nitric.secret.v1.SecretService"; + static readonly string __ServiceName = "nitric.proto.secrets.v1.SecretManager"; static void __Helper_SerializeMessage(global::Google.Protobuf.IMessage message, grpc::SerializationContext context) { @@ -45,34 +45,34 @@ static T __Helper_DeserializeMessage(grpc::DeserializationContext context, gl return parser.ParseFrom(context.PayloadAsNewBuffer()); } - static readonly grpc::Marshaller __Marshaller_nitric_secret_v1_SecretPutRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Secret.v1.SecretPutRequest.Parser)); - static readonly grpc::Marshaller __Marshaller_nitric_secret_v1_SecretPutResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Secret.v1.SecretPutResponse.Parser)); - static readonly grpc::Marshaller __Marshaller_nitric_secret_v1_SecretAccessRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Secret.v1.SecretAccessRequest.Parser)); - static readonly grpc::Marshaller __Marshaller_nitric_secret_v1_SecretAccessResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Secret.v1.SecretAccessResponse.Parser)); + static readonly grpc::Marshaller __Marshaller_nitric_proto_secrets_v1_SecretPutRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Secrets.v1.SecretPutRequest.Parser)); + static readonly grpc::Marshaller __Marshaller_nitric_proto_secrets_v1_SecretPutResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Secrets.v1.SecretPutResponse.Parser)); + static readonly grpc::Marshaller __Marshaller_nitric_proto_secrets_v1_SecretAccessRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Secrets.v1.SecretAccessRequest.Parser)); + static readonly grpc::Marshaller __Marshaller_nitric_proto_secrets_v1_SecretAccessResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Secrets.v1.SecretAccessResponse.Parser)); - static readonly grpc::Method __Method_Put = new grpc::Method( + static readonly grpc::Method __Method_Put = new grpc::Method( grpc::MethodType.Unary, __ServiceName, "Put", - __Marshaller_nitric_secret_v1_SecretPutRequest, - __Marshaller_nitric_secret_v1_SecretPutResponse); + __Marshaller_nitric_proto_secrets_v1_SecretPutRequest, + __Marshaller_nitric_proto_secrets_v1_SecretPutResponse); - static readonly grpc::Method __Method_Access = new grpc::Method( + static readonly grpc::Method __Method_Access = new grpc::Method( grpc::MethodType.Unary, __ServiceName, "Access", - __Marshaller_nitric_secret_v1_SecretAccessRequest, - __Marshaller_nitric_secret_v1_SecretAccessResponse); + __Marshaller_nitric_proto_secrets_v1_SecretAccessRequest, + __Marshaller_nitric_proto_secrets_v1_SecretAccessResponse); /// Service descriptor public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor { - get { return global::Nitric.Proto.Secret.v1.SecretReflection.Descriptor.Services[0]; } + get { return global::Nitric.Proto.Secrets.v1.SecretsReflection.Descriptor.Services[0]; } } - /// Base class for server-side implementations of SecretService - [grpc::BindServiceMethod(typeof(SecretService), "BindService")] - public abstract partial class SecretServiceBase + /// Base class for server-side implementations of SecretManager + [grpc::BindServiceMethod(typeof(SecretManager), "BindService")] + public abstract partial class SecretManagerBase { /// /// Updates a secret, creating a new one if it doesn't already exist @@ -80,7 +80,7 @@ public abstract partial class SecretServiceBase /// The request received from the client. /// The context of the server-side call handler being invoked. /// The response to send back to the client (wrapped by a task). - public virtual global::System.Threading.Tasks.Task Put(global::Nitric.Proto.Secret.v1.SecretPutRequest request, grpc::ServerCallContext context) + public virtual global::System.Threading.Tasks.Task Put(global::Nitric.Proto.Secrets.v1.SecretPutRequest request, grpc::ServerCallContext context) { throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); } @@ -91,33 +91,33 @@ public abstract partial class SecretServiceBase /// The request received from the client. /// The context of the server-side call handler being invoked. /// The response to send back to the client (wrapped by a task). - public virtual global::System.Threading.Tasks.Task Access(global::Nitric.Proto.Secret.v1.SecretAccessRequest request, grpc::ServerCallContext context) + public virtual global::System.Threading.Tasks.Task Access(global::Nitric.Proto.Secrets.v1.SecretAccessRequest request, grpc::ServerCallContext context) { throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); } } - /// Client for SecretService - public partial class SecretServiceClient : grpc::ClientBase + /// Client for SecretManager + public partial class SecretManagerClient : grpc::ClientBase { - /// Creates a new client for SecretService + /// Creates a new client for SecretManager /// The channel to use to make remote calls. - public SecretServiceClient(grpc::ChannelBase channel) : base(channel) + public SecretManagerClient(grpc::ChannelBase channel) : base(channel) { } - /// Creates a new client for SecretService that uses a custom CallInvoker. + /// Creates a new client for SecretManager that uses a custom CallInvoker. /// The callInvoker to use to make remote calls. - public SecretServiceClient(grpc::CallInvoker callInvoker) : base(callInvoker) + public SecretManagerClient(grpc::CallInvoker callInvoker) : base(callInvoker) { } /// Protected parameterless constructor to allow creation of test doubles. - protected SecretServiceClient() : base() + protected SecretManagerClient() : base() { } /// Protected constructor to allow creation of configured clients. /// The client configuration. - protected SecretServiceClient(ClientBaseConfiguration configuration) : base(configuration) + protected SecretManagerClient(ClientBaseConfiguration configuration) : base(configuration) { } @@ -129,7 +129,7 @@ protected SecretServiceClient(ClientBaseConfiguration configuration) : base(conf /// An optional deadline for the call. The call will be cancelled if deadline is hit. /// An optional token for canceling the call. /// The response received from the server. - public virtual global::Nitric.Proto.Secret.v1.SecretPutResponse Put(global::Nitric.Proto.Secret.v1.SecretPutRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public virtual global::Nitric.Proto.Secrets.v1.SecretPutResponse Put(global::Nitric.Proto.Secrets.v1.SecretPutRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { return Put(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } @@ -139,7 +139,7 @@ protected SecretServiceClient(ClientBaseConfiguration configuration) : base(conf /// The request to send to the server. /// The options for the call. /// The response received from the server. - public virtual global::Nitric.Proto.Secret.v1.SecretPutResponse Put(global::Nitric.Proto.Secret.v1.SecretPutRequest request, grpc::CallOptions options) + public virtual global::Nitric.Proto.Secrets.v1.SecretPutResponse Put(global::Nitric.Proto.Secrets.v1.SecretPutRequest request, grpc::CallOptions options) { return CallInvoker.BlockingUnaryCall(__Method_Put, null, options, request); } @@ -151,7 +151,7 @@ protected SecretServiceClient(ClientBaseConfiguration configuration) : base(conf /// An optional deadline for the call. The call will be cancelled if deadline is hit. /// An optional token for canceling the call. /// The call object. - public virtual grpc::AsyncUnaryCall PutAsync(global::Nitric.Proto.Secret.v1.SecretPutRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public virtual grpc::AsyncUnaryCall PutAsync(global::Nitric.Proto.Secrets.v1.SecretPutRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { return PutAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } @@ -161,7 +161,7 @@ protected SecretServiceClient(ClientBaseConfiguration configuration) : base(conf /// The request to send to the server. /// The options for the call. /// The call object. - public virtual grpc::AsyncUnaryCall PutAsync(global::Nitric.Proto.Secret.v1.SecretPutRequest request, grpc::CallOptions options) + public virtual grpc::AsyncUnaryCall PutAsync(global::Nitric.Proto.Secrets.v1.SecretPutRequest request, grpc::CallOptions options) { return CallInvoker.AsyncUnaryCall(__Method_Put, null, options, request); } @@ -173,7 +173,7 @@ protected SecretServiceClient(ClientBaseConfiguration configuration) : base(conf /// An optional deadline for the call. The call will be cancelled if deadline is hit. /// An optional token for canceling the call. /// The response received from the server. - public virtual global::Nitric.Proto.Secret.v1.SecretAccessResponse Access(global::Nitric.Proto.Secret.v1.SecretAccessRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public virtual global::Nitric.Proto.Secrets.v1.SecretAccessResponse Access(global::Nitric.Proto.Secrets.v1.SecretAccessRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { return Access(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } @@ -183,7 +183,7 @@ protected SecretServiceClient(ClientBaseConfiguration configuration) : base(conf /// The request to send to the server. /// The options for the call. /// The response received from the server. - public virtual global::Nitric.Proto.Secret.v1.SecretAccessResponse Access(global::Nitric.Proto.Secret.v1.SecretAccessRequest request, grpc::CallOptions options) + public virtual global::Nitric.Proto.Secrets.v1.SecretAccessResponse Access(global::Nitric.Proto.Secrets.v1.SecretAccessRequest request, grpc::CallOptions options) { return CallInvoker.BlockingUnaryCall(__Method_Access, null, options, request); } @@ -195,7 +195,7 @@ protected SecretServiceClient(ClientBaseConfiguration configuration) : base(conf /// An optional deadline for the call. The call will be cancelled if deadline is hit. /// An optional token for canceling the call. /// The call object. - public virtual grpc::AsyncUnaryCall AccessAsync(global::Nitric.Proto.Secret.v1.SecretAccessRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public virtual grpc::AsyncUnaryCall AccessAsync(global::Nitric.Proto.Secrets.v1.SecretAccessRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { return AccessAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } @@ -205,20 +205,20 @@ protected SecretServiceClient(ClientBaseConfiguration configuration) : base(conf /// The request to send to the server. /// The options for the call. /// The call object. - public virtual grpc::AsyncUnaryCall AccessAsync(global::Nitric.Proto.Secret.v1.SecretAccessRequest request, grpc::CallOptions options) + public virtual grpc::AsyncUnaryCall AccessAsync(global::Nitric.Proto.Secrets.v1.SecretAccessRequest request, grpc::CallOptions options) { return CallInvoker.AsyncUnaryCall(__Method_Access, null, options, request); } /// Creates a new instance of client from given ClientBaseConfiguration. - protected override SecretServiceClient NewInstance(ClientBaseConfiguration configuration) + protected override SecretManagerClient NewInstance(ClientBaseConfiguration configuration) { - return new SecretServiceClient(configuration); + return new SecretManagerClient(configuration); } } /// Creates service definition that can be registered with a server /// An object implementing the server-side handling logic. - public static grpc::ServerServiceDefinition BindService(SecretServiceBase serviceImpl) + public static grpc::ServerServiceDefinition BindService(SecretManagerBase serviceImpl) { return grpc::ServerServiceDefinition.CreateBuilder() .AddMethod(__Method_Put, serviceImpl.Put) @@ -229,10 +229,10 @@ protected override SecretServiceClient NewInstance(ClientBaseConfiguration confi /// Note: this method is part of an experimental API that can change or be removed without any prior notice. /// Service methods will be bound by calling AddMethod on this object. /// An object implementing the server-side handling logic. - public static void BindService(grpc::ServiceBinderBase serviceBinder, SecretServiceBase serviceImpl) + public static void BindService(grpc::ServiceBinderBase serviceBinder, SecretManagerBase serviceImpl) { - serviceBinder.AddMethod(__Method_Put, serviceImpl == null ? null : new grpc::UnaryServerMethod(serviceImpl.Put)); - serviceBinder.AddMethod(__Method_Access, serviceImpl == null ? null : new grpc::UnaryServerMethod(serviceImpl.Access)); + serviceBinder.AddMethod(__Method_Put, serviceImpl == null ? null : new grpc::UnaryServerMethod(serviceImpl.Put)); + serviceBinder.AddMethod(__Method_Access, serviceImpl == null ? null : new grpc::UnaryServerMethod(serviceImpl.Access)); } } diff --git a/src/Nitric.Sdk/Proto/nitric/proto/sql/v1/Sql.cs b/src/Nitric.Sdk/Proto/nitric/proto/sql/v1/Sql.cs new file mode 100644 index 0000000..4ff8fe3 --- /dev/null +++ b/src/Nitric.Sdk/Proto/nitric/proto/sql/v1/Sql.cs @@ -0,0 +1,402 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: nitric/proto/sql/v1/sql.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Nitric.Proto.Sql.v1 { + + /// Holder for reflection information generated from nitric/proto/sql/v1/sql.proto + public static partial class SqlReflection { + + #region Descriptor + /// File descriptor for nitric/proto/sql/v1/sql.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static SqlReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "Ch1uaXRyaWMvcHJvdG8vc3FsL3YxL3NxbC5wcm90bxITbml0cmljLnByb3Rv", + "LnNxbC52MSIzChpTcWxDb25uZWN0aW9uU3RyaW5nUmVxdWVzdBIVCg1kYXRh", + "YmFzZV9uYW1lGAEgASgJIjgKG1NxbENvbm5lY3Rpb25TdHJpbmdSZXNwb25z", + "ZRIZChFjb25uZWN0aW9uX3N0cmluZxgBIAEoCTJ8CgNTcWwSdQoQQ29ubmVj", + "dGlvblN0cmluZxIvLm5pdHJpYy5wcm90by5zcWwudjEuU3FsQ29ubmVjdGlv", + "blN0cmluZ1JlcXVlc3QaMC5uaXRyaWMucHJvdG8uc3FsLnYxLlNxbENvbm5l", + "Y3Rpb25TdHJpbmdSZXNwb25zZUKMAQoWaW8ubml0cmljLnByb3RvLnNxbC52", + "MUIKU3FsU2VydmljZVABWjhnaXRodWIuY29tL25pdHJpY3RlY2gvbml0cmlj", + "L2NvcmUvcGtnL3Byb3RvL3NxbC92MTtzcWxwYqoCE05pdHJpYy5Qcm90by5T", + "cWwudjHKAhNOaXRyaWNcUHJvdG9cU3FsXFYxYgZwcm90bzM=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Sql.v1.SqlConnectionStringRequest), global::Nitric.Proto.Sql.v1.SqlConnectionStringRequest.Parser, new[]{ "DatabaseName" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Sql.v1.SqlConnectionStringResponse), global::Nitric.Proto.Sql.v1.SqlConnectionStringResponse.Parser, new[]{ "ConnectionString" }, null, null, null, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class SqlConnectionStringRequest : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SqlConnectionStringRequest()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Nitric.Proto.Sql.v1.SqlReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SqlConnectionStringRequest() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SqlConnectionStringRequest(SqlConnectionStringRequest other) : this() { + databaseName_ = other.databaseName_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SqlConnectionStringRequest Clone() { + return new SqlConnectionStringRequest(this); + } + + /// Field number for the "database_name" field. + public const int DatabaseNameFieldNumber = 1; + private string databaseName_ = ""; + /// + /// The name of the database to retrieve the connection string for + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string DatabaseName { + get { return databaseName_; } + set { + databaseName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as SqlConnectionStringRequest); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(SqlConnectionStringRequest other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (DatabaseName != other.DatabaseName) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (DatabaseName.Length != 0) hash ^= DatabaseName.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (DatabaseName.Length != 0) { + output.WriteRawTag(10); + output.WriteString(DatabaseName); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (DatabaseName.Length != 0) { + output.WriteRawTag(10); + output.WriteString(DatabaseName); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (DatabaseName.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(DatabaseName); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(SqlConnectionStringRequest other) { + if (other == null) { + return; + } + if (other.DatabaseName.Length != 0) { + DatabaseName = other.DatabaseName; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + DatabaseName = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + DatabaseName = input.ReadString(); + break; + } + } + } + } + #endif + + } + + public sealed partial class SqlConnectionStringResponse : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SqlConnectionStringResponse()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Nitric.Proto.Sql.v1.SqlReflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SqlConnectionStringResponse() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SqlConnectionStringResponse(SqlConnectionStringResponse other) : this() { + connectionString_ = other.connectionString_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SqlConnectionStringResponse Clone() { + return new SqlConnectionStringResponse(this); + } + + /// Field number for the "connection_string" field. + public const int ConnectionStringFieldNumber = 1; + private string connectionString_ = ""; + /// + /// The connection string for the database + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string ConnectionString { + get { return connectionString_; } + set { + connectionString_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as SqlConnectionStringResponse); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(SqlConnectionStringResponse other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (ConnectionString != other.ConnectionString) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (ConnectionString.Length != 0) hash ^= ConnectionString.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (ConnectionString.Length != 0) { + output.WriteRawTag(10); + output.WriteString(ConnectionString); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (ConnectionString.Length != 0) { + output.WriteRawTag(10); + output.WriteString(ConnectionString); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (ConnectionString.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(ConnectionString); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(SqlConnectionStringResponse other) { + if (other == null) { + return; + } + if (other.ConnectionString.Length != 0) { + ConnectionString = other.ConnectionString; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + ConnectionString = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + ConnectionString = input.ReadString(); + break; + } + } + } + } + #endif + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/src/Nitric.Sdk/Proto/nitric/proto/sql/v1/SqlGrpc.cs b/src/Nitric.Sdk/Proto/nitric/proto/sql/v1/SqlGrpc.cs new file mode 100644 index 0000000..73dc6bb --- /dev/null +++ b/src/Nitric.Sdk/Proto/nitric/proto/sql/v1/SqlGrpc.cs @@ -0,0 +1,174 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: nitric/proto/sql/v1/sql.proto +// +#pragma warning disable 0414, 1591 +#region Designer generated code + +using grpc = global::Grpc.Core; + +namespace Nitric.Proto.Sql.v1 { + /// + /// The Nitric Secret Service + /// + public static partial class Sql + { + static readonly string __ServiceName = "nitric.proto.sql.v1.Sql"; + + static void __Helper_SerializeMessage(global::Google.Protobuf.IMessage message, grpc::SerializationContext context) + { + #if !GRPC_DISABLE_PROTOBUF_BUFFER_SERIALIZATION + if (message is global::Google.Protobuf.IBufferMessage) + { + context.SetPayloadLength(message.CalculateSize()); + global::Google.Protobuf.MessageExtensions.WriteTo(message, context.GetBufferWriter()); + context.Complete(); + return; + } + #endif + context.Complete(global::Google.Protobuf.MessageExtensions.ToByteArray(message)); + } + + static class __Helper_MessageCache + { + public static readonly bool IsBufferMessage = global::System.Reflection.IntrospectionExtensions.GetTypeInfo(typeof(global::Google.Protobuf.IBufferMessage)).IsAssignableFrom(typeof(T)); + } + + static T __Helper_DeserializeMessage(grpc::DeserializationContext context, global::Google.Protobuf.MessageParser parser) where T : global::Google.Protobuf.IMessage + { + #if !GRPC_DISABLE_PROTOBUF_BUFFER_SERIALIZATION + if (__Helper_MessageCache.IsBufferMessage) + { + return parser.ParseFrom(context.PayloadAsReadOnlySequence()); + } + #endif + return parser.ParseFrom(context.PayloadAsNewBuffer()); + } + + static readonly grpc::Marshaller __Marshaller_nitric_proto_sql_v1_SqlConnectionStringRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Sql.v1.SqlConnectionStringRequest.Parser)); + static readonly grpc::Marshaller __Marshaller_nitric_proto_sql_v1_SqlConnectionStringResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Sql.v1.SqlConnectionStringResponse.Parser)); + + static readonly grpc::Method __Method_ConnectionString = new grpc::Method( + grpc::MethodType.Unary, + __ServiceName, + "ConnectionString", + __Marshaller_nitric_proto_sql_v1_SqlConnectionStringRequest, + __Marshaller_nitric_proto_sql_v1_SqlConnectionStringResponse); + + /// Service descriptor + public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor + { + get { return global::Nitric.Proto.Sql.v1.SqlReflection.Descriptor.Services[0]; } + } + + /// Base class for server-side implementations of Sql + [grpc::BindServiceMethod(typeof(Sql), "BindService")] + public abstract partial class SqlBase + { + /// + /// Retrieve the connection string for a given database + /// + /// The request received from the client. + /// The context of the server-side call handler being invoked. + /// The response to send back to the client (wrapped by a task). + public virtual global::System.Threading.Tasks.Task ConnectionString(global::Nitric.Proto.Sql.v1.SqlConnectionStringRequest request, grpc::ServerCallContext context) + { + throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); + } + + } + + /// Client for Sql + public partial class SqlClient : grpc::ClientBase + { + /// Creates a new client for Sql + /// The channel to use to make remote calls. + public SqlClient(grpc::ChannelBase channel) : base(channel) + { + } + /// Creates a new client for Sql that uses a custom CallInvoker. + /// The callInvoker to use to make remote calls. + public SqlClient(grpc::CallInvoker callInvoker) : base(callInvoker) + { + } + /// Protected parameterless constructor to allow creation of test doubles. + protected SqlClient() : base() + { + } + /// Protected constructor to allow creation of configured clients. + /// The client configuration. + protected SqlClient(ClientBaseConfiguration configuration) : base(configuration) + { + } + + /// + /// Retrieve the connection string for a given database + /// + /// The request to send to the server. + /// The initial metadata to send with the call. This parameter is optional. + /// An optional deadline for the call. The call will be cancelled if deadline is hit. + /// An optional token for canceling the call. + /// The response received from the server. + public virtual global::Nitric.Proto.Sql.v1.SqlConnectionStringResponse ConnectionString(global::Nitric.Proto.Sql.v1.SqlConnectionStringRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return ConnectionString(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + /// + /// Retrieve the connection string for a given database + /// + /// The request to send to the server. + /// The options for the call. + /// The response received from the server. + public virtual global::Nitric.Proto.Sql.v1.SqlConnectionStringResponse ConnectionString(global::Nitric.Proto.Sql.v1.SqlConnectionStringRequest request, grpc::CallOptions options) + { + return CallInvoker.BlockingUnaryCall(__Method_ConnectionString, null, options, request); + } + /// + /// Retrieve the connection string for a given database + /// + /// The request to send to the server. + /// The initial metadata to send with the call. This parameter is optional. + /// An optional deadline for the call. The call will be cancelled if deadline is hit. + /// An optional token for canceling the call. + /// The call object. + public virtual grpc::AsyncUnaryCall ConnectionStringAsync(global::Nitric.Proto.Sql.v1.SqlConnectionStringRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return ConnectionStringAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + /// + /// Retrieve the connection string for a given database + /// + /// The request to send to the server. + /// The options for the call. + /// The call object. + public virtual grpc::AsyncUnaryCall ConnectionStringAsync(global::Nitric.Proto.Sql.v1.SqlConnectionStringRequest request, grpc::CallOptions options) + { + return CallInvoker.AsyncUnaryCall(__Method_ConnectionString, null, options, request); + } + /// Creates a new instance of client from given ClientBaseConfiguration. + protected override SqlClient NewInstance(ClientBaseConfiguration configuration) + { + return new SqlClient(configuration); + } + } + + /// Creates service definition that can be registered with a server + /// An object implementing the server-side handling logic. + public static grpc::ServerServiceDefinition BindService(SqlBase serviceImpl) + { + return grpc::ServerServiceDefinition.CreateBuilder() + .AddMethod(__Method_ConnectionString, serviceImpl.ConnectionString).Build(); + } + + /// Register service method with a service binder with or without implementation. Useful when customizing the service binding logic. + /// Note: this method is part of an experimental API that can change or be removed without any prior notice. + /// Service methods will be bound by calling AddMethod on this object. + /// An object implementing the server-side handling logic. + public static void BindService(grpc::ServiceBinderBase serviceBinder, SqlBase serviceImpl) + { + serviceBinder.AddMethod(__Method_ConnectionString, serviceImpl == null ? null : new grpc::UnaryServerMethod(serviceImpl.ConnectionString)); + } + + } +} +#endregion diff --git a/src/Nitric.Sdk/Proto/nitric/proto/storage/v1/Storage.cs b/src/Nitric.Sdk/Proto/nitric/proto/storage/v1/Storage.cs new file mode 100644 index 0000000..6186066 --- /dev/null +++ b/src/Nitric.Sdk/Proto/nitric/proto/storage/v1/Storage.cs @@ -0,0 +1,4385 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: nitric/proto/storage/v1/storage.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Nitric.Proto.Storage.v1 { + + /// Holder for reflection information generated from nitric/proto/storage/v1/storage.proto + public static partial class StorageReflection { + + #region Descriptor + /// File descriptor for nitric/proto/storage/v1/storage.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static StorageReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CiVuaXRyaWMvcHJvdG8vc3RvcmFnZS92MS9zdG9yYWdlLnByb3RvEhduaXRy", + "aWMucHJvdG8uc3RvcmFnZS52MRoeZ29vZ2xlL3Byb3RvYnVmL2R1cmF0aW9u", + "LnByb3RvIr8BCg1DbGllbnRNZXNzYWdlEgoKAmlkGAEgASgJEkwKFHJlZ2lz", + "dHJhdGlvbl9yZXF1ZXN0GAIgASgLMiwubml0cmljLnByb3RvLnN0b3JhZ2Uu", + "djEuUmVnaXN0cmF0aW9uUmVxdWVzdEgAEkkKE2Jsb2JfZXZlbnRfcmVzcG9u", + "c2UYAyABKAsyKi5uaXRyaWMucHJvdG8uc3RvcmFnZS52MS5CbG9iRXZlbnRS", + "ZXNwb25zZUgAQgkKB2NvbnRlbnQivwEKDVNlcnZlck1lc3NhZ2USCgoCaWQY", + "ASABKAkSTgoVcmVnaXN0cmF0aW9uX3Jlc3BvbnNlGAIgASgLMi0ubml0cmlj", + "LnByb3RvLnN0b3JhZ2UudjEuUmVnaXN0cmF0aW9uUmVzcG9uc2VIABJHChJi", + "bG9iX2V2ZW50X3JlcXVlc3QYAyABKAsyKS5uaXRyaWMucHJvdG8uc3RvcmFn", + "ZS52MS5CbG9iRXZlbnRSZXF1ZXN0SABCCQoHY29udGVudCJqChBCbG9iRXZl", + "bnRSZXF1ZXN0EhMKC2J1Y2tldF9uYW1lGAEgASgJEjgKCmJsb2JfZXZlbnQY", + "CiABKAsyIi5uaXRyaWMucHJvdG8uc3RvcmFnZS52MS5CbG9iRXZlbnRIAEIH", + "CgVldmVudCJOCglCbG9iRXZlbnQSCwoDa2V5GAEgASgJEjQKBHR5cGUYAiAB", + "KA4yJi5uaXRyaWMucHJvdG8uc3RvcmFnZS52MS5CbG9iRXZlbnRUeXBlIiQK", + "EUJsb2JFdmVudFJlc3BvbnNlEg8KB3N1Y2Nlc3MYASABKAgihgEKE1JlZ2lz", + "dHJhdGlvblJlcXVlc3QSEwoLYnVja2V0X25hbWUYASABKAkSPwoPYmxvYl9l", + "dmVudF90eXBlGAIgASgOMiYubml0cmljLnByb3RvLnN0b3JhZ2UudjEuQmxv", + "YkV2ZW50VHlwZRIZChFrZXlfcHJlZml4X2ZpbHRlchgDIAEoCSIiChRSZWdp", + "c3RyYXRpb25SZXNwb25zZRIKCgJpZBgBIAEoCSJFChNTdG9yYWdlV3JpdGVS", + "ZXF1ZXN0EhMKC2J1Y2tldF9uYW1lGAEgASgJEgsKA2tleRgCIAEoCRIMCgRi", + "b2R5GAMgASgMIhYKFFN0b3JhZ2VXcml0ZVJlc3BvbnNlIjYKElN0b3JhZ2VS", + "ZWFkUmVxdWVzdBITCgtidWNrZXRfbmFtZRgBIAEoCRILCgNrZXkYAiABKAki", + "IwoTU3RvcmFnZVJlYWRSZXNwb25zZRIMCgRib2R5GAEgASgMIjgKFFN0b3Jh", + "Z2VEZWxldGVSZXF1ZXN0EhMKC2J1Y2tldF9uYW1lGAEgASgJEgsKA2tleRgC", + "IAEoCSIXChVTdG9yYWdlRGVsZXRlUmVzcG9uc2Ui2QEKGFN0b3JhZ2VQcmVT", + "aWduVXJsUmVxdWVzdBITCgtidWNrZXRfbmFtZRgBIAEoCRILCgNrZXkYAiAB", + "KAkSTgoJb3BlcmF0aW9uGAMgASgOMjsubml0cmljLnByb3RvLnN0b3JhZ2Uu", + "djEuU3RvcmFnZVByZVNpZ25VcmxSZXF1ZXN0Lk9wZXJhdGlvbhIpCgZleHBp", + "cnkYBCABKAsyGS5nb29nbGUucHJvdG9idWYuRHVyYXRpb24iIAoJT3BlcmF0", + "aW9uEggKBFJFQUQQABIJCgVXUklURRABIigKGVN0b3JhZ2VQcmVTaWduVXJs", + "UmVzcG9uc2USCwoDdXJsGAEgASgJIj4KF1N0b3JhZ2VMaXN0QmxvYnNSZXF1", + "ZXN0EhMKC2J1Y2tldF9uYW1lGAEgASgJEg4KBnByZWZpeBgCIAEoCSITCgRC", + "bG9iEgsKA2tleRgBIAEoCSJIChhTdG9yYWdlTGlzdEJsb2JzUmVzcG9uc2US", + "LAoFYmxvYnMYASADKAsyHS5uaXRyaWMucHJvdG8uc3RvcmFnZS52MS5CbG9i", + "IjgKFFN0b3JhZ2VFeGlzdHNSZXF1ZXN0EhMKC2J1Y2tldF9uYW1lGAEgASgJ", + "EgsKA2tleRgCIAEoCSInChVTdG9yYWdlRXhpc3RzUmVzcG9uc2USDgoGZXhp", + "c3RzGAEgASgIKikKDUJsb2JFdmVudFR5cGUSCwoHQ3JlYXRlZBAAEgsKB0Rl", + "bGV0ZWQQATKLBQoHU3RvcmFnZRJhCgRSZWFkEisubml0cmljLnByb3RvLnN0", + "b3JhZ2UudjEuU3RvcmFnZVJlYWRSZXF1ZXN0Giwubml0cmljLnByb3RvLnN0", + "b3JhZ2UudjEuU3RvcmFnZVJlYWRSZXNwb25zZRJkCgVXcml0ZRIsLm5pdHJp", + "Yy5wcm90by5zdG9yYWdlLnYxLlN0b3JhZ2VXcml0ZVJlcXVlc3QaLS5uaXRy", + "aWMucHJvdG8uc3RvcmFnZS52MS5TdG9yYWdlV3JpdGVSZXNwb25zZRJnCgZE", + "ZWxldGUSLS5uaXRyaWMucHJvdG8uc3RvcmFnZS52MS5TdG9yYWdlRGVsZXRl", + "UmVxdWVzdBouLm5pdHJpYy5wcm90by5zdG9yYWdlLnYxLlN0b3JhZ2VEZWxl", + "dGVSZXNwb25zZRJzCgpQcmVTaWduVXJsEjEubml0cmljLnByb3RvLnN0b3Jh", + "Z2UudjEuU3RvcmFnZVByZVNpZ25VcmxSZXF1ZXN0GjIubml0cmljLnByb3Rv", + "LnN0b3JhZ2UudjEuU3RvcmFnZVByZVNpZ25VcmxSZXNwb25zZRJwCglMaXN0", + "QmxvYnMSMC5uaXRyaWMucHJvdG8uc3RvcmFnZS52MS5TdG9yYWdlTGlzdEJs", + "b2JzUmVxdWVzdBoxLm5pdHJpYy5wcm90by5zdG9yYWdlLnYxLlN0b3JhZ2VM", + "aXN0QmxvYnNSZXNwb25zZRJnCgZFeGlzdHMSLS5uaXRyaWMucHJvdG8uc3Rv", + "cmFnZS52MS5TdG9yYWdlRXhpc3RzUmVxdWVzdBouLm5pdHJpYy5wcm90by5z", + "dG9yYWdlLnYxLlN0b3JhZ2VFeGlzdHNSZXNwb25zZTJvCg9TdG9yYWdlTGlz", + "dGVuZXISXAoGTGlzdGVuEiYubml0cmljLnByb3RvLnN0b3JhZ2UudjEuQ2xp", + "ZW50TWVzc2FnZRomLm5pdHJpYy5wcm90by5zdG9yYWdlLnYxLlNlcnZlck1l", + "c3NhZ2UoATABQqQBChppby5uaXRyaWMucHJvdG8uc3RvcmFnZS52MUIOU3Rv", + "cmFnZVNlcnZpY2VQAVpAZ2l0aHViLmNvbS9uaXRyaWN0ZWNoL25pdHJpYy9j", + "b3JlL3BrZy9wcm90by9zdG9yYWdlL3YxO3N0b3JhZ2VwYqoCF05pdHJpYy5Q", + "cm90by5TdG9yYWdlLnYxygIXTml0cmljXFByb3RvXFN0b3JhZ2VcVjFiBnBy", + "b3RvMw==")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Google.Protobuf.WellKnownTypes.DurationReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Nitric.Proto.Storage.v1.BlobEventType), }, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Storage.v1.ClientMessage), global::Nitric.Proto.Storage.v1.ClientMessage.Parser, new[]{ "Id", "RegistrationRequest", "BlobEventResponse" }, new[]{ "Content" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Storage.v1.ServerMessage), global::Nitric.Proto.Storage.v1.ServerMessage.Parser, new[]{ "Id", "RegistrationResponse", "BlobEventRequest" }, new[]{ "Content" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Storage.v1.BlobEventRequest), global::Nitric.Proto.Storage.v1.BlobEventRequest.Parser, new[]{ "BucketName", "BlobEvent" }, new[]{ "Event" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Storage.v1.BlobEvent), global::Nitric.Proto.Storage.v1.BlobEvent.Parser, new[]{ "Key", "Type" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Storage.v1.BlobEventResponse), global::Nitric.Proto.Storage.v1.BlobEventResponse.Parser, new[]{ "Success" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Storage.v1.RegistrationRequest), global::Nitric.Proto.Storage.v1.RegistrationRequest.Parser, new[]{ "BucketName", "BlobEventType", "KeyPrefixFilter" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Storage.v1.RegistrationResponse), global::Nitric.Proto.Storage.v1.RegistrationResponse.Parser, new[]{ "Id" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Storage.v1.StorageWriteRequest), global::Nitric.Proto.Storage.v1.StorageWriteRequest.Parser, new[]{ "BucketName", "Key", "Body" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Storage.v1.StorageWriteResponse), global::Nitric.Proto.Storage.v1.StorageWriteResponse.Parser, null, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Storage.v1.StorageReadRequest), global::Nitric.Proto.Storage.v1.StorageReadRequest.Parser, new[]{ "BucketName", "Key" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Storage.v1.StorageReadResponse), global::Nitric.Proto.Storage.v1.StorageReadResponse.Parser, new[]{ "Body" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Storage.v1.StorageDeleteRequest), global::Nitric.Proto.Storage.v1.StorageDeleteRequest.Parser, new[]{ "BucketName", "Key" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Storage.v1.StorageDeleteResponse), global::Nitric.Proto.Storage.v1.StorageDeleteResponse.Parser, null, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Storage.v1.StoragePreSignUrlRequest), global::Nitric.Proto.Storage.v1.StoragePreSignUrlRequest.Parser, new[]{ "BucketName", "Key", "Operation", "Expiry" }, null, new[]{ typeof(global::Nitric.Proto.Storage.v1.StoragePreSignUrlRequest.Types.Operation) }, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Storage.v1.StoragePreSignUrlResponse), global::Nitric.Proto.Storage.v1.StoragePreSignUrlResponse.Parser, new[]{ "Url" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Storage.v1.StorageListBlobsRequest), global::Nitric.Proto.Storage.v1.StorageListBlobsRequest.Parser, new[]{ "BucketName", "Prefix" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Storage.v1.Blob), global::Nitric.Proto.Storage.v1.Blob.Parser, new[]{ "Key" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Storage.v1.StorageListBlobsResponse), global::Nitric.Proto.Storage.v1.StorageListBlobsResponse.Parser, new[]{ "Blobs" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Storage.v1.StorageExistsRequest), global::Nitric.Proto.Storage.v1.StorageExistsRequest.Parser, new[]{ "BucketName", "Key" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Storage.v1.StorageExistsResponse), global::Nitric.Proto.Storage.v1.StorageExistsResponse.Parser, new[]{ "Exists" }, null, null, null, null) + })); + } + #endregion + + } + #region Enums + public enum BlobEventType { + [pbr::OriginalName("Created")] Created = 0, + [pbr::OriginalName("Deleted")] Deleted = 1, + } + + #endregion + + #region Messages + /// + /// ClientMessages are sent from the service to the nitric server + /// + public sealed partial class ClientMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ClientMessage()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Nitric.Proto.Storage.v1.StorageReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ClientMessage() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ClientMessage(ClientMessage other) : this() { + id_ = other.id_; + switch (other.ContentCase) { + case ContentOneofCase.RegistrationRequest: + RegistrationRequest = other.RegistrationRequest.Clone(); + break; + case ContentOneofCase.BlobEventResponse: + BlobEventResponse = other.BlobEventResponse.Clone(); + break; + } + + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ClientMessage Clone() { + return new ClientMessage(this); + } + + /// Field number for the "id" field. + public const int IdFieldNumber = 1; + private string id_ = ""; + /// + /// globally unique ID of the request/response pair + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Id { + get { return id_; } + set { + id_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "registration_request" field. + public const int RegistrationRequestFieldNumber = 2; + /// + /// Watch for changes on a bucket + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Nitric.Proto.Storage.v1.RegistrationRequest RegistrationRequest { + get { return contentCase_ == ContentOneofCase.RegistrationRequest ? (global::Nitric.Proto.Storage.v1.RegistrationRequest) content_ : null; } + set { + content_ = value; + contentCase_ = value == null ? ContentOneofCase.None : ContentOneofCase.RegistrationRequest; + } + } + + /// Field number for the "blob_event_response" field. + public const int BlobEventResponseFieldNumber = 3; + /// + /// Response to a blob event (change to a blob) + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Nitric.Proto.Storage.v1.BlobEventResponse BlobEventResponse { + get { return contentCase_ == ContentOneofCase.BlobEventResponse ? (global::Nitric.Proto.Storage.v1.BlobEventResponse) content_ : null; } + set { + content_ = value; + contentCase_ = value == null ? ContentOneofCase.None : ContentOneofCase.BlobEventResponse; + } + } + + private object content_; + /// Enum of possible cases for the "content" oneof. + public enum ContentOneofCase { + None = 0, + RegistrationRequest = 2, + BlobEventResponse = 3, + } + private ContentOneofCase contentCase_ = ContentOneofCase.None; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ContentOneofCase ContentCase { + get { return contentCase_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void ClearContent() { + contentCase_ = ContentOneofCase.None; + content_ = null; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as ClientMessage); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ClientMessage other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Id != other.Id) return false; + if (!object.Equals(RegistrationRequest, other.RegistrationRequest)) return false; + if (!object.Equals(BlobEventResponse, other.BlobEventResponse)) return false; + if (ContentCase != other.ContentCase) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Id.Length != 0) hash ^= Id.GetHashCode(); + if (contentCase_ == ContentOneofCase.RegistrationRequest) hash ^= RegistrationRequest.GetHashCode(); + if (contentCase_ == ContentOneofCase.BlobEventResponse) hash ^= BlobEventResponse.GetHashCode(); + hash ^= (int) contentCase_; + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (Id.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Id); + } + if (contentCase_ == ContentOneofCase.RegistrationRequest) { + output.WriteRawTag(18); + output.WriteMessage(RegistrationRequest); + } + if (contentCase_ == ContentOneofCase.BlobEventResponse) { + output.WriteRawTag(26); + output.WriteMessage(BlobEventResponse); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Id.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Id); + } + if (contentCase_ == ContentOneofCase.RegistrationRequest) { + output.WriteRawTag(18); + output.WriteMessage(RegistrationRequest); + } + if (contentCase_ == ContentOneofCase.BlobEventResponse) { + output.WriteRawTag(26); + output.WriteMessage(BlobEventResponse); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Id.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Id); + } + if (contentCase_ == ContentOneofCase.RegistrationRequest) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(RegistrationRequest); + } + if (contentCase_ == ContentOneofCase.BlobEventResponse) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(BlobEventResponse); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(ClientMessage other) { + if (other == null) { + return; + } + if (other.Id.Length != 0) { + Id = other.Id; + } + switch (other.ContentCase) { + case ContentOneofCase.RegistrationRequest: + if (RegistrationRequest == null) { + RegistrationRequest = new global::Nitric.Proto.Storage.v1.RegistrationRequest(); + } + RegistrationRequest.MergeFrom(other.RegistrationRequest); + break; + case ContentOneofCase.BlobEventResponse: + if (BlobEventResponse == null) { + BlobEventResponse = new global::Nitric.Proto.Storage.v1.BlobEventResponse(); + } + BlobEventResponse.MergeFrom(other.BlobEventResponse); + break; + } + + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Id = input.ReadString(); + break; + } + case 18: { + global::Nitric.Proto.Storage.v1.RegistrationRequest subBuilder = new global::Nitric.Proto.Storage.v1.RegistrationRequest(); + if (contentCase_ == ContentOneofCase.RegistrationRequest) { + subBuilder.MergeFrom(RegistrationRequest); + } + input.ReadMessage(subBuilder); + RegistrationRequest = subBuilder; + break; + } + case 26: { + global::Nitric.Proto.Storage.v1.BlobEventResponse subBuilder = new global::Nitric.Proto.Storage.v1.BlobEventResponse(); + if (contentCase_ == ContentOneofCase.BlobEventResponse) { + subBuilder.MergeFrom(BlobEventResponse); + } + input.ReadMessage(subBuilder); + BlobEventResponse = subBuilder; + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Id = input.ReadString(); + break; + } + case 18: { + global::Nitric.Proto.Storage.v1.RegistrationRequest subBuilder = new global::Nitric.Proto.Storage.v1.RegistrationRequest(); + if (contentCase_ == ContentOneofCase.RegistrationRequest) { + subBuilder.MergeFrom(RegistrationRequest); + } + input.ReadMessage(subBuilder); + RegistrationRequest = subBuilder; + break; + } + case 26: { + global::Nitric.Proto.Storage.v1.BlobEventResponse subBuilder = new global::Nitric.Proto.Storage.v1.BlobEventResponse(); + if (contentCase_ == ContentOneofCase.BlobEventResponse) { + subBuilder.MergeFrom(BlobEventResponse); + } + input.ReadMessage(subBuilder); + BlobEventResponse = subBuilder; + break; + } + } + } + } + #endif + + } + + /// + /// ServerMessages are sent from the nitric server to the service + /// + public sealed partial class ServerMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ServerMessage()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Nitric.Proto.Storage.v1.StorageReflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ServerMessage() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ServerMessage(ServerMessage other) : this() { + id_ = other.id_; + switch (other.ContentCase) { + case ContentOneofCase.RegistrationResponse: + RegistrationResponse = other.RegistrationResponse.Clone(); + break; + case ContentOneofCase.BlobEventRequest: + BlobEventRequest = other.BlobEventRequest.Clone(); + break; + } + + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ServerMessage Clone() { + return new ServerMessage(this); + } + + /// Field number for the "id" field. + public const int IdFieldNumber = 1; + private string id_ = ""; + /// + /// globally unique ID of the request/response pair + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Id { + get { return id_; } + set { + id_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "registration_response" field. + public const int RegistrationResponseFieldNumber = 2; + /// + /// Watch for changes on a bucket + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Nitric.Proto.Storage.v1.RegistrationResponse RegistrationResponse { + get { return contentCase_ == ContentOneofCase.RegistrationResponse ? (global::Nitric.Proto.Storage.v1.RegistrationResponse) content_ : null; } + set { + content_ = value; + contentCase_ = value == null ? ContentOneofCase.None : ContentOneofCase.RegistrationResponse; + } + } + + /// Field number for the "blob_event_request" field. + public const int BlobEventRequestFieldNumber = 3; + /// + /// Event for a blob in a bucket + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Nitric.Proto.Storage.v1.BlobEventRequest BlobEventRequest { + get { return contentCase_ == ContentOneofCase.BlobEventRequest ? (global::Nitric.Proto.Storage.v1.BlobEventRequest) content_ : null; } + set { + content_ = value; + contentCase_ = value == null ? ContentOneofCase.None : ContentOneofCase.BlobEventRequest; + } + } + + private object content_; + /// Enum of possible cases for the "content" oneof. + public enum ContentOneofCase { + None = 0, + RegistrationResponse = 2, + BlobEventRequest = 3, + } + private ContentOneofCase contentCase_ = ContentOneofCase.None; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ContentOneofCase ContentCase { + get { return contentCase_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void ClearContent() { + contentCase_ = ContentOneofCase.None; + content_ = null; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as ServerMessage); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ServerMessage other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Id != other.Id) return false; + if (!object.Equals(RegistrationResponse, other.RegistrationResponse)) return false; + if (!object.Equals(BlobEventRequest, other.BlobEventRequest)) return false; + if (ContentCase != other.ContentCase) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Id.Length != 0) hash ^= Id.GetHashCode(); + if (contentCase_ == ContentOneofCase.RegistrationResponse) hash ^= RegistrationResponse.GetHashCode(); + if (contentCase_ == ContentOneofCase.BlobEventRequest) hash ^= BlobEventRequest.GetHashCode(); + hash ^= (int) contentCase_; + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (Id.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Id); + } + if (contentCase_ == ContentOneofCase.RegistrationResponse) { + output.WriteRawTag(18); + output.WriteMessage(RegistrationResponse); + } + if (contentCase_ == ContentOneofCase.BlobEventRequest) { + output.WriteRawTag(26); + output.WriteMessage(BlobEventRequest); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Id.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Id); + } + if (contentCase_ == ContentOneofCase.RegistrationResponse) { + output.WriteRawTag(18); + output.WriteMessage(RegistrationResponse); + } + if (contentCase_ == ContentOneofCase.BlobEventRequest) { + output.WriteRawTag(26); + output.WriteMessage(BlobEventRequest); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Id.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Id); + } + if (contentCase_ == ContentOneofCase.RegistrationResponse) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(RegistrationResponse); + } + if (contentCase_ == ContentOneofCase.BlobEventRequest) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(BlobEventRequest); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(ServerMessage other) { + if (other == null) { + return; + } + if (other.Id.Length != 0) { + Id = other.Id; + } + switch (other.ContentCase) { + case ContentOneofCase.RegistrationResponse: + if (RegistrationResponse == null) { + RegistrationResponse = new global::Nitric.Proto.Storage.v1.RegistrationResponse(); + } + RegistrationResponse.MergeFrom(other.RegistrationResponse); + break; + case ContentOneofCase.BlobEventRequest: + if (BlobEventRequest == null) { + BlobEventRequest = new global::Nitric.Proto.Storage.v1.BlobEventRequest(); + } + BlobEventRequest.MergeFrom(other.BlobEventRequest); + break; + } + + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Id = input.ReadString(); + break; + } + case 18: { + global::Nitric.Proto.Storage.v1.RegistrationResponse subBuilder = new global::Nitric.Proto.Storage.v1.RegistrationResponse(); + if (contentCase_ == ContentOneofCase.RegistrationResponse) { + subBuilder.MergeFrom(RegistrationResponse); + } + input.ReadMessage(subBuilder); + RegistrationResponse = subBuilder; + break; + } + case 26: { + global::Nitric.Proto.Storage.v1.BlobEventRequest subBuilder = new global::Nitric.Proto.Storage.v1.BlobEventRequest(); + if (contentCase_ == ContentOneofCase.BlobEventRequest) { + subBuilder.MergeFrom(BlobEventRequest); + } + input.ReadMessage(subBuilder); + BlobEventRequest = subBuilder; + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Id = input.ReadString(); + break; + } + case 18: { + global::Nitric.Proto.Storage.v1.RegistrationResponse subBuilder = new global::Nitric.Proto.Storage.v1.RegistrationResponse(); + if (contentCase_ == ContentOneofCase.RegistrationResponse) { + subBuilder.MergeFrom(RegistrationResponse); + } + input.ReadMessage(subBuilder); + RegistrationResponse = subBuilder; + break; + } + case 26: { + global::Nitric.Proto.Storage.v1.BlobEventRequest subBuilder = new global::Nitric.Proto.Storage.v1.BlobEventRequest(); + if (contentCase_ == ContentOneofCase.BlobEventRequest) { + subBuilder.MergeFrom(BlobEventRequest); + } + input.ReadMessage(subBuilder); + BlobEventRequest = subBuilder; + break; + } + } + } + } + #endif + + } + + public sealed partial class BlobEventRequest : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new BlobEventRequest()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Nitric.Proto.Storage.v1.StorageReflection.Descriptor.MessageTypes[2]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public BlobEventRequest() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public BlobEventRequest(BlobEventRequest other) : this() { + bucketName_ = other.bucketName_; + switch (other.EventCase) { + case EventOneofCase.BlobEvent: + BlobEvent = other.BlobEvent.Clone(); + break; + } + + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public BlobEventRequest Clone() { + return new BlobEventRequest(this); + } + + /// Field number for the "bucket_name" field. + public const int BucketNameFieldNumber = 1; + private string bucketName_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string BucketName { + get { return bucketName_; } + set { + bucketName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "blob_event" field. + public const int BlobEventFieldNumber = 10; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Nitric.Proto.Storage.v1.BlobEvent BlobEvent { + get { return eventCase_ == EventOneofCase.BlobEvent ? (global::Nitric.Proto.Storage.v1.BlobEvent) event_ : null; } + set { + event_ = value; + eventCase_ = value == null ? EventOneofCase.None : EventOneofCase.BlobEvent; + } + } + + private object event_; + /// Enum of possible cases for the "event" oneof. + public enum EventOneofCase { + None = 0, + BlobEvent = 10, + } + private EventOneofCase eventCase_ = EventOneofCase.None; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public EventOneofCase EventCase { + get { return eventCase_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void ClearEvent() { + eventCase_ = EventOneofCase.None; + event_ = null; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as BlobEventRequest); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(BlobEventRequest other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (BucketName != other.BucketName) return false; + if (!object.Equals(BlobEvent, other.BlobEvent)) return false; + if (EventCase != other.EventCase) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (BucketName.Length != 0) hash ^= BucketName.GetHashCode(); + if (eventCase_ == EventOneofCase.BlobEvent) hash ^= BlobEvent.GetHashCode(); + hash ^= (int) eventCase_; + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (BucketName.Length != 0) { + output.WriteRawTag(10); + output.WriteString(BucketName); + } + if (eventCase_ == EventOneofCase.BlobEvent) { + output.WriteRawTag(82); + output.WriteMessage(BlobEvent); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (BucketName.Length != 0) { + output.WriteRawTag(10); + output.WriteString(BucketName); + } + if (eventCase_ == EventOneofCase.BlobEvent) { + output.WriteRawTag(82); + output.WriteMessage(BlobEvent); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (BucketName.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(BucketName); + } + if (eventCase_ == EventOneofCase.BlobEvent) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(BlobEvent); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(BlobEventRequest other) { + if (other == null) { + return; + } + if (other.BucketName.Length != 0) { + BucketName = other.BucketName; + } + switch (other.EventCase) { + case EventOneofCase.BlobEvent: + if (BlobEvent == null) { + BlobEvent = new global::Nitric.Proto.Storage.v1.BlobEvent(); + } + BlobEvent.MergeFrom(other.BlobEvent); + break; + } + + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + BucketName = input.ReadString(); + break; + } + case 82: { + global::Nitric.Proto.Storage.v1.BlobEvent subBuilder = new global::Nitric.Proto.Storage.v1.BlobEvent(); + if (eventCase_ == EventOneofCase.BlobEvent) { + subBuilder.MergeFrom(BlobEvent); + } + input.ReadMessage(subBuilder); + BlobEvent = subBuilder; + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + BucketName = input.ReadString(); + break; + } + case 82: { + global::Nitric.Proto.Storage.v1.BlobEvent subBuilder = new global::Nitric.Proto.Storage.v1.BlobEvent(); + if (eventCase_ == EventOneofCase.BlobEvent) { + subBuilder.MergeFrom(BlobEvent); + } + input.ReadMessage(subBuilder); + BlobEvent = subBuilder; + break; + } + } + } + } + #endif + + } + + public sealed partial class BlobEvent : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new BlobEvent()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Nitric.Proto.Storage.v1.StorageReflection.Descriptor.MessageTypes[3]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public BlobEvent() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public BlobEvent(BlobEvent other) : this() { + key_ = other.key_; + type_ = other.type_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public BlobEvent Clone() { + return new BlobEvent(this); + } + + /// Field number for the "key" field. + public const int KeyFieldNumber = 1; + private string key_ = ""; + /// + /// The key of the blob the event is for + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Key { + get { return key_; } + set { + key_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "type" field. + public const int TypeFieldNumber = 2; + private global::Nitric.Proto.Storage.v1.BlobEventType type_ = global::Nitric.Proto.Storage.v1.BlobEventType.Created; + /// + /// The type of event that occurred + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Nitric.Proto.Storage.v1.BlobEventType Type { + get { return type_; } + set { + type_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as BlobEvent); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(BlobEvent other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Key != other.Key) return false; + if (Type != other.Type) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Key.Length != 0) hash ^= Key.GetHashCode(); + if (Type != global::Nitric.Proto.Storage.v1.BlobEventType.Created) hash ^= Type.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (Key.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Key); + } + if (Type != global::Nitric.Proto.Storage.v1.BlobEventType.Created) { + output.WriteRawTag(16); + output.WriteEnum((int) Type); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Key.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Key); + } + if (Type != global::Nitric.Proto.Storage.v1.BlobEventType.Created) { + output.WriteRawTag(16); + output.WriteEnum((int) Type); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Key.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Key); + } + if (Type != global::Nitric.Proto.Storage.v1.BlobEventType.Created) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Type); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(BlobEvent other) { + if (other == null) { + return; + } + if (other.Key.Length != 0) { + Key = other.Key; + } + if (other.Type != global::Nitric.Proto.Storage.v1.BlobEventType.Created) { + Type = other.Type; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Key = input.ReadString(); + break; + } + case 16: { + Type = (global::Nitric.Proto.Storage.v1.BlobEventType) input.ReadEnum(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Key = input.ReadString(); + break; + } + case 16: { + Type = (global::Nitric.Proto.Storage.v1.BlobEventType) input.ReadEnum(); + break; + } + } + } + } + #endif + + } + + public sealed partial class BlobEventResponse : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new BlobEventResponse()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Nitric.Proto.Storage.v1.StorageReflection.Descriptor.MessageTypes[4]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public BlobEventResponse() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public BlobEventResponse(BlobEventResponse other) : this() { + success_ = other.success_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public BlobEventResponse Clone() { + return new BlobEventResponse(this); + } + + /// Field number for the "success" field. + public const int SuccessFieldNumber = 1; + private bool success_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Success { + get { return success_; } + set { + success_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as BlobEventResponse); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(BlobEventResponse other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Success != other.Success) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Success != false) hash ^= Success.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (Success != false) { + output.WriteRawTag(8); + output.WriteBool(Success); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Success != false) { + output.WriteRawTag(8); + output.WriteBool(Success); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Success != false) { + size += 1 + 1; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(BlobEventResponse other) { + if (other == null) { + return; + } + if (other.Success != false) { + Success = other.Success; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Success = input.ReadBool(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Success = input.ReadBool(); + break; + } + } + } + } + #endif + + } + + public sealed partial class RegistrationRequest : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RegistrationRequest()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Nitric.Proto.Storage.v1.StorageReflection.Descriptor.MessageTypes[5]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public RegistrationRequest() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public RegistrationRequest(RegistrationRequest other) : this() { + bucketName_ = other.bucketName_; + blobEventType_ = other.blobEventType_; + keyPrefixFilter_ = other.keyPrefixFilter_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public RegistrationRequest Clone() { + return new RegistrationRequest(this); + } + + /// Field number for the "bucket_name" field. + public const int BucketNameFieldNumber = 1; + private string bucketName_ = ""; + /// + /// Name of the bucket to watch + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string BucketName { + get { return bucketName_; } + set { + bucketName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "blob_event_type" field. + public const int BlobEventTypeFieldNumber = 2; + private global::Nitric.Proto.Storage.v1.BlobEventType blobEventType_ = global::Nitric.Proto.Storage.v1.BlobEventType.Created; + /// + /// Event type to listen for + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Nitric.Proto.Storage.v1.BlobEventType BlobEventType { + get { return blobEventType_; } + set { + blobEventType_ = value; + } + } + + /// Field number for the "key_prefix_filter" field. + public const int KeyPrefixFilterFieldNumber = 3; + private string keyPrefixFilter_ = ""; + /// + /// A blob key prefix to filter events by + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string KeyPrefixFilter { + get { return keyPrefixFilter_; } + set { + keyPrefixFilter_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as RegistrationRequest); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(RegistrationRequest other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (BucketName != other.BucketName) return false; + if (BlobEventType != other.BlobEventType) return false; + if (KeyPrefixFilter != other.KeyPrefixFilter) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (BucketName.Length != 0) hash ^= BucketName.GetHashCode(); + if (BlobEventType != global::Nitric.Proto.Storage.v1.BlobEventType.Created) hash ^= BlobEventType.GetHashCode(); + if (KeyPrefixFilter.Length != 0) hash ^= KeyPrefixFilter.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (BucketName.Length != 0) { + output.WriteRawTag(10); + output.WriteString(BucketName); + } + if (BlobEventType != global::Nitric.Proto.Storage.v1.BlobEventType.Created) { + output.WriteRawTag(16); + output.WriteEnum((int) BlobEventType); + } + if (KeyPrefixFilter.Length != 0) { + output.WriteRawTag(26); + output.WriteString(KeyPrefixFilter); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (BucketName.Length != 0) { + output.WriteRawTag(10); + output.WriteString(BucketName); + } + if (BlobEventType != global::Nitric.Proto.Storage.v1.BlobEventType.Created) { + output.WriteRawTag(16); + output.WriteEnum((int) BlobEventType); + } + if (KeyPrefixFilter.Length != 0) { + output.WriteRawTag(26); + output.WriteString(KeyPrefixFilter); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (BucketName.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(BucketName); + } + if (BlobEventType != global::Nitric.Proto.Storage.v1.BlobEventType.Created) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) BlobEventType); + } + if (KeyPrefixFilter.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(KeyPrefixFilter); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(RegistrationRequest other) { + if (other == null) { + return; + } + if (other.BucketName.Length != 0) { + BucketName = other.BucketName; + } + if (other.BlobEventType != global::Nitric.Proto.Storage.v1.BlobEventType.Created) { + BlobEventType = other.BlobEventType; + } + if (other.KeyPrefixFilter.Length != 0) { + KeyPrefixFilter = other.KeyPrefixFilter; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + BucketName = input.ReadString(); + break; + } + case 16: { + BlobEventType = (global::Nitric.Proto.Storage.v1.BlobEventType) input.ReadEnum(); + break; + } + case 26: { + KeyPrefixFilter = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + BucketName = input.ReadString(); + break; + } + case 16: { + BlobEventType = (global::Nitric.Proto.Storage.v1.BlobEventType) input.ReadEnum(); + break; + } + case 26: { + KeyPrefixFilter = input.ReadString(); + break; + } + } + } + } + #endif + + } + + public sealed partial class RegistrationResponse : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RegistrationResponse()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Nitric.Proto.Storage.v1.StorageReflection.Descriptor.MessageTypes[6]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public RegistrationResponse() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public RegistrationResponse(RegistrationResponse other) : this() { + id_ = other.id_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public RegistrationResponse Clone() { + return new RegistrationResponse(this); + } + + /// Field number for the "id" field. + public const int IdFieldNumber = 1; + private string id_ = ""; + /// + /// The ID of the registration + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Id { + get { return id_; } + set { + id_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as RegistrationResponse); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(RegistrationResponse other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Id != other.Id) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Id.Length != 0) hash ^= Id.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (Id.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Id); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Id.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Id); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Id.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Id); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(RegistrationResponse other) { + if (other == null) { + return; + } + if (other.Id.Length != 0) { + Id = other.Id; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Id = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Id = input.ReadString(); + break; + } + } + } + } + #endif + + } + + /// + /// Request to put (create/update) a storage item + /// + public sealed partial class StorageWriteRequest : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new StorageWriteRequest()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Nitric.Proto.Storage.v1.StorageReflection.Descriptor.MessageTypes[7]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public StorageWriteRequest() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public StorageWriteRequest(StorageWriteRequest other) : this() { + bucketName_ = other.bucketName_; + key_ = other.key_; + body_ = other.body_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public StorageWriteRequest Clone() { + return new StorageWriteRequest(this); + } + + /// Field number for the "bucket_name" field. + public const int BucketNameFieldNumber = 1; + private string bucketName_ = ""; + /// + /// Nitric name of the bucket to store in + /// this will be automatically resolved to the provider specific bucket identifier. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string BucketName { + get { return bucketName_; } + set { + bucketName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "key" field. + public const int KeyFieldNumber = 2; + private string key_ = ""; + /// + /// Key to store the item under + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Key { + get { return key_; } + set { + key_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "body" field. + public const int BodyFieldNumber = 3; + private pb::ByteString body_ = pb::ByteString.Empty; + /// + /// bytes array to store + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pb::ByteString Body { + get { return body_; } + set { + body_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as StorageWriteRequest); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(StorageWriteRequest other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (BucketName != other.BucketName) return false; + if (Key != other.Key) return false; + if (Body != other.Body) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (BucketName.Length != 0) hash ^= BucketName.GetHashCode(); + if (Key.Length != 0) hash ^= Key.GetHashCode(); + if (Body.Length != 0) hash ^= Body.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (BucketName.Length != 0) { + output.WriteRawTag(10); + output.WriteString(BucketName); + } + if (Key.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Key); + } + if (Body.Length != 0) { + output.WriteRawTag(26); + output.WriteBytes(Body); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (BucketName.Length != 0) { + output.WriteRawTag(10); + output.WriteString(BucketName); + } + if (Key.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Key); + } + if (Body.Length != 0) { + output.WriteRawTag(26); + output.WriteBytes(Body); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (BucketName.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(BucketName); + } + if (Key.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Key); + } + if (Body.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeBytesSize(Body); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(StorageWriteRequest other) { + if (other == null) { + return; + } + if (other.BucketName.Length != 0) { + BucketName = other.BucketName; + } + if (other.Key.Length != 0) { + Key = other.Key; + } + if (other.Body.Length != 0) { + Body = other.Body; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + BucketName = input.ReadString(); + break; + } + case 18: { + Key = input.ReadString(); + break; + } + case 26: { + Body = input.ReadBytes(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + BucketName = input.ReadString(); + break; + } + case 18: { + Key = input.ReadString(); + break; + } + case 26: { + Body = input.ReadBytes(); + break; + } + } + } + } + #endif + + } + + /// + /// Result of putting a storage item + /// + public sealed partial class StorageWriteResponse : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new StorageWriteResponse()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Nitric.Proto.Storage.v1.StorageReflection.Descriptor.MessageTypes[8]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public StorageWriteResponse() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public StorageWriteResponse(StorageWriteResponse other) : this() { + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public StorageWriteResponse Clone() { + return new StorageWriteResponse(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as StorageWriteResponse); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(StorageWriteResponse other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(StorageWriteResponse other) { + if (other == null) { + return; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + } + } + } + #endif + + } + + /// + /// Request to retrieve a storage item + /// + public sealed partial class StorageReadRequest : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new StorageReadRequest()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Nitric.Proto.Storage.v1.StorageReflection.Descriptor.MessageTypes[9]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public StorageReadRequest() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public StorageReadRequest(StorageReadRequest other) : this() { + bucketName_ = other.bucketName_; + key_ = other.key_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public StorageReadRequest Clone() { + return new StorageReadRequest(this); + } + + /// Field number for the "bucket_name" field. + public const int BucketNameFieldNumber = 1; + private string bucketName_ = ""; + /// + /// Nitric name of the bucket to retrieve from + /// this will be automatically resolved to the provider specific bucket identifier. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string BucketName { + get { return bucketName_; } + set { + bucketName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "key" field. + public const int KeyFieldNumber = 2; + private string key_ = ""; + /// + /// Key of item to retrieve + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Key { + get { return key_; } + set { + key_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as StorageReadRequest); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(StorageReadRequest other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (BucketName != other.BucketName) return false; + if (Key != other.Key) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (BucketName.Length != 0) hash ^= BucketName.GetHashCode(); + if (Key.Length != 0) hash ^= Key.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (BucketName.Length != 0) { + output.WriteRawTag(10); + output.WriteString(BucketName); + } + if (Key.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Key); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (BucketName.Length != 0) { + output.WriteRawTag(10); + output.WriteString(BucketName); + } + if (Key.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Key); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (BucketName.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(BucketName); + } + if (Key.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Key); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(StorageReadRequest other) { + if (other == null) { + return; + } + if (other.BucketName.Length != 0) { + BucketName = other.BucketName; + } + if (other.Key.Length != 0) { + Key = other.Key; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + BucketName = input.ReadString(); + break; + } + case 18: { + Key = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + BucketName = input.ReadString(); + break; + } + case 18: { + Key = input.ReadString(); + break; + } + } + } + } + #endif + + } + + /// + /// Returned storage item + /// + public sealed partial class StorageReadResponse : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new StorageReadResponse()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Nitric.Proto.Storage.v1.StorageReflection.Descriptor.MessageTypes[10]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public StorageReadResponse() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public StorageReadResponse(StorageReadResponse other) : this() { + body_ = other.body_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public StorageReadResponse Clone() { + return new StorageReadResponse(this); + } + + /// Field number for the "body" field. + public const int BodyFieldNumber = 1; + private pb::ByteString body_ = pb::ByteString.Empty; + /// + /// The body bytes of the retrieved storage item + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pb::ByteString Body { + get { return body_; } + set { + body_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as StorageReadResponse); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(StorageReadResponse other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Body != other.Body) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Body.Length != 0) hash ^= Body.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (Body.Length != 0) { + output.WriteRawTag(10); + output.WriteBytes(Body); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Body.Length != 0) { + output.WriteRawTag(10); + output.WriteBytes(Body); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Body.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeBytesSize(Body); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(StorageReadResponse other) { + if (other == null) { + return; + } + if (other.Body.Length != 0) { + Body = other.Body; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Body = input.ReadBytes(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Body = input.ReadBytes(); + break; + } + } + } + } + #endif + + } + + /// + /// Request to delete a storage item + /// + public sealed partial class StorageDeleteRequest : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new StorageDeleteRequest()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Nitric.Proto.Storage.v1.StorageReflection.Descriptor.MessageTypes[11]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public StorageDeleteRequest() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public StorageDeleteRequest(StorageDeleteRequest other) : this() { + bucketName_ = other.bucketName_; + key_ = other.key_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public StorageDeleteRequest Clone() { + return new StorageDeleteRequest(this); + } + + /// Field number for the "bucket_name" field. + public const int BucketNameFieldNumber = 1; + private string bucketName_ = ""; + /// + /// Name of the bucket to delete from + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string BucketName { + get { return bucketName_; } + set { + bucketName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "key" field. + public const int KeyFieldNumber = 2; + private string key_ = ""; + /// + /// Key of item to delete + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Key { + get { return key_; } + set { + key_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as StorageDeleteRequest); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(StorageDeleteRequest other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (BucketName != other.BucketName) return false; + if (Key != other.Key) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (BucketName.Length != 0) hash ^= BucketName.GetHashCode(); + if (Key.Length != 0) hash ^= Key.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (BucketName.Length != 0) { + output.WriteRawTag(10); + output.WriteString(BucketName); + } + if (Key.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Key); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (BucketName.Length != 0) { + output.WriteRawTag(10); + output.WriteString(BucketName); + } + if (Key.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Key); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (BucketName.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(BucketName); + } + if (Key.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Key); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(StorageDeleteRequest other) { + if (other == null) { + return; + } + if (other.BucketName.Length != 0) { + BucketName = other.BucketName; + } + if (other.Key.Length != 0) { + Key = other.Key; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + BucketName = input.ReadString(); + break; + } + case 18: { + Key = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + BucketName = input.ReadString(); + break; + } + case 18: { + Key = input.ReadString(); + break; + } + } + } + } + #endif + + } + + /// + /// Result of deleting a storage item + /// + public sealed partial class StorageDeleteResponse : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new StorageDeleteResponse()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Nitric.Proto.Storage.v1.StorageReflection.Descriptor.MessageTypes[12]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public StorageDeleteResponse() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public StorageDeleteResponse(StorageDeleteResponse other) : this() { + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public StorageDeleteResponse Clone() { + return new StorageDeleteResponse(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as StorageDeleteResponse); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(StorageDeleteResponse other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(StorageDeleteResponse other) { + if (other == null) { + return; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + } + } + } + #endif + + } + + /// + /// Request to generate a pre-signed URL for a blob to perform a specific operation, such as read or write. + /// + public sealed partial class StoragePreSignUrlRequest : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new StoragePreSignUrlRequest()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Nitric.Proto.Storage.v1.StorageReflection.Descriptor.MessageTypes[13]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public StoragePreSignUrlRequest() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public StoragePreSignUrlRequest(StoragePreSignUrlRequest other) : this() { + bucketName_ = other.bucketName_; + key_ = other.key_; + operation_ = other.operation_; + expiry_ = other.expiry_ != null ? other.expiry_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public StoragePreSignUrlRequest Clone() { + return new StoragePreSignUrlRequest(this); + } + + /// Field number for the "bucket_name" field. + public const int BucketNameFieldNumber = 1; + private string bucketName_ = ""; + /// + /// Nitric name of the bucket to retrieve from + /// this will be automatically resolved to the provider specific bucket identifier. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string BucketName { + get { return bucketName_; } + set { + bucketName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "key" field. + public const int KeyFieldNumber = 2; + private string key_ = ""; + /// + /// Key of item to generate the signed URL for. + /// The URL and the token it contains will only be valid for operations on this resource specifically. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Key { + get { return key_; } + set { + key_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "operation" field. + public const int OperationFieldNumber = 3; + private global::Nitric.Proto.Storage.v1.StoragePreSignUrlRequest.Types.Operation operation_ = global::Nitric.Proto.Storage.v1.StoragePreSignUrlRequest.Types.Operation.Read; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Nitric.Proto.Storage.v1.StoragePreSignUrlRequest.Types.Operation Operation { + get { return operation_; } + set { + operation_ = value; + } + } + + /// Field number for the "expiry" field. + public const int ExpiryFieldNumber = 4; + private global::Google.Protobuf.WellKnownTypes.Duration expiry_; + /// + /// Expiry defined as as protobuf duration + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Google.Protobuf.WellKnownTypes.Duration Expiry { + get { return expiry_; } + set { + expiry_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as StoragePreSignUrlRequest); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(StoragePreSignUrlRequest other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (BucketName != other.BucketName) return false; + if (Key != other.Key) return false; + if (Operation != other.Operation) return false; + if (!object.Equals(Expiry, other.Expiry)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (BucketName.Length != 0) hash ^= BucketName.GetHashCode(); + if (Key.Length != 0) hash ^= Key.GetHashCode(); + if (Operation != global::Nitric.Proto.Storage.v1.StoragePreSignUrlRequest.Types.Operation.Read) hash ^= Operation.GetHashCode(); + if (expiry_ != null) hash ^= Expiry.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (BucketName.Length != 0) { + output.WriteRawTag(10); + output.WriteString(BucketName); + } + if (Key.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Key); + } + if (Operation != global::Nitric.Proto.Storage.v1.StoragePreSignUrlRequest.Types.Operation.Read) { + output.WriteRawTag(24); + output.WriteEnum((int) Operation); + } + if (expiry_ != null) { + output.WriteRawTag(34); + output.WriteMessage(Expiry); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (BucketName.Length != 0) { + output.WriteRawTag(10); + output.WriteString(BucketName); + } + if (Key.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Key); + } + if (Operation != global::Nitric.Proto.Storage.v1.StoragePreSignUrlRequest.Types.Operation.Read) { + output.WriteRawTag(24); + output.WriteEnum((int) Operation); + } + if (expiry_ != null) { + output.WriteRawTag(34); + output.WriteMessage(Expiry); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (BucketName.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(BucketName); + } + if (Key.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Key); + } + if (Operation != global::Nitric.Proto.Storage.v1.StoragePreSignUrlRequest.Types.Operation.Read) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Operation); + } + if (expiry_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Expiry); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(StoragePreSignUrlRequest other) { + if (other == null) { + return; + } + if (other.BucketName.Length != 0) { + BucketName = other.BucketName; + } + if (other.Key.Length != 0) { + Key = other.Key; + } + if (other.Operation != global::Nitric.Proto.Storage.v1.StoragePreSignUrlRequest.Types.Operation.Read) { + Operation = other.Operation; + } + if (other.expiry_ != null) { + if (expiry_ == null) { + Expiry = new global::Google.Protobuf.WellKnownTypes.Duration(); + } + Expiry.MergeFrom(other.Expiry); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + BucketName = input.ReadString(); + break; + } + case 18: { + Key = input.ReadString(); + break; + } + case 24: { + Operation = (global::Nitric.Proto.Storage.v1.StoragePreSignUrlRequest.Types.Operation) input.ReadEnum(); + break; + } + case 34: { + if (expiry_ == null) { + Expiry = new global::Google.Protobuf.WellKnownTypes.Duration(); + } + input.ReadMessage(Expiry); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + BucketName = input.ReadString(); + break; + } + case 18: { + Key = input.ReadString(); + break; + } + case 24: { + Operation = (global::Nitric.Proto.Storage.v1.StoragePreSignUrlRequest.Types.Operation) input.ReadEnum(); + break; + } + case 34: { + if (expiry_ == null) { + Expiry = new global::Google.Protobuf.WellKnownTypes.Duration(); + } + input.ReadMessage(Expiry); + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the StoragePreSignUrlRequest message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static partial class Types { + /// + /// Operation + /// + public enum Operation { + [pbr::OriginalName("READ")] Read = 0, + [pbr::OriginalName("WRITE")] Write = 1, + } + + } + #endregion + + } + + public sealed partial class StoragePreSignUrlResponse : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new StoragePreSignUrlResponse()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Nitric.Proto.Storage.v1.StorageReflection.Descriptor.MessageTypes[14]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public StoragePreSignUrlResponse() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public StoragePreSignUrlResponse(StoragePreSignUrlResponse other) : this() { + url_ = other.url_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public StoragePreSignUrlResponse Clone() { + return new StoragePreSignUrlResponse(this); + } + + /// Field number for the "url" field. + public const int UrlFieldNumber = 1; + private string url_ = ""; + /// + /// The pre-signed url, restricted to the operation, resource and expiry time specified in the request. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Url { + get { return url_; } + set { + url_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as StoragePreSignUrlResponse); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(StoragePreSignUrlResponse other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Url != other.Url) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Url.Length != 0) hash ^= Url.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (Url.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Url); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Url.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Url); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Url.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Url); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(StoragePreSignUrlResponse other) { + if (other == null) { + return; + } + if (other.Url.Length != 0) { + Url = other.Url; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Url = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Url = input.ReadString(); + break; + } + } + } + } + #endif + + } + + public sealed partial class StorageListBlobsRequest : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new StorageListBlobsRequest()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Nitric.Proto.Storage.v1.StorageReflection.Descriptor.MessageTypes[15]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public StorageListBlobsRequest() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public StorageListBlobsRequest(StorageListBlobsRequest other) : this() { + bucketName_ = other.bucketName_; + prefix_ = other.prefix_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public StorageListBlobsRequest Clone() { + return new StorageListBlobsRequest(this); + } + + /// Field number for the "bucket_name" field. + public const int BucketNameFieldNumber = 1; + private string bucketName_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string BucketName { + get { return bucketName_; } + set { + bucketName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "prefix" field. + public const int PrefixFieldNumber = 2; + private string prefix_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Prefix { + get { return prefix_; } + set { + prefix_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as StorageListBlobsRequest); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(StorageListBlobsRequest other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (BucketName != other.BucketName) return false; + if (Prefix != other.Prefix) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (BucketName.Length != 0) hash ^= BucketName.GetHashCode(); + if (Prefix.Length != 0) hash ^= Prefix.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (BucketName.Length != 0) { + output.WriteRawTag(10); + output.WriteString(BucketName); + } + if (Prefix.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Prefix); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (BucketName.Length != 0) { + output.WriteRawTag(10); + output.WriteString(BucketName); + } + if (Prefix.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Prefix); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (BucketName.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(BucketName); + } + if (Prefix.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Prefix); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(StorageListBlobsRequest other) { + if (other == null) { + return; + } + if (other.BucketName.Length != 0) { + BucketName = other.BucketName; + } + if (other.Prefix.Length != 0) { + Prefix = other.Prefix; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + BucketName = input.ReadString(); + break; + } + case 18: { + Prefix = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + BucketName = input.ReadString(); + break; + } + case 18: { + Prefix = input.ReadString(); + break; + } + } + } + } + #endif + + } + + public sealed partial class Blob : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Blob()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Nitric.Proto.Storage.v1.StorageReflection.Descriptor.MessageTypes[16]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Blob() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Blob(Blob other) : this() { + key_ = other.key_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Blob Clone() { + return new Blob(this); + } + + /// Field number for the "key" field. + public const int KeyFieldNumber = 1; + private string key_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Key { + get { return key_; } + set { + key_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as Blob); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(Blob other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Key != other.Key) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Key.Length != 0) hash ^= Key.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (Key.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Key); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Key.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Key); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Key.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Key); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(Blob other) { + if (other == null) { + return; + } + if (other.Key.Length != 0) { + Key = other.Key; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Key = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Key = input.ReadString(); + break; + } + } + } + } + #endif + + } + + public sealed partial class StorageListBlobsResponse : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new StorageListBlobsResponse()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Nitric.Proto.Storage.v1.StorageReflection.Descriptor.MessageTypes[17]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public StorageListBlobsResponse() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public StorageListBlobsResponse(StorageListBlobsResponse other) : this() { + blobs_ = other.blobs_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public StorageListBlobsResponse Clone() { + return new StorageListBlobsResponse(this); + } + + /// Field number for the "blobs" field. + public const int BlobsFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_blobs_codec + = pb::FieldCodec.ForMessage(10, global::Nitric.Proto.Storage.v1.Blob.Parser); + private readonly pbc::RepeatedField blobs_ = new pbc::RepeatedField(); + /// + /// keys of the blobs in the bucket + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField Blobs { + get { return blobs_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as StorageListBlobsResponse); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(StorageListBlobsResponse other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!blobs_.Equals(other.blobs_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + hash ^= blobs_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + blobs_.WriteTo(output, _repeated_blobs_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + blobs_.WriteTo(ref output, _repeated_blobs_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + size += blobs_.CalculateSize(_repeated_blobs_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(StorageListBlobsResponse other) { + if (other == null) { + return; + } + blobs_.Add(other.blobs_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + blobs_.AddEntriesFrom(input, _repeated_blobs_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + blobs_.AddEntriesFrom(ref input, _repeated_blobs_codec); + break; + } + } + } + } + #endif + + } + + public sealed partial class StorageExistsRequest : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new StorageExistsRequest()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Nitric.Proto.Storage.v1.StorageReflection.Descriptor.MessageTypes[18]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public StorageExistsRequest() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public StorageExistsRequest(StorageExistsRequest other) : this() { + bucketName_ = other.bucketName_; + key_ = other.key_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public StorageExistsRequest Clone() { + return new StorageExistsRequest(this); + } + + /// Field number for the "bucket_name" field. + public const int BucketNameFieldNumber = 1; + private string bucketName_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string BucketName { + get { return bucketName_; } + set { + bucketName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "key" field. + public const int KeyFieldNumber = 2; + private string key_ = ""; + /// + /// Key of item to retrieve + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Key { + get { return key_; } + set { + key_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as StorageExistsRequest); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(StorageExistsRequest other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (BucketName != other.BucketName) return false; + if (Key != other.Key) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (BucketName.Length != 0) hash ^= BucketName.GetHashCode(); + if (Key.Length != 0) hash ^= Key.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (BucketName.Length != 0) { + output.WriteRawTag(10); + output.WriteString(BucketName); + } + if (Key.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Key); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (BucketName.Length != 0) { + output.WriteRawTag(10); + output.WriteString(BucketName); + } + if (Key.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Key); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (BucketName.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(BucketName); + } + if (Key.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Key); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(StorageExistsRequest other) { + if (other == null) { + return; + } + if (other.BucketName.Length != 0) { + BucketName = other.BucketName; + } + if (other.Key.Length != 0) { + Key = other.Key; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + BucketName = input.ReadString(); + break; + } + case 18: { + Key = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + BucketName = input.ReadString(); + break; + } + case 18: { + Key = input.ReadString(); + break; + } + } + } + } + #endif + + } + + public sealed partial class StorageExistsResponse : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new StorageExistsResponse()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Nitric.Proto.Storage.v1.StorageReflection.Descriptor.MessageTypes[19]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public StorageExistsResponse() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public StorageExistsResponse(StorageExistsResponse other) : this() { + exists_ = other.exists_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public StorageExistsResponse Clone() { + return new StorageExistsResponse(this); + } + + /// Field number for the "exists" field. + public const int ExistsFieldNumber = 1; + private bool exists_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Exists { + get { return exists_; } + set { + exists_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as StorageExistsResponse); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(StorageExistsResponse other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Exists != other.Exists) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Exists != false) hash ^= Exists.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (Exists != false) { + output.WriteRawTag(8); + output.WriteBool(Exists); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Exists != false) { + output.WriteRawTag(8); + output.WriteBool(Exists); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Exists != false) { + size += 1 + 1; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(StorageExistsResponse other) { + if (other == null) { + return; + } + if (other.Exists != false) { + Exists = other.Exists; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Exists = input.ReadBool(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Exists = input.ReadBool(); + break; + } + } + } + } + #endif + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/src/Nitric.Sdk/Proto/proto/storage/v1/StorageGrpc.cs b/src/Nitric.Sdk/Proto/nitric/proto/storage/v1/StorageGrpc.cs similarity index 67% rename from src/Nitric.Sdk/Proto/proto/storage/v1/StorageGrpc.cs rename to src/Nitric.Sdk/Proto/nitric/proto/storage/v1/StorageGrpc.cs index 9ea1423..e29700f 100644 --- a/src/Nitric.Sdk/Proto/proto/storage/v1/StorageGrpc.cs +++ b/src/Nitric.Sdk/Proto/nitric/proto/storage/v1/StorageGrpc.cs @@ -1,6 +1,6 @@ // // Generated by the protocol buffer compiler. DO NOT EDIT! -// source: proto/storage/v1/storage.proto +// source: nitric/proto/storage/v1/storage.proto // #pragma warning disable 0414, 1591 #region Designer generated code @@ -9,11 +9,11 @@ namespace Nitric.Proto.Storage.v1 { /// - /// Services for storage and retrieval of files in the form of byte arrays, such as text and binary files. + /// Services for storage and retrieval of blobs in the form of byte arrays, such as text and binary blobs. /// - public static partial class StorageService + public static partial class Storage { - static readonly string __ServiceName = "nitric.storage.v1.StorageService"; + static readonly string __ServiceName = "nitric.proto.storage.v1.Storage"; static void __Helper_SerializeMessage(global::Google.Protobuf.IMessage message, grpc::SerializationContext context) { @@ -45,60 +45,60 @@ static T __Helper_DeserializeMessage(grpc::DeserializationContext context, gl return parser.ParseFrom(context.PayloadAsNewBuffer()); } - static readonly grpc::Marshaller __Marshaller_nitric_storage_v1_StorageReadRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Storage.v1.StorageReadRequest.Parser)); - static readonly grpc::Marshaller __Marshaller_nitric_storage_v1_StorageReadResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Storage.v1.StorageReadResponse.Parser)); - static readonly grpc::Marshaller __Marshaller_nitric_storage_v1_StorageWriteRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Storage.v1.StorageWriteRequest.Parser)); - static readonly grpc::Marshaller __Marshaller_nitric_storage_v1_StorageWriteResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Storage.v1.StorageWriteResponse.Parser)); - static readonly grpc::Marshaller __Marshaller_nitric_storage_v1_StorageDeleteRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Storage.v1.StorageDeleteRequest.Parser)); - static readonly grpc::Marshaller __Marshaller_nitric_storage_v1_StorageDeleteResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Storage.v1.StorageDeleteResponse.Parser)); - static readonly grpc::Marshaller __Marshaller_nitric_storage_v1_StoragePreSignUrlRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Storage.v1.StoragePreSignUrlRequest.Parser)); - static readonly grpc::Marshaller __Marshaller_nitric_storage_v1_StoragePreSignUrlResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Storage.v1.StoragePreSignUrlResponse.Parser)); - static readonly grpc::Marshaller __Marshaller_nitric_storage_v1_StorageListFilesRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Storage.v1.StorageListFilesRequest.Parser)); - static readonly grpc::Marshaller __Marshaller_nitric_storage_v1_StorageListFilesResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Storage.v1.StorageListFilesResponse.Parser)); - static readonly grpc::Marshaller __Marshaller_nitric_storage_v1_StorageExistsRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Storage.v1.StorageExistsRequest.Parser)); - static readonly grpc::Marshaller __Marshaller_nitric_storage_v1_StorageExistsResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Storage.v1.StorageExistsResponse.Parser)); + static readonly grpc::Marshaller __Marshaller_nitric_proto_storage_v1_StorageReadRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Storage.v1.StorageReadRequest.Parser)); + static readonly grpc::Marshaller __Marshaller_nitric_proto_storage_v1_StorageReadResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Storage.v1.StorageReadResponse.Parser)); + static readonly grpc::Marshaller __Marshaller_nitric_proto_storage_v1_StorageWriteRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Storage.v1.StorageWriteRequest.Parser)); + static readonly grpc::Marshaller __Marshaller_nitric_proto_storage_v1_StorageWriteResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Storage.v1.StorageWriteResponse.Parser)); + static readonly grpc::Marshaller __Marshaller_nitric_proto_storage_v1_StorageDeleteRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Storage.v1.StorageDeleteRequest.Parser)); + static readonly grpc::Marshaller __Marshaller_nitric_proto_storage_v1_StorageDeleteResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Storage.v1.StorageDeleteResponse.Parser)); + static readonly grpc::Marshaller __Marshaller_nitric_proto_storage_v1_StoragePreSignUrlRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Storage.v1.StoragePreSignUrlRequest.Parser)); + static readonly grpc::Marshaller __Marshaller_nitric_proto_storage_v1_StoragePreSignUrlResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Storage.v1.StoragePreSignUrlResponse.Parser)); + static readonly grpc::Marshaller __Marshaller_nitric_proto_storage_v1_StorageListBlobsRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Storage.v1.StorageListBlobsRequest.Parser)); + static readonly grpc::Marshaller __Marshaller_nitric_proto_storage_v1_StorageListBlobsResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Storage.v1.StorageListBlobsResponse.Parser)); + static readonly grpc::Marshaller __Marshaller_nitric_proto_storage_v1_StorageExistsRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Storage.v1.StorageExistsRequest.Parser)); + static readonly grpc::Marshaller __Marshaller_nitric_proto_storage_v1_StorageExistsResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Storage.v1.StorageExistsResponse.Parser)); static readonly grpc::Method __Method_Read = new grpc::Method( grpc::MethodType.Unary, __ServiceName, "Read", - __Marshaller_nitric_storage_v1_StorageReadRequest, - __Marshaller_nitric_storage_v1_StorageReadResponse); + __Marshaller_nitric_proto_storage_v1_StorageReadRequest, + __Marshaller_nitric_proto_storage_v1_StorageReadResponse); static readonly grpc::Method __Method_Write = new grpc::Method( grpc::MethodType.Unary, __ServiceName, "Write", - __Marshaller_nitric_storage_v1_StorageWriteRequest, - __Marshaller_nitric_storage_v1_StorageWriteResponse); + __Marshaller_nitric_proto_storage_v1_StorageWriteRequest, + __Marshaller_nitric_proto_storage_v1_StorageWriteResponse); static readonly grpc::Method __Method_Delete = new grpc::Method( grpc::MethodType.Unary, __ServiceName, "Delete", - __Marshaller_nitric_storage_v1_StorageDeleteRequest, - __Marshaller_nitric_storage_v1_StorageDeleteResponse); + __Marshaller_nitric_proto_storage_v1_StorageDeleteRequest, + __Marshaller_nitric_proto_storage_v1_StorageDeleteResponse); static readonly grpc::Method __Method_PreSignUrl = new grpc::Method( grpc::MethodType.Unary, __ServiceName, "PreSignUrl", - __Marshaller_nitric_storage_v1_StoragePreSignUrlRequest, - __Marshaller_nitric_storage_v1_StoragePreSignUrlResponse); + __Marshaller_nitric_proto_storage_v1_StoragePreSignUrlRequest, + __Marshaller_nitric_proto_storage_v1_StoragePreSignUrlResponse); - static readonly grpc::Method __Method_ListFiles = new grpc::Method( + static readonly grpc::Method __Method_ListBlobs = new grpc::Method( grpc::MethodType.Unary, __ServiceName, - "ListFiles", - __Marshaller_nitric_storage_v1_StorageListFilesRequest, - __Marshaller_nitric_storage_v1_StorageListFilesResponse); + "ListBlobs", + __Marshaller_nitric_proto_storage_v1_StorageListBlobsRequest, + __Marshaller_nitric_proto_storage_v1_StorageListBlobsResponse); static readonly grpc::Method __Method_Exists = new grpc::Method( grpc::MethodType.Unary, __ServiceName, "Exists", - __Marshaller_nitric_storage_v1_StorageExistsRequest, - __Marshaller_nitric_storage_v1_StorageExistsResponse); + __Marshaller_nitric_proto_storage_v1_StorageExistsRequest, + __Marshaller_nitric_proto_storage_v1_StorageExistsResponse); /// Service descriptor public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor @@ -106,9 +106,9 @@ static T __Helper_DeserializeMessage(grpc::DeserializationContext context, gl get { return global::Nitric.Proto.Storage.v1.StorageReflection.Descriptor.Services[0]; } } - /// Base class for server-side implementations of StorageService - [grpc::BindServiceMethod(typeof(StorageService), "BindService")] - public abstract partial class StorageServiceBase + /// Base class for server-side implementations of Storage + [grpc::BindServiceMethod(typeof(Storage), "BindService")] + public abstract partial class StorageBase { /// /// Retrieve an item from a bucket @@ -155,12 +155,12 @@ public abstract partial class StorageServiceBase } /// - /// List files currently in the bucket + /// List blobs currently in the bucket /// /// The request received from the client. /// The context of the server-side call handler being invoked. /// The response to send back to the client (wrapped by a task). - public virtual global::System.Threading.Tasks.Task ListFiles(global::Nitric.Proto.Storage.v1.StorageListFilesRequest request, grpc::ServerCallContext context) + public virtual global::System.Threading.Tasks.Task ListBlobs(global::Nitric.Proto.Storage.v1.StorageListBlobsRequest request, grpc::ServerCallContext context) { throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); } @@ -178,26 +178,26 @@ public abstract partial class StorageServiceBase } - /// Client for StorageService - public partial class StorageServiceClient : grpc::ClientBase + /// Client for Storage + public partial class StorageClient : grpc::ClientBase { - /// Creates a new client for StorageService + /// Creates a new client for Storage /// The channel to use to make remote calls. - public StorageServiceClient(grpc::ChannelBase channel) : base(channel) + public StorageClient(grpc::ChannelBase channel) : base(channel) { } - /// Creates a new client for StorageService that uses a custom CallInvoker. + /// Creates a new client for Storage that uses a custom CallInvoker. /// The callInvoker to use to make remote calls. - public StorageServiceClient(grpc::CallInvoker callInvoker) : base(callInvoker) + public StorageClient(grpc::CallInvoker callInvoker) : base(callInvoker) { } /// Protected parameterless constructor to allow creation of test doubles. - protected StorageServiceClient() : base() + protected StorageClient() : base() { } /// Protected constructor to allow creation of configured clients. /// The client configuration. - protected StorageServiceClient(ClientBaseConfiguration configuration) : base(configuration) + protected StorageClient(ClientBaseConfiguration configuration) : base(configuration) { } @@ -378,48 +378,48 @@ protected StorageServiceClient(ClientBaseConfiguration configuration) : base(con return CallInvoker.AsyncUnaryCall(__Method_PreSignUrl, null, options, request); } /// - /// List files currently in the bucket + /// List blobs currently in the bucket /// /// The request to send to the server. /// The initial metadata to send with the call. This parameter is optional. /// An optional deadline for the call. The call will be cancelled if deadline is hit. /// An optional token for canceling the call. /// The response received from the server. - public virtual global::Nitric.Proto.Storage.v1.StorageListFilesResponse ListFiles(global::Nitric.Proto.Storage.v1.StorageListFilesRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public virtual global::Nitric.Proto.Storage.v1.StorageListBlobsResponse ListBlobs(global::Nitric.Proto.Storage.v1.StorageListBlobsRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { - return ListFiles(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + return ListBlobs(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// - /// List files currently in the bucket + /// List blobs currently in the bucket /// /// The request to send to the server. /// The options for the call. /// The response received from the server. - public virtual global::Nitric.Proto.Storage.v1.StorageListFilesResponse ListFiles(global::Nitric.Proto.Storage.v1.StorageListFilesRequest request, grpc::CallOptions options) + public virtual global::Nitric.Proto.Storage.v1.StorageListBlobsResponse ListBlobs(global::Nitric.Proto.Storage.v1.StorageListBlobsRequest request, grpc::CallOptions options) { - return CallInvoker.BlockingUnaryCall(__Method_ListFiles, null, options, request); + return CallInvoker.BlockingUnaryCall(__Method_ListBlobs, null, options, request); } /// - /// List files currently in the bucket + /// List blobs currently in the bucket /// /// The request to send to the server. /// The initial metadata to send with the call. This parameter is optional. /// An optional deadline for the call. The call will be cancelled if deadline is hit. /// An optional token for canceling the call. /// The call object. - public virtual grpc::AsyncUnaryCall ListFilesAsync(global::Nitric.Proto.Storage.v1.StorageListFilesRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public virtual grpc::AsyncUnaryCall ListBlobsAsync(global::Nitric.Proto.Storage.v1.StorageListBlobsRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { - return ListFilesAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + return ListBlobsAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// - /// List files currently in the bucket + /// List blobs currently in the bucket /// /// The request to send to the server. /// The options for the call. /// The call object. - public virtual grpc::AsyncUnaryCall ListFilesAsync(global::Nitric.Proto.Storage.v1.StorageListFilesRequest request, grpc::CallOptions options) + public virtual grpc::AsyncUnaryCall ListBlobsAsync(global::Nitric.Proto.Storage.v1.StorageListBlobsRequest request, grpc::CallOptions options) { - return CallInvoker.AsyncUnaryCall(__Method_ListFiles, null, options, request); + return CallInvoker.AsyncUnaryCall(__Method_ListBlobs, null, options, request); } /// /// Determine is an object exists in a bucket @@ -466,22 +466,22 @@ protected StorageServiceClient(ClientBaseConfiguration configuration) : base(con return CallInvoker.AsyncUnaryCall(__Method_Exists, null, options, request); } /// Creates a new instance of client from given ClientBaseConfiguration. - protected override StorageServiceClient NewInstance(ClientBaseConfiguration configuration) + protected override StorageClient NewInstance(ClientBaseConfiguration configuration) { - return new StorageServiceClient(configuration); + return new StorageClient(configuration); } } /// Creates service definition that can be registered with a server /// An object implementing the server-side handling logic. - public static grpc::ServerServiceDefinition BindService(StorageServiceBase serviceImpl) + public static grpc::ServerServiceDefinition BindService(StorageBase serviceImpl) { return grpc::ServerServiceDefinition.CreateBuilder() .AddMethod(__Method_Read, serviceImpl.Read) .AddMethod(__Method_Write, serviceImpl.Write) .AddMethod(__Method_Delete, serviceImpl.Delete) .AddMethod(__Method_PreSignUrl, serviceImpl.PreSignUrl) - .AddMethod(__Method_ListFiles, serviceImpl.ListFiles) + .AddMethod(__Method_ListBlobs, serviceImpl.ListBlobs) .AddMethod(__Method_Exists, serviceImpl.Exists).Build(); } @@ -489,16 +489,152 @@ protected override StorageServiceClient NewInstance(ClientBaseConfiguration conf /// Note: this method is part of an experimental API that can change or be removed without any prior notice. /// Service methods will be bound by calling AddMethod on this object. /// An object implementing the server-side handling logic. - public static void BindService(grpc::ServiceBinderBase serviceBinder, StorageServiceBase serviceImpl) + public static void BindService(grpc::ServiceBinderBase serviceBinder, StorageBase serviceImpl) { serviceBinder.AddMethod(__Method_Read, serviceImpl == null ? null : new grpc::UnaryServerMethod(serviceImpl.Read)); serviceBinder.AddMethod(__Method_Write, serviceImpl == null ? null : new grpc::UnaryServerMethod(serviceImpl.Write)); serviceBinder.AddMethod(__Method_Delete, serviceImpl == null ? null : new grpc::UnaryServerMethod(serviceImpl.Delete)); serviceBinder.AddMethod(__Method_PreSignUrl, serviceImpl == null ? null : new grpc::UnaryServerMethod(serviceImpl.PreSignUrl)); - serviceBinder.AddMethod(__Method_ListFiles, serviceImpl == null ? null : new grpc::UnaryServerMethod(serviceImpl.ListFiles)); + serviceBinder.AddMethod(__Method_ListBlobs, serviceImpl == null ? null : new grpc::UnaryServerMethod(serviceImpl.ListBlobs)); serviceBinder.AddMethod(__Method_Exists, serviceImpl == null ? null : new grpc::UnaryServerMethod(serviceImpl.Exists)); } } + public static partial class StorageListener + { + static readonly string __ServiceName = "nitric.proto.storage.v1.StorageListener"; + + static void __Helper_SerializeMessage(global::Google.Protobuf.IMessage message, grpc::SerializationContext context) + { + #if !GRPC_DISABLE_PROTOBUF_BUFFER_SERIALIZATION + if (message is global::Google.Protobuf.IBufferMessage) + { + context.SetPayloadLength(message.CalculateSize()); + global::Google.Protobuf.MessageExtensions.WriteTo(message, context.GetBufferWriter()); + context.Complete(); + return; + } + #endif + context.Complete(global::Google.Protobuf.MessageExtensions.ToByteArray(message)); + } + + static class __Helper_MessageCache + { + public static readonly bool IsBufferMessage = global::System.Reflection.IntrospectionExtensions.GetTypeInfo(typeof(global::Google.Protobuf.IBufferMessage)).IsAssignableFrom(typeof(T)); + } + + static T __Helper_DeserializeMessage(grpc::DeserializationContext context, global::Google.Protobuf.MessageParser parser) where T : global::Google.Protobuf.IMessage + { + #if !GRPC_DISABLE_PROTOBUF_BUFFER_SERIALIZATION + if (__Helper_MessageCache.IsBufferMessage) + { + return parser.ParseFrom(context.PayloadAsReadOnlySequence()); + } + #endif + return parser.ParseFrom(context.PayloadAsNewBuffer()); + } + + static readonly grpc::Marshaller __Marshaller_nitric_proto_storage_v1_ClientMessage = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Storage.v1.ClientMessage.Parser)); + static readonly grpc::Marshaller __Marshaller_nitric_proto_storage_v1_ServerMessage = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Storage.v1.ServerMessage.Parser)); + + static readonly grpc::Method __Method_Listen = new grpc::Method( + grpc::MethodType.DuplexStreaming, + __ServiceName, + "Listen", + __Marshaller_nitric_proto_storage_v1_ClientMessage, + __Marshaller_nitric_proto_storage_v1_ServerMessage); + + /// Service descriptor + public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor + { + get { return global::Nitric.Proto.Storage.v1.StorageReflection.Descriptor.Services[1]; } + } + + /// Base class for server-side implementations of StorageListener + [grpc::BindServiceMethod(typeof(StorageListener), "BindService")] + public abstract partial class StorageListenerBase + { + /// + /// Listen for changes on a bucket + /// + /// Used for reading requests from the client. + /// Used for sending responses back to the client. + /// The context of the server-side call handler being invoked. + /// A task indicating completion of the handler. + public virtual global::System.Threading.Tasks.Task Listen(grpc::IAsyncStreamReader requestStream, grpc::IServerStreamWriter responseStream, grpc::ServerCallContext context) + { + throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); + } + + } + + /// Client for StorageListener + public partial class StorageListenerClient : grpc::ClientBase + { + /// Creates a new client for StorageListener + /// The channel to use to make remote calls. + public StorageListenerClient(grpc::ChannelBase channel) : base(channel) + { + } + /// Creates a new client for StorageListener that uses a custom CallInvoker. + /// The callInvoker to use to make remote calls. + public StorageListenerClient(grpc::CallInvoker callInvoker) : base(callInvoker) + { + } + /// Protected parameterless constructor to allow creation of test doubles. + protected StorageListenerClient() : base() + { + } + /// Protected constructor to allow creation of configured clients. + /// The client configuration. + protected StorageListenerClient(ClientBaseConfiguration configuration) : base(configuration) + { + } + + /// + /// Listen for changes on a bucket + /// + /// The initial metadata to send with the call. This parameter is optional. + /// An optional deadline for the call. The call will be cancelled if deadline is hit. + /// An optional token for canceling the call. + /// The call object. + public virtual grpc::AsyncDuplexStreamingCall Listen(grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return Listen(new grpc::CallOptions(headers, deadline, cancellationToken)); + } + /// + /// Listen for changes on a bucket + /// + /// The options for the call. + /// The call object. + public virtual grpc::AsyncDuplexStreamingCall Listen(grpc::CallOptions options) + { + return CallInvoker.AsyncDuplexStreamingCall(__Method_Listen, null, options); + } + /// Creates a new instance of client from given ClientBaseConfiguration. + protected override StorageListenerClient NewInstance(ClientBaseConfiguration configuration) + { + return new StorageListenerClient(configuration); + } + } + + /// Creates service definition that can be registered with a server + /// An object implementing the server-side handling logic. + public static grpc::ServerServiceDefinition BindService(StorageListenerBase serviceImpl) + { + return grpc::ServerServiceDefinition.CreateBuilder() + .AddMethod(__Method_Listen, serviceImpl.Listen).Build(); + } + + /// Register service method with a service binder with or without implementation. Useful when customizing the service binding logic. + /// Note: this method is part of an experimental API that can change or be removed without any prior notice. + /// Service methods will be bound by calling AddMethod on this object. + /// An object implementing the server-side handling logic. + public static void BindService(grpc::ServiceBinderBase serviceBinder, StorageListenerBase serviceImpl) + { + serviceBinder.AddMethod(__Method_Listen, serviceImpl == null ? null : new grpc::DuplexStreamingServerMethod(serviceImpl.Listen)); + } + + } } #endregion diff --git a/src/Nitric.Sdk/Proto/nitric/proto/topics/v1/Topics.cs b/src/Nitric.Sdk/Proto/nitric/proto/topics/v1/Topics.cs new file mode 100644 index 0000000..0f00cf4 --- /dev/null +++ b/src/Nitric.Sdk/Proto/nitric/proto/topics/v1/Topics.cs @@ -0,0 +1,2031 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: nitric/proto/topics/v1/topics.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Nitric.Proto.Topics.v1 { + + /// Holder for reflection information generated from nitric/proto/topics/v1/topics.proto + public static partial class TopicsReflection { + + #region Descriptor + /// File descriptor for nitric/proto/topics/v1/topics.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static TopicsReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CiNuaXRyaWMvcHJvdG8vdG9waWNzL3YxL3RvcGljcy5wcm90bxIWbml0cmlj", + "LnByb3RvLnRvcGljcy52MRoeZ29vZ2xlL3Byb3RvYnVmL2R1cmF0aW9uLnBy", + "b3RvGhxnb29nbGUvcHJvdG9idWYvc3RydWN0LnByb3RvIrgBCg1DbGllbnRN", + "ZXNzYWdlEgoKAmlkGAEgASgJEksKFHJlZ2lzdHJhdGlvbl9yZXF1ZXN0GAIg", + "ASgLMisubml0cmljLnByb3RvLnRvcGljcy52MS5SZWdpc3RyYXRpb25SZXF1", + "ZXN0SAASQwoQbWVzc2FnZV9yZXNwb25zZRgDIAEoCzInLm5pdHJpYy5wcm90", + "by50b3BpY3MudjEuTWVzc2FnZVJlc3BvbnNlSABCCQoHY29udGVudCJbCg5N", + "ZXNzYWdlUmVxdWVzdBISCgp0b3BpY19uYW1lGAEgASgJEjUKB21lc3NhZ2UY", + "AiABKAsyJC5uaXRyaWMucHJvdG8udG9waWNzLnYxLlRvcGljTWVzc2FnZSIi", + "Cg9NZXNzYWdlUmVzcG9uc2USDwoHc3VjY2VzcxgBIAEoCCK4AQoNU2VydmVy", + "TWVzc2FnZRIKCgJpZBgBIAEoCRJNChVyZWdpc3RyYXRpb25fcmVzcG9uc2UY", + "AiABKAsyLC5uaXRyaWMucHJvdG8udG9waWNzLnYxLlJlZ2lzdHJhdGlvblJl", + "c3BvbnNlSAASQQoPbWVzc2FnZV9yZXF1ZXN0GAMgASgLMiYubml0cmljLnBy", + "b3RvLnRvcGljcy52MS5NZXNzYWdlUmVxdWVzdEgAQgkKB2NvbnRlbnQiKQoT", + "UmVnaXN0cmF0aW9uUmVxdWVzdBISCgp0b3BpY19uYW1lGAEgASgJIhYKFFJl", + "Z2lzdHJhdGlvblJlc3BvbnNlIkwKDFRvcGljTWVzc2FnZRIxCg5zdHJ1Y3Rf", + "cGF5bG9hZBgBIAEoCzIXLmdvb2dsZS5wcm90b2J1Zi5TdHJ1Y3RIAEIJCgdj", + "b250ZW50IooBChNUb3BpY1B1Ymxpc2hSZXF1ZXN0EhIKCnRvcGljX25hbWUY", + "ASABKAkSNQoHbWVzc2FnZRgCIAEoCzIkLm5pdHJpYy5wcm90by50b3BpY3Mu", + "djEuVG9waWNNZXNzYWdlEigKBWRlbGF5GAMgASgLMhkuZ29vZ2xlLnByb3Rv", + "YnVmLkR1cmF0aW9uIhYKFFRvcGljUHVibGlzaFJlc3BvbnNlMm4KBlRvcGlj", + "cxJkCgdQdWJsaXNoEisubml0cmljLnByb3RvLnRvcGljcy52MS5Ub3BpY1B1", + "Ymxpc2hSZXF1ZXN0Giwubml0cmljLnByb3RvLnRvcGljcy52MS5Ub3BpY1B1", + "Ymxpc2hSZXNwb25zZTJrCgpTdWJzY3JpYmVyEl0KCVN1YnNjcmliZRIlLm5p", + "dHJpYy5wcm90by50b3BpY3MudjEuQ2xpZW50TWVzc2FnZRolLm5pdHJpYy5w", + "cm90by50b3BpY3MudjEuU2VydmVyTWVzc2FnZSgBMAFCngEKGWlvLm5pdHJp", + "Yy5wcm90by50b3BpY3MudjFCDVRvcGljc1NlcnZpY2VQAVo+Z2l0aHViLmNv", + "bS9uaXRyaWN0ZWNoL25pdHJpYy9jb3JlL3BrZy9wcm90by90b3BpY3MvdjE7", + "dG9waWNzcGKqAhZOaXRyaWMuUHJvdG8uVG9waWNzLnYxygIWTml0cmljXFBy", + "b3RvXFRvcGljc1xWMWIGcHJvdG8z")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Google.Protobuf.WellKnownTypes.DurationReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.StructReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Topics.v1.ClientMessage), global::Nitric.Proto.Topics.v1.ClientMessage.Parser, new[]{ "Id", "RegistrationRequest", "MessageResponse" }, new[]{ "Content" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Topics.v1.MessageRequest), global::Nitric.Proto.Topics.v1.MessageRequest.Parser, new[]{ "TopicName", "Message" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Topics.v1.MessageResponse), global::Nitric.Proto.Topics.v1.MessageResponse.Parser, new[]{ "Success" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Topics.v1.ServerMessage), global::Nitric.Proto.Topics.v1.ServerMessage.Parser, new[]{ "Id", "RegistrationResponse", "MessageRequest" }, new[]{ "Content" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Topics.v1.RegistrationRequest), global::Nitric.Proto.Topics.v1.RegistrationRequest.Parser, new[]{ "TopicName" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Topics.v1.RegistrationResponse), global::Nitric.Proto.Topics.v1.RegistrationResponse.Parser, null, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Topics.v1.TopicMessage), global::Nitric.Proto.Topics.v1.TopicMessage.Parser, new[]{ "StructPayload" }, new[]{ "Content" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Topics.v1.TopicPublishRequest), global::Nitric.Proto.Topics.v1.TopicPublishRequest.Parser, new[]{ "TopicName", "Message", "Delay" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Topics.v1.TopicPublishResponse), global::Nitric.Proto.Topics.v1.TopicPublishResponse.Parser, null, null, null, null, null) + })); + } + #endregion + + } + #region Messages + /// + /// ClientMessage is the message sent from the service to the nitric server + /// + public sealed partial class ClientMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ClientMessage()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Nitric.Proto.Topics.v1.TopicsReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ClientMessage() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ClientMessage(ClientMessage other) : this() { + id_ = other.id_; + switch (other.ContentCase) { + case ContentOneofCase.RegistrationRequest: + RegistrationRequest = other.RegistrationRequest.Clone(); + break; + case ContentOneofCase.MessageResponse: + MessageResponse = other.MessageResponse.Clone(); + break; + } + + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ClientMessage Clone() { + return new ClientMessage(this); + } + + /// Field number for the "id" field. + public const int IdFieldNumber = 1; + private string id_ = ""; + /// + /// globally unique ID of the request/response pair + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Id { + get { return id_; } + set { + id_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "registration_request" field. + public const int RegistrationRequestFieldNumber = 2; + /// + /// Register a subscription to a topic + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Nitric.Proto.Topics.v1.RegistrationRequest RegistrationRequest { + get { return contentCase_ == ContentOneofCase.RegistrationRequest ? (global::Nitric.Proto.Topics.v1.RegistrationRequest) content_ : null; } + set { + content_ = value; + contentCase_ = value == null ? ContentOneofCase.None : ContentOneofCase.RegistrationRequest; + } + } + + /// Field number for the "message_response" field. + public const int MessageResponseFieldNumber = 3; + /// + /// Handle a message received from a topic + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Nitric.Proto.Topics.v1.MessageResponse MessageResponse { + get { return contentCase_ == ContentOneofCase.MessageResponse ? (global::Nitric.Proto.Topics.v1.MessageResponse) content_ : null; } + set { + content_ = value; + contentCase_ = value == null ? ContentOneofCase.None : ContentOneofCase.MessageResponse; + } + } + + private object content_; + /// Enum of possible cases for the "content" oneof. + public enum ContentOneofCase { + None = 0, + RegistrationRequest = 2, + MessageResponse = 3, + } + private ContentOneofCase contentCase_ = ContentOneofCase.None; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ContentOneofCase ContentCase { + get { return contentCase_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void ClearContent() { + contentCase_ = ContentOneofCase.None; + content_ = null; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as ClientMessage); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ClientMessage other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Id != other.Id) return false; + if (!object.Equals(RegistrationRequest, other.RegistrationRequest)) return false; + if (!object.Equals(MessageResponse, other.MessageResponse)) return false; + if (ContentCase != other.ContentCase) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Id.Length != 0) hash ^= Id.GetHashCode(); + if (contentCase_ == ContentOneofCase.RegistrationRequest) hash ^= RegistrationRequest.GetHashCode(); + if (contentCase_ == ContentOneofCase.MessageResponse) hash ^= MessageResponse.GetHashCode(); + hash ^= (int) contentCase_; + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (Id.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Id); + } + if (contentCase_ == ContentOneofCase.RegistrationRequest) { + output.WriteRawTag(18); + output.WriteMessage(RegistrationRequest); + } + if (contentCase_ == ContentOneofCase.MessageResponse) { + output.WriteRawTag(26); + output.WriteMessage(MessageResponse); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Id.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Id); + } + if (contentCase_ == ContentOneofCase.RegistrationRequest) { + output.WriteRawTag(18); + output.WriteMessage(RegistrationRequest); + } + if (contentCase_ == ContentOneofCase.MessageResponse) { + output.WriteRawTag(26); + output.WriteMessage(MessageResponse); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Id.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Id); + } + if (contentCase_ == ContentOneofCase.RegistrationRequest) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(RegistrationRequest); + } + if (contentCase_ == ContentOneofCase.MessageResponse) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(MessageResponse); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(ClientMessage other) { + if (other == null) { + return; + } + if (other.Id.Length != 0) { + Id = other.Id; + } + switch (other.ContentCase) { + case ContentOneofCase.RegistrationRequest: + if (RegistrationRequest == null) { + RegistrationRequest = new global::Nitric.Proto.Topics.v1.RegistrationRequest(); + } + RegistrationRequest.MergeFrom(other.RegistrationRequest); + break; + case ContentOneofCase.MessageResponse: + if (MessageResponse == null) { + MessageResponse = new global::Nitric.Proto.Topics.v1.MessageResponse(); + } + MessageResponse.MergeFrom(other.MessageResponse); + break; + } + + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Id = input.ReadString(); + break; + } + case 18: { + global::Nitric.Proto.Topics.v1.RegistrationRequest subBuilder = new global::Nitric.Proto.Topics.v1.RegistrationRequest(); + if (contentCase_ == ContentOneofCase.RegistrationRequest) { + subBuilder.MergeFrom(RegistrationRequest); + } + input.ReadMessage(subBuilder); + RegistrationRequest = subBuilder; + break; + } + case 26: { + global::Nitric.Proto.Topics.v1.MessageResponse subBuilder = new global::Nitric.Proto.Topics.v1.MessageResponse(); + if (contentCase_ == ContentOneofCase.MessageResponse) { + subBuilder.MergeFrom(MessageResponse); + } + input.ReadMessage(subBuilder); + MessageResponse = subBuilder; + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Id = input.ReadString(); + break; + } + case 18: { + global::Nitric.Proto.Topics.v1.RegistrationRequest subBuilder = new global::Nitric.Proto.Topics.v1.RegistrationRequest(); + if (contentCase_ == ContentOneofCase.RegistrationRequest) { + subBuilder.MergeFrom(RegistrationRequest); + } + input.ReadMessage(subBuilder); + RegistrationRequest = subBuilder; + break; + } + case 26: { + global::Nitric.Proto.Topics.v1.MessageResponse subBuilder = new global::Nitric.Proto.Topics.v1.MessageResponse(); + if (contentCase_ == ContentOneofCase.MessageResponse) { + subBuilder.MergeFrom(MessageResponse); + } + input.ReadMessage(subBuilder); + MessageResponse = subBuilder; + break; + } + } + } + } + #endif + + } + + public sealed partial class MessageRequest : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MessageRequest()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Nitric.Proto.Topics.v1.TopicsReflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public MessageRequest() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public MessageRequest(MessageRequest other) : this() { + topicName_ = other.topicName_; + message_ = other.message_ != null ? other.message_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public MessageRequest Clone() { + return new MessageRequest(this); + } + + /// Field number for the "topic_name" field. + public const int TopicNameFieldNumber = 1; + private string topicName_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string TopicName { + get { return topicName_; } + set { + topicName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "message" field. + public const int MessageFieldNumber = 2; + private global::Nitric.Proto.Topics.v1.TopicMessage message_; + /// + /// Message Type + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Nitric.Proto.Topics.v1.TopicMessage Message { + get { return message_; } + set { + message_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as MessageRequest); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(MessageRequest other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (TopicName != other.TopicName) return false; + if (!object.Equals(Message, other.Message)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (TopicName.Length != 0) hash ^= TopicName.GetHashCode(); + if (message_ != null) hash ^= Message.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (TopicName.Length != 0) { + output.WriteRawTag(10); + output.WriteString(TopicName); + } + if (message_ != null) { + output.WriteRawTag(18); + output.WriteMessage(Message); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (TopicName.Length != 0) { + output.WriteRawTag(10); + output.WriteString(TopicName); + } + if (message_ != null) { + output.WriteRawTag(18); + output.WriteMessage(Message); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (TopicName.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(TopicName); + } + if (message_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Message); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(MessageRequest other) { + if (other == null) { + return; + } + if (other.TopicName.Length != 0) { + TopicName = other.TopicName; + } + if (other.message_ != null) { + if (message_ == null) { + Message = new global::Nitric.Proto.Topics.v1.TopicMessage(); + } + Message.MergeFrom(other.Message); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + TopicName = input.ReadString(); + break; + } + case 18: { + if (message_ == null) { + Message = new global::Nitric.Proto.Topics.v1.TopicMessage(); + } + input.ReadMessage(Message); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + TopicName = input.ReadString(); + break; + } + case 18: { + if (message_ == null) { + Message = new global::Nitric.Proto.Topics.v1.TopicMessage(); + } + input.ReadMessage(Message); + break; + } + } + } + } + #endif + + } + + public sealed partial class MessageResponse : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MessageResponse()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Nitric.Proto.Topics.v1.TopicsReflection.Descriptor.MessageTypes[2]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public MessageResponse() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public MessageResponse(MessageResponse other) : this() { + success_ = other.success_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public MessageResponse Clone() { + return new MessageResponse(this); + } + + /// Field number for the "success" field. + public const int SuccessFieldNumber = 1; + private bool success_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Success { + get { return success_; } + set { + success_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as MessageResponse); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(MessageResponse other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Success != other.Success) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Success != false) hash ^= Success.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (Success != false) { + output.WriteRawTag(8); + output.WriteBool(Success); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Success != false) { + output.WriteRawTag(8); + output.WriteBool(Success); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Success != false) { + size += 1 + 1; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(MessageResponse other) { + if (other == null) { + return; + } + if (other.Success != false) { + Success = other.Success; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Success = input.ReadBool(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Success = input.ReadBool(); + break; + } + } + } + } + #endif + + } + + /// + /// ServerMessage is the message sent from the nitric server to the service + /// + public sealed partial class ServerMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ServerMessage()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Nitric.Proto.Topics.v1.TopicsReflection.Descriptor.MessageTypes[3]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ServerMessage() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ServerMessage(ServerMessage other) : this() { + id_ = other.id_; + switch (other.ContentCase) { + case ContentOneofCase.RegistrationResponse: + RegistrationResponse = other.RegistrationResponse.Clone(); + break; + case ContentOneofCase.MessageRequest: + MessageRequest = other.MessageRequest.Clone(); + break; + } + + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ServerMessage Clone() { + return new ServerMessage(this); + } + + /// Field number for the "id" field. + public const int IdFieldNumber = 1; + private string id_ = ""; + /// + /// globally unique ID of the request/response pair + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Id { + get { return id_; } + set { + id_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "registration_response" field. + public const int RegistrationResponseFieldNumber = 2; + /// + /// Response to a topic subscription request + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Nitric.Proto.Topics.v1.RegistrationResponse RegistrationResponse { + get { return contentCase_ == ContentOneofCase.RegistrationResponse ? (global::Nitric.Proto.Topics.v1.RegistrationResponse) content_ : null; } + set { + content_ = value; + contentCase_ = value == null ? ContentOneofCase.None : ContentOneofCase.RegistrationResponse; + } + } + + /// Field number for the "message_request" field. + public const int MessageRequestFieldNumber = 3; + /// + /// Response to a topic message request + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Nitric.Proto.Topics.v1.MessageRequest MessageRequest { + get { return contentCase_ == ContentOneofCase.MessageRequest ? (global::Nitric.Proto.Topics.v1.MessageRequest) content_ : null; } + set { + content_ = value; + contentCase_ = value == null ? ContentOneofCase.None : ContentOneofCase.MessageRequest; + } + } + + private object content_; + /// Enum of possible cases for the "content" oneof. + public enum ContentOneofCase { + None = 0, + RegistrationResponse = 2, + MessageRequest = 3, + } + private ContentOneofCase contentCase_ = ContentOneofCase.None; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ContentOneofCase ContentCase { + get { return contentCase_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void ClearContent() { + contentCase_ = ContentOneofCase.None; + content_ = null; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as ServerMessage); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ServerMessage other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Id != other.Id) return false; + if (!object.Equals(RegistrationResponse, other.RegistrationResponse)) return false; + if (!object.Equals(MessageRequest, other.MessageRequest)) return false; + if (ContentCase != other.ContentCase) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Id.Length != 0) hash ^= Id.GetHashCode(); + if (contentCase_ == ContentOneofCase.RegistrationResponse) hash ^= RegistrationResponse.GetHashCode(); + if (contentCase_ == ContentOneofCase.MessageRequest) hash ^= MessageRequest.GetHashCode(); + hash ^= (int) contentCase_; + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (Id.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Id); + } + if (contentCase_ == ContentOneofCase.RegistrationResponse) { + output.WriteRawTag(18); + output.WriteMessage(RegistrationResponse); + } + if (contentCase_ == ContentOneofCase.MessageRequest) { + output.WriteRawTag(26); + output.WriteMessage(MessageRequest); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Id.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Id); + } + if (contentCase_ == ContentOneofCase.RegistrationResponse) { + output.WriteRawTag(18); + output.WriteMessage(RegistrationResponse); + } + if (contentCase_ == ContentOneofCase.MessageRequest) { + output.WriteRawTag(26); + output.WriteMessage(MessageRequest); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Id.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Id); + } + if (contentCase_ == ContentOneofCase.RegistrationResponse) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(RegistrationResponse); + } + if (contentCase_ == ContentOneofCase.MessageRequest) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(MessageRequest); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(ServerMessage other) { + if (other == null) { + return; + } + if (other.Id.Length != 0) { + Id = other.Id; + } + switch (other.ContentCase) { + case ContentOneofCase.RegistrationResponse: + if (RegistrationResponse == null) { + RegistrationResponse = new global::Nitric.Proto.Topics.v1.RegistrationResponse(); + } + RegistrationResponse.MergeFrom(other.RegistrationResponse); + break; + case ContentOneofCase.MessageRequest: + if (MessageRequest == null) { + MessageRequest = new global::Nitric.Proto.Topics.v1.MessageRequest(); + } + MessageRequest.MergeFrom(other.MessageRequest); + break; + } + + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Id = input.ReadString(); + break; + } + case 18: { + global::Nitric.Proto.Topics.v1.RegistrationResponse subBuilder = new global::Nitric.Proto.Topics.v1.RegistrationResponse(); + if (contentCase_ == ContentOneofCase.RegistrationResponse) { + subBuilder.MergeFrom(RegistrationResponse); + } + input.ReadMessage(subBuilder); + RegistrationResponse = subBuilder; + break; + } + case 26: { + global::Nitric.Proto.Topics.v1.MessageRequest subBuilder = new global::Nitric.Proto.Topics.v1.MessageRequest(); + if (contentCase_ == ContentOneofCase.MessageRequest) { + subBuilder.MergeFrom(MessageRequest); + } + input.ReadMessage(subBuilder); + MessageRequest = subBuilder; + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Id = input.ReadString(); + break; + } + case 18: { + global::Nitric.Proto.Topics.v1.RegistrationResponse subBuilder = new global::Nitric.Proto.Topics.v1.RegistrationResponse(); + if (contentCase_ == ContentOneofCase.RegistrationResponse) { + subBuilder.MergeFrom(RegistrationResponse); + } + input.ReadMessage(subBuilder); + RegistrationResponse = subBuilder; + break; + } + case 26: { + global::Nitric.Proto.Topics.v1.MessageRequest subBuilder = new global::Nitric.Proto.Topics.v1.MessageRequest(); + if (contentCase_ == ContentOneofCase.MessageRequest) { + subBuilder.MergeFrom(MessageRequest); + } + input.ReadMessage(subBuilder); + MessageRequest = subBuilder; + break; + } + } + } + } + #endif + + } + + public sealed partial class RegistrationRequest : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RegistrationRequest()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Nitric.Proto.Topics.v1.TopicsReflection.Descriptor.MessageTypes[4]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public RegistrationRequest() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public RegistrationRequest(RegistrationRequest other) : this() { + topicName_ = other.topicName_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public RegistrationRequest Clone() { + return new RegistrationRequest(this); + } + + /// Field number for the "topic_name" field. + public const int TopicNameFieldNumber = 1; + private string topicName_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string TopicName { + get { return topicName_; } + set { + topicName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as RegistrationRequest); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(RegistrationRequest other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (TopicName != other.TopicName) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (TopicName.Length != 0) hash ^= TopicName.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (TopicName.Length != 0) { + output.WriteRawTag(10); + output.WriteString(TopicName); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (TopicName.Length != 0) { + output.WriteRawTag(10); + output.WriteString(TopicName); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (TopicName.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(TopicName); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(RegistrationRequest other) { + if (other == null) { + return; + } + if (other.TopicName.Length != 0) { + TopicName = other.TopicName; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + TopicName = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + TopicName = input.ReadString(); + break; + } + } + } + } + #endif + + } + + public sealed partial class RegistrationResponse : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RegistrationResponse()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Nitric.Proto.Topics.v1.TopicsReflection.Descriptor.MessageTypes[5]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public RegistrationResponse() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public RegistrationResponse(RegistrationResponse other) : this() { + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public RegistrationResponse Clone() { + return new RegistrationResponse(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as RegistrationResponse); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(RegistrationResponse other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(RegistrationResponse other) { + if (other == null) { + return; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + } + } + } + #endif + + } + + public sealed partial class TopicMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TopicMessage()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Nitric.Proto.Topics.v1.TopicsReflection.Descriptor.MessageTypes[6]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public TopicMessage() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public TopicMessage(TopicMessage other) : this() { + switch (other.ContentCase) { + case ContentOneofCase.StructPayload: + StructPayload = other.StructPayload.Clone(); + break; + } + + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public TopicMessage Clone() { + return new TopicMessage(this); + } + + /// Field number for the "struct_payload" field. + public const int StructPayloadFieldNumber = 1; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Google.Protobuf.WellKnownTypes.Struct StructPayload { + get { return contentCase_ == ContentOneofCase.StructPayload ? (global::Google.Protobuf.WellKnownTypes.Struct) content_ : null; } + set { + content_ = value; + contentCase_ = value == null ? ContentOneofCase.None : ContentOneofCase.StructPayload; + } + } + + private object content_; + /// Enum of possible cases for the "content" oneof. + public enum ContentOneofCase { + None = 0, + StructPayload = 1, + } + private ContentOneofCase contentCase_ = ContentOneofCase.None; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ContentOneofCase ContentCase { + get { return contentCase_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void ClearContent() { + contentCase_ = ContentOneofCase.None; + content_ = null; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as TopicMessage); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(TopicMessage other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(StructPayload, other.StructPayload)) return false; + if (ContentCase != other.ContentCase) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (contentCase_ == ContentOneofCase.StructPayload) hash ^= StructPayload.GetHashCode(); + hash ^= (int) contentCase_; + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (contentCase_ == ContentOneofCase.StructPayload) { + output.WriteRawTag(10); + output.WriteMessage(StructPayload); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (contentCase_ == ContentOneofCase.StructPayload) { + output.WriteRawTag(10); + output.WriteMessage(StructPayload); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (contentCase_ == ContentOneofCase.StructPayload) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(StructPayload); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(TopicMessage other) { + if (other == null) { + return; + } + switch (other.ContentCase) { + case ContentOneofCase.StructPayload: + if (StructPayload == null) { + StructPayload = new global::Google.Protobuf.WellKnownTypes.Struct(); + } + StructPayload.MergeFrom(other.StructPayload); + break; + } + + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + global::Google.Protobuf.WellKnownTypes.Struct subBuilder = new global::Google.Protobuf.WellKnownTypes.Struct(); + if (contentCase_ == ContentOneofCase.StructPayload) { + subBuilder.MergeFrom(StructPayload); + } + input.ReadMessage(subBuilder); + StructPayload = subBuilder; + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + global::Google.Protobuf.WellKnownTypes.Struct subBuilder = new global::Google.Protobuf.WellKnownTypes.Struct(); + if (contentCase_ == ContentOneofCase.StructPayload) { + subBuilder.MergeFrom(StructPayload); + } + input.ReadMessage(subBuilder); + StructPayload = subBuilder; + break; + } + } + } + } + #endif + + } + + /// + /// Request to publish a message to a topic + /// + public sealed partial class TopicPublishRequest : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TopicPublishRequest()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Nitric.Proto.Topics.v1.TopicsReflection.Descriptor.MessageTypes[7]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public TopicPublishRequest() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public TopicPublishRequest(TopicPublishRequest other) : this() { + topicName_ = other.topicName_; + message_ = other.message_ != null ? other.message_.Clone() : null; + delay_ = other.delay_ != null ? other.delay_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public TopicPublishRequest Clone() { + return new TopicPublishRequest(this); + } + + /// Field number for the "topic_name" field. + public const int TopicNameFieldNumber = 1; + private string topicName_ = ""; + /// + /// The name of the topic to publish the topic to + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string TopicName { + get { return topicName_; } + set { + topicName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "message" field. + public const int MessageFieldNumber = 2; + private global::Nitric.Proto.Topics.v1.TopicMessage message_; + /// + /// The message to be published + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Nitric.Proto.Topics.v1.TopicMessage Message { + get { return message_; } + set { + message_ = value; + } + } + + /// Field number for the "delay" field. + public const int DelayFieldNumber = 3; + private global::Google.Protobuf.WellKnownTypes.Duration delay_; + /// + /// An optional delay specified in seconds (minimum 10 seconds) + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Google.Protobuf.WellKnownTypes.Duration Delay { + get { return delay_; } + set { + delay_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as TopicPublishRequest); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(TopicPublishRequest other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (TopicName != other.TopicName) return false; + if (!object.Equals(Message, other.Message)) return false; + if (!object.Equals(Delay, other.Delay)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (TopicName.Length != 0) hash ^= TopicName.GetHashCode(); + if (message_ != null) hash ^= Message.GetHashCode(); + if (delay_ != null) hash ^= Delay.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (TopicName.Length != 0) { + output.WriteRawTag(10); + output.WriteString(TopicName); + } + if (message_ != null) { + output.WriteRawTag(18); + output.WriteMessage(Message); + } + if (delay_ != null) { + output.WriteRawTag(26); + output.WriteMessage(Delay); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (TopicName.Length != 0) { + output.WriteRawTag(10); + output.WriteString(TopicName); + } + if (message_ != null) { + output.WriteRawTag(18); + output.WriteMessage(Message); + } + if (delay_ != null) { + output.WriteRawTag(26); + output.WriteMessage(Delay); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (TopicName.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(TopicName); + } + if (message_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Message); + } + if (delay_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Delay); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(TopicPublishRequest other) { + if (other == null) { + return; + } + if (other.TopicName.Length != 0) { + TopicName = other.TopicName; + } + if (other.message_ != null) { + if (message_ == null) { + Message = new global::Nitric.Proto.Topics.v1.TopicMessage(); + } + Message.MergeFrom(other.Message); + } + if (other.delay_ != null) { + if (delay_ == null) { + Delay = new global::Google.Protobuf.WellKnownTypes.Duration(); + } + Delay.MergeFrom(other.Delay); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + TopicName = input.ReadString(); + break; + } + case 18: { + if (message_ == null) { + Message = new global::Nitric.Proto.Topics.v1.TopicMessage(); + } + input.ReadMessage(Message); + break; + } + case 26: { + if (delay_ == null) { + Delay = new global::Google.Protobuf.WellKnownTypes.Duration(); + } + input.ReadMessage(Delay); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + TopicName = input.ReadString(); + break; + } + case 18: { + if (message_ == null) { + Message = new global::Nitric.Proto.Topics.v1.TopicMessage(); + } + input.ReadMessage(Message); + break; + } + case 26: { + if (delay_ == null) { + Delay = new global::Google.Protobuf.WellKnownTypes.Duration(); + } + input.ReadMessage(Delay); + break; + } + } + } + } + #endif + + } + + /// + /// Result of publishing an topic + /// + public sealed partial class TopicPublishResponse : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TopicPublishResponse()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Nitric.Proto.Topics.v1.TopicsReflection.Descriptor.MessageTypes[8]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public TopicPublishResponse() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public TopicPublishResponse(TopicPublishResponse other) : this() { + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public TopicPublishResponse Clone() { + return new TopicPublishResponse(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as TopicPublishResponse); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(TopicPublishResponse other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(TopicPublishResponse other) { + if (other == null) { + return; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + } + } + } + #endif + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/src/Nitric.Sdk/Proto/proto/event/v1/EventGrpc.cs b/src/Nitric.Sdk/Proto/nitric/proto/topics/v1/TopicsGrpc.cs similarity index 50% rename from src/Nitric.Sdk/Proto/proto/event/v1/EventGrpc.cs rename to src/Nitric.Sdk/Proto/nitric/proto/topics/v1/TopicsGrpc.cs index 6a71037..5ef7756 100644 --- a/src/Nitric.Sdk/Proto/proto/event/v1/EventGrpc.cs +++ b/src/Nitric.Sdk/Proto/nitric/proto/topics/v1/TopicsGrpc.cs @@ -1,19 +1,19 @@ // // Generated by the protocol buffer compiler. DO NOT EDIT! -// source: proto/event/v1/event.proto +// source: nitric/proto/topics/v1/topics.proto // #pragma warning disable 0414, 1591 #region Designer generated code using grpc = global::Grpc.Core; -namespace Nitric.Proto.Event.v1 { +namespace Nitric.Proto.Topics.v1 { /// - /// Service for publishing asynchronous event + /// Service for publishing asynchronous messages /// - public static partial class EventService + public static partial class Topics { - static readonly string __ServiceName = "nitric.event.v1.EventService"; + static readonly string __ServiceName = "nitric.proto.topics.v1.Topics"; static void __Helper_SerializeMessage(global::Google.Protobuf.IMessage message, grpc::SerializationContext context) { @@ -45,116 +45,116 @@ static T __Helper_DeserializeMessage(grpc::DeserializationContext context, gl return parser.ParseFrom(context.PayloadAsNewBuffer()); } - static readonly grpc::Marshaller __Marshaller_nitric_event_v1_EventPublishRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Event.v1.EventPublishRequest.Parser)); - static readonly grpc::Marshaller __Marshaller_nitric_event_v1_EventPublishResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Event.v1.EventPublishResponse.Parser)); + static readonly grpc::Marshaller __Marshaller_nitric_proto_topics_v1_TopicPublishRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Topics.v1.TopicPublishRequest.Parser)); + static readonly grpc::Marshaller __Marshaller_nitric_proto_topics_v1_TopicPublishResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Topics.v1.TopicPublishResponse.Parser)); - static readonly grpc::Method __Method_Publish = new grpc::Method( + static readonly grpc::Method __Method_Publish = new grpc::Method( grpc::MethodType.Unary, __ServiceName, "Publish", - __Marshaller_nitric_event_v1_EventPublishRequest, - __Marshaller_nitric_event_v1_EventPublishResponse); + __Marshaller_nitric_proto_topics_v1_TopicPublishRequest, + __Marshaller_nitric_proto_topics_v1_TopicPublishResponse); /// Service descriptor public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor { - get { return global::Nitric.Proto.Event.v1.EventReflection.Descriptor.Services[0]; } + get { return global::Nitric.Proto.Topics.v1.TopicsReflection.Descriptor.Services[0]; } } - /// Base class for server-side implementations of EventService - [grpc::BindServiceMethod(typeof(EventService), "BindService")] - public abstract partial class EventServiceBase + /// Base class for server-side implementations of Topics + [grpc::BindServiceMethod(typeof(Topics), "BindService")] + public abstract partial class TopicsBase { /// - /// Publishes an message to a given topic + /// Publishes a message to a given topic /// /// The request received from the client. /// The context of the server-side call handler being invoked. /// The response to send back to the client (wrapped by a task). - public virtual global::System.Threading.Tasks.Task Publish(global::Nitric.Proto.Event.v1.EventPublishRequest request, grpc::ServerCallContext context) + public virtual global::System.Threading.Tasks.Task Publish(global::Nitric.Proto.Topics.v1.TopicPublishRequest request, grpc::ServerCallContext context) { throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); } } - /// Client for EventService - public partial class EventServiceClient : grpc::ClientBase + /// Client for Topics + public partial class TopicsClient : grpc::ClientBase { - /// Creates a new client for EventService + /// Creates a new client for Topics /// The channel to use to make remote calls. - public EventServiceClient(grpc::ChannelBase channel) : base(channel) + public TopicsClient(grpc::ChannelBase channel) : base(channel) { } - /// Creates a new client for EventService that uses a custom CallInvoker. + /// Creates a new client for Topics that uses a custom CallInvoker. /// The callInvoker to use to make remote calls. - public EventServiceClient(grpc::CallInvoker callInvoker) : base(callInvoker) + public TopicsClient(grpc::CallInvoker callInvoker) : base(callInvoker) { } /// Protected parameterless constructor to allow creation of test doubles. - protected EventServiceClient() : base() + protected TopicsClient() : base() { } /// Protected constructor to allow creation of configured clients. /// The client configuration. - protected EventServiceClient(ClientBaseConfiguration configuration) : base(configuration) + protected TopicsClient(ClientBaseConfiguration configuration) : base(configuration) { } /// - /// Publishes an message to a given topic + /// Publishes a message to a given topic /// /// The request to send to the server. /// The initial metadata to send with the call. This parameter is optional. /// An optional deadline for the call. The call will be cancelled if deadline is hit. /// An optional token for canceling the call. /// The response received from the server. - public virtual global::Nitric.Proto.Event.v1.EventPublishResponse Publish(global::Nitric.Proto.Event.v1.EventPublishRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public virtual global::Nitric.Proto.Topics.v1.TopicPublishResponse Publish(global::Nitric.Proto.Topics.v1.TopicPublishRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { return Publish(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// - /// Publishes an message to a given topic + /// Publishes a message to a given topic /// /// The request to send to the server. /// The options for the call. /// The response received from the server. - public virtual global::Nitric.Proto.Event.v1.EventPublishResponse Publish(global::Nitric.Proto.Event.v1.EventPublishRequest request, grpc::CallOptions options) + public virtual global::Nitric.Proto.Topics.v1.TopicPublishResponse Publish(global::Nitric.Proto.Topics.v1.TopicPublishRequest request, grpc::CallOptions options) { return CallInvoker.BlockingUnaryCall(__Method_Publish, null, options, request); } /// - /// Publishes an message to a given topic + /// Publishes a message to a given topic /// /// The request to send to the server. /// The initial metadata to send with the call. This parameter is optional. /// An optional deadline for the call. The call will be cancelled if deadline is hit. /// An optional token for canceling the call. /// The call object. - public virtual grpc::AsyncUnaryCall PublishAsync(global::Nitric.Proto.Event.v1.EventPublishRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public virtual grpc::AsyncUnaryCall PublishAsync(global::Nitric.Proto.Topics.v1.TopicPublishRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { return PublishAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// - /// Publishes an message to a given topic + /// Publishes a message to a given topic /// /// The request to send to the server. /// The options for the call. /// The call object. - public virtual grpc::AsyncUnaryCall PublishAsync(global::Nitric.Proto.Event.v1.EventPublishRequest request, grpc::CallOptions options) + public virtual grpc::AsyncUnaryCall PublishAsync(global::Nitric.Proto.Topics.v1.TopicPublishRequest request, grpc::CallOptions options) { return CallInvoker.AsyncUnaryCall(__Method_Publish, null, options, request); } /// Creates a new instance of client from given ClientBaseConfiguration. - protected override EventServiceClient NewInstance(ClientBaseConfiguration configuration) + protected override TopicsClient NewInstance(ClientBaseConfiguration configuration) { - return new EventServiceClient(configuration); + return new TopicsClient(configuration); } } /// Creates service definition that can be registered with a server /// An object implementing the server-side handling logic. - public static grpc::ServerServiceDefinition BindService(EventServiceBase serviceImpl) + public static grpc::ServerServiceDefinition BindService(TopicsBase serviceImpl) { return grpc::ServerServiceDefinition.CreateBuilder() .AddMethod(__Method_Publish, serviceImpl.Publish).Build(); @@ -164,18 +164,18 @@ protected override EventServiceClient NewInstance(ClientBaseConfiguration config /// Note: this method is part of an experimental API that can change or be removed without any prior notice. /// Service methods will be bound by calling AddMethod on this object. /// An object implementing the server-side handling logic. - public static void BindService(grpc::ServiceBinderBase serviceBinder, EventServiceBase serviceImpl) + public static void BindService(grpc::ServiceBinderBase serviceBinder, TopicsBase serviceImpl) { - serviceBinder.AddMethod(__Method_Publish, serviceImpl == null ? null : new grpc::UnaryServerMethod(serviceImpl.Publish)); + serviceBinder.AddMethod(__Method_Publish, serviceImpl == null ? null : new grpc::UnaryServerMethod(serviceImpl.Publish)); } } /// - /// Service for management of event topics + /// Service for subscribing to asynchronous messages /// - public static partial class TopicService + public static partial class Subscriber { - static readonly string __ServiceName = "nitric.event.v1.TopicService"; + static readonly string __ServiceName = "nitric.proto.topics.v1.Subscriber"; static void __Helper_SerializeMessage(global::Google.Protobuf.IMessage message, grpc::SerializationContext context) { @@ -207,128 +207,105 @@ static T __Helper_DeserializeMessage(grpc::DeserializationContext context, gl return parser.ParseFrom(context.PayloadAsNewBuffer()); } - static readonly grpc::Marshaller __Marshaller_nitric_event_v1_TopicListRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Event.v1.TopicListRequest.Parser)); - static readonly grpc::Marshaller __Marshaller_nitric_event_v1_TopicListResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Event.v1.TopicListResponse.Parser)); + static readonly grpc::Marshaller __Marshaller_nitric_proto_topics_v1_ClientMessage = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Topics.v1.ClientMessage.Parser)); + static readonly grpc::Marshaller __Marshaller_nitric_proto_topics_v1_ServerMessage = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Topics.v1.ServerMessage.Parser)); - static readonly grpc::Method __Method_List = new grpc::Method( - grpc::MethodType.Unary, + static readonly grpc::Method __Method_Subscribe = new grpc::Method( + grpc::MethodType.DuplexStreaming, __ServiceName, - "List", - __Marshaller_nitric_event_v1_TopicListRequest, - __Marshaller_nitric_event_v1_TopicListResponse); + "Subscribe", + __Marshaller_nitric_proto_topics_v1_ClientMessage, + __Marshaller_nitric_proto_topics_v1_ServerMessage); /// Service descriptor public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor { - get { return global::Nitric.Proto.Event.v1.EventReflection.Descriptor.Services[1]; } + get { return global::Nitric.Proto.Topics.v1.TopicsReflection.Descriptor.Services[1]; } } - /// Base class for server-side implementations of TopicService - [grpc::BindServiceMethod(typeof(TopicService), "BindService")] - public abstract partial class TopicServiceBase + /// Base class for server-side implementations of Subscriber + [grpc::BindServiceMethod(typeof(Subscriber), "BindService")] + public abstract partial class SubscriberBase { /// - /// Return a list of existing topics in the provider environment + /// Subscribe to a topic and handle incoming messages /// - /// The request received from the client. + /// Used for reading requests from the client. + /// Used for sending responses back to the client. /// The context of the server-side call handler being invoked. - /// The response to send back to the client (wrapped by a task). - public virtual global::System.Threading.Tasks.Task List(global::Nitric.Proto.Event.v1.TopicListRequest request, grpc::ServerCallContext context) + /// A task indicating completion of the handler. + public virtual global::System.Threading.Tasks.Task Subscribe(grpc::IAsyncStreamReader requestStream, grpc::IServerStreamWriter responseStream, grpc::ServerCallContext context) { throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); } } - /// Client for TopicService - public partial class TopicServiceClient : grpc::ClientBase + /// Client for Subscriber + public partial class SubscriberClient : grpc::ClientBase { - /// Creates a new client for TopicService + /// Creates a new client for Subscriber /// The channel to use to make remote calls. - public TopicServiceClient(grpc::ChannelBase channel) : base(channel) + public SubscriberClient(grpc::ChannelBase channel) : base(channel) { } - /// Creates a new client for TopicService that uses a custom CallInvoker. + /// Creates a new client for Subscriber that uses a custom CallInvoker. /// The callInvoker to use to make remote calls. - public TopicServiceClient(grpc::CallInvoker callInvoker) : base(callInvoker) + public SubscriberClient(grpc::CallInvoker callInvoker) : base(callInvoker) { } /// Protected parameterless constructor to allow creation of test doubles. - protected TopicServiceClient() : base() + protected SubscriberClient() : base() { } /// Protected constructor to allow creation of configured clients. /// The client configuration. - protected TopicServiceClient(ClientBaseConfiguration configuration) : base(configuration) + protected SubscriberClient(ClientBaseConfiguration configuration) : base(configuration) { } /// - /// Return a list of existing topics in the provider environment + /// Subscribe to a topic and handle incoming messages /// - /// The request to send to the server. - /// The initial metadata to send with the call. This parameter is optional. - /// An optional deadline for the call. The call will be cancelled if deadline is hit. - /// An optional token for canceling the call. - /// The response received from the server. - public virtual global::Nitric.Proto.Event.v1.TopicListResponse List(global::Nitric.Proto.Event.v1.TopicListRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) - { - return List(request, new grpc::CallOptions(headers, deadline, cancellationToken)); - } - /// - /// Return a list of existing topics in the provider environment - /// - /// The request to send to the server. - /// The options for the call. - /// The response received from the server. - public virtual global::Nitric.Proto.Event.v1.TopicListResponse List(global::Nitric.Proto.Event.v1.TopicListRequest request, grpc::CallOptions options) - { - return CallInvoker.BlockingUnaryCall(__Method_List, null, options, request); - } - /// - /// Return a list of existing topics in the provider environment - /// - /// The request to send to the server. /// The initial metadata to send with the call. This parameter is optional. /// An optional deadline for the call. The call will be cancelled if deadline is hit. /// An optional token for canceling the call. /// The call object. - public virtual grpc::AsyncUnaryCall ListAsync(global::Nitric.Proto.Event.v1.TopicListRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public virtual grpc::AsyncDuplexStreamingCall Subscribe(grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { - return ListAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + return Subscribe(new grpc::CallOptions(headers, deadline, cancellationToken)); } /// - /// Return a list of existing topics in the provider environment + /// Subscribe to a topic and handle incoming messages /// - /// The request to send to the server. /// The options for the call. /// The call object. - public virtual grpc::AsyncUnaryCall ListAsync(global::Nitric.Proto.Event.v1.TopicListRequest request, grpc::CallOptions options) + public virtual grpc::AsyncDuplexStreamingCall Subscribe(grpc::CallOptions options) { - return CallInvoker.AsyncUnaryCall(__Method_List, null, options, request); + return CallInvoker.AsyncDuplexStreamingCall(__Method_Subscribe, null, options); } /// Creates a new instance of client from given ClientBaseConfiguration. - protected override TopicServiceClient NewInstance(ClientBaseConfiguration configuration) + protected override SubscriberClient NewInstance(ClientBaseConfiguration configuration) { - return new TopicServiceClient(configuration); + return new SubscriberClient(configuration); } } /// Creates service definition that can be registered with a server /// An object implementing the server-side handling logic. - public static grpc::ServerServiceDefinition BindService(TopicServiceBase serviceImpl) + public static grpc::ServerServiceDefinition BindService(SubscriberBase serviceImpl) { return grpc::ServerServiceDefinition.CreateBuilder() - .AddMethod(__Method_List, serviceImpl.List).Build(); + .AddMethod(__Method_Subscribe, serviceImpl.Subscribe).Build(); } /// Register service method with a service binder with or without implementation. Useful when customizing the service binding logic. /// Note: this method is part of an experimental API that can change or be removed without any prior notice. /// Service methods will be bound by calling AddMethod on this object. /// An object implementing the server-side handling logic. - public static void BindService(grpc::ServiceBinderBase serviceBinder, TopicServiceBase serviceImpl) + public static void BindService(grpc::ServiceBinderBase serviceBinder, SubscriberBase serviceImpl) { - serviceBinder.AddMethod(__Method_List, serviceImpl == null ? null : new grpc::UnaryServerMethod(serviceImpl.List)); + serviceBinder.AddMethod(__Method_Subscribe, serviceImpl == null ? null : new grpc::DuplexStreamingServerMethod(serviceImpl.Subscribe)); } } diff --git a/src/Nitric.Sdk/Proto/proto/document/v1/Document.cs b/src/Nitric.Sdk/Proto/nitric/proto/websockets/v1/Websockets.cs similarity index 50% rename from src/Nitric.Sdk/Proto/proto/document/v1/Document.cs rename to src/Nitric.Sdk/Proto/nitric/proto/websockets/v1/Websockets.cs index a8798c7..1fe3f6c 100644 --- a/src/Nitric.Sdk/Proto/proto/document/v1/Document.cs +++ b/src/Nitric.Sdk/Proto/nitric/proto/websockets/v1/Websockets.cs @@ -1,6 +1,6 @@ // // Generated by the protocol buffer compiler. DO NOT EDIT! -// source: proto/document/v1/document.proto +// source: nitric/proto/websockets/v1/websockets.proto // #pragma warning disable 1591, 0612, 3021 #region Designer generated code @@ -9,116 +9,135 @@ using pbc = global::Google.Protobuf.Collections; using pbr = global::Google.Protobuf.Reflection; using scg = global::System.Collections.Generic; -namespace Nitric.Proto.Document.v1 { +namespace Nitric.Proto.Websockets.v1 { - /// Holder for reflection information generated from proto/document/v1/document.proto - public static partial class DocumentReflection { + /// Holder for reflection information generated from nitric/proto/websockets/v1/websockets.proto + public static partial class WebsocketsReflection { #region Descriptor - /// File descriptor for proto/document/v1/document.proto + /// File descriptor for nitric/proto/websockets/v1/websockets.proto public static pbr::FileDescriptor Descriptor { get { return descriptor; } } private static pbr::FileDescriptor descriptor; - static DocumentReflection() { + static WebsocketsReflection() { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( - "CiBwcm90by9kb2N1bWVudC92MS9kb2N1bWVudC5wcm90bxISbml0cmljLmRv", - "Y3VtZW50LnYxGhxnb29nbGUvcHJvdG9idWYvc3RydWN0LnByb3RvGhd2YWxp", - "ZGF0ZS92YWxpZGF0ZS5wcm90byJDCgpDb2xsZWN0aW9uEgwKBG5hbWUYASAB", - "KAkSJwoGcGFyZW50GAIgASgLMhcubml0cmljLmRvY3VtZW50LnYxLktleSJb", - "CgNLZXkSPAoKY29sbGVjdGlvbhgBIAEoCzIeLm5pdHJpYy5kb2N1bWVudC52", - "MS5Db2xsZWN0aW9uQgj6QgWKAQIQARIWCgJpZBgCIAEoCUIK+kIHcgUgASiA", - "AiJuCghEb2N1bWVudBIyCgdjb250ZW50GAEgASgLMhcuZ29vZ2xlLnByb3Rv", - "YnVmLlN0cnVjdEII+kIFigECEAESLgoDa2V5GAIgASgLMhcubml0cmljLmRv", - "Y3VtZW50LnYxLktleUII+kIFigECEAEidAoPRXhwcmVzc2lvblZhbHVlEhMK", - "CWludF92YWx1ZRgBIAEoA0gAEhYKDGRvdWJsZV92YWx1ZRgCIAEoAUgAEhYK", - "DHN0cmluZ192YWx1ZRgDIAEoCUgAEhQKCmJvb2xfdmFsdWUYBCABKAhIAEIG", - "CgRraW5kIpIBCgpFeHByZXNzaW9uEg8KB29wZXJhbmQYASABKAkSNQoIb3Bl", - "cmF0b3IYAiABKAlCI/pCIHIeUgI9PVIBPFICPD1SAT5SAj49UgpzdGFydHNX", - "aXRoEjwKBXZhbHVlGAMgASgLMiMubml0cmljLmRvY3VtZW50LnYxLkV4cHJl", - "c3Npb25WYWx1ZUII+kIFigECEAEiRAoSRG9jdW1lbnRHZXRSZXF1ZXN0Ei4K", - "A2tleRgBIAEoCzIXLm5pdHJpYy5kb2N1bWVudC52MS5LZXlCCPpCBYoBAhAB", - "IkUKE0RvY3VtZW50R2V0UmVzcG9uc2USLgoIZG9jdW1lbnQYASABKAsyHC5u", - "aXRyaWMuZG9jdW1lbnQudjEuRG9jdW1lbnQieAoSRG9jdW1lbnRTZXRSZXF1", - "ZXN0Ei4KA2tleRgBIAEoCzIXLm5pdHJpYy5kb2N1bWVudC52MS5LZXlCCPpC", - "BYoBAhABEjIKB2NvbnRlbnQYAyABKAsyFy5nb29nbGUucHJvdG9idWYuU3Ry", - "dWN0Qgj6QgWKAQIQASIVChNEb2N1bWVudFNldFJlc3BvbnNlIkcKFURvY3Vt", - "ZW50RGVsZXRlUmVxdWVzdBIuCgNrZXkYASABKAsyFy5uaXRyaWMuZG9jdW1l", - "bnQudjEuS2V5Qgj6QgWKAQIQASIYChZEb2N1bWVudERlbGV0ZVJlc3BvbnNl", - "Ip0CChREb2N1bWVudFF1ZXJ5UmVxdWVzdBI8Cgpjb2xsZWN0aW9uGAEgASgL", - "Mh4ubml0cmljLmRvY3VtZW50LnYxLkNvbGxlY3Rpb25CCPpCBYoBAhABEjMK", - "C2V4cHJlc3Npb25zGAMgAygLMh4ubml0cmljLmRvY3VtZW50LnYxLkV4cHJl", - "c3Npb24SDQoFbGltaXQYBCABKAUSTwoMcGFnaW5nX3Rva2VuGAUgAygLMjku", - "bml0cmljLmRvY3VtZW50LnYxLkRvY3VtZW50UXVlcnlSZXF1ZXN0LlBhZ2lu", - "Z1Rva2VuRW50cnkaMgoQUGFnaW5nVG9rZW5FbnRyeRILCgNrZXkYASABKAkS", - "DQoFdmFsdWUYAiABKAk6AjgBIs4BChVEb2N1bWVudFF1ZXJ5UmVzcG9uc2US", - "LwoJZG9jdW1lbnRzGAEgAygLMhwubml0cmljLmRvY3VtZW50LnYxLkRvY3Vt", - "ZW50ElAKDHBhZ2luZ190b2tlbhgCIAMoCzI6Lm5pdHJpYy5kb2N1bWVudC52", - "MS5Eb2N1bWVudFF1ZXJ5UmVzcG9uc2UuUGFnaW5nVG9rZW5FbnRyeRoyChBQ", - "YWdpbmdUb2tlbkVudHJ5EgsKA2tleRgBIAEoCRINCgV2YWx1ZRgCIAEoCToC", - "OAEingEKGkRvY3VtZW50UXVlcnlTdHJlYW1SZXF1ZXN0EjwKCmNvbGxlY3Rp", - "b24YASABKAsyHi5uaXRyaWMuZG9jdW1lbnQudjEuQ29sbGVjdGlvbkII+kIF", - "igECEAESMwoLZXhwcmVzc2lvbnMYAyADKAsyHi5uaXRyaWMuZG9jdW1lbnQu", - "djEuRXhwcmVzc2lvbhINCgVsaW1pdBgEIAEoBSJNChtEb2N1bWVudFF1ZXJ5", - "U3RyZWFtUmVzcG9uc2USLgoIZG9jdW1lbnQYASABKAsyHC5uaXRyaWMuZG9j", - "dW1lbnQudjEuRG9jdW1lbnQy8gMKD0RvY3VtZW50U2VydmljZRJWCgNHZXQS", - "Ji5uaXRyaWMuZG9jdW1lbnQudjEuRG9jdW1lbnRHZXRSZXF1ZXN0Gicubml0", - "cmljLmRvY3VtZW50LnYxLkRvY3VtZW50R2V0UmVzcG9uc2USVgoDU2V0EiYu", - "bml0cmljLmRvY3VtZW50LnYxLkRvY3VtZW50U2V0UmVxdWVzdBonLm5pdHJp", - "Yy5kb2N1bWVudC52MS5Eb2N1bWVudFNldFJlc3BvbnNlEl8KBkRlbGV0ZRIp", - "Lm5pdHJpYy5kb2N1bWVudC52MS5Eb2N1bWVudERlbGV0ZVJlcXVlc3QaKi5u", - "aXRyaWMuZG9jdW1lbnQudjEuRG9jdW1lbnREZWxldGVSZXNwb25zZRJcCgVR", - "dWVyeRIoLm5pdHJpYy5kb2N1bWVudC52MS5Eb2N1bWVudFF1ZXJ5UmVxdWVz", - "dBopLm5pdHJpYy5kb2N1bWVudC52MS5Eb2N1bWVudFF1ZXJ5UmVzcG9uc2US", - "cAoLUXVlcnlTdHJlYW0SLi5uaXRyaWMuZG9jdW1lbnQudjEuRG9jdW1lbnRR", - "dWVyeVN0cmVhbVJlcXVlc3QaLy5uaXRyaWMuZG9jdW1lbnQudjEuRG9jdW1l", - "bnRRdWVyeVN0cmVhbVJlc3BvbnNlMAFClQEKG2lvLm5pdHJpYy5wcm90by5k", - "b2N1bWVudC52MUIJRG9jdW1lbnRzUAFaM2dpdGh1Yi5jb20vbml0cmljdGVj", - "aC9uaXRyaWMvY29yZS9wa2cvYXBpL25pdHJpYy92MaoCGE5pdHJpYy5Qcm90", - "by5Eb2N1bWVudC52McoCGE5pdHJpY1xQcm90b1xEb2N1bWVudFxWMWIGcHJv", - "dG8z")); + "CituaXRyaWMvcHJvdG8vd2Vic29ja2V0cy92MS93ZWJzb2NrZXRzLnByb3Rv", + "EhpuaXRyaWMucHJvdG8ud2Vic29ja2V0cy52MSIuChdXZWJzb2NrZXREZXRh", + "aWxzUmVxdWVzdBITCgtzb2NrZXRfbmFtZRgBIAEoCSInChhXZWJzb2NrZXRE", + "ZXRhaWxzUmVzcG9uc2USCwoDdXJsGAEgASgJIlAKFFdlYnNvY2tldFNlbmRS", + "ZXF1ZXN0EhMKC3NvY2tldF9uYW1lGAEgASgJEhUKDWNvbm5lY3Rpb25faWQY", + "AiABKAkSDAoEZGF0YRgDIAEoDCIXChVXZWJzb2NrZXRTZW5kUmVzcG9uc2Ui", + "TQofV2Vic29ja2V0Q2xvc2VDb25uZWN0aW9uUmVxdWVzdBITCgtzb2NrZXRf", + "bmFtZRgBIAEoCRIVCg1jb25uZWN0aW9uX2lkGAIgASgJIiIKIFdlYnNvY2tl", + "dENsb3NlQ29ubmVjdGlvblJlc3BvbnNlIs8BCg1DbGllbnRNZXNzYWdlEgoK", + "AmlkGAEgASgJEk8KFHJlZ2lzdHJhdGlvbl9yZXF1ZXN0GAIgASgLMi8ubml0", + "cmljLnByb3RvLndlYnNvY2tldHMudjEuUmVnaXN0cmF0aW9uUmVxdWVzdEgA", + "ElYKGHdlYnNvY2tldF9ldmVudF9yZXNwb25zZRgDIAEoCzIyLm5pdHJpYy5w", + "cm90by53ZWJzb2NrZXRzLnYxLldlYnNvY2tldEV2ZW50UmVzcG9uc2VIAEIJ", + "Cgdjb250ZW50IhYKFFJlZ2lzdHJhdGlvblJlc3BvbnNlIm4KE1JlZ2lzdHJh", + "dGlvblJlcXVlc3QSEwoLc29ja2V0X25hbWUYASABKAkSQgoKZXZlbnRfdHlw", + "ZRgCIAEoDjIuLm5pdHJpYy5wcm90by53ZWJzb2NrZXRzLnYxLldlYnNvY2tl", + "dEV2ZW50VHlwZSK6AgoVV2Vic29ja2V0RXZlbnRSZXF1ZXN0EhMKC3NvY2tl", + "dF9uYW1lGAEgASgJEhUKDWNvbm5lY3Rpb25faWQYAiABKAkSSgoKY29ubmVj", + "dGlvbhgKIAEoCzI0Lm5pdHJpYy5wcm90by53ZWJzb2NrZXRzLnYxLldlYnNv", + "Y2tldENvbm5lY3Rpb25FdmVudEgAElAKDWRpc2Nvbm5lY3Rpb24YCyABKAsy", + "Ny5uaXRyaWMucHJvdG8ud2Vic29ja2V0cy52MS5XZWJzb2NrZXREaXNjb25u", + "ZWN0aW9uRXZlbnRIABJECgdtZXNzYWdlGAwgASgLMjEubml0cmljLnByb3Rv", + "LndlYnNvY2tldHMudjEuV2Vic29ja2V0TWVzc2FnZUV2ZW50SABCEQoPd2Vi", + "c29ja2V0X2V2ZW50IhsKClF1ZXJ5VmFsdWUSDQoFdmFsdWUYASADKAkizwEK", + "DVNlcnZlck1lc3NhZ2USCgoCaWQYASABKAkSUQoVcmVnaXN0cmF0aW9uX3Jl", + "c3BvbnNlGAIgASgLMjAubml0cmljLnByb3RvLndlYnNvY2tldHMudjEuUmVn", + "aXN0cmF0aW9uUmVzcG9uc2VIABJUChd3ZWJzb2NrZXRfZXZlbnRfcmVxdWVz", + "dBgDIAEoCzIxLm5pdHJpYy5wcm90by53ZWJzb2NrZXRzLnYxLldlYnNvY2tl", + "dEV2ZW50UmVxdWVzdEgAQgkKB2NvbnRlbnQihgEKFldlYnNvY2tldEV2ZW50", + "UmVzcG9uc2USVgoTY29ubmVjdGlvbl9yZXNwb25zZRgKIAEoCzI3Lm5pdHJp", + "Yy5wcm90by53ZWJzb2NrZXRzLnYxLldlYnNvY2tldENvbm5lY3Rpb25SZXNw", + "b25zZUgAQhQKEndlYnNvY2tldF9yZXNwb25zZSLTAQoYV2Vic29ja2V0Q29u", + "bmVjdGlvbkV2ZW50ElsKDHF1ZXJ5X3BhcmFtcxgBIAMoCzJFLm5pdHJpYy5w", + "cm90by53ZWJzb2NrZXRzLnYxLldlYnNvY2tldENvbm5lY3Rpb25FdmVudC5R", + "dWVyeVBhcmFtc0VudHJ5GloKEFF1ZXJ5UGFyYW1zRW50cnkSCwoDa2V5GAEg", + "ASgJEjUKBXZhbHVlGAIgASgLMiYubml0cmljLnByb3RvLndlYnNvY2tldHMu", + "djEuUXVlcnlWYWx1ZToCOAEiLQobV2Vic29ja2V0Q29ubmVjdGlvblJlc3Bv", + "bnNlEg4KBnJlamVjdBgBIAEoCCIdChtXZWJzb2NrZXREaXNjb25uZWN0aW9u", + "RXZlbnQiJQoVV2Vic29ja2V0TWVzc2FnZUV2ZW50EgwKBGJvZHkYASABKAwq", + "PgoSV2Vic29ja2V0RXZlbnRUeXBlEgsKB0Nvbm5lY3QQABIOCgpEaXNjb25u", + "ZWN0EAESCwoHTWVzc2FnZRACMooDCglXZWJzb2NrZXQScgoLU2VuZE1lc3Nh", + "Z2USMC5uaXRyaWMucHJvdG8ud2Vic29ja2V0cy52MS5XZWJzb2NrZXRTZW5k", + "UmVxdWVzdBoxLm5pdHJpYy5wcm90by53ZWJzb2NrZXRzLnYxLldlYnNvY2tl", + "dFNlbmRSZXNwb25zZRKMAQoPQ2xvc2VDb25uZWN0aW9uEjsubml0cmljLnBy", + "b3RvLndlYnNvY2tldHMudjEuV2Vic29ja2V0Q2xvc2VDb25uZWN0aW9uUmVx", + "dWVzdBo8Lm5pdHJpYy5wcm90by53ZWJzb2NrZXRzLnYxLldlYnNvY2tldENs", + "b3NlQ29ubmVjdGlvblJlc3BvbnNlEnoKDVNvY2tldERldGFpbHMSMy5uaXRy", + "aWMucHJvdG8ud2Vic29ja2V0cy52MS5XZWJzb2NrZXREZXRhaWxzUmVxdWVz", + "dBo0Lm5pdHJpYy5wcm90by53ZWJzb2NrZXRzLnYxLldlYnNvY2tldERldGFp", + "bHNSZXNwb25zZTJ8ChBXZWJzb2NrZXRIYW5kbGVyEmgKDEhhbmRsZUV2ZW50", + "cxIpLm5pdHJpYy5wcm90by53ZWJzb2NrZXRzLnYxLkNsaWVudE1lc3NhZ2Ua", + "KS5uaXRyaWMucHJvdG8ud2Vic29ja2V0cy52MS5TZXJ2ZXJNZXNzYWdlKAEw", + "AUK2AQodaW8ubml0cmljLnByb3RvLndlYnNvY2tldHMudjFCEVdlYnNvY2tl", + "dHNTZXJ2aWNlUAFaRmdpdGh1Yi5jb20vbml0cmljdGVjaC9uaXRyaWMvY29y", + "ZS9wa2cvcHJvdG8vd2Vic29ja2V0cy92MTt3ZWJzb2NrZXRzcGKqAhpOaXRy", + "aWMuUHJvdG8uV2Vic29ja2V0cy52McoCGk5pdHJpY1xQcm90b1xXZWJzb2Nr", + "ZXRzXFYxYgZwcm90bzM=")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, - new pbr::FileDescriptor[] { global::Google.Protobuf.WellKnownTypes.StructReflection.Descriptor, global::Validate.ValidateReflection.Descriptor, }, - new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Document.v1.Collection), global::Nitric.Proto.Document.v1.Collection.Parser, new[]{ "Name", "Parent" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Document.v1.Key), global::Nitric.Proto.Document.v1.Key.Parser, new[]{ "Collection", "Id" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Document.v1.Document), global::Nitric.Proto.Document.v1.Document.Parser, new[]{ "Content", "Key" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Document.v1.ExpressionValue), global::Nitric.Proto.Document.v1.ExpressionValue.Parser, new[]{ "IntValue", "DoubleValue", "StringValue", "BoolValue" }, new[]{ "Kind" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Document.v1.Expression), global::Nitric.Proto.Document.v1.Expression.Parser, new[]{ "Operand", "Operator", "Value" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Document.v1.DocumentGetRequest), global::Nitric.Proto.Document.v1.DocumentGetRequest.Parser, new[]{ "Key" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Document.v1.DocumentGetResponse), global::Nitric.Proto.Document.v1.DocumentGetResponse.Parser, new[]{ "Document" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Document.v1.DocumentSetRequest), global::Nitric.Proto.Document.v1.DocumentSetRequest.Parser, new[]{ "Key", "Content" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Document.v1.DocumentSetResponse), global::Nitric.Proto.Document.v1.DocumentSetResponse.Parser, null, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Document.v1.DocumentDeleteRequest), global::Nitric.Proto.Document.v1.DocumentDeleteRequest.Parser, new[]{ "Key" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Document.v1.DocumentDeleteResponse), global::Nitric.Proto.Document.v1.DocumentDeleteResponse.Parser, null, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Document.v1.DocumentQueryRequest), global::Nitric.Proto.Document.v1.DocumentQueryRequest.Parser, new[]{ "Collection", "Expressions", "Limit", "PagingToken" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { null, }), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Document.v1.DocumentQueryResponse), global::Nitric.Proto.Document.v1.DocumentQueryResponse.Parser, new[]{ "Documents", "PagingToken" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { null, }), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Document.v1.DocumentQueryStreamRequest), global::Nitric.Proto.Document.v1.DocumentQueryStreamRequest.Parser, new[]{ "Collection", "Expressions", "Limit" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Document.v1.DocumentQueryStreamResponse), global::Nitric.Proto.Document.v1.DocumentQueryStreamResponse.Parser, new[]{ "Document" }, null, null, null, null) + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Nitric.Proto.Websockets.v1.WebsocketEventType), }, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Websockets.v1.WebsocketDetailsRequest), global::Nitric.Proto.Websockets.v1.WebsocketDetailsRequest.Parser, new[]{ "SocketName" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Websockets.v1.WebsocketDetailsResponse), global::Nitric.Proto.Websockets.v1.WebsocketDetailsResponse.Parser, new[]{ "Url" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Websockets.v1.WebsocketSendRequest), global::Nitric.Proto.Websockets.v1.WebsocketSendRequest.Parser, new[]{ "SocketName", "ConnectionId", "Data" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Websockets.v1.WebsocketSendResponse), global::Nitric.Proto.Websockets.v1.WebsocketSendResponse.Parser, null, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Websockets.v1.WebsocketCloseConnectionRequest), global::Nitric.Proto.Websockets.v1.WebsocketCloseConnectionRequest.Parser, new[]{ "SocketName", "ConnectionId" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Websockets.v1.WebsocketCloseConnectionResponse), global::Nitric.Proto.Websockets.v1.WebsocketCloseConnectionResponse.Parser, null, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Websockets.v1.ClientMessage), global::Nitric.Proto.Websockets.v1.ClientMessage.Parser, new[]{ "Id", "RegistrationRequest", "WebsocketEventResponse" }, new[]{ "Content" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Websockets.v1.RegistrationResponse), global::Nitric.Proto.Websockets.v1.RegistrationResponse.Parser, null, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Websockets.v1.RegistrationRequest), global::Nitric.Proto.Websockets.v1.RegistrationRequest.Parser, new[]{ "SocketName", "EventType" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Websockets.v1.WebsocketEventRequest), global::Nitric.Proto.Websockets.v1.WebsocketEventRequest.Parser, new[]{ "SocketName", "ConnectionId", "Connection", "Disconnection", "Message" }, new[]{ "WebsocketEvent" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Websockets.v1.QueryValue), global::Nitric.Proto.Websockets.v1.QueryValue.Parser, new[]{ "Value" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Websockets.v1.ServerMessage), global::Nitric.Proto.Websockets.v1.ServerMessage.Parser, new[]{ "Id", "RegistrationResponse", "WebsocketEventRequest" }, new[]{ "Content" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Websockets.v1.WebsocketEventResponse), global::Nitric.Proto.Websockets.v1.WebsocketEventResponse.Parser, new[]{ "ConnectionResponse" }, new[]{ "WebsocketResponse" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Websockets.v1.WebsocketConnectionEvent), global::Nitric.Proto.Websockets.v1.WebsocketConnectionEvent.Parser, new[]{ "QueryParams" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { null, }), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Websockets.v1.WebsocketConnectionResponse), global::Nitric.Proto.Websockets.v1.WebsocketConnectionResponse.Parser, new[]{ "Reject" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Websockets.v1.WebsocketDisconnectionEvent), global::Nitric.Proto.Websockets.v1.WebsocketDisconnectionEvent.Parser, null, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Websockets.v1.WebsocketMessageEvent), global::Nitric.Proto.Websockets.v1.WebsocketMessageEvent.Parser, new[]{ "Body" }, null, null, null, null) })); } #endregion } + #region Enums + public enum WebsocketEventType { + /// + /// Specialised Event for handling new client connections + /// + [pbr::OriginalName("Connect")] Connect = 0, + /// + /// Specialised Event for handling existing client connections + /// + [pbr::OriginalName("Disconnect")] Disconnect = 1, + /// + /// All other types of events are messages + /// + [pbr::OriginalName("Message")] Message = 2, + } + + #endregion + #region Messages - /// - /// Provides a Collection type for storing documents - /// - public sealed partial class Collection : pb::IMessage + public sealed partial class WebsocketDetailsRequest : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Collection()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new WebsocketDetailsRequest()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Document.v1.DocumentReflection.Descriptor.MessageTypes[0]; } + get { return global::Nitric.Proto.Websockets.v1.WebsocketsReflection.Descriptor.MessageTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -127,75 +146,227 @@ public sealed partial class Collection : pb::IMessage } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Collection() { + public WebsocketDetailsRequest() { OnConstruction(); } partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Collection(Collection other) : this() { - name_ = other.name_; - parent_ = other.parent_ != null ? other.parent_.Clone() : null; + public WebsocketDetailsRequest(WebsocketDetailsRequest other) : this() { + socketName_ = other.socketName_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Collection Clone() { - return new Collection(this); + public WebsocketDetailsRequest Clone() { + return new WebsocketDetailsRequest(this); } - /// Field number for the "name" field. - public const int NameFieldNumber = 1; - private string name_ = ""; - /// - /// The collection name - /// + /// Field number for the "socket_name" field. + public const int SocketNameFieldNumber = 1; + private string socketName_ = ""; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string Name { - get { return name_; } + public string SocketName { + get { return socketName_; } set { - name_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + socketName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); } } - /// Field number for the "parent" field. - public const int ParentFieldNumber = 2; - private global::Nitric.Proto.Document.v1.Key parent_; - /// - /// Optional parent key, required when the collection is a sub-collection of another document - /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Document.v1.Key Parent { - get { return parent_; } + public override bool Equals(object other) { + return Equals(other as WebsocketDetailsRequest); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(WebsocketDetailsRequest other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (SocketName != other.SocketName) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (SocketName.Length != 0) hash ^= SocketName.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (SocketName.Length != 0) { + output.WriteRawTag(10); + output.WriteString(SocketName); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (SocketName.Length != 0) { + output.WriteRawTag(10); + output.WriteString(SocketName); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (SocketName.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(SocketName); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(WebsocketDetailsRequest other) { + if (other == null) { + return; + } + if (other.SocketName.Length != 0) { + SocketName = other.SocketName; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + SocketName = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + SocketName = input.ReadString(); + break; + } + } + } + } + #endif + + } + + public sealed partial class WebsocketDetailsResponse : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new WebsocketDetailsResponse()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Nitric.Proto.Websockets.v1.WebsocketsReflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public WebsocketDetailsResponse() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public WebsocketDetailsResponse(WebsocketDetailsResponse other) : this() { + url_ = other.url_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public WebsocketDetailsResponse Clone() { + return new WebsocketDetailsResponse(this); + } + + /// Field number for the "url" field. + public const int UrlFieldNumber = 1; + private string url_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Url { + get { return url_; } set { - parent_ = value; + url_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { - return Equals(other as Collection); + return Equals(other as WebsocketDetailsResponse); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(Collection other) { + public bool Equals(WebsocketDetailsResponse other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } - if (Name != other.Name) return false; - if (!object.Equals(Parent, other.Parent)) return false; + if (Url != other.Url) return false; return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; - if (Name.Length != 0) hash ^= Name.GetHashCode(); - if (parent_ != null) hash ^= Parent.GetHashCode(); + if (Url.Length != 0) hash ^= Url.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -212,13 +383,9 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else - if (Name.Length != 0) { + if (Url.Length != 0) { output.WriteRawTag(10); - output.WriteString(Name); - } - if (parent_ != null) { - output.WriteRawTag(18); - output.WriteMessage(Parent); + output.WriteString(Url); } if (_unknownFields != null) { _unknownFields.WriteTo(output); @@ -229,13 +396,9 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (Name.Length != 0) { + if (Url.Length != 0) { output.WriteRawTag(10); - output.WriteString(Name); - } - if (parent_ != null) { - output.WriteRawTag(18); - output.WriteMessage(Parent); + output.WriteString(Url); } if (_unknownFields != null) { _unknownFields.WriteTo(ref output); @@ -246,11 +409,8 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; - if (Name.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Name); - } - if (parent_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Parent); + if (Url.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Url); } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); @@ -259,18 +419,12 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(Collection other) { + public void MergeFrom(WebsocketDetailsResponse other) { if (other == null) { return; } - if (other.Name.Length != 0) { - Name = other.Name; - } - if (other.parent_ != null) { - if (parent_ == null) { - Parent = new global::Nitric.Proto.Document.v1.Key(); - } - Parent.MergeFrom(other.Parent); + if (other.Url.Length != 0) { + Url = other.Url; } _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } @@ -287,14 +441,7 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { - Name = input.ReadString(); - break; - } - case 18: { - if (parent_ == null) { - Parent = new global::Nitric.Proto.Document.v1.Key(); - } - input.ReadMessage(Parent); + Url = input.ReadString(); break; } } @@ -312,14 +459,7 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; case 10: { - Name = input.ReadString(); - break; - } - case 18: { - if (parent_ == null) { - Parent = new global::Nitric.Proto.Document.v1.Key(); - } - input.ReadMessage(Parent); + Url = input.ReadString(); break; } } @@ -329,22 +469,19 @@ public void MergeFrom(pb::CodedInputStream input) { } - /// - /// Provides a document identifying key type - /// - public sealed partial class Key : pb::IMessage + public sealed partial class WebsocketSendRequest : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Key()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new WebsocketSendRequest()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Document.v1.DocumentReflection.Descriptor.MessageTypes[1]; } + get { return global::Nitric.Proto.Websockets.v1.WebsocketsReflection.Descriptor.MessageTypes[2]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -353,75 +490,92 @@ public sealed partial class Key : pb::IMessage } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Key() { + public WebsocketSendRequest() { OnConstruction(); } partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Key(Key other) : this() { - collection_ = other.collection_ != null ? other.collection_.Clone() : null; - id_ = other.id_; + public WebsocketSendRequest(WebsocketSendRequest other) : this() { + socketName_ = other.socketName_; + connectionId_ = other.connectionId_; + data_ = other.data_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Key Clone() { - return new Key(this); + public WebsocketSendRequest Clone() { + return new WebsocketSendRequest(this); } - /// Field number for the "collection" field. - public const int CollectionFieldNumber = 1; - private global::Nitric.Proto.Document.v1.Collection collection_; + /// Field number for the "socket_name" field. + public const int SocketNameFieldNumber = 1; + private string socketName_ = ""; /// - /// The item collection + /// The nitric name of the socket to send on /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Document.v1.Collection Collection { - get { return collection_; } + public string SocketName { + get { return socketName_; } set { - collection_ = value; + socketName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); } } - /// Field number for the "id" field. - public const int IdFieldNumber = 2; - private string id_ = ""; + /// Field number for the "connection_id" field. + public const int ConnectionIdFieldNumber = 2; + private string connectionId_ = ""; /// - /// The items unique id + /// The connection ID of the client to send to /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string Id { - get { return id_; } + public string ConnectionId { + get { return connectionId_; } set { - id_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + connectionId_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "data" field. + public const int DataFieldNumber = 3; + private pb::ByteString data_ = pb::ByteString.Empty; + /// + /// The data to send to the socket + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pb::ByteString Data { + get { return data_; } + set { + data_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { - return Equals(other as Key); + return Equals(other as WebsocketSendRequest); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(Key other) { + public bool Equals(WebsocketSendRequest other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } - if (!object.Equals(Collection, other.Collection)) return false; - if (Id != other.Id) return false; + if (SocketName != other.SocketName) return false; + if (ConnectionId != other.ConnectionId) return false; + if (Data != other.Data) return false; return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; - if (collection_ != null) hash ^= Collection.GetHashCode(); - if (Id.Length != 0) hash ^= Id.GetHashCode(); + if (SocketName.Length != 0) hash ^= SocketName.GetHashCode(); + if (ConnectionId.Length != 0) hash ^= ConnectionId.GetHashCode(); + if (Data.Length != 0) hash ^= Data.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -438,13 +592,17 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else - if (collection_ != null) { + if (SocketName.Length != 0) { output.WriteRawTag(10); - output.WriteMessage(Collection); + output.WriteString(SocketName); } - if (Id.Length != 0) { + if (ConnectionId.Length != 0) { output.WriteRawTag(18); - output.WriteString(Id); + output.WriteString(ConnectionId); + } + if (Data.Length != 0) { + output.WriteRawTag(26); + output.WriteBytes(Data); } if (_unknownFields != null) { _unknownFields.WriteTo(output); @@ -455,13 +613,17 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (collection_ != null) { + if (SocketName.Length != 0) { output.WriteRawTag(10); - output.WriteMessage(Collection); + output.WriteString(SocketName); } - if (Id.Length != 0) { + if (ConnectionId.Length != 0) { output.WriteRawTag(18); - output.WriteString(Id); + output.WriteString(ConnectionId); + } + if (Data.Length != 0) { + output.WriteRawTag(26); + output.WriteBytes(Data); } if (_unknownFields != null) { _unknownFields.WriteTo(ref output); @@ -472,11 +634,14 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; - if (collection_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Collection); + if (SocketName.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(SocketName); } - if (Id.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Id); + if (ConnectionId.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(ConnectionId); + } + if (Data.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeBytesSize(Data); } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); @@ -485,18 +650,178 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(Key other) { + public void MergeFrom(WebsocketSendRequest other) { if (other == null) { return; } - if (other.collection_ != null) { - if (collection_ == null) { - Collection = new global::Nitric.Proto.Document.v1.Collection(); + if (other.SocketName.Length != 0) { + SocketName = other.SocketName; + } + if (other.ConnectionId.Length != 0) { + ConnectionId = other.ConnectionId; + } + if (other.Data.Length != 0) { + Data = other.Data; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + SocketName = input.ReadString(); + break; + } + case 18: { + ConnectionId = input.ReadString(); + break; + } + case 26: { + Data = input.ReadBytes(); + break; + } } - Collection.MergeFrom(other.Collection); } - if (other.Id.Length != 0) { - Id = other.Id; + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + SocketName = input.ReadString(); + break; + } + case 18: { + ConnectionId = input.ReadString(); + break; + } + case 26: { + Data = input.ReadBytes(); + break; + } + } + } + } + #endif + + } + + public sealed partial class WebsocketSendResponse : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new WebsocketSendResponse()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Nitric.Proto.Websockets.v1.WebsocketsReflection.Descriptor.MessageTypes[3]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public WebsocketSendResponse() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public WebsocketSendResponse(WebsocketSendResponse other) : this() { + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public WebsocketSendResponse Clone() { + return new WebsocketSendResponse(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as WebsocketSendResponse); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(WebsocketSendResponse other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(WebsocketSendResponse other) { + if (other == null) { + return; } _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } @@ -512,17 +837,6 @@ public void MergeFrom(pb::CodedInputStream input) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; - case 10: { - if (collection_ == null) { - Collection = new global::Nitric.Proto.Document.v1.Collection(); - } - input.ReadMessage(Collection); - break; - } - case 18: { - Id = input.ReadString(); - break; - } } } #endif @@ -537,17 +851,6 @@ public void MergeFrom(pb::CodedInputStream input) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; - case 10: { - if (collection_ == null) { - Collection = new global::Nitric.Proto.Document.v1.Collection(); - } - input.ReadMessage(Collection); - break; - } - case 18: { - Id = input.ReadString(); - break; - } } } } @@ -555,22 +858,19 @@ public void MergeFrom(pb::CodedInputStream input) { } - /// - /// Provides a return document type - /// - public sealed partial class Document : pb::IMessage + public sealed partial class WebsocketCloseConnectionRequest : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Document()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new WebsocketCloseConnectionRequest()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Document.v1.DocumentReflection.Descriptor.MessageTypes[2]; } + get { return global::Nitric.Proto.Websockets.v1.WebsocketsReflection.Descriptor.MessageTypes[4]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -579,75 +879,75 @@ public sealed partial class Document : pb::IMessage } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Document() { + public WebsocketCloseConnectionRequest() { OnConstruction(); } partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Document(Document other) : this() { - content_ = other.content_ != null ? other.content_.Clone() : null; - key_ = other.key_ != null ? other.key_.Clone() : null; + public WebsocketCloseConnectionRequest(WebsocketCloseConnectionRequest other) : this() { + socketName_ = other.socketName_; + connectionId_ = other.connectionId_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Document Clone() { - return new Document(this); + public WebsocketCloseConnectionRequest Clone() { + return new WebsocketCloseConnectionRequest(this); } - /// Field number for the "content" field. - public const int ContentFieldNumber = 1; - private global::Google.Protobuf.WellKnownTypes.Struct content_; + /// Field number for the "socket_name" field. + public const int SocketNameFieldNumber = 1; + private string socketName_ = ""; /// - /// The document content (JSON object) + /// The nitric name of the socket to send on /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Google.Protobuf.WellKnownTypes.Struct Content { - get { return content_; } + public string SocketName { + get { return socketName_; } set { - content_ = value; + socketName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); } } - /// Field number for the "key" field. - public const int KeyFieldNumber = 2; - private global::Nitric.Proto.Document.v1.Key key_; + /// Field number for the "connection_id" field. + public const int ConnectionIdFieldNumber = 2; + private string connectionId_ = ""; /// - /// The document's unique key, including collection/sub-collections + /// The connection ID of the client to send to /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Document.v1.Key Key { - get { return key_; } + public string ConnectionId { + get { return connectionId_; } set { - key_ = value; + connectionId_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { - return Equals(other as Document); + return Equals(other as WebsocketCloseConnectionRequest); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(Document other) { + public bool Equals(WebsocketCloseConnectionRequest other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } - if (!object.Equals(Content, other.Content)) return false; - if (!object.Equals(Key, other.Key)) return false; + if (SocketName != other.SocketName) return false; + if (ConnectionId != other.ConnectionId) return false; return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; - if (content_ != null) hash ^= Content.GetHashCode(); - if (key_ != null) hash ^= Key.GetHashCode(); + if (SocketName.Length != 0) hash ^= SocketName.GetHashCode(); + if (ConnectionId.Length != 0) hash ^= ConnectionId.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -664,13 +964,13 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else - if (content_ != null) { + if (SocketName.Length != 0) { output.WriteRawTag(10); - output.WriteMessage(Content); + output.WriteString(SocketName); } - if (key_ != null) { + if (ConnectionId.Length != 0) { output.WriteRawTag(18); - output.WriteMessage(Key); + output.WriteString(ConnectionId); } if (_unknownFields != null) { _unknownFields.WriteTo(output); @@ -681,13 +981,13 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (content_ != null) { + if (SocketName.Length != 0) { output.WriteRawTag(10); - output.WriteMessage(Content); + output.WriteString(SocketName); } - if (key_ != null) { + if (ConnectionId.Length != 0) { output.WriteRawTag(18); - output.WriteMessage(Key); + output.WriteString(ConnectionId); } if (_unknownFields != null) { _unknownFields.WriteTo(ref output); @@ -698,11 +998,11 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; - if (content_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Content); + if (SocketName.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(SocketName); } - if (key_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Key); + if (ConnectionId.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(ConnectionId); } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); @@ -711,21 +1011,15 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(Document other) { + public void MergeFrom(WebsocketCloseConnectionRequest other) { if (other == null) { return; } - if (other.content_ != null) { - if (content_ == null) { - Content = new global::Google.Protobuf.WellKnownTypes.Struct(); - } - Content.MergeFrom(other.Content); + if (other.SocketName.Length != 0) { + SocketName = other.SocketName; } - if (other.key_ != null) { - if (key_ == null) { - Key = new global::Nitric.Proto.Document.v1.Key(); - } - Key.MergeFrom(other.Key); + if (other.ConnectionId.Length != 0) { + ConnectionId = other.ConnectionId; } _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } @@ -742,17 +1036,11 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { - if (content_ == null) { - Content = new global::Google.Protobuf.WellKnownTypes.Struct(); - } - input.ReadMessage(Content); + SocketName = input.ReadString(); break; } case 18: { - if (key_ == null) { - Key = new global::Nitric.Proto.Document.v1.Key(); - } - input.ReadMessage(Key); + ConnectionId = input.ReadString(); break; } } @@ -770,17 +1058,11 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; case 10: { - if (content_ == null) { - Content = new global::Google.Protobuf.WellKnownTypes.Struct(); - } - input.ReadMessage(Content); + SocketName = input.ReadString(); break; } case 18: { - if (key_ == null) { - Key = new global::Nitric.Proto.Document.v1.Key(); - } - input.ReadMessage(Key); + ConnectionId = input.ReadString(); break; } } @@ -790,19 +1072,19 @@ public void MergeFrom(pb::CodedInputStream input) { } - public sealed partial class ExpressionValue : pb::IMessage + public sealed partial class WebsocketCloseConnectionResponse : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ExpressionValue()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new WebsocketCloseConnectionResponse()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Document.v1.DocumentReflection.Descriptor.MessageTypes[3]; } + get { return global::Nitric.Proto.Websockets.v1.WebsocketsReflection.Descriptor.MessageTypes[5]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -811,143 +1093,41 @@ public sealed partial class ExpressionValue : pb::IMessage } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ExpressionValue() { + public WebsocketCloseConnectionResponse() { OnConstruction(); } partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ExpressionValue(ExpressionValue other) : this() { - switch (other.KindCase) { - case KindOneofCase.IntValue: - IntValue = other.IntValue; - break; - case KindOneofCase.DoubleValue: - DoubleValue = other.DoubleValue; - break; - case KindOneofCase.StringValue: - StringValue = other.StringValue; - break; - case KindOneofCase.BoolValue: - BoolValue = other.BoolValue; - break; - } - + public WebsocketCloseConnectionResponse(WebsocketCloseConnectionResponse other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ExpressionValue Clone() { - return new ExpressionValue(this); - } - - /// Field number for the "int_value" field. - public const int IntValueFieldNumber = 1; - /// - /// Represents an integer value. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public long IntValue { - get { return kindCase_ == KindOneofCase.IntValue ? (long) kind_ : 0L; } - set { - kind_ = value; - kindCase_ = KindOneofCase.IntValue; - } - } - - /// Field number for the "double_value" field. - public const int DoubleValueFieldNumber = 2; - /// - /// Represents a double value. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double DoubleValue { - get { return kindCase_ == KindOneofCase.DoubleValue ? (double) kind_ : 0D; } - set { - kind_ = value; - kindCase_ = KindOneofCase.DoubleValue; - } - } - - /// Field number for the "string_value" field. - public const int StringValueFieldNumber = 3; - /// - /// Represents a string value. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string StringValue { - get { return kindCase_ == KindOneofCase.StringValue ? (string) kind_ : ""; } - set { - kind_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - kindCase_ = KindOneofCase.StringValue; - } - } - - /// Field number for the "bool_value" field. - public const int BoolValueFieldNumber = 4; - /// - /// Represents a boolean value. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool BoolValue { - get { return kindCase_ == KindOneofCase.BoolValue ? (bool) kind_ : false; } - set { - kind_ = value; - kindCase_ = KindOneofCase.BoolValue; - } - } - - private object kind_; - /// Enum of possible cases for the "kind" oneof. - public enum KindOneofCase { - None = 0, - IntValue = 1, - DoubleValue = 2, - StringValue = 3, - BoolValue = 4, - } - private KindOneofCase kindCase_ = KindOneofCase.None; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public KindOneofCase KindCase { - get { return kindCase_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearKind() { - kindCase_ = KindOneofCase.None; - kind_ = null; + public WebsocketCloseConnectionResponse Clone() { + return new WebsocketCloseConnectionResponse(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { - return Equals(other as ExpressionValue); + return Equals(other as WebsocketCloseConnectionResponse); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(ExpressionValue other) { + public bool Equals(WebsocketCloseConnectionResponse other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } - if (IntValue != other.IntValue) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleValue, other.DoubleValue)) return false; - if (StringValue != other.StringValue) return false; - if (BoolValue != other.BoolValue) return false; - if (KindCase != other.KindCase) return false; return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; - if (kindCase_ == KindOneofCase.IntValue) hash ^= IntValue.GetHashCode(); - if (kindCase_ == KindOneofCase.DoubleValue) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleValue); - if (kindCase_ == KindOneofCase.StringValue) hash ^= StringValue.GetHashCode(); - if (kindCase_ == KindOneofCase.BoolValue) hash ^= BoolValue.GetHashCode(); - hash ^= (int) kindCase_; if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -964,22 +1144,6 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else - if (kindCase_ == KindOneofCase.IntValue) { - output.WriteRawTag(8); - output.WriteInt64(IntValue); - } - if (kindCase_ == KindOneofCase.DoubleValue) { - output.WriteRawTag(17); - output.WriteDouble(DoubleValue); - } - if (kindCase_ == KindOneofCase.StringValue) { - output.WriteRawTag(26); - output.WriteString(StringValue); - } - if (kindCase_ == KindOneofCase.BoolValue) { - output.WriteRawTag(32); - output.WriteBool(BoolValue); - } if (_unknownFields != null) { _unknownFields.WriteTo(output); } @@ -989,22 +1153,6 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (kindCase_ == KindOneofCase.IntValue) { - output.WriteRawTag(8); - output.WriteInt64(IntValue); - } - if (kindCase_ == KindOneofCase.DoubleValue) { - output.WriteRawTag(17); - output.WriteDouble(DoubleValue); - } - if (kindCase_ == KindOneofCase.StringValue) { - output.WriteRawTag(26); - output.WriteString(StringValue); - } - if (kindCase_ == KindOneofCase.BoolValue) { - output.WriteRawTag(32); - output.WriteBool(BoolValue); - } if (_unknownFields != null) { _unknownFields.WriteTo(ref output); } @@ -1014,18 +1162,6 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; - if (kindCase_ == KindOneofCase.IntValue) { - size += 1 + pb::CodedOutputStream.ComputeInt64Size(IntValue); - } - if (kindCase_ == KindOneofCase.DoubleValue) { - size += 1 + 8; - } - if (kindCase_ == KindOneofCase.StringValue) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(StringValue); - } - if (kindCase_ == KindOneofCase.BoolValue) { - size += 1 + 1; - } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); } @@ -1033,25 +1169,10 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(ExpressionValue other) { + public void MergeFrom(WebsocketCloseConnectionResponse other) { if (other == null) { return; } - switch (other.KindCase) { - case KindOneofCase.IntValue: - IntValue = other.IntValue; - break; - case KindOneofCase.DoubleValue: - DoubleValue = other.DoubleValue; - break; - case KindOneofCase.StringValue: - StringValue = other.StringValue; - break; - case KindOneofCase.BoolValue: - BoolValue = other.BoolValue; - break; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } @@ -1066,22 +1187,6 @@ public void MergeFrom(pb::CodedInputStream input) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; - case 8: { - IntValue = input.ReadInt64(); - break; - } - case 17: { - DoubleValue = input.ReadDouble(); - break; - } - case 26: { - StringValue = input.ReadString(); - break; - } - case 32: { - BoolValue = input.ReadBool(); - break; - } } } #endif @@ -1096,22 +1201,6 @@ public void MergeFrom(pb::CodedInputStream input) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; - case 8: { - IntValue = input.ReadInt64(); - break; - } - case 17: { - DoubleValue = input.ReadDouble(); - break; - } - case 26: { - StringValue = input.ReadString(); - break; - } - case 32: { - BoolValue = input.ReadBool(); - break; - } } } } @@ -1120,21 +1209,21 @@ public void MergeFrom(pb::CodedInputStream input) { } /// - /// Provides a query expression type + /// ClientMessages are sent from the service to the nitric server /// - public sealed partial class Expression : pb::IMessage + public sealed partial class ClientMessage : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Expression()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ClientMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Document.v1.DocumentReflection.Descriptor.MessageTypes[4]; } + get { return global::Nitric.Proto.Websockets.v1.WebsocketsReflection.Descriptor.MessageTypes[6]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1143,92 +1232,122 @@ public sealed partial class Expression : pb::IMessage } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Expression() { + public ClientMessage() { OnConstruction(); } partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Expression(Expression other) : this() { - operand_ = other.operand_; - operator_ = other.operator_; - value_ = other.value_ != null ? other.value_.Clone() : null; + public ClientMessage(ClientMessage other) : this() { + id_ = other.id_; + switch (other.ContentCase) { + case ContentOneofCase.RegistrationRequest: + RegistrationRequest = other.RegistrationRequest.Clone(); + break; + case ContentOneofCase.WebsocketEventResponse: + WebsocketEventResponse = other.WebsocketEventResponse.Clone(); + break; + } + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Expression Clone() { - return new Expression(this); + public ClientMessage Clone() { + return new ClientMessage(this); } - /// Field number for the "operand" field. - public const int OperandFieldNumber = 1; - private string operand_ = ""; + /// Field number for the "id" field. + public const int IdFieldNumber = 1; + private string id_ = ""; /// - /// The query operand or attribute + /// Globally unique id to pair requests/responses /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string Operand { - get { return operand_; } + public string Id { + get { return id_; } set { - operand_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + id_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); } } - /// Field number for the "operator" field. - public const int OperatorFieldNumber = 2; - private string operator_ = ""; + /// Field number for the "registration_request" field. + public const int RegistrationRequestFieldNumber = 2; /// - /// The query operator [ == | < | <= | > | >= | startsWith ] + /// Client initialisation request + /// A worker will not be eligible for triggers + /// until it has identified itself /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string Operator { - get { return operator_; } + public global::Nitric.Proto.Websockets.v1.RegistrationRequest RegistrationRequest { + get { return contentCase_ == ContentOneofCase.RegistrationRequest ? (global::Nitric.Proto.Websockets.v1.RegistrationRequest) content_ : null; } set { - operator_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + content_ = value; + contentCase_ = value == null ? ContentOneofCase.None : ContentOneofCase.RegistrationRequest; } } - /// Field number for the "value" field. - public const int ValueFieldNumber = 3; - private global::Nitric.Proto.Document.v1.ExpressionValue value_; + /// Field number for the "websocket_event_response" field. + public const int WebsocketEventResponseFieldNumber = 3; /// - /// The query expression value + /// Client responding with result of a trigger /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Document.v1.ExpressionValue Value { - get { return value_; } + public global::Nitric.Proto.Websockets.v1.WebsocketEventResponse WebsocketEventResponse { + get { return contentCase_ == ContentOneofCase.WebsocketEventResponse ? (global::Nitric.Proto.Websockets.v1.WebsocketEventResponse) content_ : null; } set { - value_ = value; + content_ = value; + contentCase_ = value == null ? ContentOneofCase.None : ContentOneofCase.WebsocketEventResponse; } } + private object content_; + /// Enum of possible cases for the "content" oneof. + public enum ContentOneofCase { + None = 0, + RegistrationRequest = 2, + WebsocketEventResponse = 3, + } + private ContentOneofCase contentCase_ = ContentOneofCase.None; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ContentOneofCase ContentCase { + get { return contentCase_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void ClearContent() { + contentCase_ = ContentOneofCase.None; + content_ = null; + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { - return Equals(other as Expression); + return Equals(other as ClientMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(Expression other) { + public bool Equals(ClientMessage other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } - if (Operand != other.Operand) return false; - if (Operator != other.Operator) return false; - if (!object.Equals(Value, other.Value)) return false; + if (Id != other.Id) return false; + if (!object.Equals(RegistrationRequest, other.RegistrationRequest)) return false; + if (!object.Equals(WebsocketEventResponse, other.WebsocketEventResponse)) return false; + if (ContentCase != other.ContentCase) return false; return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; - if (Operand.Length != 0) hash ^= Operand.GetHashCode(); - if (Operator.Length != 0) hash ^= Operator.GetHashCode(); - if (value_ != null) hash ^= Value.GetHashCode(); + if (Id.Length != 0) hash ^= Id.GetHashCode(); + if (contentCase_ == ContentOneofCase.RegistrationRequest) hash ^= RegistrationRequest.GetHashCode(); + if (contentCase_ == ContentOneofCase.WebsocketEventResponse) hash ^= WebsocketEventResponse.GetHashCode(); + hash ^= (int) contentCase_; if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -1245,17 +1364,17 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else - if (Operand.Length != 0) { + if (Id.Length != 0) { output.WriteRawTag(10); - output.WriteString(Operand); + output.WriteString(Id); } - if (Operator.Length != 0) { + if (contentCase_ == ContentOneofCase.RegistrationRequest) { output.WriteRawTag(18); - output.WriteString(Operator); + output.WriteMessage(RegistrationRequest); } - if (value_ != null) { + if (contentCase_ == ContentOneofCase.WebsocketEventResponse) { output.WriteRawTag(26); - output.WriteMessage(Value); + output.WriteMessage(WebsocketEventResponse); } if (_unknownFields != null) { _unknownFields.WriteTo(output); @@ -1266,17 +1385,17 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (Operand.Length != 0) { + if (Id.Length != 0) { output.WriteRawTag(10); - output.WriteString(Operand); + output.WriteString(Id); } - if (Operator.Length != 0) { + if (contentCase_ == ContentOneofCase.RegistrationRequest) { output.WriteRawTag(18); - output.WriteString(Operator); + output.WriteMessage(RegistrationRequest); } - if (value_ != null) { + if (contentCase_ == ContentOneofCase.WebsocketEventResponse) { output.WriteRawTag(26); - output.WriteMessage(Value); + output.WriteMessage(WebsocketEventResponse); } if (_unknownFields != null) { _unknownFields.WriteTo(ref output); @@ -1287,14 +1406,14 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; - if (Operand.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Operand); + if (Id.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Id); } - if (Operator.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Operator); + if (contentCase_ == ContentOneofCase.RegistrationRequest) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(RegistrationRequest); } - if (value_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Value); + if (contentCase_ == ContentOneofCase.WebsocketEventResponse) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(WebsocketEventResponse); } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); @@ -1303,22 +1422,28 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(Expression other) { + public void MergeFrom(ClientMessage other) { if (other == null) { return; } - if (other.Operand.Length != 0) { - Operand = other.Operand; - } - if (other.Operator.Length != 0) { - Operator = other.Operator; + if (other.Id.Length != 0) { + Id = other.Id; } - if (other.value_ != null) { - if (value_ == null) { - Value = new global::Nitric.Proto.Document.v1.ExpressionValue(); - } - Value.MergeFrom(other.Value); + switch (other.ContentCase) { + case ContentOneofCase.RegistrationRequest: + if (RegistrationRequest == null) { + RegistrationRequest = new global::Nitric.Proto.Websockets.v1.RegistrationRequest(); + } + RegistrationRequest.MergeFrom(other.RegistrationRequest); + break; + case ContentOneofCase.WebsocketEventResponse: + if (WebsocketEventResponse == null) { + WebsocketEventResponse = new global::Nitric.Proto.Websockets.v1.WebsocketEventResponse(); + } + WebsocketEventResponse.MergeFrom(other.WebsocketEventResponse); + break; } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } @@ -1334,18 +1459,25 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { - Operand = input.ReadString(); + Id = input.ReadString(); break; } case 18: { - Operator = input.ReadString(); + global::Nitric.Proto.Websockets.v1.RegistrationRequest subBuilder = new global::Nitric.Proto.Websockets.v1.RegistrationRequest(); + if (contentCase_ == ContentOneofCase.RegistrationRequest) { + subBuilder.MergeFrom(RegistrationRequest); + } + input.ReadMessage(subBuilder); + RegistrationRequest = subBuilder; break; } case 26: { - if (value_ == null) { - Value = new global::Nitric.Proto.Document.v1.ExpressionValue(); + global::Nitric.Proto.Websockets.v1.WebsocketEventResponse subBuilder = new global::Nitric.Proto.Websockets.v1.WebsocketEventResponse(); + if (contentCase_ == ContentOneofCase.WebsocketEventResponse) { + subBuilder.MergeFrom(WebsocketEventResponse); } - input.ReadMessage(Value); + input.ReadMessage(subBuilder); + WebsocketEventResponse = subBuilder; break; } } @@ -1363,18 +1495,25 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; case 10: { - Operand = input.ReadString(); + Id = input.ReadString(); break; } case 18: { - Operator = input.ReadString(); + global::Nitric.Proto.Websockets.v1.RegistrationRequest subBuilder = new global::Nitric.Proto.Websockets.v1.RegistrationRequest(); + if (contentCase_ == ContentOneofCase.RegistrationRequest) { + subBuilder.MergeFrom(RegistrationRequest); + } + input.ReadMessage(subBuilder); + RegistrationRequest = subBuilder; break; } case 26: { - if (value_ == null) { - Value = new global::Nitric.Proto.Document.v1.ExpressionValue(); + global::Nitric.Proto.Websockets.v1.WebsocketEventResponse subBuilder = new global::Nitric.Proto.Websockets.v1.WebsocketEventResponse(); + if (contentCase_ == ContentOneofCase.WebsocketEventResponse) { + subBuilder.MergeFrom(WebsocketEventResponse); } - input.ReadMessage(Value); + input.ReadMessage(subBuilder); + WebsocketEventResponse = subBuilder; break; } } @@ -1384,19 +1523,22 @@ public void MergeFrom(pb::CodedInputStream input) { } - public sealed partial class DocumentGetRequest : pb::IMessage + /// + /// Placeholder message + /// + public sealed partial class RegistrationResponse : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DocumentGetRequest()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RegistrationResponse()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Document.v1.DocumentReflection.Descriptor.MessageTypes[5]; } + get { return global::Nitric.Proto.Websockets.v1.WebsocketsReflection.Descriptor.MessageTypes[7]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1405,58 +1547,41 @@ public sealed partial class DocumentGetRequest : pb::IMessageField number for the "key" field. - public const int KeyFieldNumber = 1; - private global::Nitric.Proto.Document.v1.Key key_; - /// - /// Key of the document to retrieve - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Document.v1.Key Key { - get { return key_; } - set { - key_ = value; - } + public RegistrationResponse Clone() { + return new RegistrationResponse(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { - return Equals(other as DocumentGetRequest); + return Equals(other as RegistrationResponse); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(DocumentGetRequest other) { + public bool Equals(RegistrationResponse other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } - if (!object.Equals(Key, other.Key)) return false; return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; - if (key_ != null) hash ^= Key.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -1473,10 +1598,6 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else - if (key_ != null) { - output.WriteRawTag(10); - output.WriteMessage(Key); - } if (_unknownFields != null) { _unknownFields.WriteTo(output); } @@ -1486,10 +1607,6 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (key_ != null) { - output.WriteRawTag(10); - output.WriteMessage(Key); - } if (_unknownFields != null) { _unknownFields.WriteTo(ref output); } @@ -1499,9 +1616,6 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; - if (key_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Key); - } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); } @@ -1509,16 +1623,10 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(DocumentGetRequest other) { + public void MergeFrom(RegistrationResponse other) { if (other == null) { return; } - if (other.key_ != null) { - if (key_ == null) { - Key = new global::Nitric.Proto.Document.v1.Key(); - } - Key.MergeFrom(other.Key); - } _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } @@ -1533,13 +1641,6 @@ public void MergeFrom(pb::CodedInputStream input) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; - case 10: { - if (key_ == null) { - Key = new global::Nitric.Proto.Document.v1.Key(); - } - input.ReadMessage(Key); - break; - } } } #endif @@ -1554,13 +1655,6 @@ public void MergeFrom(pb::CodedInputStream input) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; - case 10: { - if (key_ == null) { - Key = new global::Nitric.Proto.Document.v1.Key(); - } - input.ReadMessage(Key); - break; - } } } } @@ -1568,19 +1662,19 @@ public void MergeFrom(pb::CodedInputStream input) { } - public sealed partial class DocumentGetResponse : pb::IMessage + public sealed partial class RegistrationRequest : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DocumentGetResponse()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RegistrationRequest()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Document.v1.DocumentReflection.Descriptor.MessageTypes[6]; } + get { return global::Nitric.Proto.Websockets.v1.WebsocketsReflection.Descriptor.MessageTypes[8]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1589,58 +1683,75 @@ public sealed partial class DocumentGetResponse : pb::IMessageField number for the "socket_name" field. + public const int SocketNameFieldNumber = 1; + private string socketName_ = ""; + /// + /// The nitric name of the socket that this worker listens on + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string SocketName { + get { return socketName_; } + set { + socketName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } } - /// Field number for the "document" field. - public const int DocumentFieldNumber = 1; - private global::Nitric.Proto.Document.v1.Document document_; + /// Field number for the "event_type" field. + public const int EventTypeFieldNumber = 2; + private global::Nitric.Proto.Websockets.v1.WebsocketEventType eventType_ = global::Nitric.Proto.Websockets.v1.WebsocketEventType.Connect; /// - /// The retrieved value + /// The type of event that this worker handles /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Document.v1.Document Document { - get { return document_; } + public global::Nitric.Proto.Websockets.v1.WebsocketEventType EventType { + get { return eventType_; } set { - document_ = value; + eventType_ = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { - return Equals(other as DocumentGetResponse); + return Equals(other as RegistrationRequest); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(DocumentGetResponse other) { + public bool Equals(RegistrationRequest other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } - if (!object.Equals(Document, other.Document)) return false; + if (SocketName != other.SocketName) return false; + if (EventType != other.EventType) return false; return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; - if (document_ != null) hash ^= Document.GetHashCode(); + if (SocketName.Length != 0) hash ^= SocketName.GetHashCode(); + if (EventType != global::Nitric.Proto.Websockets.v1.WebsocketEventType.Connect) hash ^= EventType.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -1657,9 +1768,13 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else - if (document_ != null) { + if (SocketName.Length != 0) { output.WriteRawTag(10); - output.WriteMessage(Document); + output.WriteString(SocketName); + } + if (EventType != global::Nitric.Proto.Websockets.v1.WebsocketEventType.Connect) { + output.WriteRawTag(16); + output.WriteEnum((int) EventType); } if (_unknownFields != null) { _unknownFields.WriteTo(output); @@ -1670,9 +1785,13 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (document_ != null) { + if (SocketName.Length != 0) { output.WriteRawTag(10); - output.WriteMessage(Document); + output.WriteString(SocketName); + } + if (EventType != global::Nitric.Proto.Websockets.v1.WebsocketEventType.Connect) { + output.WriteRawTag(16); + output.WriteEnum((int) EventType); } if (_unknownFields != null) { _unknownFields.WriteTo(ref output); @@ -1683,8 +1802,11 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; - if (document_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Document); + if (SocketName.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(SocketName); + } + if (EventType != global::Nitric.Proto.Websockets.v1.WebsocketEventType.Connect) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) EventType); } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); @@ -1693,15 +1815,15 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(DocumentGetResponse other) { + public void MergeFrom(RegistrationRequest other) { if (other == null) { return; } - if (other.document_ != null) { - if (document_ == null) { - Document = new global::Nitric.Proto.Document.v1.Document(); - } - Document.MergeFrom(other.Document); + if (other.SocketName.Length != 0) { + SocketName = other.SocketName; + } + if (other.EventType != global::Nitric.Proto.Websockets.v1.WebsocketEventType.Connect) { + EventType = other.EventType; } _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } @@ -1718,10 +1840,11 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { - if (document_ == null) { - Document = new global::Nitric.Proto.Document.v1.Document(); - } - input.ReadMessage(Document); + SocketName = input.ReadString(); + break; + } + case 16: { + EventType = (global::Nitric.Proto.Websockets.v1.WebsocketEventType) input.ReadEnum(); break; } } @@ -1739,10 +1862,11 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; case 10: { - if (document_ == null) { - Document = new global::Nitric.Proto.Document.v1.Document(); - } - input.ReadMessage(Document); + SocketName = input.ReadString(); + break; + } + case 16: { + EventType = (global::Nitric.Proto.Websockets.v1.WebsocketEventType) input.ReadEnum(); break; } } @@ -1752,19 +1876,19 @@ public void MergeFrom(pb::CodedInputStream input) { } - public sealed partial class DocumentSetRequest : pb::IMessage + public sealed partial class WebsocketEventRequest : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DocumentSetRequest()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new WebsocketEventRequest()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Document.v1.DocumentReflection.Descriptor.MessageTypes[7]; } + get { return global::Nitric.Proto.Websockets.v1.WebsocketsReflection.Descriptor.MessageTypes[9]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1773,75 +1897,148 @@ public sealed partial class DocumentSetRequest : pb::IMessageField number for the "key" field. - public const int KeyFieldNumber = 1; - private global::Nitric.Proto.Document.v1.Key key_; + /// Field number for the "socket_name" field. + public const int SocketNameFieldNumber = 1; + private string socketName_ = ""; /// - /// Key of the document to set + /// The nitric name of the socket that this worker listens on /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Document.v1.Key Key { - get { return key_; } + public string SocketName { + get { return socketName_; } set { - key_ = value; + socketName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); } } - /// Field number for the "content" field. - public const int ContentFieldNumber = 3; - private global::Google.Protobuf.WellKnownTypes.Struct content_; + /// Field number for the "connection_id" field. + public const int ConnectionIdFieldNumber = 2; + private string connectionId_ = ""; /// - /// The document content to store (JSON object) + /// The connection this trigger came from /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Google.Protobuf.WellKnownTypes.Struct Content { - get { return content_; } + public string ConnectionId { + get { return connectionId_; } set { - content_ = value; + connectionId_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "connection" field. + public const int ConnectionFieldNumber = 10; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Nitric.Proto.Websockets.v1.WebsocketConnectionEvent Connection { + get { return websocketEventCase_ == WebsocketEventOneofCase.Connection ? (global::Nitric.Proto.Websockets.v1.WebsocketConnectionEvent) websocketEvent_ : null; } + set { + websocketEvent_ = value; + websocketEventCase_ = value == null ? WebsocketEventOneofCase.None : WebsocketEventOneofCase.Connection; + } + } + + /// Field number for the "disconnection" field. + public const int DisconnectionFieldNumber = 11; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Nitric.Proto.Websockets.v1.WebsocketDisconnectionEvent Disconnection { + get { return websocketEventCase_ == WebsocketEventOneofCase.Disconnection ? (global::Nitric.Proto.Websockets.v1.WebsocketDisconnectionEvent) websocketEvent_ : null; } + set { + websocketEvent_ = value; + websocketEventCase_ = value == null ? WebsocketEventOneofCase.None : WebsocketEventOneofCase.Disconnection; + } + } + + /// Field number for the "message" field. + public const int MessageFieldNumber = 12; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Nitric.Proto.Websockets.v1.WebsocketMessageEvent Message { + get { return websocketEventCase_ == WebsocketEventOneofCase.Message ? (global::Nitric.Proto.Websockets.v1.WebsocketMessageEvent) websocketEvent_ : null; } + set { + websocketEvent_ = value; + websocketEventCase_ = value == null ? WebsocketEventOneofCase.None : WebsocketEventOneofCase.Message; } } + private object websocketEvent_; + /// Enum of possible cases for the "websocket_event" oneof. + public enum WebsocketEventOneofCase { + None = 0, + Connection = 10, + Disconnection = 11, + Message = 12, + } + private WebsocketEventOneofCase websocketEventCase_ = WebsocketEventOneofCase.None; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public WebsocketEventOneofCase WebsocketEventCase { + get { return websocketEventCase_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void ClearWebsocketEvent() { + websocketEventCase_ = WebsocketEventOneofCase.None; + websocketEvent_ = null; + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { - return Equals(other as DocumentSetRequest); + return Equals(other as WebsocketEventRequest); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(DocumentSetRequest other) { + public bool Equals(WebsocketEventRequest other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } - if (!object.Equals(Key, other.Key)) return false; - if (!object.Equals(Content, other.Content)) return false; + if (SocketName != other.SocketName) return false; + if (ConnectionId != other.ConnectionId) return false; + if (!object.Equals(Connection, other.Connection)) return false; + if (!object.Equals(Disconnection, other.Disconnection)) return false; + if (!object.Equals(Message, other.Message)) return false; + if (WebsocketEventCase != other.WebsocketEventCase) return false; return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; - if (key_ != null) hash ^= Key.GetHashCode(); - if (content_ != null) hash ^= Content.GetHashCode(); + if (SocketName.Length != 0) hash ^= SocketName.GetHashCode(); + if (ConnectionId.Length != 0) hash ^= ConnectionId.GetHashCode(); + if (websocketEventCase_ == WebsocketEventOneofCase.Connection) hash ^= Connection.GetHashCode(); + if (websocketEventCase_ == WebsocketEventOneofCase.Disconnection) hash ^= Disconnection.GetHashCode(); + if (websocketEventCase_ == WebsocketEventOneofCase.Message) hash ^= Message.GetHashCode(); + hash ^= (int) websocketEventCase_; if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -1858,13 +2055,25 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else - if (key_ != null) { + if (SocketName.Length != 0) { output.WriteRawTag(10); - output.WriteMessage(Key); + output.WriteString(SocketName); } - if (content_ != null) { - output.WriteRawTag(26); - output.WriteMessage(Content); + if (ConnectionId.Length != 0) { + output.WriteRawTag(18); + output.WriteString(ConnectionId); + } + if (websocketEventCase_ == WebsocketEventOneofCase.Connection) { + output.WriteRawTag(82); + output.WriteMessage(Connection); + } + if (websocketEventCase_ == WebsocketEventOneofCase.Disconnection) { + output.WriteRawTag(90); + output.WriteMessage(Disconnection); + } + if (websocketEventCase_ == WebsocketEventOneofCase.Message) { + output.WriteRawTag(98); + output.WriteMessage(Message); } if (_unknownFields != null) { _unknownFields.WriteTo(output); @@ -1875,13 +2084,25 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (key_ != null) { + if (SocketName.Length != 0) { output.WriteRawTag(10); - output.WriteMessage(Key); + output.WriteString(SocketName); } - if (content_ != null) { - output.WriteRawTag(26); - output.WriteMessage(Content); + if (ConnectionId.Length != 0) { + output.WriteRawTag(18); + output.WriteString(ConnectionId); + } + if (websocketEventCase_ == WebsocketEventOneofCase.Connection) { + output.WriteRawTag(82); + output.WriteMessage(Connection); + } + if (websocketEventCase_ == WebsocketEventOneofCase.Disconnection) { + output.WriteRawTag(90); + output.WriteMessage(Disconnection); + } + if (websocketEventCase_ == WebsocketEventOneofCase.Message) { + output.WriteRawTag(98); + output.WriteMessage(Message); } if (_unknownFields != null) { _unknownFields.WriteTo(ref output); @@ -1892,11 +2113,20 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; - if (key_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Key); + if (SocketName.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(SocketName); + } + if (ConnectionId.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(ConnectionId); } - if (content_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Content); + if (websocketEventCase_ == WebsocketEventOneofCase.Connection) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Connection); + } + if (websocketEventCase_ == WebsocketEventOneofCase.Disconnection) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Disconnection); + } + if (websocketEventCase_ == WebsocketEventOneofCase.Message) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Message); } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); @@ -1905,22 +2135,37 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(DocumentSetRequest other) { + public void MergeFrom(WebsocketEventRequest other) { if (other == null) { return; } - if (other.key_ != null) { - if (key_ == null) { - Key = new global::Nitric.Proto.Document.v1.Key(); - } - Key.MergeFrom(other.Key); + if (other.SocketName.Length != 0) { + SocketName = other.SocketName; } - if (other.content_ != null) { - if (content_ == null) { - Content = new global::Google.Protobuf.WellKnownTypes.Struct(); - } - Content.MergeFrom(other.Content); + if (other.ConnectionId.Length != 0) { + ConnectionId = other.ConnectionId; } + switch (other.WebsocketEventCase) { + case WebsocketEventOneofCase.Connection: + if (Connection == null) { + Connection = new global::Nitric.Proto.Websockets.v1.WebsocketConnectionEvent(); + } + Connection.MergeFrom(other.Connection); + break; + case WebsocketEventOneofCase.Disconnection: + if (Disconnection == null) { + Disconnection = new global::Nitric.Proto.Websockets.v1.WebsocketDisconnectionEvent(); + } + Disconnection.MergeFrom(other.Disconnection); + break; + case WebsocketEventOneofCase.Message: + if (Message == null) { + Message = new global::Nitric.Proto.Websockets.v1.WebsocketMessageEvent(); + } + Message.MergeFrom(other.Message); + break; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } @@ -1935,18 +2180,39 @@ public void MergeFrom(pb::CodedInputStream input) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; - case 10: { - if (key_ == null) { - Key = new global::Nitric.Proto.Document.v1.Key(); + case 10: { + SocketName = input.ReadString(); + break; + } + case 18: { + ConnectionId = input.ReadString(); + break; + } + case 82: { + global::Nitric.Proto.Websockets.v1.WebsocketConnectionEvent subBuilder = new global::Nitric.Proto.Websockets.v1.WebsocketConnectionEvent(); + if (websocketEventCase_ == WebsocketEventOneofCase.Connection) { + subBuilder.MergeFrom(Connection); + } + input.ReadMessage(subBuilder); + Connection = subBuilder; + break; + } + case 90: { + global::Nitric.Proto.Websockets.v1.WebsocketDisconnectionEvent subBuilder = new global::Nitric.Proto.Websockets.v1.WebsocketDisconnectionEvent(); + if (websocketEventCase_ == WebsocketEventOneofCase.Disconnection) { + subBuilder.MergeFrom(Disconnection); } - input.ReadMessage(Key); + input.ReadMessage(subBuilder); + Disconnection = subBuilder; break; } - case 26: { - if (content_ == null) { - Content = new global::Google.Protobuf.WellKnownTypes.Struct(); + case 98: { + global::Nitric.Proto.Websockets.v1.WebsocketMessageEvent subBuilder = new global::Nitric.Proto.Websockets.v1.WebsocketMessageEvent(); + if (websocketEventCase_ == WebsocketEventOneofCase.Message) { + subBuilder.MergeFrom(Message); } - input.ReadMessage(Content); + input.ReadMessage(subBuilder); + Message = subBuilder; break; } } @@ -1964,17 +2230,38 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; case 10: { - if (key_ == null) { - Key = new global::Nitric.Proto.Document.v1.Key(); + SocketName = input.ReadString(); + break; + } + case 18: { + ConnectionId = input.ReadString(); + break; + } + case 82: { + global::Nitric.Proto.Websockets.v1.WebsocketConnectionEvent subBuilder = new global::Nitric.Proto.Websockets.v1.WebsocketConnectionEvent(); + if (websocketEventCase_ == WebsocketEventOneofCase.Connection) { + subBuilder.MergeFrom(Connection); } - input.ReadMessage(Key); + input.ReadMessage(subBuilder); + Connection = subBuilder; break; } - case 26: { - if (content_ == null) { - Content = new global::Google.Protobuf.WellKnownTypes.Struct(); + case 90: { + global::Nitric.Proto.Websockets.v1.WebsocketDisconnectionEvent subBuilder = new global::Nitric.Proto.Websockets.v1.WebsocketDisconnectionEvent(); + if (websocketEventCase_ == WebsocketEventOneofCase.Disconnection) { + subBuilder.MergeFrom(Disconnection); + } + input.ReadMessage(subBuilder); + Disconnection = subBuilder; + break; + } + case 98: { + global::Nitric.Proto.Websockets.v1.WebsocketMessageEvent subBuilder = new global::Nitric.Proto.Websockets.v1.WebsocketMessageEvent(); + if (websocketEventCase_ == WebsocketEventOneofCase.Message) { + subBuilder.MergeFrom(Message); } - input.ReadMessage(Content); + input.ReadMessage(subBuilder); + Message = subBuilder; break; } } @@ -1984,19 +2271,19 @@ public void MergeFrom(pb::CodedInputStream input) { } - public sealed partial class DocumentSetResponse : pb::IMessage + public sealed partial class QueryValue : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DocumentSetResponse()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new QueryValue()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Document.v1.DocumentReflection.Descriptor.MessageTypes[8]; } + get { return global::Nitric.Proto.Websockets.v1.WebsocketsReflection.Descriptor.MessageTypes[10]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -2005,41 +2292,54 @@ public sealed partial class DocumentSetResponse : pb::IMessageField number for the "value" field. + public const int ValueFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_value_codec + = pb::FieldCodec.ForString(10); + private readonly pbc::RepeatedField value_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField Value { + get { return value_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { - return Equals(other as DocumentSetResponse); + return Equals(other as QueryValue); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(DocumentSetResponse other) { + public bool Equals(QueryValue other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } + if(!value_.Equals(other.value_)) return false; return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; + hash ^= value_.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -2056,6 +2356,7 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else + value_.WriteTo(output, _repeated_value_codec); if (_unknownFields != null) { _unknownFields.WriteTo(output); } @@ -2065,6 +2366,7 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + value_.WriteTo(ref output, _repeated_value_codec); if (_unknownFields != null) { _unknownFields.WriteTo(ref output); } @@ -2074,6 +2376,7 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; + size += value_.CalculateSize(_repeated_value_codec); if (_unknownFields != null) { size += _unknownFields.CalculateSize(); } @@ -2081,10 +2384,11 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(DocumentSetResponse other) { + public void MergeFrom(QueryValue other) { if (other == null) { return; } + value_.Add(other.value_); _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } @@ -2099,6 +2403,10 @@ public void MergeFrom(pb::CodedInputStream input) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; + case 10: { + value_.AddEntriesFrom(input, _repeated_value_codec); + break; + } } } #endif @@ -2113,6 +2421,10 @@ public void MergeFrom(pb::CodedInputStream input) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; + case 10: { + value_.AddEntriesFrom(ref input, _repeated_value_codec); + break; + } } } } @@ -2120,19 +2432,22 @@ public void MergeFrom(pb::CodedInputStream input) { } - public sealed partial class DocumentDeleteRequest : pb::IMessage + /// + /// ServerMessages are sent from the nitric server to the service + /// + public sealed partial class ServerMessage : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DocumentDeleteRequest()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ServerMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Document.v1.DocumentReflection.Descriptor.MessageTypes[9]; } + get { return global::Nitric.Proto.Websockets.v1.WebsocketsReflection.Descriptor.MessageTypes[11]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -2141,58 +2456,122 @@ public sealed partial class DocumentDeleteRequest : pb::IMessageField number for the "id" field. + public const int IdFieldNumber = 1; + private string id_ = ""; + /// + /// Server message ID, used to pair requests/responses + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Id { + get { return id_; } + set { + id_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "registration_response" field. + public const int RegistrationResponseFieldNumber = 2; + /// + /// Server responding + /// with client configuration details to an + /// InitRequest + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Nitric.Proto.Websockets.v1.RegistrationResponse RegistrationResponse { + get { return contentCase_ == ContentOneofCase.RegistrationResponse ? (global::Nitric.Proto.Websockets.v1.RegistrationResponse) content_ : null; } + set { + content_ = value; + contentCase_ = value == null ? ContentOneofCase.None : ContentOneofCase.RegistrationResponse; + } } - /// Field number for the "key" field. - public const int KeyFieldNumber = 1; - private global::Nitric.Proto.Document.v1.Key key_; + /// Field number for the "websocket_event_request" field. + public const int WebsocketEventRequestFieldNumber = 3; /// - /// Key of the document to delete + /// Server requesting client to process an event /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Document.v1.Key Key { - get { return key_; } + public global::Nitric.Proto.Websockets.v1.WebsocketEventRequest WebsocketEventRequest { + get { return contentCase_ == ContentOneofCase.WebsocketEventRequest ? (global::Nitric.Proto.Websockets.v1.WebsocketEventRequest) content_ : null; } set { - key_ = value; + content_ = value; + contentCase_ = value == null ? ContentOneofCase.None : ContentOneofCase.WebsocketEventRequest; } } + private object content_; + /// Enum of possible cases for the "content" oneof. + public enum ContentOneofCase { + None = 0, + RegistrationResponse = 2, + WebsocketEventRequest = 3, + } + private ContentOneofCase contentCase_ = ContentOneofCase.None; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ContentOneofCase ContentCase { + get { return contentCase_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void ClearContent() { + contentCase_ = ContentOneofCase.None; + content_ = null; + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { - return Equals(other as DocumentDeleteRequest); + return Equals(other as ServerMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(DocumentDeleteRequest other) { + public bool Equals(ServerMessage other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } - if (!object.Equals(Key, other.Key)) return false; + if (Id != other.Id) return false; + if (!object.Equals(RegistrationResponse, other.RegistrationResponse)) return false; + if (!object.Equals(WebsocketEventRequest, other.WebsocketEventRequest)) return false; + if (ContentCase != other.ContentCase) return false; return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; - if (key_ != null) hash ^= Key.GetHashCode(); + if (Id.Length != 0) hash ^= Id.GetHashCode(); + if (contentCase_ == ContentOneofCase.RegistrationResponse) hash ^= RegistrationResponse.GetHashCode(); + if (contentCase_ == ContentOneofCase.WebsocketEventRequest) hash ^= WebsocketEventRequest.GetHashCode(); + hash ^= (int) contentCase_; if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -2209,9 +2588,17 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else - if (key_ != null) { + if (Id.Length != 0) { output.WriteRawTag(10); - output.WriteMessage(Key); + output.WriteString(Id); + } + if (contentCase_ == ContentOneofCase.RegistrationResponse) { + output.WriteRawTag(18); + output.WriteMessage(RegistrationResponse); + } + if (contentCase_ == ContentOneofCase.WebsocketEventRequest) { + output.WriteRawTag(26); + output.WriteMessage(WebsocketEventRequest); } if (_unknownFields != null) { _unknownFields.WriteTo(output); @@ -2222,9 +2609,17 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (key_ != null) { + if (Id.Length != 0) { output.WriteRawTag(10); - output.WriteMessage(Key); + output.WriteString(Id); + } + if (contentCase_ == ContentOneofCase.RegistrationResponse) { + output.WriteRawTag(18); + output.WriteMessage(RegistrationResponse); + } + if (contentCase_ == ContentOneofCase.WebsocketEventRequest) { + output.WriteRawTag(26); + output.WriteMessage(WebsocketEventRequest); } if (_unknownFields != null) { _unknownFields.WriteTo(ref output); @@ -2235,8 +2630,14 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; - if (key_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Key); + if (Id.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Id); + } + if (contentCase_ == ContentOneofCase.RegistrationResponse) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(RegistrationResponse); + } + if (contentCase_ == ContentOneofCase.WebsocketEventRequest) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(WebsocketEventRequest); } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); @@ -2245,16 +2646,28 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(DocumentDeleteRequest other) { + public void MergeFrom(ServerMessage other) { if (other == null) { return; } - if (other.key_ != null) { - if (key_ == null) { - Key = new global::Nitric.Proto.Document.v1.Key(); - } - Key.MergeFrom(other.Key); + if (other.Id.Length != 0) { + Id = other.Id; } + switch (other.ContentCase) { + case ContentOneofCase.RegistrationResponse: + if (RegistrationResponse == null) { + RegistrationResponse = new global::Nitric.Proto.Websockets.v1.RegistrationResponse(); + } + RegistrationResponse.MergeFrom(other.RegistrationResponse); + break; + case ContentOneofCase.WebsocketEventRequest: + if (WebsocketEventRequest == null) { + WebsocketEventRequest = new global::Nitric.Proto.Websockets.v1.WebsocketEventRequest(); + } + WebsocketEventRequest.MergeFrom(other.WebsocketEventRequest); + break; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } @@ -2270,10 +2683,25 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { - if (key_ == null) { - Key = new global::Nitric.Proto.Document.v1.Key(); + Id = input.ReadString(); + break; + } + case 18: { + global::Nitric.Proto.Websockets.v1.RegistrationResponse subBuilder = new global::Nitric.Proto.Websockets.v1.RegistrationResponse(); + if (contentCase_ == ContentOneofCase.RegistrationResponse) { + subBuilder.MergeFrom(RegistrationResponse); + } + input.ReadMessage(subBuilder); + RegistrationResponse = subBuilder; + break; + } + case 26: { + global::Nitric.Proto.Websockets.v1.WebsocketEventRequest subBuilder = new global::Nitric.Proto.Websockets.v1.WebsocketEventRequest(); + if (contentCase_ == ContentOneofCase.WebsocketEventRequest) { + subBuilder.MergeFrom(WebsocketEventRequest); } - input.ReadMessage(Key); + input.ReadMessage(subBuilder); + WebsocketEventRequest = subBuilder; break; } } @@ -2291,10 +2719,25 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; case 10: { - if (key_ == null) { - Key = new global::Nitric.Proto.Document.v1.Key(); + Id = input.ReadString(); + break; + } + case 18: { + global::Nitric.Proto.Websockets.v1.RegistrationResponse subBuilder = new global::Nitric.Proto.Websockets.v1.RegistrationResponse(); + if (contentCase_ == ContentOneofCase.RegistrationResponse) { + subBuilder.MergeFrom(RegistrationResponse); + } + input.ReadMessage(subBuilder); + RegistrationResponse = subBuilder; + break; + } + case 26: { + global::Nitric.Proto.Websockets.v1.WebsocketEventRequest subBuilder = new global::Nitric.Proto.Websockets.v1.WebsocketEventRequest(); + if (contentCase_ == ContentOneofCase.WebsocketEventRequest) { + subBuilder.MergeFrom(WebsocketEventRequest); } - input.ReadMessage(Key); + input.ReadMessage(subBuilder); + WebsocketEventRequest = subBuilder; break; } } @@ -2304,19 +2747,19 @@ public void MergeFrom(pb::CodedInputStream input) { } - public sealed partial class DocumentDeleteResponse : pb::IMessage + public sealed partial class WebsocketEventResponse : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DocumentDeleteResponse()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new WebsocketEventResponse()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Document.v1.DocumentReflection.Descriptor.MessageTypes[10]; } + get { return global::Nitric.Proto.Websockets.v1.WebsocketsReflection.Descriptor.MessageTypes[12]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -2325,41 +2768,84 @@ public sealed partial class DocumentDeleteResponse : pb::IMessageField number for the "connection_response" field. + public const int ConnectionResponseFieldNumber = 10; + /// + /// WebsocketDisconnectionResponse disconnection_response = 11; + /// WebsocketMessageEventResponse message_response = 12; + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Nitric.Proto.Websockets.v1.WebsocketConnectionResponse ConnectionResponse { + get { return websocketResponseCase_ == WebsocketResponseOneofCase.ConnectionResponse ? (global::Nitric.Proto.Websockets.v1.WebsocketConnectionResponse) websocketResponse_ : null; } + set { + websocketResponse_ = value; + websocketResponseCase_ = value == null ? WebsocketResponseOneofCase.None : WebsocketResponseOneofCase.ConnectionResponse; + } + } + + private object websocketResponse_; + /// Enum of possible cases for the "websocket_response" oneof. + public enum WebsocketResponseOneofCase { + None = 0, + ConnectionResponse = 10, + } + private WebsocketResponseOneofCase websocketResponseCase_ = WebsocketResponseOneofCase.None; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public WebsocketResponseOneofCase WebsocketResponseCase { + get { return websocketResponseCase_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void ClearWebsocketResponse() { + websocketResponseCase_ = WebsocketResponseOneofCase.None; + websocketResponse_ = null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { - return Equals(other as DocumentDeleteResponse); + return Equals(other as WebsocketEventResponse); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(DocumentDeleteResponse other) { + public bool Equals(WebsocketEventResponse other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } + if (!object.Equals(ConnectionResponse, other.ConnectionResponse)) return false; + if (WebsocketResponseCase != other.WebsocketResponseCase) return false; return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; + if (websocketResponseCase_ == WebsocketResponseOneofCase.ConnectionResponse) hash ^= ConnectionResponse.GetHashCode(); + hash ^= (int) websocketResponseCase_; if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -2376,6 +2862,10 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else + if (websocketResponseCase_ == WebsocketResponseOneofCase.ConnectionResponse) { + output.WriteRawTag(82); + output.WriteMessage(ConnectionResponse); + } if (_unknownFields != null) { _unknownFields.WriteTo(output); } @@ -2385,6 +2875,10 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (websocketResponseCase_ == WebsocketResponseOneofCase.ConnectionResponse) { + output.WriteRawTag(82); + output.WriteMessage(ConnectionResponse); + } if (_unknownFields != null) { _unknownFields.WriteTo(ref output); } @@ -2394,6 +2888,9 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; + if (websocketResponseCase_ == WebsocketResponseOneofCase.ConnectionResponse) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(ConnectionResponse); + } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); } @@ -2401,10 +2898,19 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(DocumentDeleteResponse other) { + public void MergeFrom(WebsocketEventResponse other) { if (other == null) { return; } + switch (other.WebsocketResponseCase) { + case WebsocketResponseOneofCase.ConnectionResponse: + if (ConnectionResponse == null) { + ConnectionResponse = new global::Nitric.Proto.Websockets.v1.WebsocketConnectionResponse(); + } + ConnectionResponse.MergeFrom(other.ConnectionResponse); + break; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } @@ -2419,6 +2925,15 @@ public void MergeFrom(pb::CodedInputStream input) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; + case 82: { + global::Nitric.Proto.Websockets.v1.WebsocketConnectionResponse subBuilder = new global::Nitric.Proto.Websockets.v1.WebsocketConnectionResponse(); + if (websocketResponseCase_ == WebsocketResponseOneofCase.ConnectionResponse) { + subBuilder.MergeFrom(ConnectionResponse); + } + input.ReadMessage(subBuilder); + ConnectionResponse = subBuilder; + break; + } } } #endif @@ -2433,6 +2948,15 @@ public void MergeFrom(pb::CodedInputStream input) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; + case 82: { + global::Nitric.Proto.Websockets.v1.WebsocketConnectionResponse subBuilder = new global::Nitric.Proto.Websockets.v1.WebsocketConnectionResponse(); + if (websocketResponseCase_ == WebsocketResponseOneofCase.ConnectionResponse) { + subBuilder.MergeFrom(ConnectionResponse); + } + input.ReadMessage(subBuilder); + ConnectionResponse = subBuilder; + break; + } } } } @@ -2440,19 +2964,19 @@ public void MergeFrom(pb::CodedInputStream input) { } - public sealed partial class DocumentQueryRequest : pb::IMessage + public sealed partial class WebsocketConnectionEvent : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DocumentQueryRequest()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new WebsocketConnectionEvent()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Document.v1.DocumentReflection.Descriptor.MessageTypes[11]; } + get { return global::Nitric.Proto.Websockets.v1.WebsocketsReflection.Descriptor.MessageTypes[13]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -2461,107 +2985,57 @@ public sealed partial class DocumentQueryRequest : pb::IMessageField number for the "collection" field. - public const int CollectionFieldNumber = 1; - private global::Nitric.Proto.Document.v1.Collection collection_; - /// - /// The collection to query - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Document.v1.Collection Collection { - get { return collection_; } - set { - collection_ = value; - } - } - - /// Field number for the "expressions" field. - public const int ExpressionsFieldNumber = 3; - private static readonly pb::FieldCodec _repeated_expressions_codec - = pb::FieldCodec.ForMessage(26, global::Nitric.Proto.Document.v1.Expression.Parser); - private readonly pbc::RepeatedField expressions_ = new pbc::RepeatedField(); - /// - /// Optional query expressions - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField Expressions { - get { return expressions_; } - } - - /// Field number for the "limit" field. - public const int LimitFieldNumber = 4; - private int limit_; - /// - /// Optional query fetch limit - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int Limit { - get { return limit_; } - set { - limit_ = value; - } + public WebsocketConnectionEvent Clone() { + return new WebsocketConnectionEvent(this); } - /// Field number for the "paging_token" field. - public const int PagingTokenFieldNumber = 5; - private static readonly pbc::MapField.Codec _map_pagingToken_codec - = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForString(18, ""), 42); - private readonly pbc::MapField pagingToken_ = new pbc::MapField(); + /// Field number for the "query_params" field. + public const int QueryParamsFieldNumber = 1; + private static readonly pbc::MapField.Codec _map_queryParams_codec + = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForMessage(18, global::Nitric.Proto.Websockets.v1.QueryValue.Parser), 10); + private readonly pbc::MapField queryParams_ = new pbc::MapField(); /// - /// Optional query paging continuation token + /// The query params available in the connection request /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::MapField PagingToken { - get { return pagingToken_; } + public pbc::MapField QueryParams { + get { return queryParams_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { - return Equals(other as DocumentQueryRequest); + return Equals(other as WebsocketConnectionEvent); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(DocumentQueryRequest other) { + public bool Equals(WebsocketConnectionEvent other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } - if (!object.Equals(Collection, other.Collection)) return false; - if(!expressions_.Equals(other.expressions_)) return false; - if (Limit != other.Limit) return false; - if (!PagingToken.Equals(other.PagingToken)) return false; + if (!QueryParams.Equals(other.QueryParams)) return false; return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; - if (collection_ != null) hash ^= Collection.GetHashCode(); - hash ^= expressions_.GetHashCode(); - if (Limit != 0) hash ^= Limit.GetHashCode(); - hash ^= PagingToken.GetHashCode(); + hash ^= QueryParams.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -2578,16 +3052,7 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else - if (collection_ != null) { - output.WriteRawTag(10); - output.WriteMessage(Collection); - } - expressions_.WriteTo(output, _repeated_expressions_codec); - if (Limit != 0) { - output.WriteRawTag(32); - output.WriteInt32(Limit); - } - pagingToken_.WriteTo(output, _map_pagingToken_codec); + queryParams_.WriteTo(output, _map_queryParams_codec); if (_unknownFields != null) { _unknownFields.WriteTo(output); } @@ -2597,16 +3062,7 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (collection_ != null) { - output.WriteRawTag(10); - output.WriteMessage(Collection); - } - expressions_.WriteTo(ref output, _repeated_expressions_codec); - if (Limit != 0) { - output.WriteRawTag(32); - output.WriteInt32(Limit); - } - pagingToken_.WriteTo(ref output, _map_pagingToken_codec); + queryParams_.WriteTo(ref output, _map_queryParams_codec); if (_unknownFields != null) { _unknownFields.WriteTo(ref output); } @@ -2616,14 +3072,7 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; - if (collection_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Collection); - } - size += expressions_.CalculateSize(_repeated_expressions_codec); - if (Limit != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(Limit); - } - size += pagingToken_.CalculateSize(_map_pagingToken_codec); + size += queryParams_.CalculateSize(_map_queryParams_codec); if (_unknownFields != null) { size += _unknownFields.CalculateSize(); } @@ -2631,21 +3080,11 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(DocumentQueryRequest other) { + public void MergeFrom(WebsocketConnectionEvent other) { if (other == null) { return; } - if (other.collection_ != null) { - if (collection_ == null) { - Collection = new global::Nitric.Proto.Document.v1.Collection(); - } - Collection.MergeFrom(other.Collection); - } - expressions_.Add(other.expressions_); - if (other.Limit != 0) { - Limit = other.Limit; - } - pagingToken_.Add(other.pagingToken_); + queryParams_.Add(other.queryParams_); _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } @@ -2661,22 +3100,7 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { - if (collection_ == null) { - Collection = new global::Nitric.Proto.Document.v1.Collection(); - } - input.ReadMessage(Collection); - break; - } - case 26: { - expressions_.AddEntriesFrom(input, _repeated_expressions_codec); - break; - } - case 32: { - Limit = input.ReadInt32(); - break; - } - case 42: { - pagingToken_.AddEntriesFrom(input, _map_pagingToken_codec); + queryParams_.AddEntriesFrom(input, _map_queryParams_codec); break; } } @@ -2694,22 +3118,7 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; case 10: { - if (collection_ == null) { - Collection = new global::Nitric.Proto.Document.v1.Collection(); - } - input.ReadMessage(Collection); - break; - } - case 26: { - expressions_.AddEntriesFrom(ref input, _repeated_expressions_codec); - break; - } - case 32: { - Limit = input.ReadInt32(); - break; - } - case 42: { - pagingToken_.AddEntriesFrom(ref input, _map_pagingToken_codec); + queryParams_.AddEntriesFrom(ref input, _map_queryParams_codec); break; } } @@ -2719,19 +3128,19 @@ public void MergeFrom(pb::CodedInputStream input) { } - public sealed partial class DocumentQueryResponse : pb::IMessage + public sealed partial class WebsocketConnectionResponse : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DocumentQueryResponse()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new WebsocketConnectionResponse()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Document.v1.DocumentReflection.Descriptor.MessageTypes[12]; } + get { return global::Nitric.Proto.Websockets.v1.WebsocketsReflection.Descriptor.MessageTypes[14]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -2740,73 +3149,55 @@ public sealed partial class DocumentQueryResponse : pb::IMessageField number for the "documents" field. - public const int DocumentsFieldNumber = 1; - private static readonly pb::FieldCodec _repeated_documents_codec - = pb::FieldCodec.ForMessage(10, global::Nitric.Proto.Document.v1.Document.Parser); - private readonly pbc::RepeatedField documents_ = new pbc::RepeatedField(); - /// - /// The retrieved values - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField Documents { - get { return documents_; } + public WebsocketConnectionResponse Clone() { + return new WebsocketConnectionResponse(this); } - /// Field number for the "paging_token" field. - public const int PagingTokenFieldNumber = 2; - private static readonly pbc::MapField.Codec _map_pagingToken_codec - = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForString(18, ""), 18); - private readonly pbc::MapField pagingToken_ = new pbc::MapField(); - /// - /// The query paging continuation token, when empty no further results are available - /// + /// Field number for the "reject" field. + public const int RejectFieldNumber = 1; + private bool reject_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::MapField PagingToken { - get { return pagingToken_; } + public bool Reject { + get { return reject_; } + set { + reject_ = value; + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { - return Equals(other as DocumentQueryResponse); + return Equals(other as WebsocketConnectionResponse); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(DocumentQueryResponse other) { + public bool Equals(WebsocketConnectionResponse other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } - if(!documents_.Equals(other.documents_)) return false; - if (!PagingToken.Equals(other.PagingToken)) return false; + if (Reject != other.Reject) return false; return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; - hash ^= documents_.GetHashCode(); - hash ^= PagingToken.GetHashCode(); + if (Reject != false) hash ^= Reject.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -2823,8 +3214,10 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else - documents_.WriteTo(output, _repeated_documents_codec); - pagingToken_.WriteTo(output, _map_pagingToken_codec); + if (Reject != false) { + output.WriteRawTag(8); + output.WriteBool(Reject); + } if (_unknownFields != null) { _unknownFields.WriteTo(output); } @@ -2834,8 +3227,10 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - documents_.WriteTo(ref output, _repeated_documents_codec); - pagingToken_.WriteTo(ref output, _map_pagingToken_codec); + if (Reject != false) { + output.WriteRawTag(8); + output.WriteBool(Reject); + } if (_unknownFields != null) { _unknownFields.WriteTo(ref output); } @@ -2845,8 +3240,9 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; - size += documents_.CalculateSize(_repeated_documents_codec); - size += pagingToken_.CalculateSize(_map_pagingToken_codec); + if (Reject != false) { + size += 1 + 1; + } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); } @@ -2854,12 +3250,13 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(DocumentQueryResponse other) { + public void MergeFrom(WebsocketConnectionResponse other) { if (other == null) { return; } - documents_.Add(other.documents_); - pagingToken_.Add(other.pagingToken_); + if (other.Reject != false) { + Reject = other.Reject; + } _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } @@ -2874,12 +3271,8 @@ public void MergeFrom(pb::CodedInputStream input) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; - case 10: { - documents_.AddEntriesFrom(input, _repeated_documents_codec); - break; - } - case 18: { - pagingToken_.AddEntriesFrom(input, _map_pagingToken_codec); + case 8: { + Reject = input.ReadBool(); break; } } @@ -2896,12 +3289,8 @@ public void MergeFrom(pb::CodedInputStream input) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; - case 10: { - documents_.AddEntriesFrom(ref input, _repeated_documents_codec); - break; - } - case 18: { - pagingToken_.AddEntriesFrom(ref input, _map_pagingToken_codec); + case 8: { + Reject = input.ReadBool(); break; } } @@ -2911,19 +3300,19 @@ public void MergeFrom(pb::CodedInputStream input) { } - public sealed partial class DocumentQueryStreamRequest : pb::IMessage + public sealed partial class WebsocketDisconnectionEvent : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DocumentQueryStreamRequest()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new WebsocketDisconnectionEvent()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Document.v1.DocumentReflection.Descriptor.MessageTypes[13]; } + get { return global::Nitric.Proto.Websockets.v1.WebsocketsReflection.Descriptor.MessageTypes[15]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -2932,91 +3321,41 @@ public sealed partial class DocumentQueryStreamRequest : pb::IMessageField number for the "collection" field. - public const int CollectionFieldNumber = 1; - private global::Nitric.Proto.Document.v1.Collection collection_; - /// - /// The collection to query - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Document.v1.Collection Collection { - get { return collection_; } - set { - collection_ = value; - } - } - - /// Field number for the "expressions" field. - public const int ExpressionsFieldNumber = 3; - private static readonly pb::FieldCodec _repeated_expressions_codec - = pb::FieldCodec.ForMessage(26, global::Nitric.Proto.Document.v1.Expression.Parser); - private readonly pbc::RepeatedField expressions_ = new pbc::RepeatedField(); - /// - /// Optional query expressions - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField Expressions { - get { return expressions_; } - } - - /// Field number for the "limit" field. - public const int LimitFieldNumber = 4; - private int limit_; - /// - /// Optional query fetch limit - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int Limit { - get { return limit_; } - set { - limit_ = value; - } + public WebsocketDisconnectionEvent Clone() { + return new WebsocketDisconnectionEvent(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { - return Equals(other as DocumentQueryStreamRequest); + return Equals(other as WebsocketDisconnectionEvent); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(DocumentQueryStreamRequest other) { + public bool Equals(WebsocketDisconnectionEvent other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } - if (!object.Equals(Collection, other.Collection)) return false; - if(!expressions_.Equals(other.expressions_)) return false; - if (Limit != other.Limit) return false; return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; - if (collection_ != null) hash ^= Collection.GetHashCode(); - hash ^= expressions_.GetHashCode(); - if (Limit != 0) hash ^= Limit.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -3033,15 +3372,6 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else - if (collection_ != null) { - output.WriteRawTag(10); - output.WriteMessage(Collection); - } - expressions_.WriteTo(output, _repeated_expressions_codec); - if (Limit != 0) { - output.WriteRawTag(32); - output.WriteInt32(Limit); - } if (_unknownFields != null) { _unknownFields.WriteTo(output); } @@ -3051,15 +3381,6 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (collection_ != null) { - output.WriteRawTag(10); - output.WriteMessage(Collection); - } - expressions_.WriteTo(ref output, _repeated_expressions_codec); - if (Limit != 0) { - output.WriteRawTag(32); - output.WriteInt32(Limit); - } if (_unknownFields != null) { _unknownFields.WriteTo(ref output); } @@ -3069,13 +3390,6 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; - if (collection_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Collection); - } - size += expressions_.CalculateSize(_repeated_expressions_codec); - if (Limit != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(Limit); - } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); } @@ -3083,20 +3397,10 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(DocumentQueryStreamRequest other) { + public void MergeFrom(WebsocketDisconnectionEvent other) { if (other == null) { return; } - if (other.collection_ != null) { - if (collection_ == null) { - Collection = new global::Nitric.Proto.Document.v1.Collection(); - } - Collection.MergeFrom(other.Collection); - } - expressions_.Add(other.expressions_); - if (other.Limit != 0) { - Limit = other.Limit; - } _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } @@ -3111,21 +3415,6 @@ public void MergeFrom(pb::CodedInputStream input) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; - case 10: { - if (collection_ == null) { - Collection = new global::Nitric.Proto.Document.v1.Collection(); - } - input.ReadMessage(Collection); - break; - } - case 26: { - expressions_.AddEntriesFrom(input, _repeated_expressions_codec); - break; - } - case 32: { - Limit = input.ReadInt32(); - break; - } } } #endif @@ -3140,21 +3429,6 @@ public void MergeFrom(pb::CodedInputStream input) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; - case 10: { - if (collection_ == null) { - Collection = new global::Nitric.Proto.Document.v1.Collection(); - } - input.ReadMessage(Collection); - break; - } - case 26: { - expressions_.AddEntriesFrom(ref input, _repeated_expressions_codec); - break; - } - case 32: { - Limit = input.ReadInt32(); - break; - } } } } @@ -3162,19 +3436,19 @@ public void MergeFrom(pb::CodedInputStream input) { } - public sealed partial class DocumentQueryStreamResponse : pb::IMessage + public sealed partial class WebsocketMessageEvent : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DocumentQueryStreamResponse()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new WebsocketMessageEvent()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Document.v1.DocumentReflection.Descriptor.MessageTypes[14]; } + get { return global::Nitric.Proto.Websockets.v1.WebsocketsReflection.Descriptor.MessageTypes[16]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -3183,58 +3457,58 @@ public sealed partial class DocumentQueryStreamResponse : pb::IMessageField number for the "document" field. - public const int DocumentFieldNumber = 1; - private global::Nitric.Proto.Document.v1.Document document_; + /// Field number for the "body" field. + public const int BodyFieldNumber = 1; + private pb::ByteString body_ = pb::ByteString.Empty; /// - /// The stream document + /// Data available on /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Document.v1.Document Document { - get { return document_; } + public pb::ByteString Body { + get { return body_; } set { - document_ = value; + body_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { - return Equals(other as DocumentQueryStreamResponse); + return Equals(other as WebsocketMessageEvent); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(DocumentQueryStreamResponse other) { + public bool Equals(WebsocketMessageEvent other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } - if (!object.Equals(Document, other.Document)) return false; + if (Body != other.Body) return false; return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; - if (document_ != null) hash ^= Document.GetHashCode(); + if (Body.Length != 0) hash ^= Body.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -3251,9 +3525,9 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else - if (document_ != null) { + if (Body.Length != 0) { output.WriteRawTag(10); - output.WriteMessage(Document); + output.WriteBytes(Body); } if (_unknownFields != null) { _unknownFields.WriteTo(output); @@ -3264,9 +3538,9 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (document_ != null) { + if (Body.Length != 0) { output.WriteRawTag(10); - output.WriteMessage(Document); + output.WriteBytes(Body); } if (_unknownFields != null) { _unknownFields.WriteTo(ref output); @@ -3277,8 +3551,8 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; - if (document_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Document); + if (Body.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeBytesSize(Body); } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); @@ -3287,15 +3561,12 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(DocumentQueryStreamResponse other) { + public void MergeFrom(WebsocketMessageEvent other) { if (other == null) { return; } - if (other.document_ != null) { - if (document_ == null) { - Document = new global::Nitric.Proto.Document.v1.Document(); - } - Document.MergeFrom(other.Document); + if (other.Body.Length != 0) { + Body = other.Body; } _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } @@ -3312,10 +3583,7 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { - if (document_ == null) { - Document = new global::Nitric.Proto.Document.v1.Document(); - } - input.ReadMessage(Document); + Body = input.ReadBytes(); break; } } @@ -3333,10 +3601,7 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; case 10: { - if (document_ == null) { - Document = new global::Nitric.Proto.Document.v1.Document(); - } - input.ReadMessage(Document); + Body = input.ReadBytes(); break; } } diff --git a/src/Nitric.Sdk/Proto/nitric/proto/websockets/v1/WebsocketsGrpc.cs b/src/Nitric.Sdk/Proto/nitric/proto/websockets/v1/WebsocketsGrpc.cs new file mode 100644 index 0000000..5cd8c8c --- /dev/null +++ b/src/Nitric.Sdk/Proto/nitric/proto/websockets/v1/WebsocketsGrpc.cs @@ -0,0 +1,444 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: nitric/proto/websockets/v1/websockets.proto +// +#pragma warning disable 0414, 1591 +#region Designer generated code + +using grpc = global::Grpc.Core; + +namespace Nitric.Proto.Websockets.v1 { + public static partial class Websocket + { + static readonly string __ServiceName = "nitric.proto.websockets.v1.Websocket"; + + static void __Helper_SerializeMessage(global::Google.Protobuf.IMessage message, grpc::SerializationContext context) + { + #if !GRPC_DISABLE_PROTOBUF_BUFFER_SERIALIZATION + if (message is global::Google.Protobuf.IBufferMessage) + { + context.SetPayloadLength(message.CalculateSize()); + global::Google.Protobuf.MessageExtensions.WriteTo(message, context.GetBufferWriter()); + context.Complete(); + return; + } + #endif + context.Complete(global::Google.Protobuf.MessageExtensions.ToByteArray(message)); + } + + static class __Helper_MessageCache + { + public static readonly bool IsBufferMessage = global::System.Reflection.IntrospectionExtensions.GetTypeInfo(typeof(global::Google.Protobuf.IBufferMessage)).IsAssignableFrom(typeof(T)); + } + + static T __Helper_DeserializeMessage(grpc::DeserializationContext context, global::Google.Protobuf.MessageParser parser) where T : global::Google.Protobuf.IMessage + { + #if !GRPC_DISABLE_PROTOBUF_BUFFER_SERIALIZATION + if (__Helper_MessageCache.IsBufferMessage) + { + return parser.ParseFrom(context.PayloadAsReadOnlySequence()); + } + #endif + return parser.ParseFrom(context.PayloadAsNewBuffer()); + } + + static readonly grpc::Marshaller __Marshaller_nitric_proto_websockets_v1_WebsocketSendRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Websockets.v1.WebsocketSendRequest.Parser)); + static readonly grpc::Marshaller __Marshaller_nitric_proto_websockets_v1_WebsocketSendResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Websockets.v1.WebsocketSendResponse.Parser)); + static readonly grpc::Marshaller __Marshaller_nitric_proto_websockets_v1_WebsocketCloseConnectionRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Websockets.v1.WebsocketCloseConnectionRequest.Parser)); + static readonly grpc::Marshaller __Marshaller_nitric_proto_websockets_v1_WebsocketCloseConnectionResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Websockets.v1.WebsocketCloseConnectionResponse.Parser)); + static readonly grpc::Marshaller __Marshaller_nitric_proto_websockets_v1_WebsocketDetailsRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Websockets.v1.WebsocketDetailsRequest.Parser)); + static readonly grpc::Marshaller __Marshaller_nitric_proto_websockets_v1_WebsocketDetailsResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Websockets.v1.WebsocketDetailsResponse.Parser)); + + static readonly grpc::Method __Method_SendMessage = new grpc::Method( + grpc::MethodType.Unary, + __ServiceName, + "SendMessage", + __Marshaller_nitric_proto_websockets_v1_WebsocketSendRequest, + __Marshaller_nitric_proto_websockets_v1_WebsocketSendResponse); + + static readonly grpc::Method __Method_CloseConnection = new grpc::Method( + grpc::MethodType.Unary, + __ServiceName, + "CloseConnection", + __Marshaller_nitric_proto_websockets_v1_WebsocketCloseConnectionRequest, + __Marshaller_nitric_proto_websockets_v1_WebsocketCloseConnectionResponse); + + static readonly grpc::Method __Method_SocketDetails = new grpc::Method( + grpc::MethodType.Unary, + __ServiceName, + "SocketDetails", + __Marshaller_nitric_proto_websockets_v1_WebsocketDetailsRequest, + __Marshaller_nitric_proto_websockets_v1_WebsocketDetailsResponse); + + /// Service descriptor + public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor + { + get { return global::Nitric.Proto.Websockets.v1.WebsocketsReflection.Descriptor.Services[0]; } + } + + /// Base class for server-side implementations of Websocket + [grpc::BindServiceMethod(typeof(Websocket), "BindService")] + public abstract partial class WebsocketBase + { + /// + /// Send a messages to a websocket + /// + /// The request received from the client. + /// The context of the server-side call handler being invoked. + /// The response to send back to the client (wrapped by a task). + public virtual global::System.Threading.Tasks.Task SendMessage(global::Nitric.Proto.Websockets.v1.WebsocketSendRequest request, grpc::ServerCallContext context) + { + throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); + } + + /// + /// Close a websocket connection + /// This can be used to force a client to disconnect + /// + /// The request received from the client. + /// The context of the server-side call handler being invoked. + /// The response to send back to the client (wrapped by a task). + public virtual global::System.Threading.Tasks.Task CloseConnection(global::Nitric.Proto.Websockets.v1.WebsocketCloseConnectionRequest request, grpc::ServerCallContext context) + { + throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); + } + + /// + /// Retrieve details about an API + /// + /// The request received from the client. + /// The context of the server-side call handler being invoked. + /// The response to send back to the client (wrapped by a task). + public virtual global::System.Threading.Tasks.Task SocketDetails(global::Nitric.Proto.Websockets.v1.WebsocketDetailsRequest request, grpc::ServerCallContext context) + { + throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); + } + + } + + /// Client for Websocket + public partial class WebsocketClient : grpc::ClientBase + { + /// Creates a new client for Websocket + /// The channel to use to make remote calls. + public WebsocketClient(grpc::ChannelBase channel) : base(channel) + { + } + /// Creates a new client for Websocket that uses a custom CallInvoker. + /// The callInvoker to use to make remote calls. + public WebsocketClient(grpc::CallInvoker callInvoker) : base(callInvoker) + { + } + /// Protected parameterless constructor to allow creation of test doubles. + protected WebsocketClient() : base() + { + } + /// Protected constructor to allow creation of configured clients. + /// The client configuration. + protected WebsocketClient(ClientBaseConfiguration configuration) : base(configuration) + { + } + + /// + /// Send a messages to a websocket + /// + /// The request to send to the server. + /// The initial metadata to send with the call. This parameter is optional. + /// An optional deadline for the call. The call will be cancelled if deadline is hit. + /// An optional token for canceling the call. + /// The response received from the server. + public virtual global::Nitric.Proto.Websockets.v1.WebsocketSendResponse SendMessage(global::Nitric.Proto.Websockets.v1.WebsocketSendRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return SendMessage(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + /// + /// Send a messages to a websocket + /// + /// The request to send to the server. + /// The options for the call. + /// The response received from the server. + public virtual global::Nitric.Proto.Websockets.v1.WebsocketSendResponse SendMessage(global::Nitric.Proto.Websockets.v1.WebsocketSendRequest request, grpc::CallOptions options) + { + return CallInvoker.BlockingUnaryCall(__Method_SendMessage, null, options, request); + } + /// + /// Send a messages to a websocket + /// + /// The request to send to the server. + /// The initial metadata to send with the call. This parameter is optional. + /// An optional deadline for the call. The call will be cancelled if deadline is hit. + /// An optional token for canceling the call. + /// The call object. + public virtual grpc::AsyncUnaryCall SendMessageAsync(global::Nitric.Proto.Websockets.v1.WebsocketSendRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return SendMessageAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + /// + /// Send a messages to a websocket + /// + /// The request to send to the server. + /// The options for the call. + /// The call object. + public virtual grpc::AsyncUnaryCall SendMessageAsync(global::Nitric.Proto.Websockets.v1.WebsocketSendRequest request, grpc::CallOptions options) + { + return CallInvoker.AsyncUnaryCall(__Method_SendMessage, null, options, request); + } + /// + /// Close a websocket connection + /// This can be used to force a client to disconnect + /// + /// The request to send to the server. + /// The initial metadata to send with the call. This parameter is optional. + /// An optional deadline for the call. The call will be cancelled if deadline is hit. + /// An optional token for canceling the call. + /// The response received from the server. + public virtual global::Nitric.Proto.Websockets.v1.WebsocketCloseConnectionResponse CloseConnection(global::Nitric.Proto.Websockets.v1.WebsocketCloseConnectionRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return CloseConnection(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + /// + /// Close a websocket connection + /// This can be used to force a client to disconnect + /// + /// The request to send to the server. + /// The options for the call. + /// The response received from the server. + public virtual global::Nitric.Proto.Websockets.v1.WebsocketCloseConnectionResponse CloseConnection(global::Nitric.Proto.Websockets.v1.WebsocketCloseConnectionRequest request, grpc::CallOptions options) + { + return CallInvoker.BlockingUnaryCall(__Method_CloseConnection, null, options, request); + } + /// + /// Close a websocket connection + /// This can be used to force a client to disconnect + /// + /// The request to send to the server. + /// The initial metadata to send with the call. This parameter is optional. + /// An optional deadline for the call. The call will be cancelled if deadline is hit. + /// An optional token for canceling the call. + /// The call object. + public virtual grpc::AsyncUnaryCall CloseConnectionAsync(global::Nitric.Proto.Websockets.v1.WebsocketCloseConnectionRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return CloseConnectionAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + /// + /// Close a websocket connection + /// This can be used to force a client to disconnect + /// + /// The request to send to the server. + /// The options for the call. + /// The call object. + public virtual grpc::AsyncUnaryCall CloseConnectionAsync(global::Nitric.Proto.Websockets.v1.WebsocketCloseConnectionRequest request, grpc::CallOptions options) + { + return CallInvoker.AsyncUnaryCall(__Method_CloseConnection, null, options, request); + } + /// + /// Retrieve details about an API + /// + /// The request to send to the server. + /// The initial metadata to send with the call. This parameter is optional. + /// An optional deadline for the call. The call will be cancelled if deadline is hit. + /// An optional token for canceling the call. + /// The response received from the server. + public virtual global::Nitric.Proto.Websockets.v1.WebsocketDetailsResponse SocketDetails(global::Nitric.Proto.Websockets.v1.WebsocketDetailsRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return SocketDetails(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + /// + /// Retrieve details about an API + /// + /// The request to send to the server. + /// The options for the call. + /// The response received from the server. + public virtual global::Nitric.Proto.Websockets.v1.WebsocketDetailsResponse SocketDetails(global::Nitric.Proto.Websockets.v1.WebsocketDetailsRequest request, grpc::CallOptions options) + { + return CallInvoker.BlockingUnaryCall(__Method_SocketDetails, null, options, request); + } + /// + /// Retrieve details about an API + /// + /// The request to send to the server. + /// The initial metadata to send with the call. This parameter is optional. + /// An optional deadline for the call. The call will be cancelled if deadline is hit. + /// An optional token for canceling the call. + /// The call object. + public virtual grpc::AsyncUnaryCall SocketDetailsAsync(global::Nitric.Proto.Websockets.v1.WebsocketDetailsRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return SocketDetailsAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + /// + /// Retrieve details about an API + /// + /// The request to send to the server. + /// The options for the call. + /// The call object. + public virtual grpc::AsyncUnaryCall SocketDetailsAsync(global::Nitric.Proto.Websockets.v1.WebsocketDetailsRequest request, grpc::CallOptions options) + { + return CallInvoker.AsyncUnaryCall(__Method_SocketDetails, null, options, request); + } + /// Creates a new instance of client from given ClientBaseConfiguration. + protected override WebsocketClient NewInstance(ClientBaseConfiguration configuration) + { + return new WebsocketClient(configuration); + } + } + + /// Creates service definition that can be registered with a server + /// An object implementing the server-side handling logic. + public static grpc::ServerServiceDefinition BindService(WebsocketBase serviceImpl) + { + return grpc::ServerServiceDefinition.CreateBuilder() + .AddMethod(__Method_SendMessage, serviceImpl.SendMessage) + .AddMethod(__Method_CloseConnection, serviceImpl.CloseConnection) + .AddMethod(__Method_SocketDetails, serviceImpl.SocketDetails).Build(); + } + + /// Register service method with a service binder with or without implementation. Useful when customizing the service binding logic. + /// Note: this method is part of an experimental API that can change or be removed without any prior notice. + /// Service methods will be bound by calling AddMethod on this object. + /// An object implementing the server-side handling logic. + public static void BindService(grpc::ServiceBinderBase serviceBinder, WebsocketBase serviceImpl) + { + serviceBinder.AddMethod(__Method_SendMessage, serviceImpl == null ? null : new grpc::UnaryServerMethod(serviceImpl.SendMessage)); + serviceBinder.AddMethod(__Method_CloseConnection, serviceImpl == null ? null : new grpc::UnaryServerMethod(serviceImpl.CloseConnection)); + serviceBinder.AddMethod(__Method_SocketDetails, serviceImpl == null ? null : new grpc::UnaryServerMethod(serviceImpl.SocketDetails)); + } + + } + public static partial class WebsocketHandler + { + static readonly string __ServiceName = "nitric.proto.websockets.v1.WebsocketHandler"; + + static void __Helper_SerializeMessage(global::Google.Protobuf.IMessage message, grpc::SerializationContext context) + { + #if !GRPC_DISABLE_PROTOBUF_BUFFER_SERIALIZATION + if (message is global::Google.Protobuf.IBufferMessage) + { + context.SetPayloadLength(message.CalculateSize()); + global::Google.Protobuf.MessageExtensions.WriteTo(message, context.GetBufferWriter()); + context.Complete(); + return; + } + #endif + context.Complete(global::Google.Protobuf.MessageExtensions.ToByteArray(message)); + } + + static class __Helper_MessageCache + { + public static readonly bool IsBufferMessage = global::System.Reflection.IntrospectionExtensions.GetTypeInfo(typeof(global::Google.Protobuf.IBufferMessage)).IsAssignableFrom(typeof(T)); + } + + static T __Helper_DeserializeMessage(grpc::DeserializationContext context, global::Google.Protobuf.MessageParser parser) where T : global::Google.Protobuf.IMessage + { + #if !GRPC_DISABLE_PROTOBUF_BUFFER_SERIALIZATION + if (__Helper_MessageCache.IsBufferMessage) + { + return parser.ParseFrom(context.PayloadAsReadOnlySequence()); + } + #endif + return parser.ParseFrom(context.PayloadAsNewBuffer()); + } + + static readonly grpc::Marshaller __Marshaller_nitric_proto_websockets_v1_ClientMessage = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Websockets.v1.ClientMessage.Parser)); + static readonly grpc::Marshaller __Marshaller_nitric_proto_websockets_v1_ServerMessage = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Websockets.v1.ServerMessage.Parser)); + + static readonly grpc::Method __Method_HandleEvents = new grpc::Method( + grpc::MethodType.DuplexStreaming, + __ServiceName, + "HandleEvents", + __Marshaller_nitric_proto_websockets_v1_ClientMessage, + __Marshaller_nitric_proto_websockets_v1_ServerMessage); + + /// Service descriptor + public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor + { + get { return global::Nitric.Proto.Websockets.v1.WebsocketsReflection.Descriptor.Services[1]; } + } + + /// Base class for server-side implementations of WebsocketHandler + [grpc::BindServiceMethod(typeof(WebsocketHandler), "BindService")] + public abstract partial class WebsocketHandlerBase + { + /// + /// Handle incoming websocket events + /// + /// Used for reading requests from the client. + /// Used for sending responses back to the client. + /// The context of the server-side call handler being invoked. + /// A task indicating completion of the handler. + public virtual global::System.Threading.Tasks.Task HandleEvents(grpc::IAsyncStreamReader requestStream, grpc::IServerStreamWriter responseStream, grpc::ServerCallContext context) + { + throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); + } + + } + + /// Client for WebsocketHandler + public partial class WebsocketHandlerClient : grpc::ClientBase + { + /// Creates a new client for WebsocketHandler + /// The channel to use to make remote calls. + public WebsocketHandlerClient(grpc::ChannelBase channel) : base(channel) + { + } + /// Creates a new client for WebsocketHandler that uses a custom CallInvoker. + /// The callInvoker to use to make remote calls. + public WebsocketHandlerClient(grpc::CallInvoker callInvoker) : base(callInvoker) + { + } + /// Protected parameterless constructor to allow creation of test doubles. + protected WebsocketHandlerClient() : base() + { + } + /// Protected constructor to allow creation of configured clients. + /// The client configuration. + protected WebsocketHandlerClient(ClientBaseConfiguration configuration) : base(configuration) + { + } + + /// + /// Handle incoming websocket events + /// + /// The initial metadata to send with the call. This parameter is optional. + /// An optional deadline for the call. The call will be cancelled if deadline is hit. + /// An optional token for canceling the call. + /// The call object. + public virtual grpc::AsyncDuplexStreamingCall HandleEvents(grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return HandleEvents(new grpc::CallOptions(headers, deadline, cancellationToken)); + } + /// + /// Handle incoming websocket events + /// + /// The options for the call. + /// The call object. + public virtual grpc::AsyncDuplexStreamingCall HandleEvents(grpc::CallOptions options) + { + return CallInvoker.AsyncDuplexStreamingCall(__Method_HandleEvents, null, options); + } + /// Creates a new instance of client from given ClientBaseConfiguration. + protected override WebsocketHandlerClient NewInstance(ClientBaseConfiguration configuration) + { + return new WebsocketHandlerClient(configuration); + } + } + + /// Creates service definition that can be registered with a server + /// An object implementing the server-side handling logic. + public static grpc::ServerServiceDefinition BindService(WebsocketHandlerBase serviceImpl) + { + return grpc::ServerServiceDefinition.CreateBuilder() + .AddMethod(__Method_HandleEvents, serviceImpl.HandleEvents).Build(); + } + + /// Register service method with a service binder with or without implementation. Useful when customizing the service binding logic. + /// Note: this method is part of an experimental API that can change or be removed without any prior notice. + /// Service methods will be bound by calling AddMethod on this object. + /// An object implementing the server-side handling logic. + public static void BindService(grpc::ServiceBinderBase serviceBinder, WebsocketHandlerBase serviceImpl) + { + serviceBinder.AddMethod(__Method_HandleEvents, serviceImpl == null ? null : new grpc::DuplexStreamingServerMethod(serviceImpl.HandleEvents)); + } + + } +} +#endregion diff --git a/src/Nitric.Sdk/Proto/proto/document/v1/DocumentGrpc.cs b/src/Nitric.Sdk/Proto/proto/document/v1/DocumentGrpc.cs deleted file mode 100644 index 0ea44f2..0000000 --- a/src/Nitric.Sdk/Proto/proto/document/v1/DocumentGrpc.cs +++ /dev/null @@ -1,417 +0,0 @@ -// -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: proto/document/v1/document.proto -// -#pragma warning disable 0414, 1591 -#region Designer generated code - -using grpc = global::Grpc.Core; - -namespace Nitric.Proto.Document.v1 { - /// - /// Service for storage and retrieval of simple JSON keyValue - /// - public static partial class DocumentService - { - static readonly string __ServiceName = "nitric.document.v1.DocumentService"; - - static void __Helper_SerializeMessage(global::Google.Protobuf.IMessage message, grpc::SerializationContext context) - { - #if !GRPC_DISABLE_PROTOBUF_BUFFER_SERIALIZATION - if (message is global::Google.Protobuf.IBufferMessage) - { - context.SetPayloadLength(message.CalculateSize()); - global::Google.Protobuf.MessageExtensions.WriteTo(message, context.GetBufferWriter()); - context.Complete(); - return; - } - #endif - context.Complete(global::Google.Protobuf.MessageExtensions.ToByteArray(message)); - } - - static class __Helper_MessageCache - { - public static readonly bool IsBufferMessage = global::System.Reflection.IntrospectionExtensions.GetTypeInfo(typeof(global::Google.Protobuf.IBufferMessage)).IsAssignableFrom(typeof(T)); - } - - static T __Helper_DeserializeMessage(grpc::DeserializationContext context, global::Google.Protobuf.MessageParser parser) where T : global::Google.Protobuf.IMessage - { - #if !GRPC_DISABLE_PROTOBUF_BUFFER_SERIALIZATION - if (__Helper_MessageCache.IsBufferMessage) - { - return parser.ParseFrom(context.PayloadAsReadOnlySequence()); - } - #endif - return parser.ParseFrom(context.PayloadAsNewBuffer()); - } - - static readonly grpc::Marshaller __Marshaller_nitric_document_v1_DocumentGetRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Document.v1.DocumentGetRequest.Parser)); - static readonly grpc::Marshaller __Marshaller_nitric_document_v1_DocumentGetResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Document.v1.DocumentGetResponse.Parser)); - static readonly grpc::Marshaller __Marshaller_nitric_document_v1_DocumentSetRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Document.v1.DocumentSetRequest.Parser)); - static readonly grpc::Marshaller __Marshaller_nitric_document_v1_DocumentSetResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Document.v1.DocumentSetResponse.Parser)); - static readonly grpc::Marshaller __Marshaller_nitric_document_v1_DocumentDeleteRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Document.v1.DocumentDeleteRequest.Parser)); - static readonly grpc::Marshaller __Marshaller_nitric_document_v1_DocumentDeleteResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Document.v1.DocumentDeleteResponse.Parser)); - static readonly grpc::Marshaller __Marshaller_nitric_document_v1_DocumentQueryRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Document.v1.DocumentQueryRequest.Parser)); - static readonly grpc::Marshaller __Marshaller_nitric_document_v1_DocumentQueryResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Document.v1.DocumentQueryResponse.Parser)); - static readonly grpc::Marshaller __Marshaller_nitric_document_v1_DocumentQueryStreamRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Document.v1.DocumentQueryStreamRequest.Parser)); - static readonly grpc::Marshaller __Marshaller_nitric_document_v1_DocumentQueryStreamResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Document.v1.DocumentQueryStreamResponse.Parser)); - - static readonly grpc::Method __Method_Get = new grpc::Method( - grpc::MethodType.Unary, - __ServiceName, - "Get", - __Marshaller_nitric_document_v1_DocumentGetRequest, - __Marshaller_nitric_document_v1_DocumentGetResponse); - - static readonly grpc::Method __Method_Set = new grpc::Method( - grpc::MethodType.Unary, - __ServiceName, - "Set", - __Marshaller_nitric_document_v1_DocumentSetRequest, - __Marshaller_nitric_document_v1_DocumentSetResponse); - - static readonly grpc::Method __Method_Delete = new grpc::Method( - grpc::MethodType.Unary, - __ServiceName, - "Delete", - __Marshaller_nitric_document_v1_DocumentDeleteRequest, - __Marshaller_nitric_document_v1_DocumentDeleteResponse); - - static readonly grpc::Method __Method_Query = new grpc::Method( - grpc::MethodType.Unary, - __ServiceName, - "Query", - __Marshaller_nitric_document_v1_DocumentQueryRequest, - __Marshaller_nitric_document_v1_DocumentQueryResponse); - - static readonly grpc::Method __Method_QueryStream = new grpc::Method( - grpc::MethodType.ServerStreaming, - __ServiceName, - "QueryStream", - __Marshaller_nitric_document_v1_DocumentQueryStreamRequest, - __Marshaller_nitric_document_v1_DocumentQueryStreamResponse); - - /// Service descriptor - public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor - { - get { return global::Nitric.Proto.Document.v1.DocumentReflection.Descriptor.Services[0]; } - } - - /// Base class for server-side implementations of DocumentService - [grpc::BindServiceMethod(typeof(DocumentService), "BindService")] - public abstract partial class DocumentServiceBase - { - /// - /// Get an existing document - /// - /// The request received from the client. - /// The context of the server-side call handler being invoked. - /// The response to send back to the client (wrapped by a task). - public virtual global::System.Threading.Tasks.Task Get(global::Nitric.Proto.Document.v1.DocumentGetRequest request, grpc::ServerCallContext context) - { - throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); - } - - /// - /// Create a new or overwrite an existing document - /// - /// The request received from the client. - /// The context of the server-side call handler being invoked. - /// The response to send back to the client (wrapped by a task). - public virtual global::System.Threading.Tasks.Task Set(global::Nitric.Proto.Document.v1.DocumentSetRequest request, grpc::ServerCallContext context) - { - throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); - } - - /// - /// Delete an existing document - /// - /// The request received from the client. - /// The context of the server-side call handler being invoked. - /// The response to send back to the client (wrapped by a task). - public virtual global::System.Threading.Tasks.Task Delete(global::Nitric.Proto.Document.v1.DocumentDeleteRequest request, grpc::ServerCallContext context) - { - throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); - } - - /// - /// Query the document collection (supports pagination) - /// - /// The request received from the client. - /// The context of the server-side call handler being invoked. - /// The response to send back to the client (wrapped by a task). - public virtual global::System.Threading.Tasks.Task Query(global::Nitric.Proto.Document.v1.DocumentQueryRequest request, grpc::ServerCallContext context) - { - throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); - } - - /// - /// Query the document collection (supports streaming) - /// - /// The request received from the client. - /// Used for sending responses back to the client. - /// The context of the server-side call handler being invoked. - /// A task indicating completion of the handler. - public virtual global::System.Threading.Tasks.Task QueryStream(global::Nitric.Proto.Document.v1.DocumentQueryStreamRequest request, grpc::IServerStreamWriter responseStream, grpc::ServerCallContext context) - { - throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); - } - - } - - /// Client for DocumentService - public partial class DocumentServiceClient : grpc::ClientBase - { - /// Creates a new client for DocumentService - /// The channel to use to make remote calls. - public DocumentServiceClient(grpc::ChannelBase channel) : base(channel) - { - } - /// Creates a new client for DocumentService that uses a custom CallInvoker. - /// The callInvoker to use to make remote calls. - public DocumentServiceClient(grpc::CallInvoker callInvoker) : base(callInvoker) - { - } - /// Protected parameterless constructor to allow creation of test doubles. - protected DocumentServiceClient() : base() - { - } - /// Protected constructor to allow creation of configured clients. - /// The client configuration. - protected DocumentServiceClient(ClientBaseConfiguration configuration) : base(configuration) - { - } - - /// - /// Get an existing document - /// - /// The request to send to the server. - /// The initial metadata to send with the call. This parameter is optional. - /// An optional deadline for the call. The call will be cancelled if deadline is hit. - /// An optional token for canceling the call. - /// The response received from the server. - public virtual global::Nitric.Proto.Document.v1.DocumentGetResponse Get(global::Nitric.Proto.Document.v1.DocumentGetRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) - { - return Get(request, new grpc::CallOptions(headers, deadline, cancellationToken)); - } - /// - /// Get an existing document - /// - /// The request to send to the server. - /// The options for the call. - /// The response received from the server. - public virtual global::Nitric.Proto.Document.v1.DocumentGetResponse Get(global::Nitric.Proto.Document.v1.DocumentGetRequest request, grpc::CallOptions options) - { - return CallInvoker.BlockingUnaryCall(__Method_Get, null, options, request); - } - /// - /// Get an existing document - /// - /// The request to send to the server. - /// The initial metadata to send with the call. This parameter is optional. - /// An optional deadline for the call. The call will be cancelled if deadline is hit. - /// An optional token for canceling the call. - /// The call object. - public virtual grpc::AsyncUnaryCall GetAsync(global::Nitric.Proto.Document.v1.DocumentGetRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) - { - return GetAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); - } - /// - /// Get an existing document - /// - /// The request to send to the server. - /// The options for the call. - /// The call object. - public virtual grpc::AsyncUnaryCall GetAsync(global::Nitric.Proto.Document.v1.DocumentGetRequest request, grpc::CallOptions options) - { - return CallInvoker.AsyncUnaryCall(__Method_Get, null, options, request); - } - /// - /// Create a new or overwrite an existing document - /// - /// The request to send to the server. - /// The initial metadata to send with the call. This parameter is optional. - /// An optional deadline for the call. The call will be cancelled if deadline is hit. - /// An optional token for canceling the call. - /// The response received from the server. - public virtual global::Nitric.Proto.Document.v1.DocumentSetResponse Set(global::Nitric.Proto.Document.v1.DocumentSetRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) - { - return Set(request, new grpc::CallOptions(headers, deadline, cancellationToken)); - } - /// - /// Create a new or overwrite an existing document - /// - /// The request to send to the server. - /// The options for the call. - /// The response received from the server. - public virtual global::Nitric.Proto.Document.v1.DocumentSetResponse Set(global::Nitric.Proto.Document.v1.DocumentSetRequest request, grpc::CallOptions options) - { - return CallInvoker.BlockingUnaryCall(__Method_Set, null, options, request); - } - /// - /// Create a new or overwrite an existing document - /// - /// The request to send to the server. - /// The initial metadata to send with the call. This parameter is optional. - /// An optional deadline for the call. The call will be cancelled if deadline is hit. - /// An optional token for canceling the call. - /// The call object. - public virtual grpc::AsyncUnaryCall SetAsync(global::Nitric.Proto.Document.v1.DocumentSetRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) - { - return SetAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); - } - /// - /// Create a new or overwrite an existing document - /// - /// The request to send to the server. - /// The options for the call. - /// The call object. - public virtual grpc::AsyncUnaryCall SetAsync(global::Nitric.Proto.Document.v1.DocumentSetRequest request, grpc::CallOptions options) - { - return CallInvoker.AsyncUnaryCall(__Method_Set, null, options, request); - } - /// - /// Delete an existing document - /// - /// The request to send to the server. - /// The initial metadata to send with the call. This parameter is optional. - /// An optional deadline for the call. The call will be cancelled if deadline is hit. - /// An optional token for canceling the call. - /// The response received from the server. - public virtual global::Nitric.Proto.Document.v1.DocumentDeleteResponse Delete(global::Nitric.Proto.Document.v1.DocumentDeleteRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) - { - return Delete(request, new grpc::CallOptions(headers, deadline, cancellationToken)); - } - /// - /// Delete an existing document - /// - /// The request to send to the server. - /// The options for the call. - /// The response received from the server. - public virtual global::Nitric.Proto.Document.v1.DocumentDeleteResponse Delete(global::Nitric.Proto.Document.v1.DocumentDeleteRequest request, grpc::CallOptions options) - { - return CallInvoker.BlockingUnaryCall(__Method_Delete, null, options, request); - } - /// - /// Delete an existing document - /// - /// The request to send to the server. - /// The initial metadata to send with the call. This parameter is optional. - /// An optional deadline for the call. The call will be cancelled if deadline is hit. - /// An optional token for canceling the call. - /// The call object. - public virtual grpc::AsyncUnaryCall DeleteAsync(global::Nitric.Proto.Document.v1.DocumentDeleteRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) - { - return DeleteAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); - } - /// - /// Delete an existing document - /// - /// The request to send to the server. - /// The options for the call. - /// The call object. - public virtual grpc::AsyncUnaryCall DeleteAsync(global::Nitric.Proto.Document.v1.DocumentDeleteRequest request, grpc::CallOptions options) - { - return CallInvoker.AsyncUnaryCall(__Method_Delete, null, options, request); - } - /// - /// Query the document collection (supports pagination) - /// - /// The request to send to the server. - /// The initial metadata to send with the call. This parameter is optional. - /// An optional deadline for the call. The call will be cancelled if deadline is hit. - /// An optional token for canceling the call. - /// The response received from the server. - public virtual global::Nitric.Proto.Document.v1.DocumentQueryResponse Query(global::Nitric.Proto.Document.v1.DocumentQueryRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) - { - return Query(request, new grpc::CallOptions(headers, deadline, cancellationToken)); - } - /// - /// Query the document collection (supports pagination) - /// - /// The request to send to the server. - /// The options for the call. - /// The response received from the server. - public virtual global::Nitric.Proto.Document.v1.DocumentQueryResponse Query(global::Nitric.Proto.Document.v1.DocumentQueryRequest request, grpc::CallOptions options) - { - return CallInvoker.BlockingUnaryCall(__Method_Query, null, options, request); - } - /// - /// Query the document collection (supports pagination) - /// - /// The request to send to the server. - /// The initial metadata to send with the call. This parameter is optional. - /// An optional deadline for the call. The call will be cancelled if deadline is hit. - /// An optional token for canceling the call. - /// The call object. - public virtual grpc::AsyncUnaryCall QueryAsync(global::Nitric.Proto.Document.v1.DocumentQueryRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) - { - return QueryAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); - } - /// - /// Query the document collection (supports pagination) - /// - /// The request to send to the server. - /// The options for the call. - /// The call object. - public virtual grpc::AsyncUnaryCall QueryAsync(global::Nitric.Proto.Document.v1.DocumentQueryRequest request, grpc::CallOptions options) - { - return CallInvoker.AsyncUnaryCall(__Method_Query, null, options, request); - } - /// - /// Query the document collection (supports streaming) - /// - /// The request to send to the server. - /// The initial metadata to send with the call. This parameter is optional. - /// An optional deadline for the call. The call will be cancelled if deadline is hit. - /// An optional token for canceling the call. - /// The call object. - public virtual grpc::AsyncServerStreamingCall QueryStream(global::Nitric.Proto.Document.v1.DocumentQueryStreamRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) - { - return QueryStream(request, new grpc::CallOptions(headers, deadline, cancellationToken)); - } - /// - /// Query the document collection (supports streaming) - /// - /// The request to send to the server. - /// The options for the call. - /// The call object. - public virtual grpc::AsyncServerStreamingCall QueryStream(global::Nitric.Proto.Document.v1.DocumentQueryStreamRequest request, grpc::CallOptions options) - { - return CallInvoker.AsyncServerStreamingCall(__Method_QueryStream, null, options, request); - } - /// Creates a new instance of client from given ClientBaseConfiguration. - protected override DocumentServiceClient NewInstance(ClientBaseConfiguration configuration) - { - return new DocumentServiceClient(configuration); - } - } - - /// Creates service definition that can be registered with a server - /// An object implementing the server-side handling logic. - public static grpc::ServerServiceDefinition BindService(DocumentServiceBase serviceImpl) - { - return grpc::ServerServiceDefinition.CreateBuilder() - .AddMethod(__Method_Get, serviceImpl.Get) - .AddMethod(__Method_Set, serviceImpl.Set) - .AddMethod(__Method_Delete, serviceImpl.Delete) - .AddMethod(__Method_Query, serviceImpl.Query) - .AddMethod(__Method_QueryStream, serviceImpl.QueryStream).Build(); - } - - /// Register service method with a service binder with or without implementation. Useful when customizing the service binding logic. - /// Note: this method is part of an experimental API that can change or be removed without any prior notice. - /// Service methods will be bound by calling AddMethod on this object. - /// An object implementing the server-side handling logic. - public static void BindService(grpc::ServiceBinderBase serviceBinder, DocumentServiceBase serviceImpl) - { - serviceBinder.AddMethod(__Method_Get, serviceImpl == null ? null : new grpc::UnaryServerMethod(serviceImpl.Get)); - serviceBinder.AddMethod(__Method_Set, serviceImpl == null ? null : new grpc::UnaryServerMethod(serviceImpl.Set)); - serviceBinder.AddMethod(__Method_Delete, serviceImpl == null ? null : new grpc::UnaryServerMethod(serviceImpl.Delete)); - serviceBinder.AddMethod(__Method_Query, serviceImpl == null ? null : new grpc::UnaryServerMethod(serviceImpl.Query)); - serviceBinder.AddMethod(__Method_QueryStream, serviceImpl == null ? null : new grpc::ServerStreamingServerMethod(serviceImpl.QueryStream)); - } - - } -} -#endregion diff --git a/src/Nitric.Sdk/Proto/proto/event/v1/Event.cs b/src/Nitric.Sdk/Proto/proto/event/v1/Event.cs deleted file mode 100644 index dd04bab..0000000 --- a/src/Nitric.Sdk/Proto/proto/event/v1/Event.cs +++ /dev/null @@ -1,1259 +0,0 @@ -// -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: proto/event/v1/event.proto -// -#pragma warning disable 1591, 0612, 3021 -#region Designer generated code - -using pb = global::Google.Protobuf; -using pbc = global::Google.Protobuf.Collections; -using pbr = global::Google.Protobuf.Reflection; -using scg = global::System.Collections.Generic; -namespace Nitric.Proto.Event.v1 { - - /// Holder for reflection information generated from proto/event/v1/event.proto - public static partial class EventReflection { - - #region Descriptor - /// File descriptor for proto/event/v1/event.proto - public static pbr::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbr::FileDescriptor descriptor; - - static EventReflection() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "Chpwcm90by9ldmVudC92MS9ldmVudC5wcm90bxIPbml0cmljLmV2ZW50LnYx", - "Ghxnb29nbGUvcHJvdG9idWYvc3RydWN0LnByb3RvGhd2YWxpZGF0ZS92YWxp", - "ZGF0ZS5wcm90byJ6ChNFdmVudFB1Ymxpc2hSZXF1ZXN0Eg0KBXRvcGljGAEg", - "ASgJEjUKBWV2ZW50GAIgASgLMhwubml0cmljLmV2ZW50LnYxLk5pdHJpY0V2", - "ZW50Qgj6QgWKAQIQARIdCgVkZWxheRgDIAEoDUIO+kILKgkYgJqeASgKQAEi", - "IgoURXZlbnRQdWJsaXNoUmVzcG9uc2USCgoCaWQYASABKAkiEgoQVG9waWNM", - "aXN0UmVxdWVzdCJBChFUb3BpY0xpc3RSZXNwb25zZRIsCgZ0b3BpY3MYASAD", - "KAsyHC5uaXRyaWMuZXZlbnQudjEuTml0cmljVG9waWMiGwoLTml0cmljVG9w", - "aWMSDAoEbmFtZRgBIAEoCSJZCgtOaXRyaWNFdmVudBIKCgJpZBgBIAEoCRIU", - "CgxwYXlsb2FkX3R5cGUYAiABKAkSKAoHcGF5bG9hZBgDIAEoCzIXLmdvb2ds", - "ZS5wcm90b2J1Zi5TdHJ1Y3QyZgoMRXZlbnRTZXJ2aWNlElYKB1B1Ymxpc2gS", - "JC5uaXRyaWMuZXZlbnQudjEuRXZlbnRQdWJsaXNoUmVxdWVzdBolLm5pdHJp", - "Yy5ldmVudC52MS5FdmVudFB1Ymxpc2hSZXNwb25zZTJdCgxUb3BpY1NlcnZp", - "Y2USTQoETGlzdBIhLm5pdHJpYy5ldmVudC52MS5Ub3BpY0xpc3RSZXF1ZXN0", - "GiIubml0cmljLmV2ZW50LnYxLlRvcGljTGlzdFJlc3BvbnNlQokBChhpby5u", - "aXRyaWMucHJvdG8uZXZlbnQudjFCBkV2ZW50c1ABWjNnaXRodWIuY29tL25p", - "dHJpY3RlY2gvbml0cmljL2NvcmUvcGtnL2FwaS9uaXRyaWMvdjGqAhVOaXRy", - "aWMuUHJvdG8uRXZlbnQudjHKAhVOaXRyaWNcUHJvdG9cRXZlbnRcVjFiBnBy", - "b3RvMw==")); - descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, - new pbr::FileDescriptor[] { global::Google.Protobuf.WellKnownTypes.StructReflection.Descriptor, global::Validate.ValidateReflection.Descriptor, }, - new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Event.v1.EventPublishRequest), global::Nitric.Proto.Event.v1.EventPublishRequest.Parser, new[]{ "Topic", "Event", "Delay" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Event.v1.EventPublishResponse), global::Nitric.Proto.Event.v1.EventPublishResponse.Parser, new[]{ "Id" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Event.v1.TopicListRequest), global::Nitric.Proto.Event.v1.TopicListRequest.Parser, null, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Event.v1.TopicListResponse), global::Nitric.Proto.Event.v1.TopicListResponse.Parser, new[]{ "Topics" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Event.v1.NitricTopic), global::Nitric.Proto.Event.v1.NitricTopic.Parser, new[]{ "Name" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Event.v1.NitricEvent), global::Nitric.Proto.Event.v1.NitricEvent.Parser, new[]{ "Id", "PayloadType", "Payload" }, null, null, null, null) - })); - } - #endregion - - } - #region Messages - /// - /// Request to publish an event to a topic - /// - public sealed partial class EventPublishRequest : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new EventPublishRequest()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Event.v1.EventReflection.Descriptor.MessageTypes[0]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public EventPublishRequest() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public EventPublishRequest(EventPublishRequest other) : this() { - topic_ = other.topic_; - event_ = other.event_ != null ? other.event_.Clone() : null; - delay_ = other.delay_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public EventPublishRequest Clone() { - return new EventPublishRequest(this); - } - - /// Field number for the "topic" field. - public const int TopicFieldNumber = 1; - private string topic_ = ""; - /// - /// The name of the topic to publish the event to - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string Topic { - get { return topic_; } - set { - topic_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "event" field. - public const int EventFieldNumber = 2; - private global::Nitric.Proto.Event.v1.NitricEvent event_; - /// - /// The event to be published - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Event.v1.NitricEvent Event { - get { return event_; } - set { - event_ = value; - } - } - - /// Field number for the "delay" field. - public const int DelayFieldNumber = 3; - private uint delay_; - /// - /// An optional delay specified in seconds (minimum 10 seconds) - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public uint Delay { - get { return delay_; } - set { - delay_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as EventPublishRequest); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(EventPublishRequest other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Topic != other.Topic) return false; - if (!object.Equals(Event, other.Event)) return false; - if (Delay != other.Delay) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (Topic.Length != 0) hash ^= Topic.GetHashCode(); - if (event_ != null) hash ^= Event.GetHashCode(); - if (Delay != 0) hash ^= Delay.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (Topic.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Topic); - } - if (event_ != null) { - output.WriteRawTag(18); - output.WriteMessage(Event); - } - if (Delay != 0) { - output.WriteRawTag(24); - output.WriteUInt32(Delay); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (Topic.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Topic); - } - if (event_ != null) { - output.WriteRawTag(18); - output.WriteMessage(Event); - } - if (Delay != 0) { - output.WriteRawTag(24); - output.WriteUInt32(Delay); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (Topic.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Topic); - } - if (event_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Event); - } - if (Delay != 0) { - size += 1 + pb::CodedOutputStream.ComputeUInt32Size(Delay); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(EventPublishRequest other) { - if (other == null) { - return; - } - if (other.Topic.Length != 0) { - Topic = other.Topic; - } - if (other.event_ != null) { - if (event_ == null) { - Event = new global::Nitric.Proto.Event.v1.NitricEvent(); - } - Event.MergeFrom(other.Event); - } - if (other.Delay != 0) { - Delay = other.Delay; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - Topic = input.ReadString(); - break; - } - case 18: { - if (event_ == null) { - Event = new global::Nitric.Proto.Event.v1.NitricEvent(); - } - input.ReadMessage(Event); - break; - } - case 24: { - Delay = input.ReadUInt32(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - Topic = input.ReadString(); - break; - } - case 18: { - if (event_ == null) { - Event = new global::Nitric.Proto.Event.v1.NitricEvent(); - } - input.ReadMessage(Event); - break; - } - case 24: { - Delay = input.ReadUInt32(); - break; - } - } - } - } - #endif - - } - - /// - /// Result of publishing an event - /// - public sealed partial class EventPublishResponse : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new EventPublishResponse()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Event.v1.EventReflection.Descriptor.MessageTypes[1]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public EventPublishResponse() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public EventPublishResponse(EventPublishResponse other) : this() { - id_ = other.id_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public EventPublishResponse Clone() { - return new EventPublishResponse(this); - } - - /// Field number for the "id" field. - public const int IdFieldNumber = 1; - private string id_ = ""; - /// - /// The id of the published message - /// When an id was not supplied - /// one should be automatically generated - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string Id { - get { return id_; } - set { - id_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as EventPublishResponse); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(EventPublishResponse other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Id != other.Id) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (Id.Length != 0) hash ^= Id.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (Id.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Id); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (Id.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Id); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (Id.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Id); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(EventPublishResponse other) { - if (other == null) { - return; - } - if (other.Id.Length != 0) { - Id = other.Id; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - Id = input.ReadString(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - Id = input.ReadString(); - break; - } - } - } - } - #endif - - } - - /// - /// Request for the Topic List method - /// - public sealed partial class TopicListRequest : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TopicListRequest()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Event.v1.EventReflection.Descriptor.MessageTypes[2]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public TopicListRequest() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public TopicListRequest(TopicListRequest other) : this() { - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public TopicListRequest Clone() { - return new TopicListRequest(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as TopicListRequest); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(TopicListRequest other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(TopicListRequest other) { - if (other == null) { - return; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - } - } - } - #endif - - } - - /// - /// Topic List Response - /// - public sealed partial class TopicListResponse : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TopicListResponse()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Event.v1.EventReflection.Descriptor.MessageTypes[3]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public TopicListResponse() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public TopicListResponse(TopicListResponse other) : this() { - topics_ = other.topics_.Clone(); - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public TopicListResponse Clone() { - return new TopicListResponse(this); - } - - /// Field number for the "topics" field. - public const int TopicsFieldNumber = 1; - private static readonly pb::FieldCodec _repeated_topics_codec - = pb::FieldCodec.ForMessage(10, global::Nitric.Proto.Event.v1.NitricTopic.Parser); - private readonly pbc::RepeatedField topics_ = new pbc::RepeatedField(); - /// - /// The list of found topics - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField Topics { - get { return topics_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as TopicListResponse); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(TopicListResponse other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if(!topics_.Equals(other.topics_)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - hash ^= topics_.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - topics_.WriteTo(output, _repeated_topics_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - topics_.WriteTo(ref output, _repeated_topics_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - size += topics_.CalculateSize(_repeated_topics_codec); - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(TopicListResponse other) { - if (other == null) { - return; - } - topics_.Add(other.topics_); - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - topics_.AddEntriesFrom(input, _repeated_topics_codec); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - topics_.AddEntriesFrom(ref input, _repeated_topics_codec); - break; - } - } - } - } - #endif - - } - - /// - /// Represents an event topic - /// - public sealed partial class NitricTopic : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NitricTopic()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Event.v1.EventReflection.Descriptor.MessageTypes[4]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public NitricTopic() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public NitricTopic(NitricTopic other) : this() { - name_ = other.name_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public NitricTopic Clone() { - return new NitricTopic(this); - } - - /// Field number for the "name" field. - public const int NameFieldNumber = 1; - private string name_ = ""; - /// - /// The Nitric name for the topic - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string Name { - get { return name_; } - set { - name_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as NitricTopic); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(NitricTopic other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Name != other.Name) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (Name.Length != 0) hash ^= Name.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (Name.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Name); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (Name.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Name); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (Name.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Name); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(NitricTopic other) { - if (other == null) { - return; - } - if (other.Name.Length != 0) { - Name = other.Name; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - Name = input.ReadString(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - Name = input.ReadString(); - break; - } - } - } - } - #endif - - } - - /// - /// Nitric Event Model - /// - public sealed partial class NitricEvent : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NitricEvent()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Event.v1.EventReflection.Descriptor.MessageTypes[5]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public NitricEvent() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public NitricEvent(NitricEvent other) : this() { - id_ = other.id_; - payloadType_ = other.payloadType_; - payload_ = other.payload_ != null ? other.payload_.Clone() : null; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public NitricEvent Clone() { - return new NitricEvent(this); - } - - /// Field number for the "id" field. - public const int IdFieldNumber = 1; - private string id_ = ""; - /// - /// A Unique ID for the Nitric Event - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string Id { - get { return id_; } - set { - id_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "payload_type" field. - public const int PayloadTypeFieldNumber = 2; - private string payloadType_ = ""; - /// - /// A content hint for the events payload - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string PayloadType { - get { return payloadType_; } - set { - payloadType_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "payload" field. - public const int PayloadFieldNumber = 3; - private global::Google.Protobuf.WellKnownTypes.Struct payload_; - /// - /// The payload of the event - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Google.Protobuf.WellKnownTypes.Struct Payload { - get { return payload_; } - set { - payload_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as NitricEvent); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(NitricEvent other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Id != other.Id) return false; - if (PayloadType != other.PayloadType) return false; - if (!object.Equals(Payload, other.Payload)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (Id.Length != 0) hash ^= Id.GetHashCode(); - if (PayloadType.Length != 0) hash ^= PayloadType.GetHashCode(); - if (payload_ != null) hash ^= Payload.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (Id.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Id); - } - if (PayloadType.Length != 0) { - output.WriteRawTag(18); - output.WriteString(PayloadType); - } - if (payload_ != null) { - output.WriteRawTag(26); - output.WriteMessage(Payload); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (Id.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Id); - } - if (PayloadType.Length != 0) { - output.WriteRawTag(18); - output.WriteString(PayloadType); - } - if (payload_ != null) { - output.WriteRawTag(26); - output.WriteMessage(Payload); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (Id.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Id); - } - if (PayloadType.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(PayloadType); - } - if (payload_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Payload); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(NitricEvent other) { - if (other == null) { - return; - } - if (other.Id.Length != 0) { - Id = other.Id; - } - if (other.PayloadType.Length != 0) { - PayloadType = other.PayloadType; - } - if (other.payload_ != null) { - if (payload_ == null) { - Payload = new global::Google.Protobuf.WellKnownTypes.Struct(); - } - Payload.MergeFrom(other.Payload); - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - Id = input.ReadString(); - break; - } - case 18: { - PayloadType = input.ReadString(); - break; - } - case 26: { - if (payload_ == null) { - Payload = new global::Google.Protobuf.WellKnownTypes.Struct(); - } - input.ReadMessage(Payload); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - Id = input.ReadString(); - break; - } - case 18: { - PayloadType = input.ReadString(); - break; - } - case 26: { - if (payload_ == null) { - Payload = new global::Google.Protobuf.WellKnownTypes.Struct(); - } - input.ReadMessage(Payload); - break; - } - } - } - } - #endif - - } - - #endregion - -} - -#endregion Designer generated code diff --git a/src/Nitric.Sdk/Proto/proto/faas/v1/Faas.cs b/src/Nitric.Sdk/Proto/proto/faas/v1/Faas.cs deleted file mode 100644 index 6a2ef23..0000000 --- a/src/Nitric.Sdk/Proto/proto/faas/v1/Faas.cs +++ /dev/null @@ -1,7168 +0,0 @@ -// -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: proto/faas/v1/faas.proto -// -#pragma warning disable 1591, 0612, 3021 -#region Designer generated code - -using pb = global::Google.Protobuf; -using pbc = global::Google.Protobuf.Collections; -using pbr = global::Google.Protobuf.Reflection; -using scg = global::System.Collections.Generic; -namespace Nitric.Proto.Faas.v1 { - - /// Holder for reflection information generated from proto/faas/v1/faas.proto - public static partial class FaasReflection { - - #region Descriptor - /// File descriptor for proto/faas/v1/faas.proto - public static pbr::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbr::FileDescriptor descriptor; - - static FaasReflection() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "Chhwcm90by9mYWFzL3YxL2ZhYXMucHJvdG8SDm5pdHJpYy5mYWFzLnYxIpgB", - "Cg1DbGllbnRNZXNzYWdlEgoKAmlkGAEgASgJEjMKDGluaXRfcmVxdWVzdBgC", - "IAEoCzIbLm5pdHJpYy5mYWFzLnYxLkluaXRSZXF1ZXN0SAASOwoQdHJpZ2dl", - "cl9yZXNwb25zZRgDIAEoCzIfLm5pdHJpYy5mYWFzLnYxLlRyaWdnZXJSZXNw", - "b25zZUgAQgkKB2NvbnRlbnQimAEKDVNlcnZlck1lc3NhZ2USCgoCaWQYASAB", - "KAkSNQoNaW5pdF9yZXNwb25zZRgCIAEoCzIcLm5pdHJpYy5mYWFzLnYxLklu", - "aXRSZXNwb25zZUgAEjkKD3RyaWdnZXJfcmVxdWVzdBgDIAEoCzIeLm5pdHJp", - "Yy5mYWFzLnYxLlRyaWdnZXJSZXF1ZXN0SABCCQoHY29udGVudCIhCg9BcGlX", - "b3JrZXJTY29wZXMSDgoGc2NvcGVzGAEgAygJIsEBChBBcGlXb3JrZXJPcHRp", - "b25zEkAKCHNlY3VyaXR5GAEgAygLMi4ubml0cmljLmZhYXMudjEuQXBpV29y", - "a2VyT3B0aW9ucy5TZWN1cml0eUVudHJ5EhkKEXNlY3VyaXR5X2Rpc2FibGVk", - "GAIgASgIGlAKDVNlY3VyaXR5RW50cnkSCwoDa2V5GAEgASgJEi4KBXZhbHVl", - "GAIgASgLMh8ubml0cmljLmZhYXMudjEuQXBpV29ya2VyU2NvcGVzOgI4ASJq", - "CglBcGlXb3JrZXISCwoDYXBpGAEgASgJEgwKBHBhdGgYAiABKAkSDwoHbWV0", - "aG9kcxgDIAMoCRIxCgdvcHRpb25zGAQgASgLMiAubml0cmljLmZhYXMudjEu", - "QXBpV29ya2VyT3B0aW9ucyIjChJTdWJzY3JpcHRpb25Xb3JrZXISDQoFdG9w", - "aWMYASABKAkihAEKDlNjaGVkdWxlV29ya2VyEgsKA2tleRgBIAEoCRIsCgRy", - "YXRlGAogASgLMhwubml0cmljLmZhYXMudjEuU2NoZWR1bGVSYXRlSAASLAoE", - "Y3JvbhgLIAEoCzIcLm5pdHJpYy5mYWFzLnYxLlNjaGVkdWxlQ3JvbkgAQgkK", - "B2NhZGVuY2UiHAoMU2NoZWR1bGVSYXRlEgwKBHJhdGUYASABKAkiHAoMU2No", - "ZWR1bGVDcm9uEgwKBGNyb24YASABKAkiGgoKSHR0cFdvcmtlchIMCgRwb3J0", - "GAEgASgFImQKGEJ1Y2tldE5vdGlmaWNhdGlvbldvcmtlchIOCgZidWNrZXQY", - "ASABKAkSOAoGY29uZmlnGAIgASgLMigubml0cmljLmZhYXMudjEuQnVja2V0", - "Tm90aWZpY2F0aW9uQ29uZmlnIoEBChhCdWNrZXROb3RpZmljYXRpb25Db25m", - "aWcSQQoRbm90aWZpY2F0aW9uX3R5cGUYASABKA4yJi5uaXRyaWMuZmFhcy52", - "MS5CdWNrZXROb3RpZmljYXRpb25UeXBlEiIKGm5vdGlmaWNhdGlvbl9wcmVm", - "aXhfZmlsdGVyGAIgASgJIlAKD1dlYnNvY2tldFdvcmtlchIOCgZzb2NrZXQY", - "ASABKAkSLQoFZXZlbnQYAiABKA4yHi5uaXRyaWMuZmFhcy52MS5XZWJzb2Nr", - "ZXRFdmVudCLjAgoLSW5pdFJlcXVlc3QSKAoDYXBpGAogASgLMhkubml0cmlj", - "LmZhYXMudjEuQXBpV29ya2VySAASOgoMc3Vic2NyaXB0aW9uGAsgASgLMiIu", - "bml0cmljLmZhYXMudjEuU3Vic2NyaXB0aW9uV29ya2VySAASMgoIc2NoZWR1", - "bGUYDCABKAsyHi5uaXRyaWMuZmFhcy52MS5TY2hlZHVsZVdvcmtlckgAEkcK", - "E2J1Y2tldF9ub3RpZmljYXRpb24YDSABKAsyKC5uaXRyaWMuZmFhcy52MS5C", - "dWNrZXROb3RpZmljYXRpb25Xb3JrZXJIABI0Cgl3ZWJzb2NrZXQYDiABKAsy", - "Hy5uaXRyaWMuZmFhcy52MS5XZWJzb2NrZXRXb3JrZXJIABIxCgtodHRwX3dv", - "cmtlchgPIAEoCzIaLm5pdHJpYy5mYWFzLnYxLkh0dHBXb3JrZXJIAEIICgZX", - "b3JrZXIiDgoMSW5pdFJlc3BvbnNlIncKDFRyYWNlQ29udGV4dBI4CgZ2YWx1", - "ZXMYASADKAsyKC5uaXRyaWMuZmFhcy52MS5UcmFjZUNvbnRleHQuVmFsdWVz", - "RW50cnkaLQoLVmFsdWVzRW50cnkSCwoDa2V5GAEgASgJEg0KBXZhbHVlGAIg", - "ASgJOgI4ASLdAgoOVHJpZ2dlclJlcXVlc3QSDAoEZGF0YRgBIAEoDBIRCglt", - "aW1lX3R5cGUYAiABKAkSMwoNdHJhY2VfY29udGV4dBgKIAEoCzIcLm5pdHJp", - "Yy5mYWFzLnYxLlRyYWNlQ29udGV4dBIyCgRodHRwGAMgASgLMiIubml0cmlj", - "LmZhYXMudjEuSHR0cFRyaWdnZXJDb250ZXh0SAASNAoFdG9waWMYBCABKAsy", - "Iy5uaXRyaWMuZmFhcy52MS5Ub3BpY1RyaWdnZXJDb250ZXh0SAASQgoMbm90", - "aWZpY2F0aW9uGAUgASgLMioubml0cmljLmZhYXMudjEuTm90aWZpY2F0aW9u", - "VHJpZ2dlckNvbnRleHRIABI8Cgl3ZWJzb2NrZXQYBiABKAsyJy5uaXRyaWMu", - "ZmFhcy52MS5XZWJzb2NrZXRUcmlnZ2VyQ29udGV4dEgAQgkKB2NvbnRleHQi", - "HAoLSGVhZGVyVmFsdWUSDQoFdmFsdWUYASADKAkiGwoKUXVlcnlWYWx1ZRIN", - "CgV2YWx1ZRgBIAMoCSLlBQoSSHR0cFRyaWdnZXJDb250ZXh0Eg4KBm1ldGhv", - "ZBgBIAEoCRIMCgRwYXRoGAIgASgJEksKC2hlYWRlcnNfb2xkGAMgAygLMjIu", - "bml0cmljLmZhYXMudjEuSHR0cFRyaWdnZXJDb250ZXh0LkhlYWRlcnNPbGRF", - "bnRyeUICGAESVAoQcXVlcnlfcGFyYW1zX29sZBgEIAMoCzI2Lm5pdHJpYy5m", - "YWFzLnYxLkh0dHBUcmlnZ2VyQ29udGV4dC5RdWVyeVBhcmFtc09sZEVudHJ5", - "QgIYARJACgdoZWFkZXJzGAUgAygLMi8ubml0cmljLmZhYXMudjEuSHR0cFRy", - "aWdnZXJDb250ZXh0LkhlYWRlcnNFbnRyeRJJCgxxdWVyeV9wYXJhbXMYBiAD", - "KAsyMy5uaXRyaWMuZmFhcy52MS5IdHRwVHJpZ2dlckNvbnRleHQuUXVlcnlQ", - "YXJhbXNFbnRyeRJHCgtwYXRoX3BhcmFtcxgHIAMoCzIyLm5pdHJpYy5mYWFz", - "LnYxLkh0dHBUcmlnZ2VyQ29udGV4dC5QYXRoUGFyYW1zRW50cnkaMQoPSGVh", - "ZGVyc09sZEVudHJ5EgsKA2tleRgBIAEoCRINCgV2YWx1ZRgCIAEoCToCOAEa", - "NQoTUXVlcnlQYXJhbXNPbGRFbnRyeRILCgNrZXkYASABKAkSDQoFdmFsdWUY", - "AiABKAk6AjgBGksKDEhlYWRlcnNFbnRyeRILCgNrZXkYASABKAkSKgoFdmFs", - "dWUYAiABKAsyGy5uaXRyaWMuZmFhcy52MS5IZWFkZXJWYWx1ZToCOAEaTgoQ", - "UXVlcnlQYXJhbXNFbnRyeRILCgNrZXkYASABKAkSKQoFdmFsdWUYAiABKAsy", - "Gi5uaXRyaWMuZmFhcy52MS5RdWVyeVZhbHVlOgI4ARoxCg9QYXRoUGFyYW1z", - "RW50cnkSCwoDa2V5GAEgASgJEg0KBXZhbHVlGAIgASgJOgI4ASIkChNUb3Bp", - "Y1RyaWdnZXJDb250ZXh0Eg0KBXRvcGljGAEgASgJIlcKEkJ1Y2tldE5vdGlm", - "aWNhdGlvbhILCgNrZXkYASABKAkSNAoEdHlwZRgCIAEoDjImLm5pdHJpYy5m", - "YWFzLnYxLkJ1Y2tldE5vdGlmaWNhdGlvblR5cGUicgoaTm90aWZpY2F0aW9u", - "VHJpZ2dlckNvbnRleHQSDgoGc291cmNlGAEgASgJEjQKBmJ1Y2tldBgKIAEo", - "CzIiLm5pdHJpYy5mYWFzLnYxLkJ1Y2tldE5vdGlmaWNhdGlvbkgAQg4KDG5v", - "dGlmaWNhdGlvbiKOAgoXV2Vic29ja2V0VHJpZ2dlckNvbnRleHQSDgoGc29j", - "a2V0GAEgASgJEi0KBWV2ZW50GAIgASgOMh4ubml0cmljLmZhYXMudjEuV2Vi", - "c29ja2V0RXZlbnQSFAoMY29ubmVjdGlvbklkGAMgASgJEk4KDHF1ZXJ5X3Bh", - "cmFtcxgGIAMoCzI4Lm5pdHJpYy5mYWFzLnYxLldlYnNvY2tldFRyaWdnZXJD", - "b250ZXh0LlF1ZXJ5UGFyYW1zRW50cnkaTgoQUXVlcnlQYXJhbXNFbnRyeRIL", - "CgNrZXkYASABKAkSKQoFdmFsdWUYAiABKAsyGi5uaXRyaWMuZmFhcy52MS5R", - "dWVyeVZhbHVlOgI4ASKaAgoPVHJpZ2dlclJlc3BvbnNlEgwKBGRhdGEYASAB", - "KAwSMwoEaHR0cBgKIAEoCzIjLm5pdHJpYy5mYWFzLnYxLkh0dHBSZXNwb25z", - "ZUNvbnRleHRIABI1CgV0b3BpYxgLIAEoCzIkLm5pdHJpYy5mYWFzLnYxLlRv", - "cGljUmVzcG9uc2VDb250ZXh0SAASQwoMbm90aWZpY2F0aW9uGAwgASgLMisu", - "bml0cmljLmZhYXMudjEuTm90aWZpY2F0aW9uUmVzcG9uc2VDb250ZXh0SAAS", - "PQoJd2Vic29ja2V0GA0gASgLMigubml0cmljLmZhYXMudjEuV2Vic29ja2V0", - "UmVzcG9uc2VDb250ZXh0SABCCQoHY29udGV4dCK2AgoTSHR0cFJlc3BvbnNl", - "Q29udGV4dBJMCgtoZWFkZXJzX29sZBgBIAMoCzIzLm5pdHJpYy5mYWFzLnYx", - "Lkh0dHBSZXNwb25zZUNvbnRleHQuSGVhZGVyc09sZEVudHJ5QgIYARIOCgZz", - "dGF0dXMYAiABKAUSQQoHaGVhZGVycxgDIAMoCzIwLm5pdHJpYy5mYWFzLnYx", - "Lkh0dHBSZXNwb25zZUNvbnRleHQuSGVhZGVyc0VudHJ5GjEKD0hlYWRlcnNP", - "bGRFbnRyeRILCgNrZXkYASABKAkSDQoFdmFsdWUYAiABKAk6AjgBGksKDEhl", - "YWRlcnNFbnRyeRILCgNrZXkYASABKAkSKgoFdmFsdWUYAiABKAsyGy5uaXRy", - "aWMuZmFhcy52MS5IZWFkZXJWYWx1ZToCOAEiJwoUVG9waWNSZXNwb25zZUNv", - "bnRleHQSDwoHc3VjY2VzcxgBIAEoCCIuChtOb3RpZmljYXRpb25SZXNwb25z", - "ZUNvbnRleHQSDwoHc3VjY2VzcxgBIAEoCCIrChhXZWJzb2NrZXRSZXNwb25z", - "ZUNvbnRleHQSDwoHc3VjY2VzcxgBIAEoCCo7ChZCdWNrZXROb3RpZmljYXRp", - "b25UeXBlEgcKA0FsbBAAEgsKB0NyZWF0ZWQQARILCgdEZWxldGVkEAIqOgoO", - "V2Vic29ja2V0RXZlbnQSCwoHQ29ubmVjdBAAEg4KCkRpc2Nvbm5lY3QQARIL", - "CgdNZXNzYWdlEAIyYAoLRmFhc1NlcnZpY2USUQoNVHJpZ2dlclN0cmVhbRId", - "Lm5pdHJpYy5mYWFzLnYxLkNsaWVudE1lc3NhZ2UaHS5uaXRyaWMuZmFhcy52", - "MS5TZXJ2ZXJNZXNzYWdlKAEwAUKKAQoXaW8ubml0cmljLnByb3RvLmZhYXMu", - "djFCCk5pdHJpY0ZhYXNQAVozZ2l0aHViLmNvbS9uaXRyaWN0ZWNoL25pdHJp", - "Yy9jb3JlL3BrZy9hcGkvbml0cmljL3YxqgIUTml0cmljLlByb3RvLkZhYXMu", - "djHKAhROaXRyaWNcUHJvdG9cRmFhc1xWMWIGcHJvdG8z")); - descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, - new pbr::FileDescriptor[] { }, - new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Nitric.Proto.Faas.v1.BucketNotificationType), typeof(global::Nitric.Proto.Faas.v1.WebsocketEvent), }, null, new pbr::GeneratedClrTypeInfo[] { - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Faas.v1.ClientMessage), global::Nitric.Proto.Faas.v1.ClientMessage.Parser, new[]{ "Id", "InitRequest", "TriggerResponse" }, new[]{ "Content" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Faas.v1.ServerMessage), global::Nitric.Proto.Faas.v1.ServerMessage.Parser, new[]{ "Id", "InitResponse", "TriggerRequest" }, new[]{ "Content" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Faas.v1.ApiWorkerScopes), global::Nitric.Proto.Faas.v1.ApiWorkerScopes.Parser, new[]{ "Scopes" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Faas.v1.ApiWorkerOptions), global::Nitric.Proto.Faas.v1.ApiWorkerOptions.Parser, new[]{ "Security", "SecurityDisabled" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { null, }), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Faas.v1.ApiWorker), global::Nitric.Proto.Faas.v1.ApiWorker.Parser, new[]{ "Api", "Path", "Methods", "Options" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Faas.v1.SubscriptionWorker), global::Nitric.Proto.Faas.v1.SubscriptionWorker.Parser, new[]{ "Topic" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Faas.v1.ScheduleWorker), global::Nitric.Proto.Faas.v1.ScheduleWorker.Parser, new[]{ "Key", "Rate", "Cron" }, new[]{ "Cadence" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Faas.v1.ScheduleRate), global::Nitric.Proto.Faas.v1.ScheduleRate.Parser, new[]{ "Rate" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Faas.v1.ScheduleCron), global::Nitric.Proto.Faas.v1.ScheduleCron.Parser, new[]{ "Cron" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Faas.v1.HttpWorker), global::Nitric.Proto.Faas.v1.HttpWorker.Parser, new[]{ "Port" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Faas.v1.BucketNotificationWorker), global::Nitric.Proto.Faas.v1.BucketNotificationWorker.Parser, new[]{ "Bucket", "Config" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Faas.v1.BucketNotificationConfig), global::Nitric.Proto.Faas.v1.BucketNotificationConfig.Parser, new[]{ "NotificationType", "NotificationPrefixFilter" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Faas.v1.WebsocketWorker), global::Nitric.Proto.Faas.v1.WebsocketWorker.Parser, new[]{ "Socket", "Event" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Faas.v1.InitRequest), global::Nitric.Proto.Faas.v1.InitRequest.Parser, new[]{ "Api", "Subscription", "Schedule", "BucketNotification", "Websocket", "HttpWorker" }, new[]{ "Worker" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Faas.v1.InitResponse), global::Nitric.Proto.Faas.v1.InitResponse.Parser, null, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Faas.v1.TraceContext), global::Nitric.Proto.Faas.v1.TraceContext.Parser, new[]{ "Values" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { null, }), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Faas.v1.TriggerRequest), global::Nitric.Proto.Faas.v1.TriggerRequest.Parser, new[]{ "Data", "MimeType", "TraceContext", "Http", "Topic", "Notification", "Websocket" }, new[]{ "Context" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Faas.v1.HeaderValue), global::Nitric.Proto.Faas.v1.HeaderValue.Parser, new[]{ "Value" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Faas.v1.QueryValue), global::Nitric.Proto.Faas.v1.QueryValue.Parser, new[]{ "Value" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Faas.v1.HttpTriggerContext), global::Nitric.Proto.Faas.v1.HttpTriggerContext.Parser, new[]{ "Method", "Path", "HeadersOld", "QueryParamsOld", "Headers", "QueryParams", "PathParams" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { null, null, null, null, null, }), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Faas.v1.TopicTriggerContext), global::Nitric.Proto.Faas.v1.TopicTriggerContext.Parser, new[]{ "Topic" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Faas.v1.BucketNotification), global::Nitric.Proto.Faas.v1.BucketNotification.Parser, new[]{ "Key", "Type" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Faas.v1.NotificationTriggerContext), global::Nitric.Proto.Faas.v1.NotificationTriggerContext.Parser, new[]{ "Source", "Bucket" }, new[]{ "Notification" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Faas.v1.WebsocketTriggerContext), global::Nitric.Proto.Faas.v1.WebsocketTriggerContext.Parser, new[]{ "Socket", "Event", "ConnectionId", "QueryParams" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { null, }), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Faas.v1.TriggerResponse), global::Nitric.Proto.Faas.v1.TriggerResponse.Parser, new[]{ "Data", "Http", "Topic", "Notification", "Websocket" }, new[]{ "Context" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Faas.v1.HttpResponseContext), global::Nitric.Proto.Faas.v1.HttpResponseContext.Parser, new[]{ "HeadersOld", "Status", "Headers" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { null, null, }), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Faas.v1.TopicResponseContext), global::Nitric.Proto.Faas.v1.TopicResponseContext.Parser, new[]{ "Success" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Faas.v1.NotificationResponseContext), global::Nitric.Proto.Faas.v1.NotificationResponseContext.Parser, new[]{ "Success" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Faas.v1.WebsocketResponseContext), global::Nitric.Proto.Faas.v1.WebsocketResponseContext.Parser, new[]{ "Success" }, null, null, null, null) - })); - } - #endregion - - } - #region Enums - /// - /// Notification Workers - /// - public enum BucketNotificationType { - [pbr::OriginalName("All")] All = 0, - [pbr::OriginalName("Created")] Created = 1, - [pbr::OriginalName("Deleted")] Deleted = 2, - } - - public enum WebsocketEvent { - /// - /// Specialised Event for handling new client connections - /// - [pbr::OriginalName("Connect")] Connect = 0, - /// - /// Specialised Event for handling existing client connections - /// - [pbr::OriginalName("Disconnect")] Disconnect = 1, - /// - /// All other types of events are messages - /// - [pbr::OriginalName("Message")] Message = 2, - } - - #endregion - - #region Messages - /// - /// Messages the client is able to send to the server - /// - public sealed partial class ClientMessage : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ClientMessage()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Faas.v1.FaasReflection.Descriptor.MessageTypes[0]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ClientMessage() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ClientMessage(ClientMessage other) : this() { - id_ = other.id_; - switch (other.ContentCase) { - case ContentOneofCase.InitRequest: - InitRequest = other.InitRequest.Clone(); - break; - case ContentOneofCase.TriggerResponse: - TriggerResponse = other.TriggerResponse.Clone(); - break; - } - - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ClientMessage Clone() { - return new ClientMessage(this); - } - - /// Field number for the "id" field. - public const int IdFieldNumber = 1; - private string id_ = ""; - /// - /// Client message ID, used to pair requests/responses - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string Id { - get { return id_; } - set { - id_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "init_request" field. - public const int InitRequestFieldNumber = 2; - /// - /// Client initialisation request - /// A worker will not be eligible for triggers - /// until it has identified itself - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Faas.v1.InitRequest InitRequest { - get { return contentCase_ == ContentOneofCase.InitRequest ? (global::Nitric.Proto.Faas.v1.InitRequest) content_ : null; } - set { - content_ = value; - contentCase_ = value == null ? ContentOneofCase.None : ContentOneofCase.InitRequest; - } - } - - /// Field number for the "trigger_response" field. - public const int TriggerResponseFieldNumber = 3; - /// - /// Client responsding with result of - /// a trigger - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Faas.v1.TriggerResponse TriggerResponse { - get { return contentCase_ == ContentOneofCase.TriggerResponse ? (global::Nitric.Proto.Faas.v1.TriggerResponse) content_ : null; } - set { - content_ = value; - contentCase_ = value == null ? ContentOneofCase.None : ContentOneofCase.TriggerResponse; - } - } - - private object content_; - /// Enum of possible cases for the "content" oneof. - public enum ContentOneofCase { - None = 0, - InitRequest = 2, - TriggerResponse = 3, - } - private ContentOneofCase contentCase_ = ContentOneofCase.None; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ContentOneofCase ContentCase { - get { return contentCase_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearContent() { - contentCase_ = ContentOneofCase.None; - content_ = null; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as ClientMessage); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(ClientMessage other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Id != other.Id) return false; - if (!object.Equals(InitRequest, other.InitRequest)) return false; - if (!object.Equals(TriggerResponse, other.TriggerResponse)) return false; - if (ContentCase != other.ContentCase) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (Id.Length != 0) hash ^= Id.GetHashCode(); - if (contentCase_ == ContentOneofCase.InitRequest) hash ^= InitRequest.GetHashCode(); - if (contentCase_ == ContentOneofCase.TriggerResponse) hash ^= TriggerResponse.GetHashCode(); - hash ^= (int) contentCase_; - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (Id.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Id); - } - if (contentCase_ == ContentOneofCase.InitRequest) { - output.WriteRawTag(18); - output.WriteMessage(InitRequest); - } - if (contentCase_ == ContentOneofCase.TriggerResponse) { - output.WriteRawTag(26); - output.WriteMessage(TriggerResponse); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (Id.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Id); - } - if (contentCase_ == ContentOneofCase.InitRequest) { - output.WriteRawTag(18); - output.WriteMessage(InitRequest); - } - if (contentCase_ == ContentOneofCase.TriggerResponse) { - output.WriteRawTag(26); - output.WriteMessage(TriggerResponse); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (Id.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Id); - } - if (contentCase_ == ContentOneofCase.InitRequest) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(InitRequest); - } - if (contentCase_ == ContentOneofCase.TriggerResponse) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(TriggerResponse); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(ClientMessage other) { - if (other == null) { - return; - } - if (other.Id.Length != 0) { - Id = other.Id; - } - switch (other.ContentCase) { - case ContentOneofCase.InitRequest: - if (InitRequest == null) { - InitRequest = new global::Nitric.Proto.Faas.v1.InitRequest(); - } - InitRequest.MergeFrom(other.InitRequest); - break; - case ContentOneofCase.TriggerResponse: - if (TriggerResponse == null) { - TriggerResponse = new global::Nitric.Proto.Faas.v1.TriggerResponse(); - } - TriggerResponse.MergeFrom(other.TriggerResponse); - break; - } - - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - Id = input.ReadString(); - break; - } - case 18: { - global::Nitric.Proto.Faas.v1.InitRequest subBuilder = new global::Nitric.Proto.Faas.v1.InitRequest(); - if (contentCase_ == ContentOneofCase.InitRequest) { - subBuilder.MergeFrom(InitRequest); - } - input.ReadMessage(subBuilder); - InitRequest = subBuilder; - break; - } - case 26: { - global::Nitric.Proto.Faas.v1.TriggerResponse subBuilder = new global::Nitric.Proto.Faas.v1.TriggerResponse(); - if (contentCase_ == ContentOneofCase.TriggerResponse) { - subBuilder.MergeFrom(TriggerResponse); - } - input.ReadMessage(subBuilder); - TriggerResponse = subBuilder; - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - Id = input.ReadString(); - break; - } - case 18: { - global::Nitric.Proto.Faas.v1.InitRequest subBuilder = new global::Nitric.Proto.Faas.v1.InitRequest(); - if (contentCase_ == ContentOneofCase.InitRequest) { - subBuilder.MergeFrom(InitRequest); - } - input.ReadMessage(subBuilder); - InitRequest = subBuilder; - break; - } - case 26: { - global::Nitric.Proto.Faas.v1.TriggerResponse subBuilder = new global::Nitric.Proto.Faas.v1.TriggerResponse(); - if (contentCase_ == ContentOneofCase.TriggerResponse) { - subBuilder.MergeFrom(TriggerResponse); - } - input.ReadMessage(subBuilder); - TriggerResponse = subBuilder; - break; - } - } - } - } - #endif - - } - - /// - /// Messages the server is able to send to the client - /// - public sealed partial class ServerMessage : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ServerMessage()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Faas.v1.FaasReflection.Descriptor.MessageTypes[1]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ServerMessage() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ServerMessage(ServerMessage other) : this() { - id_ = other.id_; - switch (other.ContentCase) { - case ContentOneofCase.InitResponse: - InitResponse = other.InitResponse.Clone(); - break; - case ContentOneofCase.TriggerRequest: - TriggerRequest = other.TriggerRequest.Clone(); - break; - } - - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ServerMessage Clone() { - return new ServerMessage(this); - } - - /// Field number for the "id" field. - public const int IdFieldNumber = 1; - private string id_ = ""; - /// - /// Server message ID, used to pair requests/responses - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string Id { - get { return id_; } - set { - id_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "init_response" field. - public const int InitResponseFieldNumber = 2; - /// - /// Server responding - /// with client configuration details to an - /// InitRequest - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Faas.v1.InitResponse InitResponse { - get { return contentCase_ == ContentOneofCase.InitResponse ? (global::Nitric.Proto.Faas.v1.InitResponse) content_ : null; } - set { - content_ = value; - contentCase_ = value == null ? ContentOneofCase.None : ContentOneofCase.InitResponse; - } - } - - /// Field number for the "trigger_request" field. - public const int TriggerRequestFieldNumber = 3; - /// - /// Server requesting client to - /// process a trigger - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Faas.v1.TriggerRequest TriggerRequest { - get { return contentCase_ == ContentOneofCase.TriggerRequest ? (global::Nitric.Proto.Faas.v1.TriggerRequest) content_ : null; } - set { - content_ = value; - contentCase_ = value == null ? ContentOneofCase.None : ContentOneofCase.TriggerRequest; - } - } - - private object content_; - /// Enum of possible cases for the "content" oneof. - public enum ContentOneofCase { - None = 0, - InitResponse = 2, - TriggerRequest = 3, - } - private ContentOneofCase contentCase_ = ContentOneofCase.None; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ContentOneofCase ContentCase { - get { return contentCase_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearContent() { - contentCase_ = ContentOneofCase.None; - content_ = null; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as ServerMessage); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(ServerMessage other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Id != other.Id) return false; - if (!object.Equals(InitResponse, other.InitResponse)) return false; - if (!object.Equals(TriggerRequest, other.TriggerRequest)) return false; - if (ContentCase != other.ContentCase) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (Id.Length != 0) hash ^= Id.GetHashCode(); - if (contentCase_ == ContentOneofCase.InitResponse) hash ^= InitResponse.GetHashCode(); - if (contentCase_ == ContentOneofCase.TriggerRequest) hash ^= TriggerRequest.GetHashCode(); - hash ^= (int) contentCase_; - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (Id.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Id); - } - if (contentCase_ == ContentOneofCase.InitResponse) { - output.WriteRawTag(18); - output.WriteMessage(InitResponse); - } - if (contentCase_ == ContentOneofCase.TriggerRequest) { - output.WriteRawTag(26); - output.WriteMessage(TriggerRequest); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (Id.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Id); - } - if (contentCase_ == ContentOneofCase.InitResponse) { - output.WriteRawTag(18); - output.WriteMessage(InitResponse); - } - if (contentCase_ == ContentOneofCase.TriggerRequest) { - output.WriteRawTag(26); - output.WriteMessage(TriggerRequest); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (Id.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Id); - } - if (contentCase_ == ContentOneofCase.InitResponse) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(InitResponse); - } - if (contentCase_ == ContentOneofCase.TriggerRequest) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(TriggerRequest); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(ServerMessage other) { - if (other == null) { - return; - } - if (other.Id.Length != 0) { - Id = other.Id; - } - switch (other.ContentCase) { - case ContentOneofCase.InitResponse: - if (InitResponse == null) { - InitResponse = new global::Nitric.Proto.Faas.v1.InitResponse(); - } - InitResponse.MergeFrom(other.InitResponse); - break; - case ContentOneofCase.TriggerRequest: - if (TriggerRequest == null) { - TriggerRequest = new global::Nitric.Proto.Faas.v1.TriggerRequest(); - } - TriggerRequest.MergeFrom(other.TriggerRequest); - break; - } - - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - Id = input.ReadString(); - break; - } - case 18: { - global::Nitric.Proto.Faas.v1.InitResponse subBuilder = new global::Nitric.Proto.Faas.v1.InitResponse(); - if (contentCase_ == ContentOneofCase.InitResponse) { - subBuilder.MergeFrom(InitResponse); - } - input.ReadMessage(subBuilder); - InitResponse = subBuilder; - break; - } - case 26: { - global::Nitric.Proto.Faas.v1.TriggerRequest subBuilder = new global::Nitric.Proto.Faas.v1.TriggerRequest(); - if (contentCase_ == ContentOneofCase.TriggerRequest) { - subBuilder.MergeFrom(TriggerRequest); - } - input.ReadMessage(subBuilder); - TriggerRequest = subBuilder; - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - Id = input.ReadString(); - break; - } - case 18: { - global::Nitric.Proto.Faas.v1.InitResponse subBuilder = new global::Nitric.Proto.Faas.v1.InitResponse(); - if (contentCase_ == ContentOneofCase.InitResponse) { - subBuilder.MergeFrom(InitResponse); - } - input.ReadMessage(subBuilder); - InitResponse = subBuilder; - break; - } - case 26: { - global::Nitric.Proto.Faas.v1.TriggerRequest subBuilder = new global::Nitric.Proto.Faas.v1.TriggerRequest(); - if (contentCase_ == ContentOneofCase.TriggerRequest) { - subBuilder.MergeFrom(TriggerRequest); - } - input.ReadMessage(subBuilder); - TriggerRequest = subBuilder; - break; - } - } - } - } - #endif - - } - - public sealed partial class ApiWorkerScopes : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ApiWorkerScopes()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Faas.v1.FaasReflection.Descriptor.MessageTypes[2]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ApiWorkerScopes() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ApiWorkerScopes(ApiWorkerScopes other) : this() { - scopes_ = other.scopes_.Clone(); - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ApiWorkerScopes Clone() { - return new ApiWorkerScopes(this); - } - - /// Field number for the "scopes" field. - public const int ScopesFieldNumber = 1; - private static readonly pb::FieldCodec _repeated_scopes_codec - = pb::FieldCodec.ForString(10); - private readonly pbc::RepeatedField scopes_ = new pbc::RepeatedField(); - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField Scopes { - get { return scopes_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as ApiWorkerScopes); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(ApiWorkerScopes other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if(!scopes_.Equals(other.scopes_)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - hash ^= scopes_.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - scopes_.WriteTo(output, _repeated_scopes_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - scopes_.WriteTo(ref output, _repeated_scopes_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - size += scopes_.CalculateSize(_repeated_scopes_codec); - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(ApiWorkerScopes other) { - if (other == null) { - return; - } - scopes_.Add(other.scopes_); - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - scopes_.AddEntriesFrom(input, _repeated_scopes_codec); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - scopes_.AddEntriesFrom(ref input, _repeated_scopes_codec); - break; - } - } - } - } - #endif - - } - - public sealed partial class ApiWorkerOptions : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ApiWorkerOptions()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Faas.v1.FaasReflection.Descriptor.MessageTypes[3]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ApiWorkerOptions() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ApiWorkerOptions(ApiWorkerOptions other) : this() { - security_ = other.security_.Clone(); - securityDisabled_ = other.securityDisabled_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ApiWorkerOptions Clone() { - return new ApiWorkerOptions(this); - } - - /// Field number for the "security" field. - public const int SecurityFieldNumber = 1; - private static readonly pbc::MapField.Codec _map_security_codec - = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForMessage(18, global::Nitric.Proto.Faas.v1.ApiWorkerScopes.Parser), 10); - private readonly pbc::MapField security_ = new pbc::MapField(); - /// - /// Apply security definitions to this operation - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::MapField Security { - get { return security_; } - } - - /// Field number for the "security_disabled" field. - public const int SecurityDisabledFieldNumber = 2; - private bool securityDisabled_; - /// - /// explicitly disable security for this endpoint - /// We need to do this as the default value of a repeated field - /// is always empty so there is no way of knowing if security is explicitly disabled - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool SecurityDisabled { - get { return securityDisabled_; } - set { - securityDisabled_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as ApiWorkerOptions); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(ApiWorkerOptions other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!Security.Equals(other.Security)) return false; - if (SecurityDisabled != other.SecurityDisabled) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - hash ^= Security.GetHashCode(); - if (SecurityDisabled != false) hash ^= SecurityDisabled.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - security_.WriteTo(output, _map_security_codec); - if (SecurityDisabled != false) { - output.WriteRawTag(16); - output.WriteBool(SecurityDisabled); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - security_.WriteTo(ref output, _map_security_codec); - if (SecurityDisabled != false) { - output.WriteRawTag(16); - output.WriteBool(SecurityDisabled); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - size += security_.CalculateSize(_map_security_codec); - if (SecurityDisabled != false) { - size += 1 + 1; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(ApiWorkerOptions other) { - if (other == null) { - return; - } - security_.Add(other.security_); - if (other.SecurityDisabled != false) { - SecurityDisabled = other.SecurityDisabled; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - security_.AddEntriesFrom(input, _map_security_codec); - break; - } - case 16: { - SecurityDisabled = input.ReadBool(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - security_.AddEntriesFrom(ref input, _map_security_codec); - break; - } - case 16: { - SecurityDisabled = input.ReadBool(); - break; - } - } - } - } - #endif - - } - - public sealed partial class ApiWorker : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ApiWorker()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Faas.v1.FaasReflection.Descriptor.MessageTypes[4]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ApiWorker() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ApiWorker(ApiWorker other) : this() { - api_ = other.api_; - path_ = other.path_; - methods_ = other.methods_.Clone(); - options_ = other.options_ != null ? other.options_.Clone() : null; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ApiWorker Clone() { - return new ApiWorker(this); - } - - /// Field number for the "api" field. - public const int ApiFieldNumber = 1; - private string api_ = ""; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string Api { - get { return api_; } - set { - api_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "path" field. - public const int PathFieldNumber = 2; - private string path_ = ""; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string Path { - get { return path_; } - set { - path_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "methods" field. - public const int MethodsFieldNumber = 3; - private static readonly pb::FieldCodec _repeated_methods_codec - = pb::FieldCodec.ForString(26); - private readonly pbc::RepeatedField methods_ = new pbc::RepeatedField(); - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField Methods { - get { return methods_; } - } - - /// Field number for the "options" field. - public const int OptionsFieldNumber = 4; - private global::Nitric.Proto.Faas.v1.ApiWorkerOptions options_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Faas.v1.ApiWorkerOptions Options { - get { return options_; } - set { - options_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as ApiWorker); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(ApiWorker other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Api != other.Api) return false; - if (Path != other.Path) return false; - if(!methods_.Equals(other.methods_)) return false; - if (!object.Equals(Options, other.Options)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (Api.Length != 0) hash ^= Api.GetHashCode(); - if (Path.Length != 0) hash ^= Path.GetHashCode(); - hash ^= methods_.GetHashCode(); - if (options_ != null) hash ^= Options.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (Api.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Api); - } - if (Path.Length != 0) { - output.WriteRawTag(18); - output.WriteString(Path); - } - methods_.WriteTo(output, _repeated_methods_codec); - if (options_ != null) { - output.WriteRawTag(34); - output.WriteMessage(Options); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (Api.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Api); - } - if (Path.Length != 0) { - output.WriteRawTag(18); - output.WriteString(Path); - } - methods_.WriteTo(ref output, _repeated_methods_codec); - if (options_ != null) { - output.WriteRawTag(34); - output.WriteMessage(Options); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (Api.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Api); - } - if (Path.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Path); - } - size += methods_.CalculateSize(_repeated_methods_codec); - if (options_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Options); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(ApiWorker other) { - if (other == null) { - return; - } - if (other.Api.Length != 0) { - Api = other.Api; - } - if (other.Path.Length != 0) { - Path = other.Path; - } - methods_.Add(other.methods_); - if (other.options_ != null) { - if (options_ == null) { - Options = new global::Nitric.Proto.Faas.v1.ApiWorkerOptions(); - } - Options.MergeFrom(other.Options); - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - Api = input.ReadString(); - break; - } - case 18: { - Path = input.ReadString(); - break; - } - case 26: { - methods_.AddEntriesFrom(input, _repeated_methods_codec); - break; - } - case 34: { - if (options_ == null) { - Options = new global::Nitric.Proto.Faas.v1.ApiWorkerOptions(); - } - input.ReadMessage(Options); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - Api = input.ReadString(); - break; - } - case 18: { - Path = input.ReadString(); - break; - } - case 26: { - methods_.AddEntriesFrom(ref input, _repeated_methods_codec); - break; - } - case 34: { - if (options_ == null) { - Options = new global::Nitric.Proto.Faas.v1.ApiWorkerOptions(); - } - input.ReadMessage(Options); - break; - } - } - } - } - #endif - - } - - public sealed partial class SubscriptionWorker : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SubscriptionWorker()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Faas.v1.FaasReflection.Descriptor.MessageTypes[5]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public SubscriptionWorker() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public SubscriptionWorker(SubscriptionWorker other) : this() { - topic_ = other.topic_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public SubscriptionWorker Clone() { - return new SubscriptionWorker(this); - } - - /// Field number for the "topic" field. - public const int TopicFieldNumber = 1; - private string topic_ = ""; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string Topic { - get { return topic_; } - set { - topic_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as SubscriptionWorker); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(SubscriptionWorker other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Topic != other.Topic) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (Topic.Length != 0) hash ^= Topic.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (Topic.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Topic); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (Topic.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Topic); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (Topic.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Topic); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(SubscriptionWorker other) { - if (other == null) { - return; - } - if (other.Topic.Length != 0) { - Topic = other.Topic; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - Topic = input.ReadString(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - Topic = input.ReadString(); - break; - } - } - } - } - #endif - - } - - public sealed partial class ScheduleWorker : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ScheduleWorker()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Faas.v1.FaasReflection.Descriptor.MessageTypes[6]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ScheduleWorker() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ScheduleWorker(ScheduleWorker other) : this() { - key_ = other.key_; - switch (other.CadenceCase) { - case CadenceOneofCase.Rate: - Rate = other.Rate.Clone(); - break; - case CadenceOneofCase.Cron: - Cron = other.Cron.Clone(); - break; - } - - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ScheduleWorker Clone() { - return new ScheduleWorker(this); - } - - /// Field number for the "key" field. - public const int KeyFieldNumber = 1; - private string key_ = ""; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string Key { - get { return key_; } - set { - key_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "rate" field. - public const int RateFieldNumber = 10; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Faas.v1.ScheduleRate Rate { - get { return cadenceCase_ == CadenceOneofCase.Rate ? (global::Nitric.Proto.Faas.v1.ScheduleRate) cadence_ : null; } - set { - cadence_ = value; - cadenceCase_ = value == null ? CadenceOneofCase.None : CadenceOneofCase.Rate; - } - } - - /// Field number for the "cron" field. - public const int CronFieldNumber = 11; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Faas.v1.ScheduleCron Cron { - get { return cadenceCase_ == CadenceOneofCase.Cron ? (global::Nitric.Proto.Faas.v1.ScheduleCron) cadence_ : null; } - set { - cadence_ = value; - cadenceCase_ = value == null ? CadenceOneofCase.None : CadenceOneofCase.Cron; - } - } - - private object cadence_; - /// Enum of possible cases for the "cadence" oneof. - public enum CadenceOneofCase { - None = 0, - Rate = 10, - Cron = 11, - } - private CadenceOneofCase cadenceCase_ = CadenceOneofCase.None; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public CadenceOneofCase CadenceCase { - get { return cadenceCase_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearCadence() { - cadenceCase_ = CadenceOneofCase.None; - cadence_ = null; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as ScheduleWorker); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(ScheduleWorker other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Key != other.Key) return false; - if (!object.Equals(Rate, other.Rate)) return false; - if (!object.Equals(Cron, other.Cron)) return false; - if (CadenceCase != other.CadenceCase) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (Key.Length != 0) hash ^= Key.GetHashCode(); - if (cadenceCase_ == CadenceOneofCase.Rate) hash ^= Rate.GetHashCode(); - if (cadenceCase_ == CadenceOneofCase.Cron) hash ^= Cron.GetHashCode(); - hash ^= (int) cadenceCase_; - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (Key.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Key); - } - if (cadenceCase_ == CadenceOneofCase.Rate) { - output.WriteRawTag(82); - output.WriteMessage(Rate); - } - if (cadenceCase_ == CadenceOneofCase.Cron) { - output.WriteRawTag(90); - output.WriteMessage(Cron); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (Key.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Key); - } - if (cadenceCase_ == CadenceOneofCase.Rate) { - output.WriteRawTag(82); - output.WriteMessage(Rate); - } - if (cadenceCase_ == CadenceOneofCase.Cron) { - output.WriteRawTag(90); - output.WriteMessage(Cron); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (Key.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Key); - } - if (cadenceCase_ == CadenceOneofCase.Rate) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Rate); - } - if (cadenceCase_ == CadenceOneofCase.Cron) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Cron); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(ScheduleWorker other) { - if (other == null) { - return; - } - if (other.Key.Length != 0) { - Key = other.Key; - } - switch (other.CadenceCase) { - case CadenceOneofCase.Rate: - if (Rate == null) { - Rate = new global::Nitric.Proto.Faas.v1.ScheduleRate(); - } - Rate.MergeFrom(other.Rate); - break; - case CadenceOneofCase.Cron: - if (Cron == null) { - Cron = new global::Nitric.Proto.Faas.v1.ScheduleCron(); - } - Cron.MergeFrom(other.Cron); - break; - } - - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - Key = input.ReadString(); - break; - } - case 82: { - global::Nitric.Proto.Faas.v1.ScheduleRate subBuilder = new global::Nitric.Proto.Faas.v1.ScheduleRate(); - if (cadenceCase_ == CadenceOneofCase.Rate) { - subBuilder.MergeFrom(Rate); - } - input.ReadMessage(subBuilder); - Rate = subBuilder; - break; - } - case 90: { - global::Nitric.Proto.Faas.v1.ScheduleCron subBuilder = new global::Nitric.Proto.Faas.v1.ScheduleCron(); - if (cadenceCase_ == CadenceOneofCase.Cron) { - subBuilder.MergeFrom(Cron); - } - input.ReadMessage(subBuilder); - Cron = subBuilder; - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - Key = input.ReadString(); - break; - } - case 82: { - global::Nitric.Proto.Faas.v1.ScheduleRate subBuilder = new global::Nitric.Proto.Faas.v1.ScheduleRate(); - if (cadenceCase_ == CadenceOneofCase.Rate) { - subBuilder.MergeFrom(Rate); - } - input.ReadMessage(subBuilder); - Rate = subBuilder; - break; - } - case 90: { - global::Nitric.Proto.Faas.v1.ScheduleCron subBuilder = new global::Nitric.Proto.Faas.v1.ScheduleCron(); - if (cadenceCase_ == CadenceOneofCase.Cron) { - subBuilder.MergeFrom(Cron); - } - input.ReadMessage(subBuilder); - Cron = subBuilder; - break; - } - } - } - } - #endif - - } - - public sealed partial class ScheduleRate : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ScheduleRate()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Faas.v1.FaasReflection.Descriptor.MessageTypes[7]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ScheduleRate() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ScheduleRate(ScheduleRate other) : this() { - rate_ = other.rate_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ScheduleRate Clone() { - return new ScheduleRate(this); - } - - /// Field number for the "rate" field. - public const int RateFieldNumber = 1; - private string rate_ = ""; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string Rate { - get { return rate_; } - set { - rate_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as ScheduleRate); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(ScheduleRate other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Rate != other.Rate) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (Rate.Length != 0) hash ^= Rate.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (Rate.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Rate); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (Rate.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Rate); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (Rate.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Rate); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(ScheduleRate other) { - if (other == null) { - return; - } - if (other.Rate.Length != 0) { - Rate = other.Rate; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - Rate = input.ReadString(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - Rate = input.ReadString(); - break; - } - } - } - } - #endif - - } - - public sealed partial class ScheduleCron : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ScheduleCron()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Faas.v1.FaasReflection.Descriptor.MessageTypes[8]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ScheduleCron() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ScheduleCron(ScheduleCron other) : this() { - cron_ = other.cron_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ScheduleCron Clone() { - return new ScheduleCron(this); - } - - /// Field number for the "cron" field. - public const int CronFieldNumber = 1; - private string cron_ = ""; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string Cron { - get { return cron_; } - set { - cron_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as ScheduleCron); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(ScheduleCron other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Cron != other.Cron) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (Cron.Length != 0) hash ^= Cron.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (Cron.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Cron); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (Cron.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Cron); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (Cron.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Cron); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(ScheduleCron other) { - if (other == null) { - return; - } - if (other.Cron.Length != 0) { - Cron = other.Cron; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - Cron = input.ReadString(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - Cron = input.ReadString(); - break; - } - } - } - } - #endif - - } - - public sealed partial class HttpWorker : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new HttpWorker()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Faas.v1.FaasReflection.Descriptor.MessageTypes[9]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public HttpWorker() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public HttpWorker(HttpWorker other) : this() { - port_ = other.port_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public HttpWorker Clone() { - return new HttpWorker(this); - } - - /// Field number for the "port" field. - public const int PortFieldNumber = 1; - private int port_; - /// - /// The local port the server can be accessed on - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int Port { - get { return port_; } - set { - port_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as HttpWorker); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(HttpWorker other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Port != other.Port) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (Port != 0) hash ^= Port.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (Port != 0) { - output.WriteRawTag(8); - output.WriteInt32(Port); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (Port != 0) { - output.WriteRawTag(8); - output.WriteInt32(Port); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (Port != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(Port); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(HttpWorker other) { - if (other == null) { - return; - } - if (other.Port != 0) { - Port = other.Port; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 8: { - Port = input.ReadInt32(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 8: { - Port = input.ReadInt32(); - break; - } - } - } - } - #endif - - } - - public sealed partial class BucketNotificationWorker : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new BucketNotificationWorker()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Faas.v1.FaasReflection.Descriptor.MessageTypes[10]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public BucketNotificationWorker() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public BucketNotificationWorker(BucketNotificationWorker other) : this() { - bucket_ = other.bucket_; - config_ = other.config_ != null ? other.config_.Clone() : null; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public BucketNotificationWorker Clone() { - return new BucketNotificationWorker(this); - } - - /// Field number for the "bucket" field. - public const int BucketFieldNumber = 1; - private string bucket_ = ""; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string Bucket { - get { return bucket_; } - set { - bucket_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "config" field. - public const int ConfigFieldNumber = 2; - private global::Nitric.Proto.Faas.v1.BucketNotificationConfig config_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Faas.v1.BucketNotificationConfig Config { - get { return config_; } - set { - config_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as BucketNotificationWorker); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(BucketNotificationWorker other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Bucket != other.Bucket) return false; - if (!object.Equals(Config, other.Config)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (Bucket.Length != 0) hash ^= Bucket.GetHashCode(); - if (config_ != null) hash ^= Config.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (Bucket.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Bucket); - } - if (config_ != null) { - output.WriteRawTag(18); - output.WriteMessage(Config); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (Bucket.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Bucket); - } - if (config_ != null) { - output.WriteRawTag(18); - output.WriteMessage(Config); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (Bucket.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Bucket); - } - if (config_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Config); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(BucketNotificationWorker other) { - if (other == null) { - return; - } - if (other.Bucket.Length != 0) { - Bucket = other.Bucket; - } - if (other.config_ != null) { - if (config_ == null) { - Config = new global::Nitric.Proto.Faas.v1.BucketNotificationConfig(); - } - Config.MergeFrom(other.Config); - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - Bucket = input.ReadString(); - break; - } - case 18: { - if (config_ == null) { - Config = new global::Nitric.Proto.Faas.v1.BucketNotificationConfig(); - } - input.ReadMessage(Config); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - Bucket = input.ReadString(); - break; - } - case 18: { - if (config_ == null) { - Config = new global::Nitric.Proto.Faas.v1.BucketNotificationConfig(); - } - input.ReadMessage(Config); - break; - } - } - } - } - #endif - - } - - public sealed partial class BucketNotificationConfig : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new BucketNotificationConfig()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Faas.v1.FaasReflection.Descriptor.MessageTypes[11]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public BucketNotificationConfig() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public BucketNotificationConfig(BucketNotificationConfig other) : this() { - notificationType_ = other.notificationType_; - notificationPrefixFilter_ = other.notificationPrefixFilter_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public BucketNotificationConfig Clone() { - return new BucketNotificationConfig(this); - } - - /// Field number for the "notification_type" field. - public const int NotificationTypeFieldNumber = 1; - private global::Nitric.Proto.Faas.v1.BucketNotificationType notificationType_ = global::Nitric.Proto.Faas.v1.BucketNotificationType.All; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Faas.v1.BucketNotificationType NotificationType { - get { return notificationType_; } - set { - notificationType_ = value; - } - } - - /// Field number for the "notification_prefix_filter" field. - public const int NotificationPrefixFilterFieldNumber = 2; - private string notificationPrefixFilter_ = ""; - /// - /// A notification filter is a prefix for a bucket object in which creations or deletions should trigger a notification: - /// e.g. Notification filter: /images/cat and Event Type: created, would trigger on creating /images/cat.png and /images/cat.jpg but not creating /cat.png - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string NotificationPrefixFilter { - get { return notificationPrefixFilter_; } - set { - notificationPrefixFilter_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as BucketNotificationConfig); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(BucketNotificationConfig other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (NotificationType != other.NotificationType) return false; - if (NotificationPrefixFilter != other.NotificationPrefixFilter) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (NotificationType != global::Nitric.Proto.Faas.v1.BucketNotificationType.All) hash ^= NotificationType.GetHashCode(); - if (NotificationPrefixFilter.Length != 0) hash ^= NotificationPrefixFilter.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (NotificationType != global::Nitric.Proto.Faas.v1.BucketNotificationType.All) { - output.WriteRawTag(8); - output.WriteEnum((int) NotificationType); - } - if (NotificationPrefixFilter.Length != 0) { - output.WriteRawTag(18); - output.WriteString(NotificationPrefixFilter); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (NotificationType != global::Nitric.Proto.Faas.v1.BucketNotificationType.All) { - output.WriteRawTag(8); - output.WriteEnum((int) NotificationType); - } - if (NotificationPrefixFilter.Length != 0) { - output.WriteRawTag(18); - output.WriteString(NotificationPrefixFilter); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (NotificationType != global::Nitric.Proto.Faas.v1.BucketNotificationType.All) { - size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) NotificationType); - } - if (NotificationPrefixFilter.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(NotificationPrefixFilter); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(BucketNotificationConfig other) { - if (other == null) { - return; - } - if (other.NotificationType != global::Nitric.Proto.Faas.v1.BucketNotificationType.All) { - NotificationType = other.NotificationType; - } - if (other.NotificationPrefixFilter.Length != 0) { - NotificationPrefixFilter = other.NotificationPrefixFilter; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 8: { - NotificationType = (global::Nitric.Proto.Faas.v1.BucketNotificationType) input.ReadEnum(); - break; - } - case 18: { - NotificationPrefixFilter = input.ReadString(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 8: { - NotificationType = (global::Nitric.Proto.Faas.v1.BucketNotificationType) input.ReadEnum(); - break; - } - case 18: { - NotificationPrefixFilter = input.ReadString(); - break; - } - } - } - } - #endif - - } - - public sealed partial class WebsocketWorker : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new WebsocketWorker()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Faas.v1.FaasReflection.Descriptor.MessageTypes[12]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public WebsocketWorker() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public WebsocketWorker(WebsocketWorker other) : this() { - socket_ = other.socket_; - event_ = other.event_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public WebsocketWorker Clone() { - return new WebsocketWorker(this); - } - - /// Field number for the "socket" field. - public const int SocketFieldNumber = 1; - private string socket_ = ""; - /// - /// The nitric name of the socket that this worker listens on - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string Socket { - get { return socket_; } - set { - socket_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "event" field. - public const int EventFieldNumber = 2; - private global::Nitric.Proto.Faas.v1.WebsocketEvent event_ = global::Nitric.Proto.Faas.v1.WebsocketEvent.Connect; - /// - /// The type of event that this worker handles - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Faas.v1.WebsocketEvent Event { - get { return event_; } - set { - event_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as WebsocketWorker); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(WebsocketWorker other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Socket != other.Socket) return false; - if (Event != other.Event) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (Socket.Length != 0) hash ^= Socket.GetHashCode(); - if (Event != global::Nitric.Proto.Faas.v1.WebsocketEvent.Connect) hash ^= Event.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (Socket.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Socket); - } - if (Event != global::Nitric.Proto.Faas.v1.WebsocketEvent.Connect) { - output.WriteRawTag(16); - output.WriteEnum((int) Event); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (Socket.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Socket); - } - if (Event != global::Nitric.Proto.Faas.v1.WebsocketEvent.Connect) { - output.WriteRawTag(16); - output.WriteEnum((int) Event); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (Socket.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Socket); - } - if (Event != global::Nitric.Proto.Faas.v1.WebsocketEvent.Connect) { - size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Event); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(WebsocketWorker other) { - if (other == null) { - return; - } - if (other.Socket.Length != 0) { - Socket = other.Socket; - } - if (other.Event != global::Nitric.Proto.Faas.v1.WebsocketEvent.Connect) { - Event = other.Event; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - Socket = input.ReadString(); - break; - } - case 16: { - Event = (global::Nitric.Proto.Faas.v1.WebsocketEvent) input.ReadEnum(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - Socket = input.ReadString(); - break; - } - case 16: { - Event = (global::Nitric.Proto.Faas.v1.WebsocketEvent) input.ReadEnum(); - break; - } - } - } - } - #endif - - } - - /// - /// InitRequest - Identifies a worker as ready to recieve triggers - /// This message will contain information on the type of triggers that - /// a worker is capable of handling - /// - public sealed partial class InitRequest : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new InitRequest()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Faas.v1.FaasReflection.Descriptor.MessageTypes[13]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public InitRequest() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public InitRequest(InitRequest other) : this() { - switch (other.WorkerCase) { - case WorkerOneofCase.Api: - Api = other.Api.Clone(); - break; - case WorkerOneofCase.Subscription: - Subscription = other.Subscription.Clone(); - break; - case WorkerOneofCase.Schedule: - Schedule = other.Schedule.Clone(); - break; - case WorkerOneofCase.BucketNotification: - BucketNotification = other.BucketNotification.Clone(); - break; - case WorkerOneofCase.Websocket: - Websocket = other.Websocket.Clone(); - break; - case WorkerOneofCase.HttpWorker: - HttpWorker = other.HttpWorker.Clone(); - break; - } - - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public InitRequest Clone() { - return new InitRequest(this); - } - - /// Field number for the "api" field. - public const int ApiFieldNumber = 10; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Faas.v1.ApiWorker Api { - get { return workerCase_ == WorkerOneofCase.Api ? (global::Nitric.Proto.Faas.v1.ApiWorker) worker_ : null; } - set { - worker_ = value; - workerCase_ = value == null ? WorkerOneofCase.None : WorkerOneofCase.Api; - } - } - - /// Field number for the "subscription" field. - public const int SubscriptionFieldNumber = 11; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Faas.v1.SubscriptionWorker Subscription { - get { return workerCase_ == WorkerOneofCase.Subscription ? (global::Nitric.Proto.Faas.v1.SubscriptionWorker) worker_ : null; } - set { - worker_ = value; - workerCase_ = value == null ? WorkerOneofCase.None : WorkerOneofCase.Subscription; - } - } - - /// Field number for the "schedule" field. - public const int ScheduleFieldNumber = 12; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Faas.v1.ScheduleWorker Schedule { - get { return workerCase_ == WorkerOneofCase.Schedule ? (global::Nitric.Proto.Faas.v1.ScheduleWorker) worker_ : null; } - set { - worker_ = value; - workerCase_ = value == null ? WorkerOneofCase.None : WorkerOneofCase.Schedule; - } - } - - /// Field number for the "bucket_notification" field. - public const int BucketNotificationFieldNumber = 13; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Faas.v1.BucketNotificationWorker BucketNotification { - get { return workerCase_ == WorkerOneofCase.BucketNotification ? (global::Nitric.Proto.Faas.v1.BucketNotificationWorker) worker_ : null; } - set { - worker_ = value; - workerCase_ = value == null ? WorkerOneofCase.None : WorkerOneofCase.BucketNotification; - } - } - - /// Field number for the "websocket" field. - public const int WebsocketFieldNumber = 14; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Faas.v1.WebsocketWorker Websocket { - get { return workerCase_ == WorkerOneofCase.Websocket ? (global::Nitric.Proto.Faas.v1.WebsocketWorker) worker_ : null; } - set { - worker_ = value; - workerCase_ = value == null ? WorkerOneofCase.None : WorkerOneofCase.Websocket; - } - } - - /// Field number for the "http_worker" field. - public const int HttpWorkerFieldNumber = 15; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Faas.v1.HttpWorker HttpWorker { - get { return workerCase_ == WorkerOneofCase.HttpWorker ? (global::Nitric.Proto.Faas.v1.HttpWorker) worker_ : null; } - set { - worker_ = value; - workerCase_ = value == null ? WorkerOneofCase.None : WorkerOneofCase.HttpWorker; - } - } - - private object worker_; - /// Enum of possible cases for the "Worker" oneof. - public enum WorkerOneofCase { - None = 0, - Api = 10, - Subscription = 11, - Schedule = 12, - BucketNotification = 13, - Websocket = 14, - HttpWorker = 15, - } - private WorkerOneofCase workerCase_ = WorkerOneofCase.None; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public WorkerOneofCase WorkerCase { - get { return workerCase_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearWorker() { - workerCase_ = WorkerOneofCase.None; - worker_ = null; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as InitRequest); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(InitRequest other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!object.Equals(Api, other.Api)) return false; - if (!object.Equals(Subscription, other.Subscription)) return false; - if (!object.Equals(Schedule, other.Schedule)) return false; - if (!object.Equals(BucketNotification, other.BucketNotification)) return false; - if (!object.Equals(Websocket, other.Websocket)) return false; - if (!object.Equals(HttpWorker, other.HttpWorker)) return false; - if (WorkerCase != other.WorkerCase) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (workerCase_ == WorkerOneofCase.Api) hash ^= Api.GetHashCode(); - if (workerCase_ == WorkerOneofCase.Subscription) hash ^= Subscription.GetHashCode(); - if (workerCase_ == WorkerOneofCase.Schedule) hash ^= Schedule.GetHashCode(); - if (workerCase_ == WorkerOneofCase.BucketNotification) hash ^= BucketNotification.GetHashCode(); - if (workerCase_ == WorkerOneofCase.Websocket) hash ^= Websocket.GetHashCode(); - if (workerCase_ == WorkerOneofCase.HttpWorker) hash ^= HttpWorker.GetHashCode(); - hash ^= (int) workerCase_; - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (workerCase_ == WorkerOneofCase.Api) { - output.WriteRawTag(82); - output.WriteMessage(Api); - } - if (workerCase_ == WorkerOneofCase.Subscription) { - output.WriteRawTag(90); - output.WriteMessage(Subscription); - } - if (workerCase_ == WorkerOneofCase.Schedule) { - output.WriteRawTag(98); - output.WriteMessage(Schedule); - } - if (workerCase_ == WorkerOneofCase.BucketNotification) { - output.WriteRawTag(106); - output.WriteMessage(BucketNotification); - } - if (workerCase_ == WorkerOneofCase.Websocket) { - output.WriteRawTag(114); - output.WriteMessage(Websocket); - } - if (workerCase_ == WorkerOneofCase.HttpWorker) { - output.WriteRawTag(122); - output.WriteMessage(HttpWorker); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (workerCase_ == WorkerOneofCase.Api) { - output.WriteRawTag(82); - output.WriteMessage(Api); - } - if (workerCase_ == WorkerOneofCase.Subscription) { - output.WriteRawTag(90); - output.WriteMessage(Subscription); - } - if (workerCase_ == WorkerOneofCase.Schedule) { - output.WriteRawTag(98); - output.WriteMessage(Schedule); - } - if (workerCase_ == WorkerOneofCase.BucketNotification) { - output.WriteRawTag(106); - output.WriteMessage(BucketNotification); - } - if (workerCase_ == WorkerOneofCase.Websocket) { - output.WriteRawTag(114); - output.WriteMessage(Websocket); - } - if (workerCase_ == WorkerOneofCase.HttpWorker) { - output.WriteRawTag(122); - output.WriteMessage(HttpWorker); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (workerCase_ == WorkerOneofCase.Api) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Api); - } - if (workerCase_ == WorkerOneofCase.Subscription) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Subscription); - } - if (workerCase_ == WorkerOneofCase.Schedule) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Schedule); - } - if (workerCase_ == WorkerOneofCase.BucketNotification) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(BucketNotification); - } - if (workerCase_ == WorkerOneofCase.Websocket) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Websocket); - } - if (workerCase_ == WorkerOneofCase.HttpWorker) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(HttpWorker); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(InitRequest other) { - if (other == null) { - return; - } - switch (other.WorkerCase) { - case WorkerOneofCase.Api: - if (Api == null) { - Api = new global::Nitric.Proto.Faas.v1.ApiWorker(); - } - Api.MergeFrom(other.Api); - break; - case WorkerOneofCase.Subscription: - if (Subscription == null) { - Subscription = new global::Nitric.Proto.Faas.v1.SubscriptionWorker(); - } - Subscription.MergeFrom(other.Subscription); - break; - case WorkerOneofCase.Schedule: - if (Schedule == null) { - Schedule = new global::Nitric.Proto.Faas.v1.ScheduleWorker(); - } - Schedule.MergeFrom(other.Schedule); - break; - case WorkerOneofCase.BucketNotification: - if (BucketNotification == null) { - BucketNotification = new global::Nitric.Proto.Faas.v1.BucketNotificationWorker(); - } - BucketNotification.MergeFrom(other.BucketNotification); - break; - case WorkerOneofCase.Websocket: - if (Websocket == null) { - Websocket = new global::Nitric.Proto.Faas.v1.WebsocketWorker(); - } - Websocket.MergeFrom(other.Websocket); - break; - case WorkerOneofCase.HttpWorker: - if (HttpWorker == null) { - HttpWorker = new global::Nitric.Proto.Faas.v1.HttpWorker(); - } - HttpWorker.MergeFrom(other.HttpWorker); - break; - } - - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 82: { - global::Nitric.Proto.Faas.v1.ApiWorker subBuilder = new global::Nitric.Proto.Faas.v1.ApiWorker(); - if (workerCase_ == WorkerOneofCase.Api) { - subBuilder.MergeFrom(Api); - } - input.ReadMessage(subBuilder); - Api = subBuilder; - break; - } - case 90: { - global::Nitric.Proto.Faas.v1.SubscriptionWorker subBuilder = new global::Nitric.Proto.Faas.v1.SubscriptionWorker(); - if (workerCase_ == WorkerOneofCase.Subscription) { - subBuilder.MergeFrom(Subscription); - } - input.ReadMessage(subBuilder); - Subscription = subBuilder; - break; - } - case 98: { - global::Nitric.Proto.Faas.v1.ScheduleWorker subBuilder = new global::Nitric.Proto.Faas.v1.ScheduleWorker(); - if (workerCase_ == WorkerOneofCase.Schedule) { - subBuilder.MergeFrom(Schedule); - } - input.ReadMessage(subBuilder); - Schedule = subBuilder; - break; - } - case 106: { - global::Nitric.Proto.Faas.v1.BucketNotificationWorker subBuilder = new global::Nitric.Proto.Faas.v1.BucketNotificationWorker(); - if (workerCase_ == WorkerOneofCase.BucketNotification) { - subBuilder.MergeFrom(BucketNotification); - } - input.ReadMessage(subBuilder); - BucketNotification = subBuilder; - break; - } - case 114: { - global::Nitric.Proto.Faas.v1.WebsocketWorker subBuilder = new global::Nitric.Proto.Faas.v1.WebsocketWorker(); - if (workerCase_ == WorkerOneofCase.Websocket) { - subBuilder.MergeFrom(Websocket); - } - input.ReadMessage(subBuilder); - Websocket = subBuilder; - break; - } - case 122: { - global::Nitric.Proto.Faas.v1.HttpWorker subBuilder = new global::Nitric.Proto.Faas.v1.HttpWorker(); - if (workerCase_ == WorkerOneofCase.HttpWorker) { - subBuilder.MergeFrom(HttpWorker); - } - input.ReadMessage(subBuilder); - HttpWorker = subBuilder; - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 82: { - global::Nitric.Proto.Faas.v1.ApiWorker subBuilder = new global::Nitric.Proto.Faas.v1.ApiWorker(); - if (workerCase_ == WorkerOneofCase.Api) { - subBuilder.MergeFrom(Api); - } - input.ReadMessage(subBuilder); - Api = subBuilder; - break; - } - case 90: { - global::Nitric.Proto.Faas.v1.SubscriptionWorker subBuilder = new global::Nitric.Proto.Faas.v1.SubscriptionWorker(); - if (workerCase_ == WorkerOneofCase.Subscription) { - subBuilder.MergeFrom(Subscription); - } - input.ReadMessage(subBuilder); - Subscription = subBuilder; - break; - } - case 98: { - global::Nitric.Proto.Faas.v1.ScheduleWorker subBuilder = new global::Nitric.Proto.Faas.v1.ScheduleWorker(); - if (workerCase_ == WorkerOneofCase.Schedule) { - subBuilder.MergeFrom(Schedule); - } - input.ReadMessage(subBuilder); - Schedule = subBuilder; - break; - } - case 106: { - global::Nitric.Proto.Faas.v1.BucketNotificationWorker subBuilder = new global::Nitric.Proto.Faas.v1.BucketNotificationWorker(); - if (workerCase_ == WorkerOneofCase.BucketNotification) { - subBuilder.MergeFrom(BucketNotification); - } - input.ReadMessage(subBuilder); - BucketNotification = subBuilder; - break; - } - case 114: { - global::Nitric.Proto.Faas.v1.WebsocketWorker subBuilder = new global::Nitric.Proto.Faas.v1.WebsocketWorker(); - if (workerCase_ == WorkerOneofCase.Websocket) { - subBuilder.MergeFrom(Websocket); - } - input.ReadMessage(subBuilder); - Websocket = subBuilder; - break; - } - case 122: { - global::Nitric.Proto.Faas.v1.HttpWorker subBuilder = new global::Nitric.Proto.Faas.v1.HttpWorker(); - if (workerCase_ == WorkerOneofCase.HttpWorker) { - subBuilder.MergeFrom(HttpWorker); - } - input.ReadMessage(subBuilder); - HttpWorker = subBuilder; - break; - } - } - } - } - #endif - - } - - /// - /// Placeholder message - /// - public sealed partial class InitResponse : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new InitResponse()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Faas.v1.FaasReflection.Descriptor.MessageTypes[14]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public InitResponse() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public InitResponse(InitResponse other) : this() { - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public InitResponse Clone() { - return new InitResponse(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as InitResponse); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(InitResponse other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(InitResponse other) { - if (other == null) { - return; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - } - } - } - #endif - - } - - public sealed partial class TraceContext : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TraceContext()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Faas.v1.FaasReflection.Descriptor.MessageTypes[15]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public TraceContext() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public TraceContext(TraceContext other) : this() { - values_ = other.values_.Clone(); - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public TraceContext Clone() { - return new TraceContext(this); - } - - /// Field number for the "values" field. - public const int ValuesFieldNumber = 1; - private static readonly pbc::MapField.Codec _map_values_codec - = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForString(18, ""), 10); - private readonly pbc::MapField values_ = new pbc::MapField(); - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::MapField Values { - get { return values_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as TraceContext); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(TraceContext other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!Values.Equals(other.Values)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - hash ^= Values.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - values_.WriteTo(output, _map_values_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - values_.WriteTo(ref output, _map_values_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - size += values_.CalculateSize(_map_values_codec); - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(TraceContext other) { - if (other == null) { - return; - } - values_.Add(other.values_); - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - values_.AddEntriesFrom(input, _map_values_codec); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - values_.AddEntriesFrom(ref input, _map_values_codec); - break; - } - } - } - } - #endif - - } - - /// - /// The server has a trigger for the client to handle - /// - public sealed partial class TriggerRequest : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TriggerRequest()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Faas.v1.FaasReflection.Descriptor.MessageTypes[16]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public TriggerRequest() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public TriggerRequest(TriggerRequest other) : this() { - data_ = other.data_; - mimeType_ = other.mimeType_; - traceContext_ = other.traceContext_ != null ? other.traceContext_.Clone() : null; - switch (other.ContextCase) { - case ContextOneofCase.Http: - Http = other.Http.Clone(); - break; - case ContextOneofCase.Topic: - Topic = other.Topic.Clone(); - break; - case ContextOneofCase.Notification: - Notification = other.Notification.Clone(); - break; - case ContextOneofCase.Websocket: - Websocket = other.Websocket.Clone(); - break; - } - - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public TriggerRequest Clone() { - return new TriggerRequest(this); - } - - /// Field number for the "data" field. - public const int DataFieldNumber = 1; - private pb::ByteString data_ = pb::ByteString.Empty; - /// - /// The data in the trigger - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pb::ByteString Data { - get { return data_; } - set { - data_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "mime_type" field. - public const int MimeTypeFieldNumber = 2; - private string mimeType_ = ""; - /// - /// Should we supply a mime type for the data? - /// Or rely on context? - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string MimeType { - get { return mimeType_; } - set { - mimeType_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "trace_context" field. - public const int TraceContextFieldNumber = 10; - private global::Nitric.Proto.Faas.v1.TraceContext traceContext_; - /// - /// TraceInformation from the membrane - /// Allows tying traces from external triggers (e.g. HttpRequests) - /// into each event request/response pair of the Bidirectional stream. - /// which cannot be facilitated by OOTB stream interceptors from OTEL. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Faas.v1.TraceContext TraceContext { - get { return traceContext_; } - set { - traceContext_ = value; - } - } - - /// Field number for the "http" field. - public const int HttpFieldNumber = 3; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Faas.v1.HttpTriggerContext Http { - get { return contextCase_ == ContextOneofCase.Http ? (global::Nitric.Proto.Faas.v1.HttpTriggerContext) context_ : null; } - set { - context_ = value; - contextCase_ = value == null ? ContextOneofCase.None : ContextOneofCase.Http; - } - } - - /// Field number for the "topic" field. - public const int TopicFieldNumber = 4; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Faas.v1.TopicTriggerContext Topic { - get { return contextCase_ == ContextOneofCase.Topic ? (global::Nitric.Proto.Faas.v1.TopicTriggerContext) context_ : null; } - set { - context_ = value; - contextCase_ = value == null ? ContextOneofCase.None : ContextOneofCase.Topic; - } - } - - /// Field number for the "notification" field. - public const int NotificationFieldNumber = 5; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Faas.v1.NotificationTriggerContext Notification { - get { return contextCase_ == ContextOneofCase.Notification ? (global::Nitric.Proto.Faas.v1.NotificationTriggerContext) context_ : null; } - set { - context_ = value; - contextCase_ = value == null ? ContextOneofCase.None : ContextOneofCase.Notification; - } - } - - /// Field number for the "websocket" field. - public const int WebsocketFieldNumber = 6; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Faas.v1.WebsocketTriggerContext Websocket { - get { return contextCase_ == ContextOneofCase.Websocket ? (global::Nitric.Proto.Faas.v1.WebsocketTriggerContext) context_ : null; } - set { - context_ = value; - contextCase_ = value == null ? ContextOneofCase.None : ContextOneofCase.Websocket; - } - } - - private object context_; - /// Enum of possible cases for the "context" oneof. - public enum ContextOneofCase { - None = 0, - Http = 3, - Topic = 4, - Notification = 5, - Websocket = 6, - } - private ContextOneofCase contextCase_ = ContextOneofCase.None; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ContextOneofCase ContextCase { - get { return contextCase_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearContext() { - contextCase_ = ContextOneofCase.None; - context_ = null; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as TriggerRequest); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(TriggerRequest other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Data != other.Data) return false; - if (MimeType != other.MimeType) return false; - if (!object.Equals(TraceContext, other.TraceContext)) return false; - if (!object.Equals(Http, other.Http)) return false; - if (!object.Equals(Topic, other.Topic)) return false; - if (!object.Equals(Notification, other.Notification)) return false; - if (!object.Equals(Websocket, other.Websocket)) return false; - if (ContextCase != other.ContextCase) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (Data.Length != 0) hash ^= Data.GetHashCode(); - if (MimeType.Length != 0) hash ^= MimeType.GetHashCode(); - if (traceContext_ != null) hash ^= TraceContext.GetHashCode(); - if (contextCase_ == ContextOneofCase.Http) hash ^= Http.GetHashCode(); - if (contextCase_ == ContextOneofCase.Topic) hash ^= Topic.GetHashCode(); - if (contextCase_ == ContextOneofCase.Notification) hash ^= Notification.GetHashCode(); - if (contextCase_ == ContextOneofCase.Websocket) hash ^= Websocket.GetHashCode(); - hash ^= (int) contextCase_; - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (Data.Length != 0) { - output.WriteRawTag(10); - output.WriteBytes(Data); - } - if (MimeType.Length != 0) { - output.WriteRawTag(18); - output.WriteString(MimeType); - } - if (contextCase_ == ContextOneofCase.Http) { - output.WriteRawTag(26); - output.WriteMessage(Http); - } - if (contextCase_ == ContextOneofCase.Topic) { - output.WriteRawTag(34); - output.WriteMessage(Topic); - } - if (contextCase_ == ContextOneofCase.Notification) { - output.WriteRawTag(42); - output.WriteMessage(Notification); - } - if (contextCase_ == ContextOneofCase.Websocket) { - output.WriteRawTag(50); - output.WriteMessage(Websocket); - } - if (traceContext_ != null) { - output.WriteRawTag(82); - output.WriteMessage(TraceContext); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (Data.Length != 0) { - output.WriteRawTag(10); - output.WriteBytes(Data); - } - if (MimeType.Length != 0) { - output.WriteRawTag(18); - output.WriteString(MimeType); - } - if (contextCase_ == ContextOneofCase.Http) { - output.WriteRawTag(26); - output.WriteMessage(Http); - } - if (contextCase_ == ContextOneofCase.Topic) { - output.WriteRawTag(34); - output.WriteMessage(Topic); - } - if (contextCase_ == ContextOneofCase.Notification) { - output.WriteRawTag(42); - output.WriteMessage(Notification); - } - if (contextCase_ == ContextOneofCase.Websocket) { - output.WriteRawTag(50); - output.WriteMessage(Websocket); - } - if (traceContext_ != null) { - output.WriteRawTag(82); - output.WriteMessage(TraceContext); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (Data.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeBytesSize(Data); - } - if (MimeType.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(MimeType); - } - if (traceContext_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(TraceContext); - } - if (contextCase_ == ContextOneofCase.Http) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Http); - } - if (contextCase_ == ContextOneofCase.Topic) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Topic); - } - if (contextCase_ == ContextOneofCase.Notification) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Notification); - } - if (contextCase_ == ContextOneofCase.Websocket) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Websocket); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(TriggerRequest other) { - if (other == null) { - return; - } - if (other.Data.Length != 0) { - Data = other.Data; - } - if (other.MimeType.Length != 0) { - MimeType = other.MimeType; - } - if (other.traceContext_ != null) { - if (traceContext_ == null) { - TraceContext = new global::Nitric.Proto.Faas.v1.TraceContext(); - } - TraceContext.MergeFrom(other.TraceContext); - } - switch (other.ContextCase) { - case ContextOneofCase.Http: - if (Http == null) { - Http = new global::Nitric.Proto.Faas.v1.HttpTriggerContext(); - } - Http.MergeFrom(other.Http); - break; - case ContextOneofCase.Topic: - if (Topic == null) { - Topic = new global::Nitric.Proto.Faas.v1.TopicTriggerContext(); - } - Topic.MergeFrom(other.Topic); - break; - case ContextOneofCase.Notification: - if (Notification == null) { - Notification = new global::Nitric.Proto.Faas.v1.NotificationTriggerContext(); - } - Notification.MergeFrom(other.Notification); - break; - case ContextOneofCase.Websocket: - if (Websocket == null) { - Websocket = new global::Nitric.Proto.Faas.v1.WebsocketTriggerContext(); - } - Websocket.MergeFrom(other.Websocket); - break; - } - - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - Data = input.ReadBytes(); - break; - } - case 18: { - MimeType = input.ReadString(); - break; - } - case 26: { - global::Nitric.Proto.Faas.v1.HttpTriggerContext subBuilder = new global::Nitric.Proto.Faas.v1.HttpTriggerContext(); - if (contextCase_ == ContextOneofCase.Http) { - subBuilder.MergeFrom(Http); - } - input.ReadMessage(subBuilder); - Http = subBuilder; - break; - } - case 34: { - global::Nitric.Proto.Faas.v1.TopicTriggerContext subBuilder = new global::Nitric.Proto.Faas.v1.TopicTriggerContext(); - if (contextCase_ == ContextOneofCase.Topic) { - subBuilder.MergeFrom(Topic); - } - input.ReadMessage(subBuilder); - Topic = subBuilder; - break; - } - case 42: { - global::Nitric.Proto.Faas.v1.NotificationTriggerContext subBuilder = new global::Nitric.Proto.Faas.v1.NotificationTriggerContext(); - if (contextCase_ == ContextOneofCase.Notification) { - subBuilder.MergeFrom(Notification); - } - input.ReadMessage(subBuilder); - Notification = subBuilder; - break; - } - case 50: { - global::Nitric.Proto.Faas.v1.WebsocketTriggerContext subBuilder = new global::Nitric.Proto.Faas.v1.WebsocketTriggerContext(); - if (contextCase_ == ContextOneofCase.Websocket) { - subBuilder.MergeFrom(Websocket); - } - input.ReadMessage(subBuilder); - Websocket = subBuilder; - break; - } - case 82: { - if (traceContext_ == null) { - TraceContext = new global::Nitric.Proto.Faas.v1.TraceContext(); - } - input.ReadMessage(TraceContext); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - Data = input.ReadBytes(); - break; - } - case 18: { - MimeType = input.ReadString(); - break; - } - case 26: { - global::Nitric.Proto.Faas.v1.HttpTriggerContext subBuilder = new global::Nitric.Proto.Faas.v1.HttpTriggerContext(); - if (contextCase_ == ContextOneofCase.Http) { - subBuilder.MergeFrom(Http); - } - input.ReadMessage(subBuilder); - Http = subBuilder; - break; - } - case 34: { - global::Nitric.Proto.Faas.v1.TopicTriggerContext subBuilder = new global::Nitric.Proto.Faas.v1.TopicTriggerContext(); - if (contextCase_ == ContextOneofCase.Topic) { - subBuilder.MergeFrom(Topic); - } - input.ReadMessage(subBuilder); - Topic = subBuilder; - break; - } - case 42: { - global::Nitric.Proto.Faas.v1.NotificationTriggerContext subBuilder = new global::Nitric.Proto.Faas.v1.NotificationTriggerContext(); - if (contextCase_ == ContextOneofCase.Notification) { - subBuilder.MergeFrom(Notification); - } - input.ReadMessage(subBuilder); - Notification = subBuilder; - break; - } - case 50: { - global::Nitric.Proto.Faas.v1.WebsocketTriggerContext subBuilder = new global::Nitric.Proto.Faas.v1.WebsocketTriggerContext(); - if (contextCase_ == ContextOneofCase.Websocket) { - subBuilder.MergeFrom(Websocket); - } - input.ReadMessage(subBuilder); - Websocket = subBuilder; - break; - } - case 82: { - if (traceContext_ == null) { - TraceContext = new global::Nitric.Proto.Faas.v1.TraceContext(); - } - input.ReadMessage(TraceContext); - break; - } - } - } - } - #endif - - } - - public sealed partial class HeaderValue : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new HeaderValue()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Faas.v1.FaasReflection.Descriptor.MessageTypes[17]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public HeaderValue() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public HeaderValue(HeaderValue other) : this() { - value_ = other.value_.Clone(); - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public HeaderValue Clone() { - return new HeaderValue(this); - } - - /// Field number for the "value" field. - public const int ValueFieldNumber = 1; - private static readonly pb::FieldCodec _repeated_value_codec - = pb::FieldCodec.ForString(10); - private readonly pbc::RepeatedField value_ = new pbc::RepeatedField(); - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField Value { - get { return value_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as HeaderValue); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(HeaderValue other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if(!value_.Equals(other.value_)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - hash ^= value_.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - value_.WriteTo(output, _repeated_value_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - value_.WriteTo(ref output, _repeated_value_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - size += value_.CalculateSize(_repeated_value_codec); - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(HeaderValue other) { - if (other == null) { - return; - } - value_.Add(other.value_); - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - value_.AddEntriesFrom(input, _repeated_value_codec); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - value_.AddEntriesFrom(ref input, _repeated_value_codec); - break; - } - } - } - } - #endif - - } - - public sealed partial class QueryValue : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new QueryValue()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Faas.v1.FaasReflection.Descriptor.MessageTypes[18]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public QueryValue() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public QueryValue(QueryValue other) : this() { - value_ = other.value_.Clone(); - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public QueryValue Clone() { - return new QueryValue(this); - } - - /// Field number for the "value" field. - public const int ValueFieldNumber = 1; - private static readonly pb::FieldCodec _repeated_value_codec - = pb::FieldCodec.ForString(10); - private readonly pbc::RepeatedField value_ = new pbc::RepeatedField(); - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField Value { - get { return value_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as QueryValue); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(QueryValue other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if(!value_.Equals(other.value_)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - hash ^= value_.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - value_.WriteTo(output, _repeated_value_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - value_.WriteTo(ref output, _repeated_value_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - size += value_.CalculateSize(_repeated_value_codec); - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(QueryValue other) { - if (other == null) { - return; - } - value_.Add(other.value_); - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - value_.AddEntriesFrom(input, _repeated_value_codec); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - value_.AddEntriesFrom(ref input, _repeated_value_codec); - break; - } - } - } - } - #endif - - } - - public sealed partial class HttpTriggerContext : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new HttpTriggerContext()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Faas.v1.FaasReflection.Descriptor.MessageTypes[19]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public HttpTriggerContext() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public HttpTriggerContext(HttpTriggerContext other) : this() { - method_ = other.method_; - path_ = other.path_; - headersOld_ = other.headersOld_.Clone(); - queryParamsOld_ = other.queryParamsOld_.Clone(); - headers_ = other.headers_.Clone(); - queryParams_ = other.queryParams_.Clone(); - pathParams_ = other.pathParams_.Clone(); - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public HttpTriggerContext Clone() { - return new HttpTriggerContext(this); - } - - /// Field number for the "method" field. - public const int MethodFieldNumber = 1; - private string method_ = ""; - /// - /// The request method - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string Method { - get { return method_; } - set { - method_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "path" field. - public const int PathFieldNumber = 2; - private string path_ = ""; - /// - /// The path of the request - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string Path { - get { return path_; } - set { - path_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "headers_old" field. - public const int HeadersOldFieldNumber = 3; - private static readonly pbc::MapField.Codec _map_headersOld_codec - = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForString(18, ""), 26); - private readonly pbc::MapField headersOld_ = new pbc::MapField(); - /// - /// The old request headers (preserving for backwards compatibility) - /// TODO: Remove in 1.0 - /// - [global::System.ObsoleteAttribute] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::MapField HeadersOld { - get { return headersOld_; } - } - - /// Field number for the "query_params_old" field. - public const int QueryParamsOldFieldNumber = 4; - private static readonly pbc::MapField.Codec _map_queryParamsOld_codec - = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForString(18, ""), 34); - private readonly pbc::MapField queryParamsOld_ = new pbc::MapField(); - /// - /// The old query params (preserving for backwards compatibility) - /// TODO: Remove in 1.0 - /// - [global::System.ObsoleteAttribute] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::MapField QueryParamsOld { - get { return queryParamsOld_; } - } - - /// Field number for the "headers" field. - public const int HeadersFieldNumber = 5; - private static readonly pbc::MapField.Codec _map_headers_codec - = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForMessage(18, global::Nitric.Proto.Faas.v1.HeaderValue.Parser), 42); - private readonly pbc::MapField headers_ = new pbc::MapField(); - /// - /// HTTP request headers - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::MapField Headers { - get { return headers_; } - } - - /// Field number for the "query_params" field. - public const int QueryParamsFieldNumber = 6; - private static readonly pbc::MapField.Codec _map_queryParams_codec - = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForMessage(18, global::Nitric.Proto.Faas.v1.QueryValue.Parser), 50); - private readonly pbc::MapField queryParams_ = new pbc::MapField(); - /// - /// HTTP Query params - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::MapField QueryParams { - get { return queryParams_; } - } - - /// Field number for the "path_params" field. - public const int PathParamsFieldNumber = 7; - private static readonly pbc::MapField.Codec _map_pathParams_codec - = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForString(18, ""), 58); - private readonly pbc::MapField pathParams_ = new pbc::MapField(); - /// - /// HTTP Path parameters - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::MapField PathParams { - get { return pathParams_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as HttpTriggerContext); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(HttpTriggerContext other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Method != other.Method) return false; - if (Path != other.Path) return false; - if (!HeadersOld.Equals(other.HeadersOld)) return false; - if (!QueryParamsOld.Equals(other.QueryParamsOld)) return false; - if (!Headers.Equals(other.Headers)) return false; - if (!QueryParams.Equals(other.QueryParams)) return false; - if (!PathParams.Equals(other.PathParams)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (Method.Length != 0) hash ^= Method.GetHashCode(); - if (Path.Length != 0) hash ^= Path.GetHashCode(); - hash ^= HeadersOld.GetHashCode(); - hash ^= QueryParamsOld.GetHashCode(); - hash ^= Headers.GetHashCode(); - hash ^= QueryParams.GetHashCode(); - hash ^= PathParams.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (Method.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Method); - } - if (Path.Length != 0) { - output.WriteRawTag(18); - output.WriteString(Path); - } - headersOld_.WriteTo(output, _map_headersOld_codec); - queryParamsOld_.WriteTo(output, _map_queryParamsOld_codec); - headers_.WriteTo(output, _map_headers_codec); - queryParams_.WriteTo(output, _map_queryParams_codec); - pathParams_.WriteTo(output, _map_pathParams_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (Method.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Method); - } - if (Path.Length != 0) { - output.WriteRawTag(18); - output.WriteString(Path); - } - headersOld_.WriteTo(ref output, _map_headersOld_codec); - queryParamsOld_.WriteTo(ref output, _map_queryParamsOld_codec); - headers_.WriteTo(ref output, _map_headers_codec); - queryParams_.WriteTo(ref output, _map_queryParams_codec); - pathParams_.WriteTo(ref output, _map_pathParams_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (Method.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Method); - } - if (Path.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Path); - } - size += headersOld_.CalculateSize(_map_headersOld_codec); - size += queryParamsOld_.CalculateSize(_map_queryParamsOld_codec); - size += headers_.CalculateSize(_map_headers_codec); - size += queryParams_.CalculateSize(_map_queryParams_codec); - size += pathParams_.CalculateSize(_map_pathParams_codec); - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(HttpTriggerContext other) { - if (other == null) { - return; - } - if (other.Method.Length != 0) { - Method = other.Method; - } - if (other.Path.Length != 0) { - Path = other.Path; - } - headersOld_.Add(other.headersOld_); - queryParamsOld_.Add(other.queryParamsOld_); - headers_.Add(other.headers_); - queryParams_.Add(other.queryParams_); - pathParams_.Add(other.pathParams_); - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - Method = input.ReadString(); - break; - } - case 18: { - Path = input.ReadString(); - break; - } - case 26: { - headersOld_.AddEntriesFrom(input, _map_headersOld_codec); - break; - } - case 34: { - queryParamsOld_.AddEntriesFrom(input, _map_queryParamsOld_codec); - break; - } - case 42: { - headers_.AddEntriesFrom(input, _map_headers_codec); - break; - } - case 50: { - queryParams_.AddEntriesFrom(input, _map_queryParams_codec); - break; - } - case 58: { - pathParams_.AddEntriesFrom(input, _map_pathParams_codec); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - Method = input.ReadString(); - break; - } - case 18: { - Path = input.ReadString(); - break; - } - case 26: { - headersOld_.AddEntriesFrom(ref input, _map_headersOld_codec); - break; - } - case 34: { - queryParamsOld_.AddEntriesFrom(ref input, _map_queryParamsOld_codec); - break; - } - case 42: { - headers_.AddEntriesFrom(ref input, _map_headers_codec); - break; - } - case 50: { - queryParams_.AddEntriesFrom(ref input, _map_queryParams_codec); - break; - } - case 58: { - pathParams_.AddEntriesFrom(ref input, _map_pathParams_codec); - break; - } - } - } - } - #endif - - } - - public sealed partial class TopicTriggerContext : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TopicTriggerContext()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Faas.v1.FaasReflection.Descriptor.MessageTypes[20]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public TopicTriggerContext() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public TopicTriggerContext(TopicTriggerContext other) : this() { - topic_ = other.topic_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public TopicTriggerContext Clone() { - return new TopicTriggerContext(this); - } - - /// Field number for the "topic" field. - public const int TopicFieldNumber = 1; - private string topic_ = ""; - /// - /// The topic the message was published for - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string Topic { - get { return topic_; } - set { - topic_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as TopicTriggerContext); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(TopicTriggerContext other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Topic != other.Topic) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (Topic.Length != 0) hash ^= Topic.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (Topic.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Topic); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (Topic.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Topic); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (Topic.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Topic); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(TopicTriggerContext other) { - if (other == null) { - return; - } - if (other.Topic.Length != 0) { - Topic = other.Topic; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - Topic = input.ReadString(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - Topic = input.ReadString(); - break; - } - } - } - } - #endif - - } - - public sealed partial class BucketNotification : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new BucketNotification()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Faas.v1.FaasReflection.Descriptor.MessageTypes[21]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public BucketNotification() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public BucketNotification(BucketNotification other) : this() { - key_ = other.key_; - type_ = other.type_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public BucketNotification Clone() { - return new BucketNotification(this); - } - - /// Field number for the "key" field. - public const int KeyFieldNumber = 1; - private string key_ = ""; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string Key { - get { return key_; } - set { - key_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "type" field. - public const int TypeFieldNumber = 2; - private global::Nitric.Proto.Faas.v1.BucketNotificationType type_ = global::Nitric.Proto.Faas.v1.BucketNotificationType.All; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Faas.v1.BucketNotificationType Type { - get { return type_; } - set { - type_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as BucketNotification); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(BucketNotification other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Key != other.Key) return false; - if (Type != other.Type) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (Key.Length != 0) hash ^= Key.GetHashCode(); - if (Type != global::Nitric.Proto.Faas.v1.BucketNotificationType.All) hash ^= Type.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (Key.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Key); - } - if (Type != global::Nitric.Proto.Faas.v1.BucketNotificationType.All) { - output.WriteRawTag(16); - output.WriteEnum((int) Type); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (Key.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Key); - } - if (Type != global::Nitric.Proto.Faas.v1.BucketNotificationType.All) { - output.WriteRawTag(16); - output.WriteEnum((int) Type); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (Key.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Key); - } - if (Type != global::Nitric.Proto.Faas.v1.BucketNotificationType.All) { - size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Type); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(BucketNotification other) { - if (other == null) { - return; - } - if (other.Key.Length != 0) { - Key = other.Key; - } - if (other.Type != global::Nitric.Proto.Faas.v1.BucketNotificationType.All) { - Type = other.Type; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - Key = input.ReadString(); - break; - } - case 16: { - Type = (global::Nitric.Proto.Faas.v1.BucketNotificationType) input.ReadEnum(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - Key = input.ReadString(); - break; - } - case 16: { - Type = (global::Nitric.Proto.Faas.v1.BucketNotificationType) input.ReadEnum(); - break; - } - } - } - } - #endif - - } - - public sealed partial class NotificationTriggerContext : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NotificationTriggerContext()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Faas.v1.FaasReflection.Descriptor.MessageTypes[22]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public NotificationTriggerContext() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public NotificationTriggerContext(NotificationTriggerContext other) : this() { - source_ = other.source_; - switch (other.NotificationCase) { - case NotificationOneofCase.Bucket: - Bucket = other.Bucket.Clone(); - break; - } - - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public NotificationTriggerContext Clone() { - return new NotificationTriggerContext(this); - } - - /// Field number for the "source" field. - public const int SourceFieldNumber = 1; - private string source_ = ""; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string Source { - get { return source_; } - set { - source_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "bucket" field. - public const int BucketFieldNumber = 10; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Faas.v1.BucketNotification Bucket { - get { return notificationCase_ == NotificationOneofCase.Bucket ? (global::Nitric.Proto.Faas.v1.BucketNotification) notification_ : null; } - set { - notification_ = value; - notificationCase_ = value == null ? NotificationOneofCase.None : NotificationOneofCase.Bucket; - } - } - - private object notification_; - /// Enum of possible cases for the "notification" oneof. - public enum NotificationOneofCase { - None = 0, - Bucket = 10, - } - private NotificationOneofCase notificationCase_ = NotificationOneofCase.None; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public NotificationOneofCase NotificationCase { - get { return notificationCase_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearNotification() { - notificationCase_ = NotificationOneofCase.None; - notification_ = null; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as NotificationTriggerContext); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(NotificationTriggerContext other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Source != other.Source) return false; - if (!object.Equals(Bucket, other.Bucket)) return false; - if (NotificationCase != other.NotificationCase) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (Source.Length != 0) hash ^= Source.GetHashCode(); - if (notificationCase_ == NotificationOneofCase.Bucket) hash ^= Bucket.GetHashCode(); - hash ^= (int) notificationCase_; - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (Source.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Source); - } - if (notificationCase_ == NotificationOneofCase.Bucket) { - output.WriteRawTag(82); - output.WriteMessage(Bucket); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (Source.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Source); - } - if (notificationCase_ == NotificationOneofCase.Bucket) { - output.WriteRawTag(82); - output.WriteMessage(Bucket); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (Source.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Source); - } - if (notificationCase_ == NotificationOneofCase.Bucket) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Bucket); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(NotificationTriggerContext other) { - if (other == null) { - return; - } - if (other.Source.Length != 0) { - Source = other.Source; - } - switch (other.NotificationCase) { - case NotificationOneofCase.Bucket: - if (Bucket == null) { - Bucket = new global::Nitric.Proto.Faas.v1.BucketNotification(); - } - Bucket.MergeFrom(other.Bucket); - break; - } - - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - Source = input.ReadString(); - break; - } - case 82: { - global::Nitric.Proto.Faas.v1.BucketNotification subBuilder = new global::Nitric.Proto.Faas.v1.BucketNotification(); - if (notificationCase_ == NotificationOneofCase.Bucket) { - subBuilder.MergeFrom(Bucket); - } - input.ReadMessage(subBuilder); - Bucket = subBuilder; - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - Source = input.ReadString(); - break; - } - case 82: { - global::Nitric.Proto.Faas.v1.BucketNotification subBuilder = new global::Nitric.Proto.Faas.v1.BucketNotification(); - if (notificationCase_ == NotificationOneofCase.Bucket) { - subBuilder.MergeFrom(Bucket); - } - input.ReadMessage(subBuilder); - Bucket = subBuilder; - break; - } - } - } - } - #endif - - } - - public sealed partial class WebsocketTriggerContext : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new WebsocketTriggerContext()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Faas.v1.FaasReflection.Descriptor.MessageTypes[23]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public WebsocketTriggerContext() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public WebsocketTriggerContext(WebsocketTriggerContext other) : this() { - socket_ = other.socket_; - event_ = other.event_; - connectionId_ = other.connectionId_; - queryParams_ = other.queryParams_.Clone(); - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public WebsocketTriggerContext Clone() { - return new WebsocketTriggerContext(this); - } - - /// Field number for the "socket" field. - public const int SocketFieldNumber = 1; - private string socket_ = ""; - /// - /// The nitric name of the socket that this worker listens on - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string Socket { - get { return socket_; } - set { - socket_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "event" field. - public const int EventFieldNumber = 2; - private global::Nitric.Proto.Faas.v1.WebsocketEvent event_ = global::Nitric.Proto.Faas.v1.WebsocketEvent.Connect; - /// - /// The type of websocket event - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Faas.v1.WebsocketEvent Event { - get { return event_; } - set { - event_ = value; - } - } - - /// Field number for the "connectionId" field. - public const int ConnectionIdFieldNumber = 3; - private string connectionId_ = ""; - /// - /// The connection this trigger came from - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string ConnectionId { - get { return connectionId_; } - set { - connectionId_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "query_params" field. - public const int QueryParamsFieldNumber = 6; - private static readonly pbc::MapField.Codec _map_queryParams_codec - = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForMessage(18, global::Nitric.Proto.Faas.v1.QueryValue.Parser), 50); - private readonly pbc::MapField queryParams_ = new pbc::MapField(); - /// - /// The query params available in the connection request - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::MapField QueryParams { - get { return queryParams_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as WebsocketTriggerContext); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(WebsocketTriggerContext other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Socket != other.Socket) return false; - if (Event != other.Event) return false; - if (ConnectionId != other.ConnectionId) return false; - if (!QueryParams.Equals(other.QueryParams)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (Socket.Length != 0) hash ^= Socket.GetHashCode(); - if (Event != global::Nitric.Proto.Faas.v1.WebsocketEvent.Connect) hash ^= Event.GetHashCode(); - if (ConnectionId.Length != 0) hash ^= ConnectionId.GetHashCode(); - hash ^= QueryParams.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (Socket.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Socket); - } - if (Event != global::Nitric.Proto.Faas.v1.WebsocketEvent.Connect) { - output.WriteRawTag(16); - output.WriteEnum((int) Event); - } - if (ConnectionId.Length != 0) { - output.WriteRawTag(26); - output.WriteString(ConnectionId); - } - queryParams_.WriteTo(output, _map_queryParams_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (Socket.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Socket); - } - if (Event != global::Nitric.Proto.Faas.v1.WebsocketEvent.Connect) { - output.WriteRawTag(16); - output.WriteEnum((int) Event); - } - if (ConnectionId.Length != 0) { - output.WriteRawTag(26); - output.WriteString(ConnectionId); - } - queryParams_.WriteTo(ref output, _map_queryParams_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (Socket.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Socket); - } - if (Event != global::Nitric.Proto.Faas.v1.WebsocketEvent.Connect) { - size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Event); - } - if (ConnectionId.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(ConnectionId); - } - size += queryParams_.CalculateSize(_map_queryParams_codec); - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(WebsocketTriggerContext other) { - if (other == null) { - return; - } - if (other.Socket.Length != 0) { - Socket = other.Socket; - } - if (other.Event != global::Nitric.Proto.Faas.v1.WebsocketEvent.Connect) { - Event = other.Event; - } - if (other.ConnectionId.Length != 0) { - ConnectionId = other.ConnectionId; - } - queryParams_.Add(other.queryParams_); - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - Socket = input.ReadString(); - break; - } - case 16: { - Event = (global::Nitric.Proto.Faas.v1.WebsocketEvent) input.ReadEnum(); - break; - } - case 26: { - ConnectionId = input.ReadString(); - break; - } - case 50: { - queryParams_.AddEntriesFrom(input, _map_queryParams_codec); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - Socket = input.ReadString(); - break; - } - case 16: { - Event = (global::Nitric.Proto.Faas.v1.WebsocketEvent) input.ReadEnum(); - break; - } - case 26: { - ConnectionId = input.ReadString(); - break; - } - case 50: { - queryParams_.AddEntriesFrom(ref input, _map_queryParams_codec); - break; - } - } - } - } - #endif - - } - - /// - /// The worker has successfully processed a trigger - /// - public sealed partial class TriggerResponse : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TriggerResponse()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Faas.v1.FaasReflection.Descriptor.MessageTypes[24]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public TriggerResponse() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public TriggerResponse(TriggerResponse other) : this() { - data_ = other.data_; - switch (other.ContextCase) { - case ContextOneofCase.Http: - Http = other.Http.Clone(); - break; - case ContextOneofCase.Topic: - Topic = other.Topic.Clone(); - break; - case ContextOneofCase.Notification: - Notification = other.Notification.Clone(); - break; - case ContextOneofCase.Websocket: - Websocket = other.Websocket.Clone(); - break; - } - - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public TriggerResponse Clone() { - return new TriggerResponse(this); - } - - /// Field number for the "data" field. - public const int DataFieldNumber = 1; - private pb::ByteString data_ = pb::ByteString.Empty; - /// - /// The data returned in the response - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pb::ByteString Data { - get { return data_; } - set { - data_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "http" field. - public const int HttpFieldNumber = 10; - /// - /// response to a http request - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Faas.v1.HttpResponseContext Http { - get { return contextCase_ == ContextOneofCase.Http ? (global::Nitric.Proto.Faas.v1.HttpResponseContext) context_ : null; } - set { - context_ = value; - contextCase_ = value == null ? ContextOneofCase.None : ContextOneofCase.Http; - } - } - - /// Field number for the "topic" field. - public const int TopicFieldNumber = 11; - /// - /// response to a topic trigger - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Faas.v1.TopicResponseContext Topic { - get { return contextCase_ == ContextOneofCase.Topic ? (global::Nitric.Proto.Faas.v1.TopicResponseContext) context_ : null; } - set { - context_ = value; - contextCase_ = value == null ? ContextOneofCase.None : ContextOneofCase.Topic; - } - } - - /// Field number for the "notification" field. - public const int NotificationFieldNumber = 12; - /// - /// response to a notification trigger - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Faas.v1.NotificationResponseContext Notification { - get { return contextCase_ == ContextOneofCase.Notification ? (global::Nitric.Proto.Faas.v1.NotificationResponseContext) context_ : null; } - set { - context_ = value; - contextCase_ = value == null ? ContextOneofCase.None : ContextOneofCase.Notification; - } - } - - /// Field number for the "websocket" field. - public const int WebsocketFieldNumber = 13; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Nitric.Proto.Faas.v1.WebsocketResponseContext Websocket { - get { return contextCase_ == ContextOneofCase.Websocket ? (global::Nitric.Proto.Faas.v1.WebsocketResponseContext) context_ : null; } - set { - context_ = value; - contextCase_ = value == null ? ContextOneofCase.None : ContextOneofCase.Websocket; - } - } - - private object context_; - /// Enum of possible cases for the "context" oneof. - public enum ContextOneofCase { - None = 0, - Http = 10, - Topic = 11, - Notification = 12, - Websocket = 13, - } - private ContextOneofCase contextCase_ = ContextOneofCase.None; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ContextOneofCase ContextCase { - get { return contextCase_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearContext() { - contextCase_ = ContextOneofCase.None; - context_ = null; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as TriggerResponse); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(TriggerResponse other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Data != other.Data) return false; - if (!object.Equals(Http, other.Http)) return false; - if (!object.Equals(Topic, other.Topic)) return false; - if (!object.Equals(Notification, other.Notification)) return false; - if (!object.Equals(Websocket, other.Websocket)) return false; - if (ContextCase != other.ContextCase) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (Data.Length != 0) hash ^= Data.GetHashCode(); - if (contextCase_ == ContextOneofCase.Http) hash ^= Http.GetHashCode(); - if (contextCase_ == ContextOneofCase.Topic) hash ^= Topic.GetHashCode(); - if (contextCase_ == ContextOneofCase.Notification) hash ^= Notification.GetHashCode(); - if (contextCase_ == ContextOneofCase.Websocket) hash ^= Websocket.GetHashCode(); - hash ^= (int) contextCase_; - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (Data.Length != 0) { - output.WriteRawTag(10); - output.WriteBytes(Data); - } - if (contextCase_ == ContextOneofCase.Http) { - output.WriteRawTag(82); - output.WriteMessage(Http); - } - if (contextCase_ == ContextOneofCase.Topic) { - output.WriteRawTag(90); - output.WriteMessage(Topic); - } - if (contextCase_ == ContextOneofCase.Notification) { - output.WriteRawTag(98); - output.WriteMessage(Notification); - } - if (contextCase_ == ContextOneofCase.Websocket) { - output.WriteRawTag(106); - output.WriteMessage(Websocket); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (Data.Length != 0) { - output.WriteRawTag(10); - output.WriteBytes(Data); - } - if (contextCase_ == ContextOneofCase.Http) { - output.WriteRawTag(82); - output.WriteMessage(Http); - } - if (contextCase_ == ContextOneofCase.Topic) { - output.WriteRawTag(90); - output.WriteMessage(Topic); - } - if (contextCase_ == ContextOneofCase.Notification) { - output.WriteRawTag(98); - output.WriteMessage(Notification); - } - if (contextCase_ == ContextOneofCase.Websocket) { - output.WriteRawTag(106); - output.WriteMessage(Websocket); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (Data.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeBytesSize(Data); - } - if (contextCase_ == ContextOneofCase.Http) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Http); - } - if (contextCase_ == ContextOneofCase.Topic) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Topic); - } - if (contextCase_ == ContextOneofCase.Notification) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Notification); - } - if (contextCase_ == ContextOneofCase.Websocket) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Websocket); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(TriggerResponse other) { - if (other == null) { - return; - } - if (other.Data.Length != 0) { - Data = other.Data; - } - switch (other.ContextCase) { - case ContextOneofCase.Http: - if (Http == null) { - Http = new global::Nitric.Proto.Faas.v1.HttpResponseContext(); - } - Http.MergeFrom(other.Http); - break; - case ContextOneofCase.Topic: - if (Topic == null) { - Topic = new global::Nitric.Proto.Faas.v1.TopicResponseContext(); - } - Topic.MergeFrom(other.Topic); - break; - case ContextOneofCase.Notification: - if (Notification == null) { - Notification = new global::Nitric.Proto.Faas.v1.NotificationResponseContext(); - } - Notification.MergeFrom(other.Notification); - break; - case ContextOneofCase.Websocket: - if (Websocket == null) { - Websocket = new global::Nitric.Proto.Faas.v1.WebsocketResponseContext(); - } - Websocket.MergeFrom(other.Websocket); - break; - } - - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - Data = input.ReadBytes(); - break; - } - case 82: { - global::Nitric.Proto.Faas.v1.HttpResponseContext subBuilder = new global::Nitric.Proto.Faas.v1.HttpResponseContext(); - if (contextCase_ == ContextOneofCase.Http) { - subBuilder.MergeFrom(Http); - } - input.ReadMessage(subBuilder); - Http = subBuilder; - break; - } - case 90: { - global::Nitric.Proto.Faas.v1.TopicResponseContext subBuilder = new global::Nitric.Proto.Faas.v1.TopicResponseContext(); - if (contextCase_ == ContextOneofCase.Topic) { - subBuilder.MergeFrom(Topic); - } - input.ReadMessage(subBuilder); - Topic = subBuilder; - break; - } - case 98: { - global::Nitric.Proto.Faas.v1.NotificationResponseContext subBuilder = new global::Nitric.Proto.Faas.v1.NotificationResponseContext(); - if (contextCase_ == ContextOneofCase.Notification) { - subBuilder.MergeFrom(Notification); - } - input.ReadMessage(subBuilder); - Notification = subBuilder; - break; - } - case 106: { - global::Nitric.Proto.Faas.v1.WebsocketResponseContext subBuilder = new global::Nitric.Proto.Faas.v1.WebsocketResponseContext(); - if (contextCase_ == ContextOneofCase.Websocket) { - subBuilder.MergeFrom(Websocket); - } - input.ReadMessage(subBuilder); - Websocket = subBuilder; - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - Data = input.ReadBytes(); - break; - } - case 82: { - global::Nitric.Proto.Faas.v1.HttpResponseContext subBuilder = new global::Nitric.Proto.Faas.v1.HttpResponseContext(); - if (contextCase_ == ContextOneofCase.Http) { - subBuilder.MergeFrom(Http); - } - input.ReadMessage(subBuilder); - Http = subBuilder; - break; - } - case 90: { - global::Nitric.Proto.Faas.v1.TopicResponseContext subBuilder = new global::Nitric.Proto.Faas.v1.TopicResponseContext(); - if (contextCase_ == ContextOneofCase.Topic) { - subBuilder.MergeFrom(Topic); - } - input.ReadMessage(subBuilder); - Topic = subBuilder; - break; - } - case 98: { - global::Nitric.Proto.Faas.v1.NotificationResponseContext subBuilder = new global::Nitric.Proto.Faas.v1.NotificationResponseContext(); - if (contextCase_ == ContextOneofCase.Notification) { - subBuilder.MergeFrom(Notification); - } - input.ReadMessage(subBuilder); - Notification = subBuilder; - break; - } - case 106: { - global::Nitric.Proto.Faas.v1.WebsocketResponseContext subBuilder = new global::Nitric.Proto.Faas.v1.WebsocketResponseContext(); - if (contextCase_ == ContextOneofCase.Websocket) { - subBuilder.MergeFrom(Websocket); - } - input.ReadMessage(subBuilder); - Websocket = subBuilder; - break; - } - } - } - } - #endif - - } - - /// - /// Specific HttpResponse message - /// Note this does not have to be handled by the - /// User at all but they will have the option of control - /// If they choose... - /// - public sealed partial class HttpResponseContext : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new HttpResponseContext()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Faas.v1.FaasReflection.Descriptor.MessageTypes[25]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public HttpResponseContext() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public HttpResponseContext(HttpResponseContext other) : this() { - headersOld_ = other.headersOld_.Clone(); - status_ = other.status_; - headers_ = other.headers_.Clone(); - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public HttpResponseContext Clone() { - return new HttpResponseContext(this); - } - - /// Field number for the "headers_old" field. - public const int HeadersOldFieldNumber = 1; - private static readonly pbc::MapField.Codec _map_headersOld_codec - = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForString(18, ""), 10); - private readonly pbc::MapField headersOld_ = new pbc::MapField(); - /// - /// Old HTTP response headers (deprecated) - /// TODO: Remove in 1.0 - /// - [global::System.ObsoleteAttribute] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::MapField HeadersOld { - get { return headersOld_; } - } - - /// Field number for the "status" field. - public const int StatusFieldNumber = 2; - private int status_; - /// - /// The HTTP status of the request - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int Status { - get { return status_; } - set { - status_ = value; - } - } - - /// Field number for the "headers" field. - public const int HeadersFieldNumber = 3; - private static readonly pbc::MapField.Codec _map_headers_codec - = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForMessage(18, global::Nitric.Proto.Faas.v1.HeaderValue.Parser), 26); - private readonly pbc::MapField headers_ = new pbc::MapField(); - /// - /// HTTP response headers - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::MapField Headers { - get { return headers_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as HttpResponseContext); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(HttpResponseContext other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!HeadersOld.Equals(other.HeadersOld)) return false; - if (Status != other.Status) return false; - if (!Headers.Equals(other.Headers)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - hash ^= HeadersOld.GetHashCode(); - if (Status != 0) hash ^= Status.GetHashCode(); - hash ^= Headers.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - headersOld_.WriteTo(output, _map_headersOld_codec); - if (Status != 0) { - output.WriteRawTag(16); - output.WriteInt32(Status); - } - headers_.WriteTo(output, _map_headers_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - headersOld_.WriteTo(ref output, _map_headersOld_codec); - if (Status != 0) { - output.WriteRawTag(16); - output.WriteInt32(Status); - } - headers_.WriteTo(ref output, _map_headers_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - size += headersOld_.CalculateSize(_map_headersOld_codec); - if (Status != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(Status); - } - size += headers_.CalculateSize(_map_headers_codec); - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(HttpResponseContext other) { - if (other == null) { - return; - } - headersOld_.Add(other.headersOld_); - if (other.Status != 0) { - Status = other.Status; - } - headers_.Add(other.headers_); - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - headersOld_.AddEntriesFrom(input, _map_headersOld_codec); - break; - } - case 16: { - Status = input.ReadInt32(); - break; - } - case 26: { - headers_.AddEntriesFrom(input, _map_headers_codec); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - headersOld_.AddEntriesFrom(ref input, _map_headersOld_codec); - break; - } - case 16: { - Status = input.ReadInt32(); - break; - } - case 26: { - headers_.AddEntriesFrom(ref input, _map_headers_codec); - break; - } - } - } - } - #endif - - } - - /// - /// Specific event response message - /// We do not accept responses for events - /// only whether or not they were successfully processed - /// - public sealed partial class TopicResponseContext : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TopicResponseContext()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Faas.v1.FaasReflection.Descriptor.MessageTypes[26]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public TopicResponseContext() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public TopicResponseContext(TopicResponseContext other) : this() { - success_ = other.success_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public TopicResponseContext Clone() { - return new TopicResponseContext(this); - } - - /// Field number for the "success" field. - public const int SuccessFieldNumber = 1; - private bool success_; - /// - /// Success status of the handled event - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Success { - get { return success_; } - set { - success_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as TopicResponseContext); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(TopicResponseContext other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Success != other.Success) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (Success != false) hash ^= Success.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (Success != false) { - output.WriteRawTag(8); - output.WriteBool(Success); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (Success != false) { - output.WriteRawTag(8); - output.WriteBool(Success); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (Success != false) { - size += 1 + 1; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(TopicResponseContext other) { - if (other == null) { - return; - } - if (other.Success != false) { - Success = other.Success; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 8: { - Success = input.ReadBool(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 8: { - Success = input.ReadBool(); - break; - } - } - } - } - #endif - - } - - public sealed partial class NotificationResponseContext : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NotificationResponseContext()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Faas.v1.FaasReflection.Descriptor.MessageTypes[27]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public NotificationResponseContext() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public NotificationResponseContext(NotificationResponseContext other) : this() { - success_ = other.success_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public NotificationResponseContext Clone() { - return new NotificationResponseContext(this); - } - - /// Field number for the "success" field. - public const int SuccessFieldNumber = 1; - private bool success_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Success { - get { return success_; } - set { - success_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as NotificationResponseContext); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(NotificationResponseContext other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Success != other.Success) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (Success != false) hash ^= Success.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (Success != false) { - output.WriteRawTag(8); - output.WriteBool(Success); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (Success != false) { - output.WriteRawTag(8); - output.WriteBool(Success); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (Success != false) { - size += 1 + 1; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(NotificationResponseContext other) { - if (other == null) { - return; - } - if (other.Success != false) { - Success = other.Success; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 8: { - Success = input.ReadBool(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 8: { - Success = input.ReadBool(); - break; - } - } - } - } - #endif - - } - - public sealed partial class WebsocketResponseContext : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new WebsocketResponseContext()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Faas.v1.FaasReflection.Descriptor.MessageTypes[28]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public WebsocketResponseContext() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public WebsocketResponseContext(WebsocketResponseContext other) : this() { - success_ = other.success_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public WebsocketResponseContext Clone() { - return new WebsocketResponseContext(this); - } - - /// Field number for the "success" field. - public const int SuccessFieldNumber = 1; - private bool success_; - /// - /// There aren't really responses here, instead we need to provide a runtime - /// API for responding back and emitting/broadcasting on the websocket from the server - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Success { - get { return success_; } - set { - success_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as WebsocketResponseContext); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(WebsocketResponseContext other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Success != other.Success) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (Success != false) hash ^= Success.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (Success != false) { - output.WriteRawTag(8); - output.WriteBool(Success); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (Success != false) { - output.WriteRawTag(8); - output.WriteBool(Success); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (Success != false) { - size += 1 + 1; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(WebsocketResponseContext other) { - if (other == null) { - return; - } - if (other.Success != false) { - Success = other.Success; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 8: { - Success = input.ReadBool(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 8: { - Success = input.ReadBool(); - break; - } - } - } - } - #endif - - } - - #endregion - -} - -#endregion Designer generated code diff --git a/src/Nitric.Sdk/Proto/proto/queue/v1/QueueGrpc.cs b/src/Nitric.Sdk/Proto/proto/queue/v1/QueueGrpc.cs deleted file mode 100644 index 46f19c9..0000000 --- a/src/Nitric.Sdk/Proto/proto/queue/v1/QueueGrpc.cs +++ /dev/null @@ -1,372 +0,0 @@ -// -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: proto/queue/v1/queue.proto -// -#pragma warning disable 0414, 1591 -#region Designer generated code - -using grpc = global::Grpc.Core; - -namespace Nitric.Proto.Queue.v1 { - /// - /// The Nitric Queue Service contract - /// - public static partial class QueueService - { - static readonly string __ServiceName = "nitric.queue.v1.QueueService"; - - static void __Helper_SerializeMessage(global::Google.Protobuf.IMessage message, grpc::SerializationContext context) - { - #if !GRPC_DISABLE_PROTOBUF_BUFFER_SERIALIZATION - if (message is global::Google.Protobuf.IBufferMessage) - { - context.SetPayloadLength(message.CalculateSize()); - global::Google.Protobuf.MessageExtensions.WriteTo(message, context.GetBufferWriter()); - context.Complete(); - return; - } - #endif - context.Complete(global::Google.Protobuf.MessageExtensions.ToByteArray(message)); - } - - static class __Helper_MessageCache - { - public static readonly bool IsBufferMessage = global::System.Reflection.IntrospectionExtensions.GetTypeInfo(typeof(global::Google.Protobuf.IBufferMessage)).IsAssignableFrom(typeof(T)); - } - - static T __Helper_DeserializeMessage(grpc::DeserializationContext context, global::Google.Protobuf.MessageParser parser) where T : global::Google.Protobuf.IMessage - { - #if !GRPC_DISABLE_PROTOBUF_BUFFER_SERIALIZATION - if (__Helper_MessageCache.IsBufferMessage) - { - return parser.ParseFrom(context.PayloadAsReadOnlySequence()); - } - #endif - return parser.ParseFrom(context.PayloadAsNewBuffer()); - } - - static readonly grpc::Marshaller __Marshaller_nitric_queue_v1_QueueSendRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Queue.v1.QueueSendRequest.Parser)); - static readonly grpc::Marshaller __Marshaller_nitric_queue_v1_QueueSendResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Queue.v1.QueueSendResponse.Parser)); - static readonly grpc::Marshaller __Marshaller_nitric_queue_v1_QueueSendBatchRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Queue.v1.QueueSendBatchRequest.Parser)); - static readonly grpc::Marshaller __Marshaller_nitric_queue_v1_QueueSendBatchResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Queue.v1.QueueSendBatchResponse.Parser)); - static readonly grpc::Marshaller __Marshaller_nitric_queue_v1_QueueReceiveRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Queue.v1.QueueReceiveRequest.Parser)); - static readonly grpc::Marshaller __Marshaller_nitric_queue_v1_QueueReceiveResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Queue.v1.QueueReceiveResponse.Parser)); - static readonly grpc::Marshaller __Marshaller_nitric_queue_v1_QueueCompleteRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Queue.v1.QueueCompleteRequest.Parser)); - static readonly grpc::Marshaller __Marshaller_nitric_queue_v1_QueueCompleteResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Queue.v1.QueueCompleteResponse.Parser)); - - static readonly grpc::Method __Method_Send = new grpc::Method( - grpc::MethodType.Unary, - __ServiceName, - "Send", - __Marshaller_nitric_queue_v1_QueueSendRequest, - __Marshaller_nitric_queue_v1_QueueSendResponse); - - static readonly grpc::Method __Method_SendBatch = new grpc::Method( - grpc::MethodType.Unary, - __ServiceName, - "SendBatch", - __Marshaller_nitric_queue_v1_QueueSendBatchRequest, - __Marshaller_nitric_queue_v1_QueueSendBatchResponse); - - static readonly grpc::Method __Method_Receive = new grpc::Method( - grpc::MethodType.Unary, - __ServiceName, - "Receive", - __Marshaller_nitric_queue_v1_QueueReceiveRequest, - __Marshaller_nitric_queue_v1_QueueReceiveResponse); - - static readonly grpc::Method __Method_Complete = new grpc::Method( - grpc::MethodType.Unary, - __ServiceName, - "Complete", - __Marshaller_nitric_queue_v1_QueueCompleteRequest, - __Marshaller_nitric_queue_v1_QueueCompleteResponse); - - /// Service descriptor - public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor - { - get { return global::Nitric.Proto.Queue.v1.QueueReflection.Descriptor.Services[0]; } - } - - /// Base class for server-side implementations of QueueService - [grpc::BindServiceMethod(typeof(QueueService), "BindService")] - public abstract partial class QueueServiceBase - { - /// - /// Send a single event to a queue - /// - /// The request received from the client. - /// The context of the server-side call handler being invoked. - /// The response to send back to the client (wrapped by a task). - public virtual global::System.Threading.Tasks.Task Send(global::Nitric.Proto.Queue.v1.QueueSendRequest request, grpc::ServerCallContext context) - { - throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); - } - - /// - /// Send multiple events to a queue - /// - /// The request received from the client. - /// The context of the server-side call handler being invoked. - /// The response to send back to the client (wrapped by a task). - public virtual global::System.Threading.Tasks.Task SendBatch(global::Nitric.Proto.Queue.v1.QueueSendBatchRequest request, grpc::ServerCallContext context) - { - throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); - } - - /// - /// Receive event(s) off a queue - /// - /// The request received from the client. - /// The context of the server-side call handler being invoked. - /// The response to send back to the client (wrapped by a task). - public virtual global::System.Threading.Tasks.Task Receive(global::Nitric.Proto.Queue.v1.QueueReceiveRequest request, grpc::ServerCallContext context) - { - throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); - } - - /// - /// Complete an event previously popped from a queue - /// - /// The request received from the client. - /// The context of the server-side call handler being invoked. - /// The response to send back to the client (wrapped by a task). - public virtual global::System.Threading.Tasks.Task Complete(global::Nitric.Proto.Queue.v1.QueueCompleteRequest request, grpc::ServerCallContext context) - { - throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); - } - - } - - /// Client for QueueService - public partial class QueueServiceClient : grpc::ClientBase - { - /// Creates a new client for QueueService - /// The channel to use to make remote calls. - public QueueServiceClient(grpc::ChannelBase channel) : base(channel) - { - } - /// Creates a new client for QueueService that uses a custom CallInvoker. - /// The callInvoker to use to make remote calls. - public QueueServiceClient(grpc::CallInvoker callInvoker) : base(callInvoker) - { - } - /// Protected parameterless constructor to allow creation of test doubles. - protected QueueServiceClient() : base() - { - } - /// Protected constructor to allow creation of configured clients. - /// The client configuration. - protected QueueServiceClient(ClientBaseConfiguration configuration) : base(configuration) - { - } - - /// - /// Send a single event to a queue - /// - /// The request to send to the server. - /// The initial metadata to send with the call. This parameter is optional. - /// An optional deadline for the call. The call will be cancelled if deadline is hit. - /// An optional token for canceling the call. - /// The response received from the server. - public virtual global::Nitric.Proto.Queue.v1.QueueSendResponse Send(global::Nitric.Proto.Queue.v1.QueueSendRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) - { - return Send(request, new grpc::CallOptions(headers, deadline, cancellationToken)); - } - /// - /// Send a single event to a queue - /// - /// The request to send to the server. - /// The options for the call. - /// The response received from the server. - public virtual global::Nitric.Proto.Queue.v1.QueueSendResponse Send(global::Nitric.Proto.Queue.v1.QueueSendRequest request, grpc::CallOptions options) - { - return CallInvoker.BlockingUnaryCall(__Method_Send, null, options, request); - } - /// - /// Send a single event to a queue - /// - /// The request to send to the server. - /// The initial metadata to send with the call. This parameter is optional. - /// An optional deadline for the call. The call will be cancelled if deadline is hit. - /// An optional token for canceling the call. - /// The call object. - public virtual grpc::AsyncUnaryCall SendAsync(global::Nitric.Proto.Queue.v1.QueueSendRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) - { - return SendAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); - } - /// - /// Send a single event to a queue - /// - /// The request to send to the server. - /// The options for the call. - /// The call object. - public virtual grpc::AsyncUnaryCall SendAsync(global::Nitric.Proto.Queue.v1.QueueSendRequest request, grpc::CallOptions options) - { - return CallInvoker.AsyncUnaryCall(__Method_Send, null, options, request); - } - /// - /// Send multiple events to a queue - /// - /// The request to send to the server. - /// The initial metadata to send with the call. This parameter is optional. - /// An optional deadline for the call. The call will be cancelled if deadline is hit. - /// An optional token for canceling the call. - /// The response received from the server. - public virtual global::Nitric.Proto.Queue.v1.QueueSendBatchResponse SendBatch(global::Nitric.Proto.Queue.v1.QueueSendBatchRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) - { - return SendBatch(request, new grpc::CallOptions(headers, deadline, cancellationToken)); - } - /// - /// Send multiple events to a queue - /// - /// The request to send to the server. - /// The options for the call. - /// The response received from the server. - public virtual global::Nitric.Proto.Queue.v1.QueueSendBatchResponse SendBatch(global::Nitric.Proto.Queue.v1.QueueSendBatchRequest request, grpc::CallOptions options) - { - return CallInvoker.BlockingUnaryCall(__Method_SendBatch, null, options, request); - } - /// - /// Send multiple events to a queue - /// - /// The request to send to the server. - /// The initial metadata to send with the call. This parameter is optional. - /// An optional deadline for the call. The call will be cancelled if deadline is hit. - /// An optional token for canceling the call. - /// The call object. - public virtual grpc::AsyncUnaryCall SendBatchAsync(global::Nitric.Proto.Queue.v1.QueueSendBatchRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) - { - return SendBatchAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); - } - /// - /// Send multiple events to a queue - /// - /// The request to send to the server. - /// The options for the call. - /// The call object. - public virtual grpc::AsyncUnaryCall SendBatchAsync(global::Nitric.Proto.Queue.v1.QueueSendBatchRequest request, grpc::CallOptions options) - { - return CallInvoker.AsyncUnaryCall(__Method_SendBatch, null, options, request); - } - /// - /// Receive event(s) off a queue - /// - /// The request to send to the server. - /// The initial metadata to send with the call. This parameter is optional. - /// An optional deadline for the call. The call will be cancelled if deadline is hit. - /// An optional token for canceling the call. - /// The response received from the server. - public virtual global::Nitric.Proto.Queue.v1.QueueReceiveResponse Receive(global::Nitric.Proto.Queue.v1.QueueReceiveRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) - { - return Receive(request, new grpc::CallOptions(headers, deadline, cancellationToken)); - } - /// - /// Receive event(s) off a queue - /// - /// The request to send to the server. - /// The options for the call. - /// The response received from the server. - public virtual global::Nitric.Proto.Queue.v1.QueueReceiveResponse Receive(global::Nitric.Proto.Queue.v1.QueueReceiveRequest request, grpc::CallOptions options) - { - return CallInvoker.BlockingUnaryCall(__Method_Receive, null, options, request); - } - /// - /// Receive event(s) off a queue - /// - /// The request to send to the server. - /// The initial metadata to send with the call. This parameter is optional. - /// An optional deadline for the call. The call will be cancelled if deadline is hit. - /// An optional token for canceling the call. - /// The call object. - public virtual grpc::AsyncUnaryCall ReceiveAsync(global::Nitric.Proto.Queue.v1.QueueReceiveRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) - { - return ReceiveAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); - } - /// - /// Receive event(s) off a queue - /// - /// The request to send to the server. - /// The options for the call. - /// The call object. - public virtual grpc::AsyncUnaryCall ReceiveAsync(global::Nitric.Proto.Queue.v1.QueueReceiveRequest request, grpc::CallOptions options) - { - return CallInvoker.AsyncUnaryCall(__Method_Receive, null, options, request); - } - /// - /// Complete an event previously popped from a queue - /// - /// The request to send to the server. - /// The initial metadata to send with the call. This parameter is optional. - /// An optional deadline for the call. The call will be cancelled if deadline is hit. - /// An optional token for canceling the call. - /// The response received from the server. - public virtual global::Nitric.Proto.Queue.v1.QueueCompleteResponse Complete(global::Nitric.Proto.Queue.v1.QueueCompleteRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) - { - return Complete(request, new grpc::CallOptions(headers, deadline, cancellationToken)); - } - /// - /// Complete an event previously popped from a queue - /// - /// The request to send to the server. - /// The options for the call. - /// The response received from the server. - public virtual global::Nitric.Proto.Queue.v1.QueueCompleteResponse Complete(global::Nitric.Proto.Queue.v1.QueueCompleteRequest request, grpc::CallOptions options) - { - return CallInvoker.BlockingUnaryCall(__Method_Complete, null, options, request); - } - /// - /// Complete an event previously popped from a queue - /// - /// The request to send to the server. - /// The initial metadata to send with the call. This parameter is optional. - /// An optional deadline for the call. The call will be cancelled if deadline is hit. - /// An optional token for canceling the call. - /// The call object. - public virtual grpc::AsyncUnaryCall CompleteAsync(global::Nitric.Proto.Queue.v1.QueueCompleteRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) - { - return CompleteAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); - } - /// - /// Complete an event previously popped from a queue - /// - /// The request to send to the server. - /// The options for the call. - /// The call object. - public virtual grpc::AsyncUnaryCall CompleteAsync(global::Nitric.Proto.Queue.v1.QueueCompleteRequest request, grpc::CallOptions options) - { - return CallInvoker.AsyncUnaryCall(__Method_Complete, null, options, request); - } - /// Creates a new instance of client from given ClientBaseConfiguration. - protected override QueueServiceClient NewInstance(ClientBaseConfiguration configuration) - { - return new QueueServiceClient(configuration); - } - } - - /// Creates service definition that can be registered with a server - /// An object implementing the server-side handling logic. - public static grpc::ServerServiceDefinition BindService(QueueServiceBase serviceImpl) - { - return grpc::ServerServiceDefinition.CreateBuilder() - .AddMethod(__Method_Send, serviceImpl.Send) - .AddMethod(__Method_SendBatch, serviceImpl.SendBatch) - .AddMethod(__Method_Receive, serviceImpl.Receive) - .AddMethod(__Method_Complete, serviceImpl.Complete).Build(); - } - - /// Register service method with a service binder with or without implementation. Useful when customizing the service binding logic. - /// Note: this method is part of an experimental API that can change or be removed without any prior notice. - /// Service methods will be bound by calling AddMethod on this object. - /// An object implementing the server-side handling logic. - public static void BindService(grpc::ServiceBinderBase serviceBinder, QueueServiceBase serviceImpl) - { - serviceBinder.AddMethod(__Method_Send, serviceImpl == null ? null : new grpc::UnaryServerMethod(serviceImpl.Send)); - serviceBinder.AddMethod(__Method_SendBatch, serviceImpl == null ? null : new grpc::UnaryServerMethod(serviceImpl.SendBatch)); - serviceBinder.AddMethod(__Method_Receive, serviceImpl == null ? null : new grpc::UnaryServerMethod(serviceImpl.Receive)); - serviceBinder.AddMethod(__Method_Complete, serviceImpl == null ? null : new grpc::UnaryServerMethod(serviceImpl.Complete)); - } - - } -} -#endregion diff --git a/src/Nitric.Sdk/Proto/proto/resource/v1/ResourceGrpc.cs b/src/Nitric.Sdk/Proto/proto/resource/v1/ResourceGrpc.cs deleted file mode 100644 index 59f0099..0000000 --- a/src/Nitric.Sdk/Proto/proto/resource/v1/ResourceGrpc.cs +++ /dev/null @@ -1,251 +0,0 @@ -// -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: proto/resource/v1/resource.proto -// -#pragma warning disable 0414, 1591 -#region Designer generated code - -using grpc = global::Grpc.Core; - -namespace Nitric.Proto.Resource.v1 { - /// - /// Nitric Resource Service - /// The service definition exists to allow a nitric application to declare peripheral dependencies - /// - public static partial class ResourceService - { - static readonly string __ServiceName = "nitric.resource.v1.ResourceService"; - - static void __Helper_SerializeMessage(global::Google.Protobuf.IMessage message, grpc::SerializationContext context) - { - #if !GRPC_DISABLE_PROTOBUF_BUFFER_SERIALIZATION - if (message is global::Google.Protobuf.IBufferMessage) - { - context.SetPayloadLength(message.CalculateSize()); - global::Google.Protobuf.MessageExtensions.WriteTo(message, context.GetBufferWriter()); - context.Complete(); - return; - } - #endif - context.Complete(global::Google.Protobuf.MessageExtensions.ToByteArray(message)); - } - - static class __Helper_MessageCache - { - public static readonly bool IsBufferMessage = global::System.Reflection.IntrospectionExtensions.GetTypeInfo(typeof(global::Google.Protobuf.IBufferMessage)).IsAssignableFrom(typeof(T)); - } - - static T __Helper_DeserializeMessage(grpc::DeserializationContext context, global::Google.Protobuf.MessageParser parser) where T : global::Google.Protobuf.IMessage - { - #if !GRPC_DISABLE_PROTOBUF_BUFFER_SERIALIZATION - if (__Helper_MessageCache.IsBufferMessage) - { - return parser.ParseFrom(context.PayloadAsReadOnlySequence()); - } - #endif - return parser.ParseFrom(context.PayloadAsNewBuffer()); - } - - static readonly grpc::Marshaller __Marshaller_nitric_resource_v1_ResourceDeclareRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Resource.v1.ResourceDeclareRequest.Parser)); - static readonly grpc::Marshaller __Marshaller_nitric_resource_v1_ResourceDeclareResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Resource.v1.ResourceDeclareResponse.Parser)); - static readonly grpc::Marshaller __Marshaller_nitric_resource_v1_ResourceDetailsRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Resource.v1.ResourceDetailsRequest.Parser)); - static readonly grpc::Marshaller __Marshaller_nitric_resource_v1_ResourceDetailsResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Resource.v1.ResourceDetailsResponse.Parser)); - - static readonly grpc::Method __Method_Declare = new grpc::Method( - grpc::MethodType.Unary, - __ServiceName, - "Declare", - __Marshaller_nitric_resource_v1_ResourceDeclareRequest, - __Marshaller_nitric_resource_v1_ResourceDeclareResponse); - - static readonly grpc::Method __Method_Details = new grpc::Method( - grpc::MethodType.Unary, - __ServiceName, - "Details", - __Marshaller_nitric_resource_v1_ResourceDetailsRequest, - __Marshaller_nitric_resource_v1_ResourceDetailsResponse); - - /// Service descriptor - public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor - { - get { return global::Nitric.Proto.Resource.v1.ResourceReflection.Descriptor.Services[0]; } - } - - /// Base class for server-side implementations of ResourceService - [grpc::BindServiceMethod(typeof(ResourceService), "BindService")] - public abstract partial class ResourceServiceBase - { - /// - /// Declare a resource for the nitric application - /// At Deploy time this will create resources as part of the nitric stacks dependency graph - /// At runtime - /// - /// The request received from the client. - /// The context of the server-side call handler being invoked. - /// The response to send back to the client (wrapped by a task). - public virtual global::System.Threading.Tasks.Task Declare(global::Nitric.Proto.Resource.v1.ResourceDeclareRequest request, grpc::ServerCallContext context) - { - throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); - } - - /// - /// Retrieve details about a resource at runtime - /// - /// The request received from the client. - /// The context of the server-side call handler being invoked. - /// The response to send back to the client (wrapped by a task). - public virtual global::System.Threading.Tasks.Task Details(global::Nitric.Proto.Resource.v1.ResourceDetailsRequest request, grpc::ServerCallContext context) - { - throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); - } - - } - - /// Client for ResourceService - public partial class ResourceServiceClient : grpc::ClientBase - { - /// Creates a new client for ResourceService - /// The channel to use to make remote calls. - public ResourceServiceClient(grpc::ChannelBase channel) : base(channel) - { - } - /// Creates a new client for ResourceService that uses a custom CallInvoker. - /// The callInvoker to use to make remote calls. - public ResourceServiceClient(grpc::CallInvoker callInvoker) : base(callInvoker) - { - } - /// Protected parameterless constructor to allow creation of test doubles. - protected ResourceServiceClient() : base() - { - } - /// Protected constructor to allow creation of configured clients. - /// The client configuration. - protected ResourceServiceClient(ClientBaseConfiguration configuration) : base(configuration) - { - } - - /// - /// Declare a resource for the nitric application - /// At Deploy time this will create resources as part of the nitric stacks dependency graph - /// At runtime - /// - /// The request to send to the server. - /// The initial metadata to send with the call. This parameter is optional. - /// An optional deadline for the call. The call will be cancelled if deadline is hit. - /// An optional token for canceling the call. - /// The response received from the server. - public virtual global::Nitric.Proto.Resource.v1.ResourceDeclareResponse Declare(global::Nitric.Proto.Resource.v1.ResourceDeclareRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) - { - return Declare(request, new grpc::CallOptions(headers, deadline, cancellationToken)); - } - /// - /// Declare a resource for the nitric application - /// At Deploy time this will create resources as part of the nitric stacks dependency graph - /// At runtime - /// - /// The request to send to the server. - /// The options for the call. - /// The response received from the server. - public virtual global::Nitric.Proto.Resource.v1.ResourceDeclareResponse Declare(global::Nitric.Proto.Resource.v1.ResourceDeclareRequest request, grpc::CallOptions options) - { - return CallInvoker.BlockingUnaryCall(__Method_Declare, null, options, request); - } - /// - /// Declare a resource for the nitric application - /// At Deploy time this will create resources as part of the nitric stacks dependency graph - /// At runtime - /// - /// The request to send to the server. - /// The initial metadata to send with the call. This parameter is optional. - /// An optional deadline for the call. The call will be cancelled if deadline is hit. - /// An optional token for canceling the call. - /// The call object. - public virtual grpc::AsyncUnaryCall DeclareAsync(global::Nitric.Proto.Resource.v1.ResourceDeclareRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) - { - return DeclareAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); - } - /// - /// Declare a resource for the nitric application - /// At Deploy time this will create resources as part of the nitric stacks dependency graph - /// At runtime - /// - /// The request to send to the server. - /// The options for the call. - /// The call object. - public virtual grpc::AsyncUnaryCall DeclareAsync(global::Nitric.Proto.Resource.v1.ResourceDeclareRequest request, grpc::CallOptions options) - { - return CallInvoker.AsyncUnaryCall(__Method_Declare, null, options, request); - } - /// - /// Retrieve details about a resource at runtime - /// - /// The request to send to the server. - /// The initial metadata to send with the call. This parameter is optional. - /// An optional deadline for the call. The call will be cancelled if deadline is hit. - /// An optional token for canceling the call. - /// The response received from the server. - public virtual global::Nitric.Proto.Resource.v1.ResourceDetailsResponse Details(global::Nitric.Proto.Resource.v1.ResourceDetailsRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) - { - return Details(request, new grpc::CallOptions(headers, deadline, cancellationToken)); - } - /// - /// Retrieve details about a resource at runtime - /// - /// The request to send to the server. - /// The options for the call. - /// The response received from the server. - public virtual global::Nitric.Proto.Resource.v1.ResourceDetailsResponse Details(global::Nitric.Proto.Resource.v1.ResourceDetailsRequest request, grpc::CallOptions options) - { - return CallInvoker.BlockingUnaryCall(__Method_Details, null, options, request); - } - /// - /// Retrieve details about a resource at runtime - /// - /// The request to send to the server. - /// The initial metadata to send with the call. This parameter is optional. - /// An optional deadline for the call. The call will be cancelled if deadline is hit. - /// An optional token for canceling the call. - /// The call object. - public virtual grpc::AsyncUnaryCall DetailsAsync(global::Nitric.Proto.Resource.v1.ResourceDetailsRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) - { - return DetailsAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); - } - /// - /// Retrieve details about a resource at runtime - /// - /// The request to send to the server. - /// The options for the call. - /// The call object. - public virtual grpc::AsyncUnaryCall DetailsAsync(global::Nitric.Proto.Resource.v1.ResourceDetailsRequest request, grpc::CallOptions options) - { - return CallInvoker.AsyncUnaryCall(__Method_Details, null, options, request); - } - /// Creates a new instance of client from given ClientBaseConfiguration. - protected override ResourceServiceClient NewInstance(ClientBaseConfiguration configuration) - { - return new ResourceServiceClient(configuration); - } - } - - /// Creates service definition that can be registered with a server - /// An object implementing the server-side handling logic. - public static grpc::ServerServiceDefinition BindService(ResourceServiceBase serviceImpl) - { - return grpc::ServerServiceDefinition.CreateBuilder() - .AddMethod(__Method_Declare, serviceImpl.Declare) - .AddMethod(__Method_Details, serviceImpl.Details).Build(); - } - - /// Register service method with a service binder with or without implementation. Useful when customizing the service binding logic. - /// Note: this method is part of an experimental API that can change or be removed without any prior notice. - /// Service methods will be bound by calling AddMethod on this object. - /// An object implementing the server-side handling logic. - public static void BindService(grpc::ServiceBinderBase serviceBinder, ResourceServiceBase serviceImpl) - { - serviceBinder.AddMethod(__Method_Declare, serviceImpl == null ? null : new grpc::UnaryServerMethod(serviceImpl.Declare)); - serviceBinder.AddMethod(__Method_Details, serviceImpl == null ? null : new grpc::UnaryServerMethod(serviceImpl.Details)); - } - - } -} -#endregion diff --git a/src/Nitric.Sdk/Proto/proto/websocket/v1/Websocket.cs b/src/Nitric.Sdk/Proto/proto/websocket/v1/Websocket.cs deleted file mode 100644 index 21796b0..0000000 --- a/src/Nitric.Sdk/Proto/proto/websocket/v1/Websocket.cs +++ /dev/null @@ -1,799 +0,0 @@ -// -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: proto/websocket/v1/websocket.proto -// -#pragma warning disable 1591, 0612, 3021 -#region Designer generated code - -using pb = global::Google.Protobuf; -using pbc = global::Google.Protobuf.Collections; -using pbr = global::Google.Protobuf.Reflection; -using scg = global::System.Collections.Generic; -namespace Nitric.Proto.Websocket.v1 { - - /// Holder for reflection information generated from proto/websocket/v1/websocket.proto - public static partial class WebsocketReflection { - - #region Descriptor - /// File descriptor for proto/websocket/v1/websocket.proto - public static pbr::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbr::FileDescriptor descriptor; - - static WebsocketReflection() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "CiJwcm90by93ZWJzb2NrZXQvdjEvd2Vic29ja2V0LnByb3RvEhNuaXRyaWMu", - "d2Vic29ja2V0LnYxGhd2YWxpZGF0ZS92YWxpZGF0ZS5wcm90byJdChRXZWJz", - "b2NrZXRTZW5kUmVxdWVzdBIXCgZzb2NrZXQYASABKAlCB/pCBHICEAESHgoN", - "Y29ubmVjdGlvbl9pZBgCIAEoCUIH+kIEcgIQARIMCgRkYXRhGAMgASgMIhcK", - "FVdlYnNvY2tldFNlbmRSZXNwb25zZSJQChVXZWJzb2NrZXRDbG9zZVJlcXVl", - "c3QSFwoGc29ja2V0GAEgASgJQgf6QgRyAhABEh4KDWNvbm5lY3Rpb25faWQY", - "AiABKAlCB/pCBHICEAEiGAoWV2Vic29ja2V0Q2xvc2VSZXNwb25zZTLTAQoQ", - "V2Vic29ja2V0U2VydmljZRJdCgRTZW5kEikubml0cmljLndlYnNvY2tldC52", - "MS5XZWJzb2NrZXRTZW5kUmVxdWVzdBoqLm5pdHJpYy53ZWJzb2NrZXQudjEu", - "V2Vic29ja2V0U2VuZFJlc3BvbnNlEmAKBUNsb3NlEioubml0cmljLndlYnNv", - "Y2tldC52MS5XZWJzb2NrZXRDbG9zZVJlcXVlc3QaKy5uaXRyaWMud2Vic29j", - "a2V0LnYxLldlYnNvY2tldENsb3NlUmVzcG9uc2VCowEKHGlvLm5pdHJpYy5w", - "cm90by53ZWJzb2NrZXQudjFCCldlYnNvY2tldHNQAVo9Z2l0aHViLmNvbS9u", - "aXRyaWN0ZWNoL25pdHJpYy9jb3JlL3BrZy9hcGkvbml0cmljL3dlYnNvY2tl", - "dC92MaoCGU5pdHJpYy5Qcm90by5XZWJzb2NrZXQudjHKAhlOaXRyaWNcUHJv", - "dG9cV2Vic29ja2V0XFYxYgZwcm90bzM=")); - descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, - new pbr::FileDescriptor[] { global::Validate.ValidateReflection.Descriptor, }, - new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Websocket.v1.WebsocketSendRequest), global::Nitric.Proto.Websocket.v1.WebsocketSendRequest.Parser, new[]{ "Socket", "ConnectionId", "Data" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Websocket.v1.WebsocketSendResponse), global::Nitric.Proto.Websocket.v1.WebsocketSendResponse.Parser, null, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Websocket.v1.WebsocketCloseRequest), global::Nitric.Proto.Websocket.v1.WebsocketCloseRequest.Parser, new[]{ "Socket", "ConnectionId" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Nitric.Proto.Websocket.v1.WebsocketCloseResponse), global::Nitric.Proto.Websocket.v1.WebsocketCloseResponse.Parser, null, null, null, null, null) - })); - } - #endregion - - } - #region Messages - public sealed partial class WebsocketSendRequest : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new WebsocketSendRequest()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Websocket.v1.WebsocketReflection.Descriptor.MessageTypes[0]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public WebsocketSendRequest() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public WebsocketSendRequest(WebsocketSendRequest other) : this() { - socket_ = other.socket_; - connectionId_ = other.connectionId_; - data_ = other.data_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public WebsocketSendRequest Clone() { - return new WebsocketSendRequest(this); - } - - /// Field number for the "socket" field. - public const int SocketFieldNumber = 1; - private string socket_ = ""; - /// - /// The nitric name of the socket to send on - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string Socket { - get { return socket_; } - set { - socket_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "connection_id" field. - public const int ConnectionIdFieldNumber = 2; - private string connectionId_ = ""; - /// - /// The connection ID of the client to send to - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string ConnectionId { - get { return connectionId_; } - set { - connectionId_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "data" field. - public const int DataFieldNumber = 3; - private pb::ByteString data_ = pb::ByteString.Empty; - /// - /// The data to send to the socket - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pb::ByteString Data { - get { return data_; } - set { - data_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as WebsocketSendRequest); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(WebsocketSendRequest other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Socket != other.Socket) return false; - if (ConnectionId != other.ConnectionId) return false; - if (Data != other.Data) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (Socket.Length != 0) hash ^= Socket.GetHashCode(); - if (ConnectionId.Length != 0) hash ^= ConnectionId.GetHashCode(); - if (Data.Length != 0) hash ^= Data.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (Socket.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Socket); - } - if (ConnectionId.Length != 0) { - output.WriteRawTag(18); - output.WriteString(ConnectionId); - } - if (Data.Length != 0) { - output.WriteRawTag(26); - output.WriteBytes(Data); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (Socket.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Socket); - } - if (ConnectionId.Length != 0) { - output.WriteRawTag(18); - output.WriteString(ConnectionId); - } - if (Data.Length != 0) { - output.WriteRawTag(26); - output.WriteBytes(Data); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (Socket.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Socket); - } - if (ConnectionId.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(ConnectionId); - } - if (Data.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeBytesSize(Data); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(WebsocketSendRequest other) { - if (other == null) { - return; - } - if (other.Socket.Length != 0) { - Socket = other.Socket; - } - if (other.ConnectionId.Length != 0) { - ConnectionId = other.ConnectionId; - } - if (other.Data.Length != 0) { - Data = other.Data; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - Socket = input.ReadString(); - break; - } - case 18: { - ConnectionId = input.ReadString(); - break; - } - case 26: { - Data = input.ReadBytes(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - Socket = input.ReadString(); - break; - } - case 18: { - ConnectionId = input.ReadString(); - break; - } - case 26: { - Data = input.ReadBytes(); - break; - } - } - } - } - #endif - - } - - public sealed partial class WebsocketSendResponse : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new WebsocketSendResponse()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Websocket.v1.WebsocketReflection.Descriptor.MessageTypes[1]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public WebsocketSendResponse() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public WebsocketSendResponse(WebsocketSendResponse other) : this() { - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public WebsocketSendResponse Clone() { - return new WebsocketSendResponse(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as WebsocketSendResponse); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(WebsocketSendResponse other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(WebsocketSendResponse other) { - if (other == null) { - return; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - } - } - } - #endif - - } - - public sealed partial class WebsocketCloseRequest : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new WebsocketCloseRequest()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Websocket.v1.WebsocketReflection.Descriptor.MessageTypes[2]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public WebsocketCloseRequest() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public WebsocketCloseRequest(WebsocketCloseRequest other) : this() { - socket_ = other.socket_; - connectionId_ = other.connectionId_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public WebsocketCloseRequest Clone() { - return new WebsocketCloseRequest(this); - } - - /// Field number for the "socket" field. - public const int SocketFieldNumber = 1; - private string socket_ = ""; - /// - /// The nitric name of the socket to send on - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string Socket { - get { return socket_; } - set { - socket_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "connection_id" field. - public const int ConnectionIdFieldNumber = 2; - private string connectionId_ = ""; - /// - /// The connection ID of the client to send to - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string ConnectionId { - get { return connectionId_; } - set { - connectionId_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as WebsocketCloseRequest); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(WebsocketCloseRequest other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Socket != other.Socket) return false; - if (ConnectionId != other.ConnectionId) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (Socket.Length != 0) hash ^= Socket.GetHashCode(); - if (ConnectionId.Length != 0) hash ^= ConnectionId.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (Socket.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Socket); - } - if (ConnectionId.Length != 0) { - output.WriteRawTag(18); - output.WriteString(ConnectionId); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (Socket.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Socket); - } - if (ConnectionId.Length != 0) { - output.WriteRawTag(18); - output.WriteString(ConnectionId); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (Socket.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Socket); - } - if (ConnectionId.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(ConnectionId); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(WebsocketCloseRequest other) { - if (other == null) { - return; - } - if (other.Socket.Length != 0) { - Socket = other.Socket; - } - if (other.ConnectionId.Length != 0) { - ConnectionId = other.ConnectionId; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - Socket = input.ReadString(); - break; - } - case 18: { - ConnectionId = input.ReadString(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - Socket = input.ReadString(); - break; - } - case 18: { - ConnectionId = input.ReadString(); - break; - } - } - } - } - #endif - - } - - public sealed partial class WebsocketCloseResponse : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new WebsocketCloseResponse()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::Nitric.Proto.Websocket.v1.WebsocketReflection.Descriptor.MessageTypes[3]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public WebsocketCloseResponse() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public WebsocketCloseResponse(WebsocketCloseResponse other) : this() { - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public WebsocketCloseResponse Clone() { - return new WebsocketCloseResponse(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as WebsocketCloseResponse); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(WebsocketCloseResponse other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(WebsocketCloseResponse other) { - if (other == null) { - return; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - } - } - } - #endif - - } - - #endregion - -} - -#endregion Designer generated code diff --git a/src/Nitric.Sdk/Proto/proto/websocket/v1/WebsocketGrpc.cs b/src/Nitric.Sdk/Proto/proto/websocket/v1/WebsocketGrpc.cs deleted file mode 100644 index 22c08dc..0000000 --- a/src/Nitric.Sdk/Proto/proto/websocket/v1/WebsocketGrpc.cs +++ /dev/null @@ -1,242 +0,0 @@ -// -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: proto/websocket/v1/websocket.proto -// -#pragma warning disable 0414, 1591 -#region Designer generated code - -using grpc = global::Grpc.Core; - -namespace Nitric.Proto.Websocket.v1 { - public static partial class WebsocketService - { - static readonly string __ServiceName = "nitric.websocket.v1.WebsocketService"; - - static void __Helper_SerializeMessage(global::Google.Protobuf.IMessage message, grpc::SerializationContext context) - { - #if !GRPC_DISABLE_PROTOBUF_BUFFER_SERIALIZATION - if (message is global::Google.Protobuf.IBufferMessage) - { - context.SetPayloadLength(message.CalculateSize()); - global::Google.Protobuf.MessageExtensions.WriteTo(message, context.GetBufferWriter()); - context.Complete(); - return; - } - #endif - context.Complete(global::Google.Protobuf.MessageExtensions.ToByteArray(message)); - } - - static class __Helper_MessageCache - { - public static readonly bool IsBufferMessage = global::System.Reflection.IntrospectionExtensions.GetTypeInfo(typeof(global::Google.Protobuf.IBufferMessage)).IsAssignableFrom(typeof(T)); - } - - static T __Helper_DeserializeMessage(grpc::DeserializationContext context, global::Google.Protobuf.MessageParser parser) where T : global::Google.Protobuf.IMessage - { - #if !GRPC_DISABLE_PROTOBUF_BUFFER_SERIALIZATION - if (__Helper_MessageCache.IsBufferMessage) - { - return parser.ParseFrom(context.PayloadAsReadOnlySequence()); - } - #endif - return parser.ParseFrom(context.PayloadAsNewBuffer()); - } - - static readonly grpc::Marshaller __Marshaller_nitric_websocket_v1_WebsocketSendRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Websocket.v1.WebsocketSendRequest.Parser)); - static readonly grpc::Marshaller __Marshaller_nitric_websocket_v1_WebsocketSendResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Websocket.v1.WebsocketSendResponse.Parser)); - static readonly grpc::Marshaller __Marshaller_nitric_websocket_v1_WebsocketCloseRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Websocket.v1.WebsocketCloseRequest.Parser)); - static readonly grpc::Marshaller __Marshaller_nitric_websocket_v1_WebsocketCloseResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Nitric.Proto.Websocket.v1.WebsocketCloseResponse.Parser)); - - static readonly grpc::Method __Method_Send = new grpc::Method( - grpc::MethodType.Unary, - __ServiceName, - "Send", - __Marshaller_nitric_websocket_v1_WebsocketSendRequest, - __Marshaller_nitric_websocket_v1_WebsocketSendResponse); - - static readonly grpc::Method __Method_Close = new grpc::Method( - grpc::MethodType.Unary, - __ServiceName, - "Close", - __Marshaller_nitric_websocket_v1_WebsocketCloseRequest, - __Marshaller_nitric_websocket_v1_WebsocketCloseResponse); - - /// Service descriptor - public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor - { - get { return global::Nitric.Proto.Websocket.v1.WebsocketReflection.Descriptor.Services[0]; } - } - - /// Base class for server-side implementations of WebsocketService - [grpc::BindServiceMethod(typeof(WebsocketService), "BindService")] - public abstract partial class WebsocketServiceBase - { - /// - /// Send a messages to a websocket - /// - /// The request received from the client. - /// The context of the server-side call handler being invoked. - /// The response to send back to the client (wrapped by a task). - public virtual global::System.Threading.Tasks.Task Send(global::Nitric.Proto.Websocket.v1.WebsocketSendRequest request, grpc::ServerCallContext context) - { - throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); - } - - /// - /// Close a websocket connection - /// This can be used to force a client to disconnect - /// - /// The request received from the client. - /// The context of the server-side call handler being invoked. - /// The response to send back to the client (wrapped by a task). - public virtual global::System.Threading.Tasks.Task Close(global::Nitric.Proto.Websocket.v1.WebsocketCloseRequest request, grpc::ServerCallContext context) - { - throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); - } - - } - - /// Client for WebsocketService - public partial class WebsocketServiceClient : grpc::ClientBase - { - /// Creates a new client for WebsocketService - /// The channel to use to make remote calls. - public WebsocketServiceClient(grpc::ChannelBase channel) : base(channel) - { - } - /// Creates a new client for WebsocketService that uses a custom CallInvoker. - /// The callInvoker to use to make remote calls. - public WebsocketServiceClient(grpc::CallInvoker callInvoker) : base(callInvoker) - { - } - /// Protected parameterless constructor to allow creation of test doubles. - protected WebsocketServiceClient() : base() - { - } - /// Protected constructor to allow creation of configured clients. - /// The client configuration. - protected WebsocketServiceClient(ClientBaseConfiguration configuration) : base(configuration) - { - } - - /// - /// Send a messages to a websocket - /// - /// The request to send to the server. - /// The initial metadata to send with the call. This parameter is optional. - /// An optional deadline for the call. The call will be cancelled if deadline is hit. - /// An optional token for canceling the call. - /// The response received from the server. - public virtual global::Nitric.Proto.Websocket.v1.WebsocketSendResponse Send(global::Nitric.Proto.Websocket.v1.WebsocketSendRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) - { - return Send(request, new grpc::CallOptions(headers, deadline, cancellationToken)); - } - /// - /// Send a messages to a websocket - /// - /// The request to send to the server. - /// The options for the call. - /// The response received from the server. - public virtual global::Nitric.Proto.Websocket.v1.WebsocketSendResponse Send(global::Nitric.Proto.Websocket.v1.WebsocketSendRequest request, grpc::CallOptions options) - { - return CallInvoker.BlockingUnaryCall(__Method_Send, null, options, request); - } - /// - /// Send a messages to a websocket - /// - /// The request to send to the server. - /// The initial metadata to send with the call. This parameter is optional. - /// An optional deadline for the call. The call will be cancelled if deadline is hit. - /// An optional token for canceling the call. - /// The call object. - public virtual grpc::AsyncUnaryCall SendAsync(global::Nitric.Proto.Websocket.v1.WebsocketSendRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) - { - return SendAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); - } - /// - /// Send a messages to a websocket - /// - /// The request to send to the server. - /// The options for the call. - /// The call object. - public virtual grpc::AsyncUnaryCall SendAsync(global::Nitric.Proto.Websocket.v1.WebsocketSendRequest request, grpc::CallOptions options) - { - return CallInvoker.AsyncUnaryCall(__Method_Send, null, options, request); - } - /// - /// Close a websocket connection - /// This can be used to force a client to disconnect - /// - /// The request to send to the server. - /// The initial metadata to send with the call. This parameter is optional. - /// An optional deadline for the call. The call will be cancelled if deadline is hit. - /// An optional token for canceling the call. - /// The response received from the server. - public virtual global::Nitric.Proto.Websocket.v1.WebsocketCloseResponse Close(global::Nitric.Proto.Websocket.v1.WebsocketCloseRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) - { - return Close(request, new grpc::CallOptions(headers, deadline, cancellationToken)); - } - /// - /// Close a websocket connection - /// This can be used to force a client to disconnect - /// - /// The request to send to the server. - /// The options for the call. - /// The response received from the server. - public virtual global::Nitric.Proto.Websocket.v1.WebsocketCloseResponse Close(global::Nitric.Proto.Websocket.v1.WebsocketCloseRequest request, grpc::CallOptions options) - { - return CallInvoker.BlockingUnaryCall(__Method_Close, null, options, request); - } - /// - /// Close a websocket connection - /// This can be used to force a client to disconnect - /// - /// The request to send to the server. - /// The initial metadata to send with the call. This parameter is optional. - /// An optional deadline for the call. The call will be cancelled if deadline is hit. - /// An optional token for canceling the call. - /// The call object. - public virtual grpc::AsyncUnaryCall CloseAsync(global::Nitric.Proto.Websocket.v1.WebsocketCloseRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) - { - return CloseAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); - } - /// - /// Close a websocket connection - /// This can be used to force a client to disconnect - /// - /// The request to send to the server. - /// The options for the call. - /// The call object. - public virtual grpc::AsyncUnaryCall CloseAsync(global::Nitric.Proto.Websocket.v1.WebsocketCloseRequest request, grpc::CallOptions options) - { - return CallInvoker.AsyncUnaryCall(__Method_Close, null, options, request); - } - /// Creates a new instance of client from given ClientBaseConfiguration. - protected override WebsocketServiceClient NewInstance(ClientBaseConfiguration configuration) - { - return new WebsocketServiceClient(configuration); - } - } - - /// Creates service definition that can be registered with a server - /// An object implementing the server-side handling logic. - public static grpc::ServerServiceDefinition BindService(WebsocketServiceBase serviceImpl) - { - return grpc::ServerServiceDefinition.CreateBuilder() - .AddMethod(__Method_Send, serviceImpl.Send) - .AddMethod(__Method_Close, serviceImpl.Close).Build(); - } - - /// Register service method with a service binder with or without implementation. Useful when customizing the service binding logic. - /// Note: this method is part of an experimental API that can change or be removed without any prior notice. - /// Service methods will be bound by calling AddMethod on this object. - /// An object implementing the server-side handling logic. - public static void BindService(grpc::ServiceBinderBase serviceBinder, WebsocketServiceBase serviceImpl) - { - serviceBinder.AddMethod(__Method_Send, serviceImpl == null ? null : new grpc::UnaryServerMethod(serviceImpl.Send)); - serviceBinder.AddMethod(__Method_Close, serviceImpl == null ? null : new grpc::UnaryServerMethod(serviceImpl.Close)); - } - - } -} -#endregion diff --git a/src/Nitric.Sdk/Proto/validate/Validate.cs b/src/Nitric.Sdk/Proto/validate/Validate.cs deleted file mode 100644 index a4d1d00..0000000 --- a/src/Nitric.Sdk/Proto/validate/Validate.cs +++ /dev/null @@ -1,13116 +0,0 @@ -// -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: validate/validate.proto -// -#pragma warning disable 1591, 0612, 3021 -#region Designer generated code - -using pb = global::Google.Protobuf; -using pbc = global::Google.Protobuf.Collections; -using pbr = global::Google.Protobuf.Reflection; -using scg = global::System.Collections.Generic; -namespace Validate { - - /// Holder for reflection information generated from validate/validate.proto - public static partial class ValidateReflection { - - #region Descriptor - /// File descriptor for validate/validate.proto - public static pbr::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbr::FileDescriptor descriptor; - - static ValidateReflection() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "Chd2YWxpZGF0ZS92YWxpZGF0ZS5wcm90bxIIdmFsaWRhdGUaIGdvb2dsZS9w", - "cm90b2J1Zi9kZXNjcmlwdG9yLnByb3RvGh5nb29nbGUvcHJvdG9idWYvZHVy", - "YXRpb24ucHJvdG8aH2dvb2dsZS9wcm90b2J1Zi90aW1lc3RhbXAucHJvdG8i", - "mAcKCkZpZWxkUnVsZXMSJwoHbWVzc2FnZRgRIAEoCzIWLnZhbGlkYXRlLk1l", - "c3NhZ2VSdWxlcxIlCgVmbG9hdBgBIAEoCzIULnZhbGlkYXRlLkZsb2F0UnVs", - "ZXNIABInCgZkb3VibGUYAiABKAsyFS52YWxpZGF0ZS5Eb3VibGVSdWxlc0gA", - "EiUKBWludDMyGAMgASgLMhQudmFsaWRhdGUuSW50MzJSdWxlc0gAEiUKBWlu", - "dDY0GAQgASgLMhQudmFsaWRhdGUuSW50NjRSdWxlc0gAEicKBnVpbnQzMhgF", - "IAEoCzIVLnZhbGlkYXRlLlVJbnQzMlJ1bGVzSAASJwoGdWludDY0GAYgASgL", - "MhUudmFsaWRhdGUuVUludDY0UnVsZXNIABInCgZzaW50MzIYByABKAsyFS52", - "YWxpZGF0ZS5TSW50MzJSdWxlc0gAEicKBnNpbnQ2NBgIIAEoCzIVLnZhbGlk", - "YXRlLlNJbnQ2NFJ1bGVzSAASKQoHZml4ZWQzMhgJIAEoCzIWLnZhbGlkYXRl", - "LkZpeGVkMzJSdWxlc0gAEikKB2ZpeGVkNjQYCiABKAsyFi52YWxpZGF0ZS5G", - "aXhlZDY0UnVsZXNIABIrCghzZml4ZWQzMhgLIAEoCzIXLnZhbGlkYXRlLlNG", - "aXhlZDMyUnVsZXNIABIrCghzZml4ZWQ2NBgMIAEoCzIXLnZhbGlkYXRlLlNG", - "aXhlZDY0UnVsZXNIABIjCgRib29sGA0gASgLMhMudmFsaWRhdGUuQm9vbFJ1", - "bGVzSAASJwoGc3RyaW5nGA4gASgLMhUudmFsaWRhdGUuU3RyaW5nUnVsZXNI", - "ABIlCgVieXRlcxgPIAEoCzIULnZhbGlkYXRlLkJ5dGVzUnVsZXNIABIjCgRl", - "bnVtGBAgASgLMhMudmFsaWRhdGUuRW51bVJ1bGVzSAASKwoIcmVwZWF0ZWQY", - "EiABKAsyFy52YWxpZGF0ZS5SZXBlYXRlZFJ1bGVzSAASIQoDbWFwGBMgASgL", - "MhIudmFsaWRhdGUuTWFwUnVsZXNIABIhCgNhbnkYFCABKAsyEi52YWxpZGF0", - "ZS5BbnlSdWxlc0gAEisKCGR1cmF0aW9uGBUgASgLMhcudmFsaWRhdGUuRHVy", - "YXRpb25SdWxlc0gAEi0KCXRpbWVzdGFtcBgWIAEoCzIYLnZhbGlkYXRlLlRp", - "bWVzdGFtcFJ1bGVzSABCBgoEdHlwZSJ/CgpGbG9hdFJ1bGVzEg0KBWNvbnN0", - "GAEgASgCEgoKAmx0GAIgASgCEgsKA2x0ZRgDIAEoAhIKCgJndBgEIAEoAhIL", - "CgNndGUYBSABKAISCgoCaW4YBiADKAISDgoGbm90X2luGAcgAygCEhQKDGln", - "bm9yZV9lbXB0eRgIIAEoCCKAAQoLRG91YmxlUnVsZXMSDQoFY29uc3QYASAB", - "KAESCgoCbHQYAiABKAESCwoDbHRlGAMgASgBEgoKAmd0GAQgASgBEgsKA2d0", - "ZRgFIAEoARIKCgJpbhgGIAMoARIOCgZub3RfaW4YByADKAESFAoMaWdub3Jl", - "X2VtcHR5GAggASgIIn8KCkludDMyUnVsZXMSDQoFY29uc3QYASABKAUSCgoC", - "bHQYAiABKAUSCwoDbHRlGAMgASgFEgoKAmd0GAQgASgFEgsKA2d0ZRgFIAEo", - "BRIKCgJpbhgGIAMoBRIOCgZub3RfaW4YByADKAUSFAoMaWdub3JlX2VtcHR5", - "GAggASgIIn8KCkludDY0UnVsZXMSDQoFY29uc3QYASABKAMSCgoCbHQYAiAB", - "KAMSCwoDbHRlGAMgASgDEgoKAmd0GAQgASgDEgsKA2d0ZRgFIAEoAxIKCgJp", - "bhgGIAMoAxIOCgZub3RfaW4YByADKAMSFAoMaWdub3JlX2VtcHR5GAggASgI", - "IoABCgtVSW50MzJSdWxlcxINCgVjb25zdBgBIAEoDRIKCgJsdBgCIAEoDRIL", - "CgNsdGUYAyABKA0SCgoCZ3QYBCABKA0SCwoDZ3RlGAUgASgNEgoKAmluGAYg", - "AygNEg4KBm5vdF9pbhgHIAMoDRIUCgxpZ25vcmVfZW1wdHkYCCABKAgigAEK", - "C1VJbnQ2NFJ1bGVzEg0KBWNvbnN0GAEgASgEEgoKAmx0GAIgASgEEgsKA2x0", - "ZRgDIAEoBBIKCgJndBgEIAEoBBILCgNndGUYBSABKAQSCgoCaW4YBiADKAQS", - "DgoGbm90X2luGAcgAygEEhQKDGlnbm9yZV9lbXB0eRgIIAEoCCKAAQoLU0lu", - "dDMyUnVsZXMSDQoFY29uc3QYASABKBESCgoCbHQYAiABKBESCwoDbHRlGAMg", - "ASgREgoKAmd0GAQgASgREgsKA2d0ZRgFIAEoERIKCgJpbhgGIAMoERIOCgZu", - "b3RfaW4YByADKBESFAoMaWdub3JlX2VtcHR5GAggASgIIoABCgtTSW50NjRS", - "dWxlcxINCgVjb25zdBgBIAEoEhIKCgJsdBgCIAEoEhILCgNsdGUYAyABKBIS", - "CgoCZ3QYBCABKBISCwoDZ3RlGAUgASgSEgoKAmluGAYgAygSEg4KBm5vdF9p", - "bhgHIAMoEhIUCgxpZ25vcmVfZW1wdHkYCCABKAgigQEKDEZpeGVkMzJSdWxl", - "cxINCgVjb25zdBgBIAEoBxIKCgJsdBgCIAEoBxILCgNsdGUYAyABKAcSCgoC", - "Z3QYBCABKAcSCwoDZ3RlGAUgASgHEgoKAmluGAYgAygHEg4KBm5vdF9pbhgH", - "IAMoBxIUCgxpZ25vcmVfZW1wdHkYCCABKAgigQEKDEZpeGVkNjRSdWxlcxIN", - "CgVjb25zdBgBIAEoBhIKCgJsdBgCIAEoBhILCgNsdGUYAyABKAYSCgoCZ3QY", - "BCABKAYSCwoDZ3RlGAUgASgGEgoKAmluGAYgAygGEg4KBm5vdF9pbhgHIAMo", - "BhIUCgxpZ25vcmVfZW1wdHkYCCABKAgiggEKDVNGaXhlZDMyUnVsZXMSDQoF", - "Y29uc3QYASABKA8SCgoCbHQYAiABKA8SCwoDbHRlGAMgASgPEgoKAmd0GAQg", - "ASgPEgsKA2d0ZRgFIAEoDxIKCgJpbhgGIAMoDxIOCgZub3RfaW4YByADKA8S", - "FAoMaWdub3JlX2VtcHR5GAggASgIIoIBCg1TRml4ZWQ2NFJ1bGVzEg0KBWNv", - "bnN0GAEgASgQEgoKAmx0GAIgASgQEgsKA2x0ZRgDIAEoEBIKCgJndBgEIAEo", - "EBILCgNndGUYBSABKBASCgoCaW4YBiADKBASDgoGbm90X2luGAcgAygQEhQK", - "DGlnbm9yZV9lbXB0eRgIIAEoCCIaCglCb29sUnVsZXMSDQoFY29uc3QYASAB", - "KAgi/QMKC1N0cmluZ1J1bGVzEg0KBWNvbnN0GAEgASgJEgsKA2xlbhgTIAEo", - "BBIPCgdtaW5fbGVuGAIgASgEEg8KB21heF9sZW4YAyABKAQSEQoJbGVuX2J5", - "dGVzGBQgASgEEhEKCW1pbl9ieXRlcxgEIAEoBBIRCgltYXhfYnl0ZXMYBSAB", - "KAQSDwoHcGF0dGVybhgGIAEoCRIOCgZwcmVmaXgYByABKAkSDgoGc3VmZml4", - "GAggASgJEhAKCGNvbnRhaW5zGAkgASgJEhQKDG5vdF9jb250YWlucxgXIAEo", - "CRIKCgJpbhgKIAMoCRIOCgZub3RfaW4YCyADKAkSDwoFZW1haWwYDCABKAhI", - "ABISCghob3N0bmFtZRgNIAEoCEgAEgwKAmlwGA4gASgISAASDgoEaXB2NBgP", - "IAEoCEgAEg4KBGlwdjYYECABKAhIABINCgN1cmkYESABKAhIABIRCgd1cmlf", - "cmVmGBIgASgISAASEQoHYWRkcmVzcxgVIAEoCEgAEg4KBHV1aWQYFiABKAhI", - "ABIwChB3ZWxsX2tub3duX3JlZ2V4GBggASgOMhQudmFsaWRhdGUuS25vd25S", - "ZWdleEgAEhQKBnN0cmljdBgZIAEoCDoEdHJ1ZRIUCgxpZ25vcmVfZW1wdHkY", - "GiABKAhCDAoKd2VsbF9rbm93biL7AQoKQnl0ZXNSdWxlcxINCgVjb25zdBgB", - "IAEoDBILCgNsZW4YDSABKAQSDwoHbWluX2xlbhgCIAEoBBIPCgdtYXhfbGVu", - "GAMgASgEEg8KB3BhdHRlcm4YBCABKAkSDgoGcHJlZml4GAUgASgMEg4KBnN1", - "ZmZpeBgGIAEoDBIQCghjb250YWlucxgHIAEoDBIKCgJpbhgIIAMoDBIOCgZu", - "b3RfaW4YCSADKAwSDAoCaXAYCiABKAhIABIOCgRpcHY0GAsgASgISAASDgoE", - "aXB2NhgMIAEoCEgAEhQKDGlnbm9yZV9lbXB0eRgOIAEoCEIMCgp3ZWxsX2tu", - "b3duIkwKCUVudW1SdWxlcxINCgVjb25zdBgBIAEoBRIUCgxkZWZpbmVkX29u", - "bHkYAiABKAgSCgoCaW4YAyADKAUSDgoGbm90X2luGAQgAygFIi4KDE1lc3Nh", - "Z2VSdWxlcxIMCgRza2lwGAEgASgIEhAKCHJlcXVpcmVkGAIgASgIIoABCg1S", - "ZXBlYXRlZFJ1bGVzEhEKCW1pbl9pdGVtcxgBIAEoBBIRCgltYXhfaXRlbXMY", - "AiABKAQSDgoGdW5pcXVlGAMgASgIEiMKBWl0ZW1zGAQgASgLMhQudmFsaWRh", - "dGUuRmllbGRSdWxlcxIUCgxpZ25vcmVfZW1wdHkYBSABKAgiowEKCE1hcFJ1", - "bGVzEhEKCW1pbl9wYWlycxgBIAEoBBIRCgltYXhfcGFpcnMYAiABKAQSEQoJ", - "bm9fc3BhcnNlGAMgASgIEiIKBGtleXMYBCABKAsyFC52YWxpZGF0ZS5GaWVs", - "ZFJ1bGVzEiQKBnZhbHVlcxgFIAEoCzIULnZhbGlkYXRlLkZpZWxkUnVsZXMS", - "FAoMaWdub3JlX2VtcHR5GAYgASgIIjgKCEFueVJ1bGVzEhAKCHJlcXVpcmVk", - "GAEgASgIEgoKAmluGAIgAygJEg4KBm5vdF9pbhgDIAMoCSK7AgoNRHVyYXRp", - "b25SdWxlcxIQCghyZXF1aXJlZBgBIAEoCBIoCgVjb25zdBgCIAEoCzIZLmdv", - "b2dsZS5wcm90b2J1Zi5EdXJhdGlvbhIlCgJsdBgDIAEoCzIZLmdvb2dsZS5w", - "cm90b2J1Zi5EdXJhdGlvbhImCgNsdGUYBCABKAsyGS5nb29nbGUucHJvdG9i", - "dWYuRHVyYXRpb24SJQoCZ3QYBSABKAsyGS5nb29nbGUucHJvdG9idWYuRHVy", - "YXRpb24SJgoDZ3RlGAYgASgLMhkuZ29vZ2xlLnByb3RvYnVmLkR1cmF0aW9u", - "EiUKAmluGAcgAygLMhkuZ29vZ2xlLnByb3RvYnVmLkR1cmF0aW9uEikKBm5v", - "dF9pbhgIIAMoCzIZLmdvb2dsZS5wcm90b2J1Zi5EdXJhdGlvbiK6AgoOVGlt", - "ZXN0YW1wUnVsZXMSEAoIcmVxdWlyZWQYASABKAgSKQoFY29uc3QYAiABKAsy", - "Gi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1wEiYKAmx0GAMgASgLMhouZ29v", - "Z2xlLnByb3RvYnVmLlRpbWVzdGFtcBInCgNsdGUYBCABKAsyGi5nb29nbGUu", - "cHJvdG9idWYuVGltZXN0YW1wEiYKAmd0GAUgASgLMhouZ29vZ2xlLnByb3Rv", - "YnVmLlRpbWVzdGFtcBInCgNndGUYBiABKAsyGi5nb29nbGUucHJvdG9idWYu", - "VGltZXN0YW1wEg4KBmx0X25vdxgHIAEoCBIOCgZndF9ub3cYCCABKAgSKQoG", - "d2l0aGluGAkgASgLMhkuZ29vZ2xlLnByb3RvYnVmLkR1cmF0aW9uKkYKCktu", - "b3duUmVnZXgSCwoHVU5LTk9XThAAEhQKEEhUVFBfSEVBREVSX05BTUUQARIV", - "ChFIVFRQX0hFQURFUl9WQUxVRRACOjIKCGRpc2FibGVkEh8uZ29vZ2xlLnBy", - "b3RvYnVmLk1lc3NhZ2VPcHRpb25zGK8IIAEoCDoxCgdpZ25vcmVkEh8uZ29v", - "Z2xlLnByb3RvYnVmLk1lc3NhZ2VPcHRpb25zGLAIIAEoCDowCghyZXF1aXJl", - "ZBIdLmdvb2dsZS5wcm90b2J1Zi5PbmVvZk9wdGlvbnMYrwggASgIOkMKBXJ1", - "bGVzEh0uZ29vZ2xlLnByb3RvYnVmLkZpZWxkT3B0aW9ucxivCCABKAsyFC52", - "YWxpZGF0ZS5GaWVsZFJ1bGVzQlAKGmlvLmVudm95cHJveHkucGd2LnZhbGlk", - "YXRlWjJnaXRodWIuY29tL2Vudm95cHJveHkvcHJvdG9jLWdlbi12YWxpZGF0", - "ZS92YWxpZGF0ZQ==")); - descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, - new pbr::FileDescriptor[] { global::Google.Protobuf.Reflection.DescriptorReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.DurationReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.TimestampReflection.Descriptor, }, - new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Validate.KnownRegex), }, new pb::Extension[] { ValidateExtensions.Disabled, ValidateExtensions.Ignored, ValidateExtensions.Required, ValidateExtensions.Rules }, new pbr::GeneratedClrTypeInfo[] { - new pbr::GeneratedClrTypeInfo(typeof(global::Validate.FieldRules), global::Validate.FieldRules.Parser, new[]{ "Message", "Float", "Double", "Int32", "Int64", "Uint32", "Uint64", "Sint32", "Sint64", "Fixed32", "Fixed64", "Sfixed32", "Sfixed64", "Bool", "String", "Bytes", "Enum", "Repeated", "Map", "Any", "Duration", "Timestamp" }, new[]{ "Type" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Validate.FloatRules), global::Validate.FloatRules.Parser, new[]{ "Const", "Lt", "Lte", "Gt", "Gte", "In", "NotIn", "IgnoreEmpty" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Validate.DoubleRules), global::Validate.DoubleRules.Parser, new[]{ "Const", "Lt", "Lte", "Gt", "Gte", "In", "NotIn", "IgnoreEmpty" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Validate.Int32Rules), global::Validate.Int32Rules.Parser, new[]{ "Const", "Lt", "Lte", "Gt", "Gte", "In", "NotIn", "IgnoreEmpty" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Validate.Int64Rules), global::Validate.Int64Rules.Parser, new[]{ "Const", "Lt", "Lte", "Gt", "Gte", "In", "NotIn", "IgnoreEmpty" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Validate.UInt32Rules), global::Validate.UInt32Rules.Parser, new[]{ "Const", "Lt", "Lte", "Gt", "Gte", "In", "NotIn", "IgnoreEmpty" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Validate.UInt64Rules), global::Validate.UInt64Rules.Parser, new[]{ "Const", "Lt", "Lte", "Gt", "Gte", "In", "NotIn", "IgnoreEmpty" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Validate.SInt32Rules), global::Validate.SInt32Rules.Parser, new[]{ "Const", "Lt", "Lte", "Gt", "Gte", "In", "NotIn", "IgnoreEmpty" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Validate.SInt64Rules), global::Validate.SInt64Rules.Parser, new[]{ "Const", "Lt", "Lte", "Gt", "Gte", "In", "NotIn", "IgnoreEmpty" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Validate.Fixed32Rules), global::Validate.Fixed32Rules.Parser, new[]{ "Const", "Lt", "Lte", "Gt", "Gte", "In", "NotIn", "IgnoreEmpty" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Validate.Fixed64Rules), global::Validate.Fixed64Rules.Parser, new[]{ "Const", "Lt", "Lte", "Gt", "Gte", "In", "NotIn", "IgnoreEmpty" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Validate.SFixed32Rules), global::Validate.SFixed32Rules.Parser, new[]{ "Const", "Lt", "Lte", "Gt", "Gte", "In", "NotIn", "IgnoreEmpty" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Validate.SFixed64Rules), global::Validate.SFixed64Rules.Parser, new[]{ "Const", "Lt", "Lte", "Gt", "Gte", "In", "NotIn", "IgnoreEmpty" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Validate.BoolRules), global::Validate.BoolRules.Parser, new[]{ "Const" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Validate.StringRules), global::Validate.StringRules.Parser, new[]{ "Const", "Len", "MinLen", "MaxLen", "LenBytes", "MinBytes", "MaxBytes", "Pattern", "Prefix", "Suffix", "Contains", "NotContains", "In", "NotIn", "Email", "Hostname", "Ip", "Ipv4", "Ipv6", "Uri", "UriRef", "Address", "Uuid", "WellKnownRegex", "Strict", "IgnoreEmpty" }, new[]{ "WellKnown" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Validate.BytesRules), global::Validate.BytesRules.Parser, new[]{ "Const", "Len", "MinLen", "MaxLen", "Pattern", "Prefix", "Suffix", "Contains", "In", "NotIn", "Ip", "Ipv4", "Ipv6", "IgnoreEmpty" }, new[]{ "WellKnown" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Validate.EnumRules), global::Validate.EnumRules.Parser, new[]{ "Const", "DefinedOnly", "In", "NotIn" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Validate.MessageRules), global::Validate.MessageRules.Parser, new[]{ "Skip", "Required" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Validate.RepeatedRules), global::Validate.RepeatedRules.Parser, new[]{ "MinItems", "MaxItems", "Unique", "Items", "IgnoreEmpty" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Validate.MapRules), global::Validate.MapRules.Parser, new[]{ "MinPairs", "MaxPairs", "NoSparse", "Keys", "Values", "IgnoreEmpty" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Validate.AnyRules), global::Validate.AnyRules.Parser, new[]{ "Required", "In", "NotIn" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Validate.DurationRules), global::Validate.DurationRules.Parser, new[]{ "Required", "Const", "Lt", "Lte", "Gt", "Gte", "In", "NotIn" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Validate.TimestampRules), global::Validate.TimestampRules.Parser, new[]{ "Required", "Const", "Lt", "Lte", "Gt", "Gte", "LtNow", "GtNow", "Within" }, null, null, null, null) - })); - } - #endregion - - } - /// Holder for extension identifiers generated from the top level of validate/validate.proto - public static partial class ValidateExtensions { - /// - /// Disabled nullifies any validation rules for this message, including any - /// message fields associated with it that do support validation. - /// - public static readonly pb::Extension Disabled = - new pb::Extension(1071, pb::FieldCodec.ForBool(8568, false)); - /// - /// Ignore skips generation of validation methods for this message. - /// - public static readonly pb::Extension Ignored = - new pb::Extension(1072, pb::FieldCodec.ForBool(8576, false)); - /// - /// Required ensures that exactly one the field options in a oneof is set; - /// validation fails if no fields in the oneof are set. - /// - public static readonly pb::Extension Required = - new pb::Extension(1071, pb::FieldCodec.ForBool(8568, false)); - /// - /// Rules specify the validations to be performed on this field. By default, - /// no validation is performed against a field. - /// - public static readonly pb::Extension Rules = - new pb::Extension(1071, pb::FieldCodec.ForMessage(8570, global::Validate.FieldRules.Parser)); - } - - #region Enums - /// - /// WellKnownRegex contain some well-known patterns. - /// - public enum KnownRegex { - [pbr::OriginalName("UNKNOWN")] Unknown = 0, - /// - /// HTTP header name as defined by RFC 7230. - /// - [pbr::OriginalName("HTTP_HEADER_NAME")] HttpHeaderName = 1, - /// - /// HTTP header value as defined by RFC 7230. - /// - [pbr::OriginalName("HTTP_HEADER_VALUE")] HttpHeaderValue = 2, - } - - #endregion - - #region Messages - /// - /// FieldRules encapsulates the rules for each type of field. Depending on the - /// field, the correct set should be used to ensure proper validations. - /// - public sealed partial class FieldRules : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FieldRules()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::Validate.ValidateReflection.Descriptor.MessageTypes[0]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public FieldRules() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public FieldRules(FieldRules other) : this() { - message_ = other.message_ != null ? other.message_.Clone() : null; - switch (other.TypeCase) { - case TypeOneofCase.Float: - Float = other.Float.Clone(); - break; - case TypeOneofCase.Double: - Double = other.Double.Clone(); - break; - case TypeOneofCase.Int32: - Int32 = other.Int32.Clone(); - break; - case TypeOneofCase.Int64: - Int64 = other.Int64.Clone(); - break; - case TypeOneofCase.Uint32: - Uint32 = other.Uint32.Clone(); - break; - case TypeOneofCase.Uint64: - Uint64 = other.Uint64.Clone(); - break; - case TypeOneofCase.Sint32: - Sint32 = other.Sint32.Clone(); - break; - case TypeOneofCase.Sint64: - Sint64 = other.Sint64.Clone(); - break; - case TypeOneofCase.Fixed32: - Fixed32 = other.Fixed32.Clone(); - break; - case TypeOneofCase.Fixed64: - Fixed64 = other.Fixed64.Clone(); - break; - case TypeOneofCase.Sfixed32: - Sfixed32 = other.Sfixed32.Clone(); - break; - case TypeOneofCase.Sfixed64: - Sfixed64 = other.Sfixed64.Clone(); - break; - case TypeOneofCase.Bool: - Bool = other.Bool.Clone(); - break; - case TypeOneofCase.String: - String = other.String.Clone(); - break; - case TypeOneofCase.Bytes: - Bytes = other.Bytes.Clone(); - break; - case TypeOneofCase.Enum: - Enum = other.Enum.Clone(); - break; - case TypeOneofCase.Repeated: - Repeated = other.Repeated.Clone(); - break; - case TypeOneofCase.Map: - Map = other.Map.Clone(); - break; - case TypeOneofCase.Any: - Any = other.Any.Clone(); - break; - case TypeOneofCase.Duration: - Duration = other.Duration.Clone(); - break; - case TypeOneofCase.Timestamp: - Timestamp = other.Timestamp.Clone(); - break; - } - - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public FieldRules Clone() { - return new FieldRules(this); - } - - /// Field number for the "message" field. - public const int MessageFieldNumber = 17; - private global::Validate.MessageRules message_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Validate.MessageRules Message { - get { return message_; } - set { - message_ = value; - } - } - - /// Field number for the "float" field. - public const int FloatFieldNumber = 1; - /// - /// Scalar Field Types - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Validate.FloatRules Float { - get { return typeCase_ == TypeOneofCase.Float ? (global::Validate.FloatRules) type_ : null; } - set { - type_ = value; - typeCase_ = value == null ? TypeOneofCase.None : TypeOneofCase.Float; - } - } - - /// Field number for the "double" field. - public const int DoubleFieldNumber = 2; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Validate.DoubleRules Double { - get { return typeCase_ == TypeOneofCase.Double ? (global::Validate.DoubleRules) type_ : null; } - set { - type_ = value; - typeCase_ = value == null ? TypeOneofCase.None : TypeOneofCase.Double; - } - } - - /// Field number for the "int32" field. - public const int Int32FieldNumber = 3; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Validate.Int32Rules Int32 { - get { return typeCase_ == TypeOneofCase.Int32 ? (global::Validate.Int32Rules) type_ : null; } - set { - type_ = value; - typeCase_ = value == null ? TypeOneofCase.None : TypeOneofCase.Int32; - } - } - - /// Field number for the "int64" field. - public const int Int64FieldNumber = 4; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Validate.Int64Rules Int64 { - get { return typeCase_ == TypeOneofCase.Int64 ? (global::Validate.Int64Rules) type_ : null; } - set { - type_ = value; - typeCase_ = value == null ? TypeOneofCase.None : TypeOneofCase.Int64; - } - } - - /// Field number for the "uint32" field. - public const int Uint32FieldNumber = 5; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Validate.UInt32Rules Uint32 { - get { return typeCase_ == TypeOneofCase.Uint32 ? (global::Validate.UInt32Rules) type_ : null; } - set { - type_ = value; - typeCase_ = value == null ? TypeOneofCase.None : TypeOneofCase.Uint32; - } - } - - /// Field number for the "uint64" field. - public const int Uint64FieldNumber = 6; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Validate.UInt64Rules Uint64 { - get { return typeCase_ == TypeOneofCase.Uint64 ? (global::Validate.UInt64Rules) type_ : null; } - set { - type_ = value; - typeCase_ = value == null ? TypeOneofCase.None : TypeOneofCase.Uint64; - } - } - - /// Field number for the "sint32" field. - public const int Sint32FieldNumber = 7; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Validate.SInt32Rules Sint32 { - get { return typeCase_ == TypeOneofCase.Sint32 ? (global::Validate.SInt32Rules) type_ : null; } - set { - type_ = value; - typeCase_ = value == null ? TypeOneofCase.None : TypeOneofCase.Sint32; - } - } - - /// Field number for the "sint64" field. - public const int Sint64FieldNumber = 8; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Validate.SInt64Rules Sint64 { - get { return typeCase_ == TypeOneofCase.Sint64 ? (global::Validate.SInt64Rules) type_ : null; } - set { - type_ = value; - typeCase_ = value == null ? TypeOneofCase.None : TypeOneofCase.Sint64; - } - } - - /// Field number for the "fixed32" field. - public const int Fixed32FieldNumber = 9; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Validate.Fixed32Rules Fixed32 { - get { return typeCase_ == TypeOneofCase.Fixed32 ? (global::Validate.Fixed32Rules) type_ : null; } - set { - type_ = value; - typeCase_ = value == null ? TypeOneofCase.None : TypeOneofCase.Fixed32; - } - } - - /// Field number for the "fixed64" field. - public const int Fixed64FieldNumber = 10; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Validate.Fixed64Rules Fixed64 { - get { return typeCase_ == TypeOneofCase.Fixed64 ? (global::Validate.Fixed64Rules) type_ : null; } - set { - type_ = value; - typeCase_ = value == null ? TypeOneofCase.None : TypeOneofCase.Fixed64; - } - } - - /// Field number for the "sfixed32" field. - public const int Sfixed32FieldNumber = 11; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Validate.SFixed32Rules Sfixed32 { - get { return typeCase_ == TypeOneofCase.Sfixed32 ? (global::Validate.SFixed32Rules) type_ : null; } - set { - type_ = value; - typeCase_ = value == null ? TypeOneofCase.None : TypeOneofCase.Sfixed32; - } - } - - /// Field number for the "sfixed64" field. - public const int Sfixed64FieldNumber = 12; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Validate.SFixed64Rules Sfixed64 { - get { return typeCase_ == TypeOneofCase.Sfixed64 ? (global::Validate.SFixed64Rules) type_ : null; } - set { - type_ = value; - typeCase_ = value == null ? TypeOneofCase.None : TypeOneofCase.Sfixed64; - } - } - - /// Field number for the "bool" field. - public const int BoolFieldNumber = 13; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Validate.BoolRules Bool { - get { return typeCase_ == TypeOneofCase.Bool ? (global::Validate.BoolRules) type_ : null; } - set { - type_ = value; - typeCase_ = value == null ? TypeOneofCase.None : TypeOneofCase.Bool; - } - } - - /// Field number for the "string" field. - public const int StringFieldNumber = 14; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Validate.StringRules String { - get { return typeCase_ == TypeOneofCase.String ? (global::Validate.StringRules) type_ : null; } - set { - type_ = value; - typeCase_ = value == null ? TypeOneofCase.None : TypeOneofCase.String; - } - } - - /// Field number for the "bytes" field. - public const int BytesFieldNumber = 15; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Validate.BytesRules Bytes { - get { return typeCase_ == TypeOneofCase.Bytes ? (global::Validate.BytesRules) type_ : null; } - set { - type_ = value; - typeCase_ = value == null ? TypeOneofCase.None : TypeOneofCase.Bytes; - } - } - - /// Field number for the "enum" field. - public const int EnumFieldNumber = 16; - /// - /// Complex Field Types - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Validate.EnumRules Enum { - get { return typeCase_ == TypeOneofCase.Enum ? (global::Validate.EnumRules) type_ : null; } - set { - type_ = value; - typeCase_ = value == null ? TypeOneofCase.None : TypeOneofCase.Enum; - } - } - - /// Field number for the "repeated" field. - public const int RepeatedFieldNumber = 18; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Validate.RepeatedRules Repeated { - get { return typeCase_ == TypeOneofCase.Repeated ? (global::Validate.RepeatedRules) type_ : null; } - set { - type_ = value; - typeCase_ = value == null ? TypeOneofCase.None : TypeOneofCase.Repeated; - } - } - - /// Field number for the "map" field. - public const int MapFieldNumber = 19; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Validate.MapRules Map { - get { return typeCase_ == TypeOneofCase.Map ? (global::Validate.MapRules) type_ : null; } - set { - type_ = value; - typeCase_ = value == null ? TypeOneofCase.None : TypeOneofCase.Map; - } - } - - /// Field number for the "any" field. - public const int AnyFieldNumber = 20; - /// - /// Well-Known Field Types - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Validate.AnyRules Any { - get { return typeCase_ == TypeOneofCase.Any ? (global::Validate.AnyRules) type_ : null; } - set { - type_ = value; - typeCase_ = value == null ? TypeOneofCase.None : TypeOneofCase.Any; - } - } - - /// Field number for the "duration" field. - public const int DurationFieldNumber = 21; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Validate.DurationRules Duration { - get { return typeCase_ == TypeOneofCase.Duration ? (global::Validate.DurationRules) type_ : null; } - set { - type_ = value; - typeCase_ = value == null ? TypeOneofCase.None : TypeOneofCase.Duration; - } - } - - /// Field number for the "timestamp" field. - public const int TimestampFieldNumber = 22; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Validate.TimestampRules Timestamp { - get { return typeCase_ == TypeOneofCase.Timestamp ? (global::Validate.TimestampRules) type_ : null; } - set { - type_ = value; - typeCase_ = value == null ? TypeOneofCase.None : TypeOneofCase.Timestamp; - } - } - - private object type_; - /// Enum of possible cases for the "type" oneof. - public enum TypeOneofCase { - None = 0, - Float = 1, - Double = 2, - Int32 = 3, - Int64 = 4, - Uint32 = 5, - Uint64 = 6, - Sint32 = 7, - Sint64 = 8, - Fixed32 = 9, - Fixed64 = 10, - Sfixed32 = 11, - Sfixed64 = 12, - Bool = 13, - String = 14, - Bytes = 15, - Enum = 16, - Repeated = 18, - Map = 19, - Any = 20, - Duration = 21, - Timestamp = 22, - } - private TypeOneofCase typeCase_ = TypeOneofCase.None; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public TypeOneofCase TypeCase { - get { return typeCase_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearType() { - typeCase_ = TypeOneofCase.None; - type_ = null; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as FieldRules); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(FieldRules other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!object.Equals(Message, other.Message)) return false; - if (!object.Equals(Float, other.Float)) return false; - if (!object.Equals(Double, other.Double)) return false; - if (!object.Equals(Int32, other.Int32)) return false; - if (!object.Equals(Int64, other.Int64)) return false; - if (!object.Equals(Uint32, other.Uint32)) return false; - if (!object.Equals(Uint64, other.Uint64)) return false; - if (!object.Equals(Sint32, other.Sint32)) return false; - if (!object.Equals(Sint64, other.Sint64)) return false; - if (!object.Equals(Fixed32, other.Fixed32)) return false; - if (!object.Equals(Fixed64, other.Fixed64)) return false; - if (!object.Equals(Sfixed32, other.Sfixed32)) return false; - if (!object.Equals(Sfixed64, other.Sfixed64)) return false; - if (!object.Equals(Bool, other.Bool)) return false; - if (!object.Equals(String, other.String)) return false; - if (!object.Equals(Bytes, other.Bytes)) return false; - if (!object.Equals(Enum, other.Enum)) return false; - if (!object.Equals(Repeated, other.Repeated)) return false; - if (!object.Equals(Map, other.Map)) return false; - if (!object.Equals(Any, other.Any)) return false; - if (!object.Equals(Duration, other.Duration)) return false; - if (!object.Equals(Timestamp, other.Timestamp)) return false; - if (TypeCase != other.TypeCase) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (message_ != null) hash ^= Message.GetHashCode(); - if (typeCase_ == TypeOneofCase.Float) hash ^= Float.GetHashCode(); - if (typeCase_ == TypeOneofCase.Double) hash ^= Double.GetHashCode(); - if (typeCase_ == TypeOneofCase.Int32) hash ^= Int32.GetHashCode(); - if (typeCase_ == TypeOneofCase.Int64) hash ^= Int64.GetHashCode(); - if (typeCase_ == TypeOneofCase.Uint32) hash ^= Uint32.GetHashCode(); - if (typeCase_ == TypeOneofCase.Uint64) hash ^= Uint64.GetHashCode(); - if (typeCase_ == TypeOneofCase.Sint32) hash ^= Sint32.GetHashCode(); - if (typeCase_ == TypeOneofCase.Sint64) hash ^= Sint64.GetHashCode(); - if (typeCase_ == TypeOneofCase.Fixed32) hash ^= Fixed32.GetHashCode(); - if (typeCase_ == TypeOneofCase.Fixed64) hash ^= Fixed64.GetHashCode(); - if (typeCase_ == TypeOneofCase.Sfixed32) hash ^= Sfixed32.GetHashCode(); - if (typeCase_ == TypeOneofCase.Sfixed64) hash ^= Sfixed64.GetHashCode(); - if (typeCase_ == TypeOneofCase.Bool) hash ^= Bool.GetHashCode(); - if (typeCase_ == TypeOneofCase.String) hash ^= String.GetHashCode(); - if (typeCase_ == TypeOneofCase.Bytes) hash ^= Bytes.GetHashCode(); - if (typeCase_ == TypeOneofCase.Enum) hash ^= Enum.GetHashCode(); - if (typeCase_ == TypeOneofCase.Repeated) hash ^= Repeated.GetHashCode(); - if (typeCase_ == TypeOneofCase.Map) hash ^= Map.GetHashCode(); - if (typeCase_ == TypeOneofCase.Any) hash ^= Any.GetHashCode(); - if (typeCase_ == TypeOneofCase.Duration) hash ^= Duration.GetHashCode(); - if (typeCase_ == TypeOneofCase.Timestamp) hash ^= Timestamp.GetHashCode(); - hash ^= (int) typeCase_; - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (typeCase_ == TypeOneofCase.Float) { - output.WriteRawTag(10); - output.WriteMessage(Float); - } - if (typeCase_ == TypeOneofCase.Double) { - output.WriteRawTag(18); - output.WriteMessage(Double); - } - if (typeCase_ == TypeOneofCase.Int32) { - output.WriteRawTag(26); - output.WriteMessage(Int32); - } - if (typeCase_ == TypeOneofCase.Int64) { - output.WriteRawTag(34); - output.WriteMessage(Int64); - } - if (typeCase_ == TypeOneofCase.Uint32) { - output.WriteRawTag(42); - output.WriteMessage(Uint32); - } - if (typeCase_ == TypeOneofCase.Uint64) { - output.WriteRawTag(50); - output.WriteMessage(Uint64); - } - if (typeCase_ == TypeOneofCase.Sint32) { - output.WriteRawTag(58); - output.WriteMessage(Sint32); - } - if (typeCase_ == TypeOneofCase.Sint64) { - output.WriteRawTag(66); - output.WriteMessage(Sint64); - } - if (typeCase_ == TypeOneofCase.Fixed32) { - output.WriteRawTag(74); - output.WriteMessage(Fixed32); - } - if (typeCase_ == TypeOneofCase.Fixed64) { - output.WriteRawTag(82); - output.WriteMessage(Fixed64); - } - if (typeCase_ == TypeOneofCase.Sfixed32) { - output.WriteRawTag(90); - output.WriteMessage(Sfixed32); - } - if (typeCase_ == TypeOneofCase.Sfixed64) { - output.WriteRawTag(98); - output.WriteMessage(Sfixed64); - } - if (typeCase_ == TypeOneofCase.Bool) { - output.WriteRawTag(106); - output.WriteMessage(Bool); - } - if (typeCase_ == TypeOneofCase.String) { - output.WriteRawTag(114); - output.WriteMessage(String); - } - if (typeCase_ == TypeOneofCase.Bytes) { - output.WriteRawTag(122); - output.WriteMessage(Bytes); - } - if (typeCase_ == TypeOneofCase.Enum) { - output.WriteRawTag(130, 1); - output.WriteMessage(Enum); - } - if (message_ != null) { - output.WriteRawTag(138, 1); - output.WriteMessage(Message); - } - if (typeCase_ == TypeOneofCase.Repeated) { - output.WriteRawTag(146, 1); - output.WriteMessage(Repeated); - } - if (typeCase_ == TypeOneofCase.Map) { - output.WriteRawTag(154, 1); - output.WriteMessage(Map); - } - if (typeCase_ == TypeOneofCase.Any) { - output.WriteRawTag(162, 1); - output.WriteMessage(Any); - } - if (typeCase_ == TypeOneofCase.Duration) { - output.WriteRawTag(170, 1); - output.WriteMessage(Duration); - } - if (typeCase_ == TypeOneofCase.Timestamp) { - output.WriteRawTag(178, 1); - output.WriteMessage(Timestamp); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (typeCase_ == TypeOneofCase.Float) { - output.WriteRawTag(10); - output.WriteMessage(Float); - } - if (typeCase_ == TypeOneofCase.Double) { - output.WriteRawTag(18); - output.WriteMessage(Double); - } - if (typeCase_ == TypeOneofCase.Int32) { - output.WriteRawTag(26); - output.WriteMessage(Int32); - } - if (typeCase_ == TypeOneofCase.Int64) { - output.WriteRawTag(34); - output.WriteMessage(Int64); - } - if (typeCase_ == TypeOneofCase.Uint32) { - output.WriteRawTag(42); - output.WriteMessage(Uint32); - } - if (typeCase_ == TypeOneofCase.Uint64) { - output.WriteRawTag(50); - output.WriteMessage(Uint64); - } - if (typeCase_ == TypeOneofCase.Sint32) { - output.WriteRawTag(58); - output.WriteMessage(Sint32); - } - if (typeCase_ == TypeOneofCase.Sint64) { - output.WriteRawTag(66); - output.WriteMessage(Sint64); - } - if (typeCase_ == TypeOneofCase.Fixed32) { - output.WriteRawTag(74); - output.WriteMessage(Fixed32); - } - if (typeCase_ == TypeOneofCase.Fixed64) { - output.WriteRawTag(82); - output.WriteMessage(Fixed64); - } - if (typeCase_ == TypeOneofCase.Sfixed32) { - output.WriteRawTag(90); - output.WriteMessage(Sfixed32); - } - if (typeCase_ == TypeOneofCase.Sfixed64) { - output.WriteRawTag(98); - output.WriteMessage(Sfixed64); - } - if (typeCase_ == TypeOneofCase.Bool) { - output.WriteRawTag(106); - output.WriteMessage(Bool); - } - if (typeCase_ == TypeOneofCase.String) { - output.WriteRawTag(114); - output.WriteMessage(String); - } - if (typeCase_ == TypeOneofCase.Bytes) { - output.WriteRawTag(122); - output.WriteMessage(Bytes); - } - if (typeCase_ == TypeOneofCase.Enum) { - output.WriteRawTag(130, 1); - output.WriteMessage(Enum); - } - if (message_ != null) { - output.WriteRawTag(138, 1); - output.WriteMessage(Message); - } - if (typeCase_ == TypeOneofCase.Repeated) { - output.WriteRawTag(146, 1); - output.WriteMessage(Repeated); - } - if (typeCase_ == TypeOneofCase.Map) { - output.WriteRawTag(154, 1); - output.WriteMessage(Map); - } - if (typeCase_ == TypeOneofCase.Any) { - output.WriteRawTag(162, 1); - output.WriteMessage(Any); - } - if (typeCase_ == TypeOneofCase.Duration) { - output.WriteRawTag(170, 1); - output.WriteMessage(Duration); - } - if (typeCase_ == TypeOneofCase.Timestamp) { - output.WriteRawTag(178, 1); - output.WriteMessage(Timestamp); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (message_ != null) { - size += 2 + pb::CodedOutputStream.ComputeMessageSize(Message); - } - if (typeCase_ == TypeOneofCase.Float) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Float); - } - if (typeCase_ == TypeOneofCase.Double) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Double); - } - if (typeCase_ == TypeOneofCase.Int32) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Int32); - } - if (typeCase_ == TypeOneofCase.Int64) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Int64); - } - if (typeCase_ == TypeOneofCase.Uint32) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Uint32); - } - if (typeCase_ == TypeOneofCase.Uint64) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Uint64); - } - if (typeCase_ == TypeOneofCase.Sint32) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Sint32); - } - if (typeCase_ == TypeOneofCase.Sint64) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Sint64); - } - if (typeCase_ == TypeOneofCase.Fixed32) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Fixed32); - } - if (typeCase_ == TypeOneofCase.Fixed64) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Fixed64); - } - if (typeCase_ == TypeOneofCase.Sfixed32) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Sfixed32); - } - if (typeCase_ == TypeOneofCase.Sfixed64) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Sfixed64); - } - if (typeCase_ == TypeOneofCase.Bool) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Bool); - } - if (typeCase_ == TypeOneofCase.String) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(String); - } - if (typeCase_ == TypeOneofCase.Bytes) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Bytes); - } - if (typeCase_ == TypeOneofCase.Enum) { - size += 2 + pb::CodedOutputStream.ComputeMessageSize(Enum); - } - if (typeCase_ == TypeOneofCase.Repeated) { - size += 2 + pb::CodedOutputStream.ComputeMessageSize(Repeated); - } - if (typeCase_ == TypeOneofCase.Map) { - size += 2 + pb::CodedOutputStream.ComputeMessageSize(Map); - } - if (typeCase_ == TypeOneofCase.Any) { - size += 2 + pb::CodedOutputStream.ComputeMessageSize(Any); - } - if (typeCase_ == TypeOneofCase.Duration) { - size += 2 + pb::CodedOutputStream.ComputeMessageSize(Duration); - } - if (typeCase_ == TypeOneofCase.Timestamp) { - size += 2 + pb::CodedOutputStream.ComputeMessageSize(Timestamp); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(FieldRules other) { - if (other == null) { - return; - } - if (other.message_ != null) { - if (message_ == null) { - Message = new global::Validate.MessageRules(); - } - Message.MergeFrom(other.Message); - } - switch (other.TypeCase) { - case TypeOneofCase.Float: - if (Float == null) { - Float = new global::Validate.FloatRules(); - } - Float.MergeFrom(other.Float); - break; - case TypeOneofCase.Double: - if (Double == null) { - Double = new global::Validate.DoubleRules(); - } - Double.MergeFrom(other.Double); - break; - case TypeOneofCase.Int32: - if (Int32 == null) { - Int32 = new global::Validate.Int32Rules(); - } - Int32.MergeFrom(other.Int32); - break; - case TypeOneofCase.Int64: - if (Int64 == null) { - Int64 = new global::Validate.Int64Rules(); - } - Int64.MergeFrom(other.Int64); - break; - case TypeOneofCase.Uint32: - if (Uint32 == null) { - Uint32 = new global::Validate.UInt32Rules(); - } - Uint32.MergeFrom(other.Uint32); - break; - case TypeOneofCase.Uint64: - if (Uint64 == null) { - Uint64 = new global::Validate.UInt64Rules(); - } - Uint64.MergeFrom(other.Uint64); - break; - case TypeOneofCase.Sint32: - if (Sint32 == null) { - Sint32 = new global::Validate.SInt32Rules(); - } - Sint32.MergeFrom(other.Sint32); - break; - case TypeOneofCase.Sint64: - if (Sint64 == null) { - Sint64 = new global::Validate.SInt64Rules(); - } - Sint64.MergeFrom(other.Sint64); - break; - case TypeOneofCase.Fixed32: - if (Fixed32 == null) { - Fixed32 = new global::Validate.Fixed32Rules(); - } - Fixed32.MergeFrom(other.Fixed32); - break; - case TypeOneofCase.Fixed64: - if (Fixed64 == null) { - Fixed64 = new global::Validate.Fixed64Rules(); - } - Fixed64.MergeFrom(other.Fixed64); - break; - case TypeOneofCase.Sfixed32: - if (Sfixed32 == null) { - Sfixed32 = new global::Validate.SFixed32Rules(); - } - Sfixed32.MergeFrom(other.Sfixed32); - break; - case TypeOneofCase.Sfixed64: - if (Sfixed64 == null) { - Sfixed64 = new global::Validate.SFixed64Rules(); - } - Sfixed64.MergeFrom(other.Sfixed64); - break; - case TypeOneofCase.Bool: - if (Bool == null) { - Bool = new global::Validate.BoolRules(); - } - Bool.MergeFrom(other.Bool); - break; - case TypeOneofCase.String: - if (String == null) { - String = new global::Validate.StringRules(); - } - String.MergeFrom(other.String); - break; - case TypeOneofCase.Bytes: - if (Bytes == null) { - Bytes = new global::Validate.BytesRules(); - } - Bytes.MergeFrom(other.Bytes); - break; - case TypeOneofCase.Enum: - if (Enum == null) { - Enum = new global::Validate.EnumRules(); - } - Enum.MergeFrom(other.Enum); - break; - case TypeOneofCase.Repeated: - if (Repeated == null) { - Repeated = new global::Validate.RepeatedRules(); - } - Repeated.MergeFrom(other.Repeated); - break; - case TypeOneofCase.Map: - if (Map == null) { - Map = new global::Validate.MapRules(); - } - Map.MergeFrom(other.Map); - break; - case TypeOneofCase.Any: - if (Any == null) { - Any = new global::Validate.AnyRules(); - } - Any.MergeFrom(other.Any); - break; - case TypeOneofCase.Duration: - if (Duration == null) { - Duration = new global::Validate.DurationRules(); - } - Duration.MergeFrom(other.Duration); - break; - case TypeOneofCase.Timestamp: - if (Timestamp == null) { - Timestamp = new global::Validate.TimestampRules(); - } - Timestamp.MergeFrom(other.Timestamp); - break; - } - - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - global::Validate.FloatRules subBuilder = new global::Validate.FloatRules(); - if (typeCase_ == TypeOneofCase.Float) { - subBuilder.MergeFrom(Float); - } - input.ReadMessage(subBuilder); - Float = subBuilder; - break; - } - case 18: { - global::Validate.DoubleRules subBuilder = new global::Validate.DoubleRules(); - if (typeCase_ == TypeOneofCase.Double) { - subBuilder.MergeFrom(Double); - } - input.ReadMessage(subBuilder); - Double = subBuilder; - break; - } - case 26: { - global::Validate.Int32Rules subBuilder = new global::Validate.Int32Rules(); - if (typeCase_ == TypeOneofCase.Int32) { - subBuilder.MergeFrom(Int32); - } - input.ReadMessage(subBuilder); - Int32 = subBuilder; - break; - } - case 34: { - global::Validate.Int64Rules subBuilder = new global::Validate.Int64Rules(); - if (typeCase_ == TypeOneofCase.Int64) { - subBuilder.MergeFrom(Int64); - } - input.ReadMessage(subBuilder); - Int64 = subBuilder; - break; - } - case 42: { - global::Validate.UInt32Rules subBuilder = new global::Validate.UInt32Rules(); - if (typeCase_ == TypeOneofCase.Uint32) { - subBuilder.MergeFrom(Uint32); - } - input.ReadMessage(subBuilder); - Uint32 = subBuilder; - break; - } - case 50: { - global::Validate.UInt64Rules subBuilder = new global::Validate.UInt64Rules(); - if (typeCase_ == TypeOneofCase.Uint64) { - subBuilder.MergeFrom(Uint64); - } - input.ReadMessage(subBuilder); - Uint64 = subBuilder; - break; - } - case 58: { - global::Validate.SInt32Rules subBuilder = new global::Validate.SInt32Rules(); - if (typeCase_ == TypeOneofCase.Sint32) { - subBuilder.MergeFrom(Sint32); - } - input.ReadMessage(subBuilder); - Sint32 = subBuilder; - break; - } - case 66: { - global::Validate.SInt64Rules subBuilder = new global::Validate.SInt64Rules(); - if (typeCase_ == TypeOneofCase.Sint64) { - subBuilder.MergeFrom(Sint64); - } - input.ReadMessage(subBuilder); - Sint64 = subBuilder; - break; - } - case 74: { - global::Validate.Fixed32Rules subBuilder = new global::Validate.Fixed32Rules(); - if (typeCase_ == TypeOneofCase.Fixed32) { - subBuilder.MergeFrom(Fixed32); - } - input.ReadMessage(subBuilder); - Fixed32 = subBuilder; - break; - } - case 82: { - global::Validate.Fixed64Rules subBuilder = new global::Validate.Fixed64Rules(); - if (typeCase_ == TypeOneofCase.Fixed64) { - subBuilder.MergeFrom(Fixed64); - } - input.ReadMessage(subBuilder); - Fixed64 = subBuilder; - break; - } - case 90: { - global::Validate.SFixed32Rules subBuilder = new global::Validate.SFixed32Rules(); - if (typeCase_ == TypeOneofCase.Sfixed32) { - subBuilder.MergeFrom(Sfixed32); - } - input.ReadMessage(subBuilder); - Sfixed32 = subBuilder; - break; - } - case 98: { - global::Validate.SFixed64Rules subBuilder = new global::Validate.SFixed64Rules(); - if (typeCase_ == TypeOneofCase.Sfixed64) { - subBuilder.MergeFrom(Sfixed64); - } - input.ReadMessage(subBuilder); - Sfixed64 = subBuilder; - break; - } - case 106: { - global::Validate.BoolRules subBuilder = new global::Validate.BoolRules(); - if (typeCase_ == TypeOneofCase.Bool) { - subBuilder.MergeFrom(Bool); - } - input.ReadMessage(subBuilder); - Bool = subBuilder; - break; - } - case 114: { - global::Validate.StringRules subBuilder = new global::Validate.StringRules(); - if (typeCase_ == TypeOneofCase.String) { - subBuilder.MergeFrom(String); - } - input.ReadMessage(subBuilder); - String = subBuilder; - break; - } - case 122: { - global::Validate.BytesRules subBuilder = new global::Validate.BytesRules(); - if (typeCase_ == TypeOneofCase.Bytes) { - subBuilder.MergeFrom(Bytes); - } - input.ReadMessage(subBuilder); - Bytes = subBuilder; - break; - } - case 130: { - global::Validate.EnumRules subBuilder = new global::Validate.EnumRules(); - if (typeCase_ == TypeOneofCase.Enum) { - subBuilder.MergeFrom(Enum); - } - input.ReadMessage(subBuilder); - Enum = subBuilder; - break; - } - case 138: { - if (message_ == null) { - Message = new global::Validate.MessageRules(); - } - input.ReadMessage(Message); - break; - } - case 146: { - global::Validate.RepeatedRules subBuilder = new global::Validate.RepeatedRules(); - if (typeCase_ == TypeOneofCase.Repeated) { - subBuilder.MergeFrom(Repeated); - } - input.ReadMessage(subBuilder); - Repeated = subBuilder; - break; - } - case 154: { - global::Validate.MapRules subBuilder = new global::Validate.MapRules(); - if (typeCase_ == TypeOneofCase.Map) { - subBuilder.MergeFrom(Map); - } - input.ReadMessage(subBuilder); - Map = subBuilder; - break; - } - case 162: { - global::Validate.AnyRules subBuilder = new global::Validate.AnyRules(); - if (typeCase_ == TypeOneofCase.Any) { - subBuilder.MergeFrom(Any); - } - input.ReadMessage(subBuilder); - Any = subBuilder; - break; - } - case 170: { - global::Validate.DurationRules subBuilder = new global::Validate.DurationRules(); - if (typeCase_ == TypeOneofCase.Duration) { - subBuilder.MergeFrom(Duration); - } - input.ReadMessage(subBuilder); - Duration = subBuilder; - break; - } - case 178: { - global::Validate.TimestampRules subBuilder = new global::Validate.TimestampRules(); - if (typeCase_ == TypeOneofCase.Timestamp) { - subBuilder.MergeFrom(Timestamp); - } - input.ReadMessage(subBuilder); - Timestamp = subBuilder; - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - global::Validate.FloatRules subBuilder = new global::Validate.FloatRules(); - if (typeCase_ == TypeOneofCase.Float) { - subBuilder.MergeFrom(Float); - } - input.ReadMessage(subBuilder); - Float = subBuilder; - break; - } - case 18: { - global::Validate.DoubleRules subBuilder = new global::Validate.DoubleRules(); - if (typeCase_ == TypeOneofCase.Double) { - subBuilder.MergeFrom(Double); - } - input.ReadMessage(subBuilder); - Double = subBuilder; - break; - } - case 26: { - global::Validate.Int32Rules subBuilder = new global::Validate.Int32Rules(); - if (typeCase_ == TypeOneofCase.Int32) { - subBuilder.MergeFrom(Int32); - } - input.ReadMessage(subBuilder); - Int32 = subBuilder; - break; - } - case 34: { - global::Validate.Int64Rules subBuilder = new global::Validate.Int64Rules(); - if (typeCase_ == TypeOneofCase.Int64) { - subBuilder.MergeFrom(Int64); - } - input.ReadMessage(subBuilder); - Int64 = subBuilder; - break; - } - case 42: { - global::Validate.UInt32Rules subBuilder = new global::Validate.UInt32Rules(); - if (typeCase_ == TypeOneofCase.Uint32) { - subBuilder.MergeFrom(Uint32); - } - input.ReadMessage(subBuilder); - Uint32 = subBuilder; - break; - } - case 50: { - global::Validate.UInt64Rules subBuilder = new global::Validate.UInt64Rules(); - if (typeCase_ == TypeOneofCase.Uint64) { - subBuilder.MergeFrom(Uint64); - } - input.ReadMessage(subBuilder); - Uint64 = subBuilder; - break; - } - case 58: { - global::Validate.SInt32Rules subBuilder = new global::Validate.SInt32Rules(); - if (typeCase_ == TypeOneofCase.Sint32) { - subBuilder.MergeFrom(Sint32); - } - input.ReadMessage(subBuilder); - Sint32 = subBuilder; - break; - } - case 66: { - global::Validate.SInt64Rules subBuilder = new global::Validate.SInt64Rules(); - if (typeCase_ == TypeOneofCase.Sint64) { - subBuilder.MergeFrom(Sint64); - } - input.ReadMessage(subBuilder); - Sint64 = subBuilder; - break; - } - case 74: { - global::Validate.Fixed32Rules subBuilder = new global::Validate.Fixed32Rules(); - if (typeCase_ == TypeOneofCase.Fixed32) { - subBuilder.MergeFrom(Fixed32); - } - input.ReadMessage(subBuilder); - Fixed32 = subBuilder; - break; - } - case 82: { - global::Validate.Fixed64Rules subBuilder = new global::Validate.Fixed64Rules(); - if (typeCase_ == TypeOneofCase.Fixed64) { - subBuilder.MergeFrom(Fixed64); - } - input.ReadMessage(subBuilder); - Fixed64 = subBuilder; - break; - } - case 90: { - global::Validate.SFixed32Rules subBuilder = new global::Validate.SFixed32Rules(); - if (typeCase_ == TypeOneofCase.Sfixed32) { - subBuilder.MergeFrom(Sfixed32); - } - input.ReadMessage(subBuilder); - Sfixed32 = subBuilder; - break; - } - case 98: { - global::Validate.SFixed64Rules subBuilder = new global::Validate.SFixed64Rules(); - if (typeCase_ == TypeOneofCase.Sfixed64) { - subBuilder.MergeFrom(Sfixed64); - } - input.ReadMessage(subBuilder); - Sfixed64 = subBuilder; - break; - } - case 106: { - global::Validate.BoolRules subBuilder = new global::Validate.BoolRules(); - if (typeCase_ == TypeOneofCase.Bool) { - subBuilder.MergeFrom(Bool); - } - input.ReadMessage(subBuilder); - Bool = subBuilder; - break; - } - case 114: { - global::Validate.StringRules subBuilder = new global::Validate.StringRules(); - if (typeCase_ == TypeOneofCase.String) { - subBuilder.MergeFrom(String); - } - input.ReadMessage(subBuilder); - String = subBuilder; - break; - } - case 122: { - global::Validate.BytesRules subBuilder = new global::Validate.BytesRules(); - if (typeCase_ == TypeOneofCase.Bytes) { - subBuilder.MergeFrom(Bytes); - } - input.ReadMessage(subBuilder); - Bytes = subBuilder; - break; - } - case 130: { - global::Validate.EnumRules subBuilder = new global::Validate.EnumRules(); - if (typeCase_ == TypeOneofCase.Enum) { - subBuilder.MergeFrom(Enum); - } - input.ReadMessage(subBuilder); - Enum = subBuilder; - break; - } - case 138: { - if (message_ == null) { - Message = new global::Validate.MessageRules(); - } - input.ReadMessage(Message); - break; - } - case 146: { - global::Validate.RepeatedRules subBuilder = new global::Validate.RepeatedRules(); - if (typeCase_ == TypeOneofCase.Repeated) { - subBuilder.MergeFrom(Repeated); - } - input.ReadMessage(subBuilder); - Repeated = subBuilder; - break; - } - case 154: { - global::Validate.MapRules subBuilder = new global::Validate.MapRules(); - if (typeCase_ == TypeOneofCase.Map) { - subBuilder.MergeFrom(Map); - } - input.ReadMessage(subBuilder); - Map = subBuilder; - break; - } - case 162: { - global::Validate.AnyRules subBuilder = new global::Validate.AnyRules(); - if (typeCase_ == TypeOneofCase.Any) { - subBuilder.MergeFrom(Any); - } - input.ReadMessage(subBuilder); - Any = subBuilder; - break; - } - case 170: { - global::Validate.DurationRules subBuilder = new global::Validate.DurationRules(); - if (typeCase_ == TypeOneofCase.Duration) { - subBuilder.MergeFrom(Duration); - } - input.ReadMessage(subBuilder); - Duration = subBuilder; - break; - } - case 178: { - global::Validate.TimestampRules subBuilder = new global::Validate.TimestampRules(); - if (typeCase_ == TypeOneofCase.Timestamp) { - subBuilder.MergeFrom(Timestamp); - } - input.ReadMessage(subBuilder); - Timestamp = subBuilder; - break; - } - } - } - } - #endif - - } - - /// - /// FloatRules describes the constraints applied to `float` values - /// - public sealed partial class FloatRules : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FloatRules()); - private pb::UnknownFieldSet _unknownFields; - private int _hasBits0; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::Validate.ValidateReflection.Descriptor.MessageTypes[1]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public FloatRules() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public FloatRules(FloatRules other) : this() { - _hasBits0 = other._hasBits0; - const_ = other.const_; - lt_ = other.lt_; - lte_ = other.lte_; - gt_ = other.gt_; - gte_ = other.gte_; - in_ = other.in_.Clone(); - notIn_ = other.notIn_.Clone(); - ignoreEmpty_ = other.ignoreEmpty_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public FloatRules Clone() { - return new FloatRules(this); - } - - /// Field number for the "const" field. - public const int ConstFieldNumber = 1; - private readonly static float ConstDefaultValue = 0F; - - private float const_; - /// - /// Const specifies that this field must be exactly the specified value - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float Const { - get { if ((_hasBits0 & 1) != 0) { return const_; } else { return ConstDefaultValue; } } - set { - _hasBits0 |= 1; - const_ = value; - } - } - /// Gets whether the "const" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasConst { - get { return (_hasBits0 & 1) != 0; } - } - /// Clears the value of the "const" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearConst() { - _hasBits0 &= ~1; - } - - /// Field number for the "lt" field. - public const int LtFieldNumber = 2; - private readonly static float LtDefaultValue = 0F; - - private float lt_; - /// - /// Lt specifies that this field must be less than the specified value, - /// exclusive - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float Lt { - get { if ((_hasBits0 & 2) != 0) { return lt_; } else { return LtDefaultValue; } } - set { - _hasBits0 |= 2; - lt_ = value; - } - } - /// Gets whether the "lt" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasLt { - get { return (_hasBits0 & 2) != 0; } - } - /// Clears the value of the "lt" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearLt() { - _hasBits0 &= ~2; - } - - /// Field number for the "lte" field. - public const int LteFieldNumber = 3; - private readonly static float LteDefaultValue = 0F; - - private float lte_; - /// - /// Lte specifies that this field must be less than or equal to the - /// specified value, inclusive - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float Lte { - get { if ((_hasBits0 & 4) != 0) { return lte_; } else { return LteDefaultValue; } } - set { - _hasBits0 |= 4; - lte_ = value; - } - } - /// Gets whether the "lte" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasLte { - get { return (_hasBits0 & 4) != 0; } - } - /// Clears the value of the "lte" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearLte() { - _hasBits0 &= ~4; - } - - /// Field number for the "gt" field. - public const int GtFieldNumber = 4; - private readonly static float GtDefaultValue = 0F; - - private float gt_; - /// - /// Gt specifies that this field must be greater than the specified value, - /// exclusive. If the value of Gt is larger than a specified Lt or Lte, the - /// range is reversed. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float Gt { - get { if ((_hasBits0 & 8) != 0) { return gt_; } else { return GtDefaultValue; } } - set { - _hasBits0 |= 8; - gt_ = value; - } - } - /// Gets whether the "gt" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasGt { - get { return (_hasBits0 & 8) != 0; } - } - /// Clears the value of the "gt" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearGt() { - _hasBits0 &= ~8; - } - - /// Field number for the "gte" field. - public const int GteFieldNumber = 5; - private readonly static float GteDefaultValue = 0F; - - private float gte_; - /// - /// Gte specifies that this field must be greater than or equal to the - /// specified value, inclusive. If the value of Gte is larger than a - /// specified Lt or Lte, the range is reversed. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float Gte { - get { if ((_hasBits0 & 16) != 0) { return gte_; } else { return GteDefaultValue; } } - set { - _hasBits0 |= 16; - gte_ = value; - } - } - /// Gets whether the "gte" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasGte { - get { return (_hasBits0 & 16) != 0; } - } - /// Clears the value of the "gte" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearGte() { - _hasBits0 &= ~16; - } - - /// Field number for the "in" field. - public const int InFieldNumber = 6; - private static readonly pb::FieldCodec _repeated_in_codec - = pb::FieldCodec.ForFloat(53); - private readonly pbc::RepeatedField in_ = new pbc::RepeatedField(); - /// - /// In specifies that this field must be equal to one of the specified - /// values - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField In { - get { return in_; } - } - - /// Field number for the "not_in" field. - public const int NotInFieldNumber = 7; - private static readonly pb::FieldCodec _repeated_notIn_codec - = pb::FieldCodec.ForFloat(61); - private readonly pbc::RepeatedField notIn_ = new pbc::RepeatedField(); - /// - /// NotIn specifies that this field cannot be equal to one of the specified - /// values - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField NotIn { - get { return notIn_; } - } - - /// Field number for the "ignore_empty" field. - public const int IgnoreEmptyFieldNumber = 8; - private readonly static bool IgnoreEmptyDefaultValue = false; - - private bool ignoreEmpty_; - /// - /// IgnoreEmpty specifies that the validation rules of this field should be - /// evaluated only if the field is not empty - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool IgnoreEmpty { - get { if ((_hasBits0 & 32) != 0) { return ignoreEmpty_; } else { return IgnoreEmptyDefaultValue; } } - set { - _hasBits0 |= 32; - ignoreEmpty_ = value; - } - } - /// Gets whether the "ignore_empty" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasIgnoreEmpty { - get { return (_hasBits0 & 32) != 0; } - } - /// Clears the value of the "ignore_empty" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearIgnoreEmpty() { - _hasBits0 &= ~32; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as FloatRules); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(FloatRules other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Const, other.Const)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Lt, other.Lt)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Lte, other.Lte)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Gt, other.Gt)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Gte, other.Gte)) return false; - if(!in_.Equals(other.in_)) return false; - if(!notIn_.Equals(other.notIn_)) return false; - if (IgnoreEmpty != other.IgnoreEmpty) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (HasConst) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Const); - if (HasLt) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Lt); - if (HasLte) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Lte); - if (HasGt) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Gt); - if (HasGte) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Gte); - hash ^= in_.GetHashCode(); - hash ^= notIn_.GetHashCode(); - if (HasIgnoreEmpty) hash ^= IgnoreEmpty.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (HasConst) { - output.WriteRawTag(13); - output.WriteFloat(Const); - } - if (HasLt) { - output.WriteRawTag(21); - output.WriteFloat(Lt); - } - if (HasLte) { - output.WriteRawTag(29); - output.WriteFloat(Lte); - } - if (HasGt) { - output.WriteRawTag(37); - output.WriteFloat(Gt); - } - if (HasGte) { - output.WriteRawTag(45); - output.WriteFloat(Gte); - } - in_.WriteTo(output, _repeated_in_codec); - notIn_.WriteTo(output, _repeated_notIn_codec); - if (HasIgnoreEmpty) { - output.WriteRawTag(64); - output.WriteBool(IgnoreEmpty); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (HasConst) { - output.WriteRawTag(13); - output.WriteFloat(Const); - } - if (HasLt) { - output.WriteRawTag(21); - output.WriteFloat(Lt); - } - if (HasLte) { - output.WriteRawTag(29); - output.WriteFloat(Lte); - } - if (HasGt) { - output.WriteRawTag(37); - output.WriteFloat(Gt); - } - if (HasGte) { - output.WriteRawTag(45); - output.WriteFloat(Gte); - } - in_.WriteTo(ref output, _repeated_in_codec); - notIn_.WriteTo(ref output, _repeated_notIn_codec); - if (HasIgnoreEmpty) { - output.WriteRawTag(64); - output.WriteBool(IgnoreEmpty); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (HasConst) { - size += 1 + 4; - } - if (HasLt) { - size += 1 + 4; - } - if (HasLte) { - size += 1 + 4; - } - if (HasGt) { - size += 1 + 4; - } - if (HasGte) { - size += 1 + 4; - } - size += in_.CalculateSize(_repeated_in_codec); - size += notIn_.CalculateSize(_repeated_notIn_codec); - if (HasIgnoreEmpty) { - size += 1 + 1; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(FloatRules other) { - if (other == null) { - return; - } - if (other.HasConst) { - Const = other.Const; - } - if (other.HasLt) { - Lt = other.Lt; - } - if (other.HasLte) { - Lte = other.Lte; - } - if (other.HasGt) { - Gt = other.Gt; - } - if (other.HasGte) { - Gte = other.Gte; - } - in_.Add(other.in_); - notIn_.Add(other.notIn_); - if (other.HasIgnoreEmpty) { - IgnoreEmpty = other.IgnoreEmpty; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 13: { - Const = input.ReadFloat(); - break; - } - case 21: { - Lt = input.ReadFloat(); - break; - } - case 29: { - Lte = input.ReadFloat(); - break; - } - case 37: { - Gt = input.ReadFloat(); - break; - } - case 45: { - Gte = input.ReadFloat(); - break; - } - case 50: - case 53: { - in_.AddEntriesFrom(input, _repeated_in_codec); - break; - } - case 58: - case 61: { - notIn_.AddEntriesFrom(input, _repeated_notIn_codec); - break; - } - case 64: { - IgnoreEmpty = input.ReadBool(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 13: { - Const = input.ReadFloat(); - break; - } - case 21: { - Lt = input.ReadFloat(); - break; - } - case 29: { - Lte = input.ReadFloat(); - break; - } - case 37: { - Gt = input.ReadFloat(); - break; - } - case 45: { - Gte = input.ReadFloat(); - break; - } - case 50: - case 53: { - in_.AddEntriesFrom(ref input, _repeated_in_codec); - break; - } - case 58: - case 61: { - notIn_.AddEntriesFrom(ref input, _repeated_notIn_codec); - break; - } - case 64: { - IgnoreEmpty = input.ReadBool(); - break; - } - } - } - } - #endif - - } - - /// - /// DoubleRules describes the constraints applied to `double` values - /// - public sealed partial class DoubleRules : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DoubleRules()); - private pb::UnknownFieldSet _unknownFields; - private int _hasBits0; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::Validate.ValidateReflection.Descriptor.MessageTypes[2]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public DoubleRules() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public DoubleRules(DoubleRules other) : this() { - _hasBits0 = other._hasBits0; - const_ = other.const_; - lt_ = other.lt_; - lte_ = other.lte_; - gt_ = other.gt_; - gte_ = other.gte_; - in_ = other.in_.Clone(); - notIn_ = other.notIn_.Clone(); - ignoreEmpty_ = other.ignoreEmpty_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public DoubleRules Clone() { - return new DoubleRules(this); - } - - /// Field number for the "const" field. - public const int ConstFieldNumber = 1; - private readonly static double ConstDefaultValue = 0D; - - private double const_; - /// - /// Const specifies that this field must be exactly the specified value - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double Const { - get { if ((_hasBits0 & 1) != 0) { return const_; } else { return ConstDefaultValue; } } - set { - _hasBits0 |= 1; - const_ = value; - } - } - /// Gets whether the "const" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasConst { - get { return (_hasBits0 & 1) != 0; } - } - /// Clears the value of the "const" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearConst() { - _hasBits0 &= ~1; - } - - /// Field number for the "lt" field. - public const int LtFieldNumber = 2; - private readonly static double LtDefaultValue = 0D; - - private double lt_; - /// - /// Lt specifies that this field must be less than the specified value, - /// exclusive - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double Lt { - get { if ((_hasBits0 & 2) != 0) { return lt_; } else { return LtDefaultValue; } } - set { - _hasBits0 |= 2; - lt_ = value; - } - } - /// Gets whether the "lt" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasLt { - get { return (_hasBits0 & 2) != 0; } - } - /// Clears the value of the "lt" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearLt() { - _hasBits0 &= ~2; - } - - /// Field number for the "lte" field. - public const int LteFieldNumber = 3; - private readonly static double LteDefaultValue = 0D; - - private double lte_; - /// - /// Lte specifies that this field must be less than or equal to the - /// specified value, inclusive - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double Lte { - get { if ((_hasBits0 & 4) != 0) { return lte_; } else { return LteDefaultValue; } } - set { - _hasBits0 |= 4; - lte_ = value; - } - } - /// Gets whether the "lte" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasLte { - get { return (_hasBits0 & 4) != 0; } - } - /// Clears the value of the "lte" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearLte() { - _hasBits0 &= ~4; - } - - /// Field number for the "gt" field. - public const int GtFieldNumber = 4; - private readonly static double GtDefaultValue = 0D; - - private double gt_; - /// - /// Gt specifies that this field must be greater than the specified value, - /// exclusive. If the value of Gt is larger than a specified Lt or Lte, the - /// range is reversed. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double Gt { - get { if ((_hasBits0 & 8) != 0) { return gt_; } else { return GtDefaultValue; } } - set { - _hasBits0 |= 8; - gt_ = value; - } - } - /// Gets whether the "gt" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasGt { - get { return (_hasBits0 & 8) != 0; } - } - /// Clears the value of the "gt" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearGt() { - _hasBits0 &= ~8; - } - - /// Field number for the "gte" field. - public const int GteFieldNumber = 5; - private readonly static double GteDefaultValue = 0D; - - private double gte_; - /// - /// Gte specifies that this field must be greater than or equal to the - /// specified value, inclusive. If the value of Gte is larger than a - /// specified Lt or Lte, the range is reversed. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double Gte { - get { if ((_hasBits0 & 16) != 0) { return gte_; } else { return GteDefaultValue; } } - set { - _hasBits0 |= 16; - gte_ = value; - } - } - /// Gets whether the "gte" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasGte { - get { return (_hasBits0 & 16) != 0; } - } - /// Clears the value of the "gte" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearGte() { - _hasBits0 &= ~16; - } - - /// Field number for the "in" field. - public const int InFieldNumber = 6; - private static readonly pb::FieldCodec _repeated_in_codec - = pb::FieldCodec.ForDouble(49); - private readonly pbc::RepeatedField in_ = new pbc::RepeatedField(); - /// - /// In specifies that this field must be equal to one of the specified - /// values - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField In { - get { return in_; } - } - - /// Field number for the "not_in" field. - public const int NotInFieldNumber = 7; - private static readonly pb::FieldCodec _repeated_notIn_codec - = pb::FieldCodec.ForDouble(57); - private readonly pbc::RepeatedField notIn_ = new pbc::RepeatedField(); - /// - /// NotIn specifies that this field cannot be equal to one of the specified - /// values - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField NotIn { - get { return notIn_; } - } - - /// Field number for the "ignore_empty" field. - public const int IgnoreEmptyFieldNumber = 8; - private readonly static bool IgnoreEmptyDefaultValue = false; - - private bool ignoreEmpty_; - /// - /// IgnoreEmpty specifies that the validation rules of this field should be - /// evaluated only if the field is not empty - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool IgnoreEmpty { - get { if ((_hasBits0 & 32) != 0) { return ignoreEmpty_; } else { return IgnoreEmptyDefaultValue; } } - set { - _hasBits0 |= 32; - ignoreEmpty_ = value; - } - } - /// Gets whether the "ignore_empty" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasIgnoreEmpty { - get { return (_hasBits0 & 32) != 0; } - } - /// Clears the value of the "ignore_empty" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearIgnoreEmpty() { - _hasBits0 &= ~32; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as DoubleRules); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(DoubleRules other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(Const, other.Const)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(Lt, other.Lt)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(Lte, other.Lte)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(Gt, other.Gt)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(Gte, other.Gte)) return false; - if(!in_.Equals(other.in_)) return false; - if(!notIn_.Equals(other.notIn_)) return false; - if (IgnoreEmpty != other.IgnoreEmpty) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (HasConst) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(Const); - if (HasLt) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(Lt); - if (HasLte) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(Lte); - if (HasGt) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(Gt); - if (HasGte) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(Gte); - hash ^= in_.GetHashCode(); - hash ^= notIn_.GetHashCode(); - if (HasIgnoreEmpty) hash ^= IgnoreEmpty.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (HasConst) { - output.WriteRawTag(9); - output.WriteDouble(Const); - } - if (HasLt) { - output.WriteRawTag(17); - output.WriteDouble(Lt); - } - if (HasLte) { - output.WriteRawTag(25); - output.WriteDouble(Lte); - } - if (HasGt) { - output.WriteRawTag(33); - output.WriteDouble(Gt); - } - if (HasGte) { - output.WriteRawTag(41); - output.WriteDouble(Gte); - } - in_.WriteTo(output, _repeated_in_codec); - notIn_.WriteTo(output, _repeated_notIn_codec); - if (HasIgnoreEmpty) { - output.WriteRawTag(64); - output.WriteBool(IgnoreEmpty); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (HasConst) { - output.WriteRawTag(9); - output.WriteDouble(Const); - } - if (HasLt) { - output.WriteRawTag(17); - output.WriteDouble(Lt); - } - if (HasLte) { - output.WriteRawTag(25); - output.WriteDouble(Lte); - } - if (HasGt) { - output.WriteRawTag(33); - output.WriteDouble(Gt); - } - if (HasGte) { - output.WriteRawTag(41); - output.WriteDouble(Gte); - } - in_.WriteTo(ref output, _repeated_in_codec); - notIn_.WriteTo(ref output, _repeated_notIn_codec); - if (HasIgnoreEmpty) { - output.WriteRawTag(64); - output.WriteBool(IgnoreEmpty); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (HasConst) { - size += 1 + 8; - } - if (HasLt) { - size += 1 + 8; - } - if (HasLte) { - size += 1 + 8; - } - if (HasGt) { - size += 1 + 8; - } - if (HasGte) { - size += 1 + 8; - } - size += in_.CalculateSize(_repeated_in_codec); - size += notIn_.CalculateSize(_repeated_notIn_codec); - if (HasIgnoreEmpty) { - size += 1 + 1; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(DoubleRules other) { - if (other == null) { - return; - } - if (other.HasConst) { - Const = other.Const; - } - if (other.HasLt) { - Lt = other.Lt; - } - if (other.HasLte) { - Lte = other.Lte; - } - if (other.HasGt) { - Gt = other.Gt; - } - if (other.HasGte) { - Gte = other.Gte; - } - in_.Add(other.in_); - notIn_.Add(other.notIn_); - if (other.HasIgnoreEmpty) { - IgnoreEmpty = other.IgnoreEmpty; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 9: { - Const = input.ReadDouble(); - break; - } - case 17: { - Lt = input.ReadDouble(); - break; - } - case 25: { - Lte = input.ReadDouble(); - break; - } - case 33: { - Gt = input.ReadDouble(); - break; - } - case 41: { - Gte = input.ReadDouble(); - break; - } - case 50: - case 49: { - in_.AddEntriesFrom(input, _repeated_in_codec); - break; - } - case 58: - case 57: { - notIn_.AddEntriesFrom(input, _repeated_notIn_codec); - break; - } - case 64: { - IgnoreEmpty = input.ReadBool(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 9: { - Const = input.ReadDouble(); - break; - } - case 17: { - Lt = input.ReadDouble(); - break; - } - case 25: { - Lte = input.ReadDouble(); - break; - } - case 33: { - Gt = input.ReadDouble(); - break; - } - case 41: { - Gte = input.ReadDouble(); - break; - } - case 50: - case 49: { - in_.AddEntriesFrom(ref input, _repeated_in_codec); - break; - } - case 58: - case 57: { - notIn_.AddEntriesFrom(ref input, _repeated_notIn_codec); - break; - } - case 64: { - IgnoreEmpty = input.ReadBool(); - break; - } - } - } - } - #endif - - } - - /// - /// Int32Rules describes the constraints applied to `int32` values - /// - public sealed partial class Int32Rules : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Int32Rules()); - private pb::UnknownFieldSet _unknownFields; - private int _hasBits0; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::Validate.ValidateReflection.Descriptor.MessageTypes[3]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Int32Rules() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Int32Rules(Int32Rules other) : this() { - _hasBits0 = other._hasBits0; - const_ = other.const_; - lt_ = other.lt_; - lte_ = other.lte_; - gt_ = other.gt_; - gte_ = other.gte_; - in_ = other.in_.Clone(); - notIn_ = other.notIn_.Clone(); - ignoreEmpty_ = other.ignoreEmpty_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Int32Rules Clone() { - return new Int32Rules(this); - } - - /// Field number for the "const" field. - public const int ConstFieldNumber = 1; - private readonly static int ConstDefaultValue = 0; - - private int const_; - /// - /// Const specifies that this field must be exactly the specified value - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int Const { - get { if ((_hasBits0 & 1) != 0) { return const_; } else { return ConstDefaultValue; } } - set { - _hasBits0 |= 1; - const_ = value; - } - } - /// Gets whether the "const" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasConst { - get { return (_hasBits0 & 1) != 0; } - } - /// Clears the value of the "const" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearConst() { - _hasBits0 &= ~1; - } - - /// Field number for the "lt" field. - public const int LtFieldNumber = 2; - private readonly static int LtDefaultValue = 0; - - private int lt_; - /// - /// Lt specifies that this field must be less than the specified value, - /// exclusive - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int Lt { - get { if ((_hasBits0 & 2) != 0) { return lt_; } else { return LtDefaultValue; } } - set { - _hasBits0 |= 2; - lt_ = value; - } - } - /// Gets whether the "lt" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasLt { - get { return (_hasBits0 & 2) != 0; } - } - /// Clears the value of the "lt" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearLt() { - _hasBits0 &= ~2; - } - - /// Field number for the "lte" field. - public const int LteFieldNumber = 3; - private readonly static int LteDefaultValue = 0; - - private int lte_; - /// - /// Lte specifies that this field must be less than or equal to the - /// specified value, inclusive - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int Lte { - get { if ((_hasBits0 & 4) != 0) { return lte_; } else { return LteDefaultValue; } } - set { - _hasBits0 |= 4; - lte_ = value; - } - } - /// Gets whether the "lte" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasLte { - get { return (_hasBits0 & 4) != 0; } - } - /// Clears the value of the "lte" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearLte() { - _hasBits0 &= ~4; - } - - /// Field number for the "gt" field. - public const int GtFieldNumber = 4; - private readonly static int GtDefaultValue = 0; - - private int gt_; - /// - /// Gt specifies that this field must be greater than the specified value, - /// exclusive. If the value of Gt is larger than a specified Lt or Lte, the - /// range is reversed. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int Gt { - get { if ((_hasBits0 & 8) != 0) { return gt_; } else { return GtDefaultValue; } } - set { - _hasBits0 |= 8; - gt_ = value; - } - } - /// Gets whether the "gt" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasGt { - get { return (_hasBits0 & 8) != 0; } - } - /// Clears the value of the "gt" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearGt() { - _hasBits0 &= ~8; - } - - /// Field number for the "gte" field. - public const int GteFieldNumber = 5; - private readonly static int GteDefaultValue = 0; - - private int gte_; - /// - /// Gte specifies that this field must be greater than or equal to the - /// specified value, inclusive. If the value of Gte is larger than a - /// specified Lt or Lte, the range is reversed. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int Gte { - get { if ((_hasBits0 & 16) != 0) { return gte_; } else { return GteDefaultValue; } } - set { - _hasBits0 |= 16; - gte_ = value; - } - } - /// Gets whether the "gte" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasGte { - get { return (_hasBits0 & 16) != 0; } - } - /// Clears the value of the "gte" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearGte() { - _hasBits0 &= ~16; - } - - /// Field number for the "in" field. - public const int InFieldNumber = 6; - private static readonly pb::FieldCodec _repeated_in_codec - = pb::FieldCodec.ForInt32(48); - private readonly pbc::RepeatedField in_ = new pbc::RepeatedField(); - /// - /// In specifies that this field must be equal to one of the specified - /// values - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField In { - get { return in_; } - } - - /// Field number for the "not_in" field. - public const int NotInFieldNumber = 7; - private static readonly pb::FieldCodec _repeated_notIn_codec - = pb::FieldCodec.ForInt32(56); - private readonly pbc::RepeatedField notIn_ = new pbc::RepeatedField(); - /// - /// NotIn specifies that this field cannot be equal to one of the specified - /// values - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField NotIn { - get { return notIn_; } - } - - /// Field number for the "ignore_empty" field. - public const int IgnoreEmptyFieldNumber = 8; - private readonly static bool IgnoreEmptyDefaultValue = false; - - private bool ignoreEmpty_; - /// - /// IgnoreEmpty specifies that the validation rules of this field should be - /// evaluated only if the field is not empty - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool IgnoreEmpty { - get { if ((_hasBits0 & 32) != 0) { return ignoreEmpty_; } else { return IgnoreEmptyDefaultValue; } } - set { - _hasBits0 |= 32; - ignoreEmpty_ = value; - } - } - /// Gets whether the "ignore_empty" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasIgnoreEmpty { - get { return (_hasBits0 & 32) != 0; } - } - /// Clears the value of the "ignore_empty" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearIgnoreEmpty() { - _hasBits0 &= ~32; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as Int32Rules); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(Int32Rules other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Const != other.Const) return false; - if (Lt != other.Lt) return false; - if (Lte != other.Lte) return false; - if (Gt != other.Gt) return false; - if (Gte != other.Gte) return false; - if(!in_.Equals(other.in_)) return false; - if(!notIn_.Equals(other.notIn_)) return false; - if (IgnoreEmpty != other.IgnoreEmpty) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (HasConst) hash ^= Const.GetHashCode(); - if (HasLt) hash ^= Lt.GetHashCode(); - if (HasLte) hash ^= Lte.GetHashCode(); - if (HasGt) hash ^= Gt.GetHashCode(); - if (HasGte) hash ^= Gte.GetHashCode(); - hash ^= in_.GetHashCode(); - hash ^= notIn_.GetHashCode(); - if (HasIgnoreEmpty) hash ^= IgnoreEmpty.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (HasConst) { - output.WriteRawTag(8); - output.WriteInt32(Const); - } - if (HasLt) { - output.WriteRawTag(16); - output.WriteInt32(Lt); - } - if (HasLte) { - output.WriteRawTag(24); - output.WriteInt32(Lte); - } - if (HasGt) { - output.WriteRawTag(32); - output.WriteInt32(Gt); - } - if (HasGte) { - output.WriteRawTag(40); - output.WriteInt32(Gte); - } - in_.WriteTo(output, _repeated_in_codec); - notIn_.WriteTo(output, _repeated_notIn_codec); - if (HasIgnoreEmpty) { - output.WriteRawTag(64); - output.WriteBool(IgnoreEmpty); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (HasConst) { - output.WriteRawTag(8); - output.WriteInt32(Const); - } - if (HasLt) { - output.WriteRawTag(16); - output.WriteInt32(Lt); - } - if (HasLte) { - output.WriteRawTag(24); - output.WriteInt32(Lte); - } - if (HasGt) { - output.WriteRawTag(32); - output.WriteInt32(Gt); - } - if (HasGte) { - output.WriteRawTag(40); - output.WriteInt32(Gte); - } - in_.WriteTo(ref output, _repeated_in_codec); - notIn_.WriteTo(ref output, _repeated_notIn_codec); - if (HasIgnoreEmpty) { - output.WriteRawTag(64); - output.WriteBool(IgnoreEmpty); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (HasConst) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(Const); - } - if (HasLt) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(Lt); - } - if (HasLte) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(Lte); - } - if (HasGt) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(Gt); - } - if (HasGte) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(Gte); - } - size += in_.CalculateSize(_repeated_in_codec); - size += notIn_.CalculateSize(_repeated_notIn_codec); - if (HasIgnoreEmpty) { - size += 1 + 1; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(Int32Rules other) { - if (other == null) { - return; - } - if (other.HasConst) { - Const = other.Const; - } - if (other.HasLt) { - Lt = other.Lt; - } - if (other.HasLte) { - Lte = other.Lte; - } - if (other.HasGt) { - Gt = other.Gt; - } - if (other.HasGte) { - Gte = other.Gte; - } - in_.Add(other.in_); - notIn_.Add(other.notIn_); - if (other.HasIgnoreEmpty) { - IgnoreEmpty = other.IgnoreEmpty; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 8: { - Const = input.ReadInt32(); - break; - } - case 16: { - Lt = input.ReadInt32(); - break; - } - case 24: { - Lte = input.ReadInt32(); - break; - } - case 32: { - Gt = input.ReadInt32(); - break; - } - case 40: { - Gte = input.ReadInt32(); - break; - } - case 50: - case 48: { - in_.AddEntriesFrom(input, _repeated_in_codec); - break; - } - case 58: - case 56: { - notIn_.AddEntriesFrom(input, _repeated_notIn_codec); - break; - } - case 64: { - IgnoreEmpty = input.ReadBool(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 8: { - Const = input.ReadInt32(); - break; - } - case 16: { - Lt = input.ReadInt32(); - break; - } - case 24: { - Lte = input.ReadInt32(); - break; - } - case 32: { - Gt = input.ReadInt32(); - break; - } - case 40: { - Gte = input.ReadInt32(); - break; - } - case 50: - case 48: { - in_.AddEntriesFrom(ref input, _repeated_in_codec); - break; - } - case 58: - case 56: { - notIn_.AddEntriesFrom(ref input, _repeated_notIn_codec); - break; - } - case 64: { - IgnoreEmpty = input.ReadBool(); - break; - } - } - } - } - #endif - - } - - /// - /// Int64Rules describes the constraints applied to `int64` values - /// - public sealed partial class Int64Rules : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Int64Rules()); - private pb::UnknownFieldSet _unknownFields; - private int _hasBits0; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::Validate.ValidateReflection.Descriptor.MessageTypes[4]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Int64Rules() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Int64Rules(Int64Rules other) : this() { - _hasBits0 = other._hasBits0; - const_ = other.const_; - lt_ = other.lt_; - lte_ = other.lte_; - gt_ = other.gt_; - gte_ = other.gte_; - in_ = other.in_.Clone(); - notIn_ = other.notIn_.Clone(); - ignoreEmpty_ = other.ignoreEmpty_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Int64Rules Clone() { - return new Int64Rules(this); - } - - /// Field number for the "const" field. - public const int ConstFieldNumber = 1; - private readonly static long ConstDefaultValue = 0L; - - private long const_; - /// - /// Const specifies that this field must be exactly the specified value - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public long Const { - get { if ((_hasBits0 & 1) != 0) { return const_; } else { return ConstDefaultValue; } } - set { - _hasBits0 |= 1; - const_ = value; - } - } - /// Gets whether the "const" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasConst { - get { return (_hasBits0 & 1) != 0; } - } - /// Clears the value of the "const" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearConst() { - _hasBits0 &= ~1; - } - - /// Field number for the "lt" field. - public const int LtFieldNumber = 2; - private readonly static long LtDefaultValue = 0L; - - private long lt_; - /// - /// Lt specifies that this field must be less than the specified value, - /// exclusive - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public long Lt { - get { if ((_hasBits0 & 2) != 0) { return lt_; } else { return LtDefaultValue; } } - set { - _hasBits0 |= 2; - lt_ = value; - } - } - /// Gets whether the "lt" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasLt { - get { return (_hasBits0 & 2) != 0; } - } - /// Clears the value of the "lt" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearLt() { - _hasBits0 &= ~2; - } - - /// Field number for the "lte" field. - public const int LteFieldNumber = 3; - private readonly static long LteDefaultValue = 0L; - - private long lte_; - /// - /// Lte specifies that this field must be less than or equal to the - /// specified value, inclusive - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public long Lte { - get { if ((_hasBits0 & 4) != 0) { return lte_; } else { return LteDefaultValue; } } - set { - _hasBits0 |= 4; - lte_ = value; - } - } - /// Gets whether the "lte" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasLte { - get { return (_hasBits0 & 4) != 0; } - } - /// Clears the value of the "lte" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearLte() { - _hasBits0 &= ~4; - } - - /// Field number for the "gt" field. - public const int GtFieldNumber = 4; - private readonly static long GtDefaultValue = 0L; - - private long gt_; - /// - /// Gt specifies that this field must be greater than the specified value, - /// exclusive. If the value of Gt is larger than a specified Lt or Lte, the - /// range is reversed. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public long Gt { - get { if ((_hasBits0 & 8) != 0) { return gt_; } else { return GtDefaultValue; } } - set { - _hasBits0 |= 8; - gt_ = value; - } - } - /// Gets whether the "gt" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasGt { - get { return (_hasBits0 & 8) != 0; } - } - /// Clears the value of the "gt" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearGt() { - _hasBits0 &= ~8; - } - - /// Field number for the "gte" field. - public const int GteFieldNumber = 5; - private readonly static long GteDefaultValue = 0L; - - private long gte_; - /// - /// Gte specifies that this field must be greater than or equal to the - /// specified value, inclusive. If the value of Gte is larger than a - /// specified Lt or Lte, the range is reversed. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public long Gte { - get { if ((_hasBits0 & 16) != 0) { return gte_; } else { return GteDefaultValue; } } - set { - _hasBits0 |= 16; - gte_ = value; - } - } - /// Gets whether the "gte" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasGte { - get { return (_hasBits0 & 16) != 0; } - } - /// Clears the value of the "gte" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearGte() { - _hasBits0 &= ~16; - } - - /// Field number for the "in" field. - public const int InFieldNumber = 6; - private static readonly pb::FieldCodec _repeated_in_codec - = pb::FieldCodec.ForInt64(48); - private readonly pbc::RepeatedField in_ = new pbc::RepeatedField(); - /// - /// In specifies that this field must be equal to one of the specified - /// values - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField In { - get { return in_; } - } - - /// Field number for the "not_in" field. - public const int NotInFieldNumber = 7; - private static readonly pb::FieldCodec _repeated_notIn_codec - = pb::FieldCodec.ForInt64(56); - private readonly pbc::RepeatedField notIn_ = new pbc::RepeatedField(); - /// - /// NotIn specifies that this field cannot be equal to one of the specified - /// values - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField NotIn { - get { return notIn_; } - } - - /// Field number for the "ignore_empty" field. - public const int IgnoreEmptyFieldNumber = 8; - private readonly static bool IgnoreEmptyDefaultValue = false; - - private bool ignoreEmpty_; - /// - /// IgnoreEmpty specifies that the validation rules of this field should be - /// evaluated only if the field is not empty - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool IgnoreEmpty { - get { if ((_hasBits0 & 32) != 0) { return ignoreEmpty_; } else { return IgnoreEmptyDefaultValue; } } - set { - _hasBits0 |= 32; - ignoreEmpty_ = value; - } - } - /// Gets whether the "ignore_empty" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasIgnoreEmpty { - get { return (_hasBits0 & 32) != 0; } - } - /// Clears the value of the "ignore_empty" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearIgnoreEmpty() { - _hasBits0 &= ~32; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as Int64Rules); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(Int64Rules other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Const != other.Const) return false; - if (Lt != other.Lt) return false; - if (Lte != other.Lte) return false; - if (Gt != other.Gt) return false; - if (Gte != other.Gte) return false; - if(!in_.Equals(other.in_)) return false; - if(!notIn_.Equals(other.notIn_)) return false; - if (IgnoreEmpty != other.IgnoreEmpty) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (HasConst) hash ^= Const.GetHashCode(); - if (HasLt) hash ^= Lt.GetHashCode(); - if (HasLte) hash ^= Lte.GetHashCode(); - if (HasGt) hash ^= Gt.GetHashCode(); - if (HasGte) hash ^= Gte.GetHashCode(); - hash ^= in_.GetHashCode(); - hash ^= notIn_.GetHashCode(); - if (HasIgnoreEmpty) hash ^= IgnoreEmpty.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (HasConst) { - output.WriteRawTag(8); - output.WriteInt64(Const); - } - if (HasLt) { - output.WriteRawTag(16); - output.WriteInt64(Lt); - } - if (HasLte) { - output.WriteRawTag(24); - output.WriteInt64(Lte); - } - if (HasGt) { - output.WriteRawTag(32); - output.WriteInt64(Gt); - } - if (HasGte) { - output.WriteRawTag(40); - output.WriteInt64(Gte); - } - in_.WriteTo(output, _repeated_in_codec); - notIn_.WriteTo(output, _repeated_notIn_codec); - if (HasIgnoreEmpty) { - output.WriteRawTag(64); - output.WriteBool(IgnoreEmpty); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (HasConst) { - output.WriteRawTag(8); - output.WriteInt64(Const); - } - if (HasLt) { - output.WriteRawTag(16); - output.WriteInt64(Lt); - } - if (HasLte) { - output.WriteRawTag(24); - output.WriteInt64(Lte); - } - if (HasGt) { - output.WriteRawTag(32); - output.WriteInt64(Gt); - } - if (HasGte) { - output.WriteRawTag(40); - output.WriteInt64(Gte); - } - in_.WriteTo(ref output, _repeated_in_codec); - notIn_.WriteTo(ref output, _repeated_notIn_codec); - if (HasIgnoreEmpty) { - output.WriteRawTag(64); - output.WriteBool(IgnoreEmpty); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (HasConst) { - size += 1 + pb::CodedOutputStream.ComputeInt64Size(Const); - } - if (HasLt) { - size += 1 + pb::CodedOutputStream.ComputeInt64Size(Lt); - } - if (HasLte) { - size += 1 + pb::CodedOutputStream.ComputeInt64Size(Lte); - } - if (HasGt) { - size += 1 + pb::CodedOutputStream.ComputeInt64Size(Gt); - } - if (HasGte) { - size += 1 + pb::CodedOutputStream.ComputeInt64Size(Gte); - } - size += in_.CalculateSize(_repeated_in_codec); - size += notIn_.CalculateSize(_repeated_notIn_codec); - if (HasIgnoreEmpty) { - size += 1 + 1; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(Int64Rules other) { - if (other == null) { - return; - } - if (other.HasConst) { - Const = other.Const; - } - if (other.HasLt) { - Lt = other.Lt; - } - if (other.HasLte) { - Lte = other.Lte; - } - if (other.HasGt) { - Gt = other.Gt; - } - if (other.HasGte) { - Gte = other.Gte; - } - in_.Add(other.in_); - notIn_.Add(other.notIn_); - if (other.HasIgnoreEmpty) { - IgnoreEmpty = other.IgnoreEmpty; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 8: { - Const = input.ReadInt64(); - break; - } - case 16: { - Lt = input.ReadInt64(); - break; - } - case 24: { - Lte = input.ReadInt64(); - break; - } - case 32: { - Gt = input.ReadInt64(); - break; - } - case 40: { - Gte = input.ReadInt64(); - break; - } - case 50: - case 48: { - in_.AddEntriesFrom(input, _repeated_in_codec); - break; - } - case 58: - case 56: { - notIn_.AddEntriesFrom(input, _repeated_notIn_codec); - break; - } - case 64: { - IgnoreEmpty = input.ReadBool(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 8: { - Const = input.ReadInt64(); - break; - } - case 16: { - Lt = input.ReadInt64(); - break; - } - case 24: { - Lte = input.ReadInt64(); - break; - } - case 32: { - Gt = input.ReadInt64(); - break; - } - case 40: { - Gte = input.ReadInt64(); - break; - } - case 50: - case 48: { - in_.AddEntriesFrom(ref input, _repeated_in_codec); - break; - } - case 58: - case 56: { - notIn_.AddEntriesFrom(ref input, _repeated_notIn_codec); - break; - } - case 64: { - IgnoreEmpty = input.ReadBool(); - break; - } - } - } - } - #endif - - } - - /// - /// UInt32Rules describes the constraints applied to `uint32` values - /// - public sealed partial class UInt32Rules : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new UInt32Rules()); - private pb::UnknownFieldSet _unknownFields; - private int _hasBits0; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::Validate.ValidateReflection.Descriptor.MessageTypes[5]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public UInt32Rules() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public UInt32Rules(UInt32Rules other) : this() { - _hasBits0 = other._hasBits0; - const_ = other.const_; - lt_ = other.lt_; - lte_ = other.lte_; - gt_ = other.gt_; - gte_ = other.gte_; - in_ = other.in_.Clone(); - notIn_ = other.notIn_.Clone(); - ignoreEmpty_ = other.ignoreEmpty_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public UInt32Rules Clone() { - return new UInt32Rules(this); - } - - /// Field number for the "const" field. - public const int ConstFieldNumber = 1; - private readonly static uint ConstDefaultValue = 0; - - private uint const_; - /// - /// Const specifies that this field must be exactly the specified value - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public uint Const { - get { if ((_hasBits0 & 1) != 0) { return const_; } else { return ConstDefaultValue; } } - set { - _hasBits0 |= 1; - const_ = value; - } - } - /// Gets whether the "const" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasConst { - get { return (_hasBits0 & 1) != 0; } - } - /// Clears the value of the "const" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearConst() { - _hasBits0 &= ~1; - } - - /// Field number for the "lt" field. - public const int LtFieldNumber = 2; - private readonly static uint LtDefaultValue = 0; - - private uint lt_; - /// - /// Lt specifies that this field must be less than the specified value, - /// exclusive - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public uint Lt { - get { if ((_hasBits0 & 2) != 0) { return lt_; } else { return LtDefaultValue; } } - set { - _hasBits0 |= 2; - lt_ = value; - } - } - /// Gets whether the "lt" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasLt { - get { return (_hasBits0 & 2) != 0; } - } - /// Clears the value of the "lt" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearLt() { - _hasBits0 &= ~2; - } - - /// Field number for the "lte" field. - public const int LteFieldNumber = 3; - private readonly static uint LteDefaultValue = 0; - - private uint lte_; - /// - /// Lte specifies that this field must be less than or equal to the - /// specified value, inclusive - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public uint Lte { - get { if ((_hasBits0 & 4) != 0) { return lte_; } else { return LteDefaultValue; } } - set { - _hasBits0 |= 4; - lte_ = value; - } - } - /// Gets whether the "lte" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasLte { - get { return (_hasBits0 & 4) != 0; } - } - /// Clears the value of the "lte" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearLte() { - _hasBits0 &= ~4; - } - - /// Field number for the "gt" field. - public const int GtFieldNumber = 4; - private readonly static uint GtDefaultValue = 0; - - private uint gt_; - /// - /// Gt specifies that this field must be greater than the specified value, - /// exclusive. If the value of Gt is larger than a specified Lt or Lte, the - /// range is reversed. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public uint Gt { - get { if ((_hasBits0 & 8) != 0) { return gt_; } else { return GtDefaultValue; } } - set { - _hasBits0 |= 8; - gt_ = value; - } - } - /// Gets whether the "gt" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasGt { - get { return (_hasBits0 & 8) != 0; } - } - /// Clears the value of the "gt" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearGt() { - _hasBits0 &= ~8; - } - - /// Field number for the "gte" field. - public const int GteFieldNumber = 5; - private readonly static uint GteDefaultValue = 0; - - private uint gte_; - /// - /// Gte specifies that this field must be greater than or equal to the - /// specified value, inclusive. If the value of Gte is larger than a - /// specified Lt or Lte, the range is reversed. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public uint Gte { - get { if ((_hasBits0 & 16) != 0) { return gte_; } else { return GteDefaultValue; } } - set { - _hasBits0 |= 16; - gte_ = value; - } - } - /// Gets whether the "gte" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasGte { - get { return (_hasBits0 & 16) != 0; } - } - /// Clears the value of the "gte" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearGte() { - _hasBits0 &= ~16; - } - - /// Field number for the "in" field. - public const int InFieldNumber = 6; - private static readonly pb::FieldCodec _repeated_in_codec - = pb::FieldCodec.ForUInt32(48); - private readonly pbc::RepeatedField in_ = new pbc::RepeatedField(); - /// - /// In specifies that this field must be equal to one of the specified - /// values - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField In { - get { return in_; } - } - - /// Field number for the "not_in" field. - public const int NotInFieldNumber = 7; - private static readonly pb::FieldCodec _repeated_notIn_codec - = pb::FieldCodec.ForUInt32(56); - private readonly pbc::RepeatedField notIn_ = new pbc::RepeatedField(); - /// - /// NotIn specifies that this field cannot be equal to one of the specified - /// values - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField NotIn { - get { return notIn_; } - } - - /// Field number for the "ignore_empty" field. - public const int IgnoreEmptyFieldNumber = 8; - private readonly static bool IgnoreEmptyDefaultValue = false; - - private bool ignoreEmpty_; - /// - /// IgnoreEmpty specifies that the validation rules of this field should be - /// evaluated only if the field is not empty - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool IgnoreEmpty { - get { if ((_hasBits0 & 32) != 0) { return ignoreEmpty_; } else { return IgnoreEmptyDefaultValue; } } - set { - _hasBits0 |= 32; - ignoreEmpty_ = value; - } - } - /// Gets whether the "ignore_empty" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasIgnoreEmpty { - get { return (_hasBits0 & 32) != 0; } - } - /// Clears the value of the "ignore_empty" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearIgnoreEmpty() { - _hasBits0 &= ~32; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as UInt32Rules); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(UInt32Rules other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Const != other.Const) return false; - if (Lt != other.Lt) return false; - if (Lte != other.Lte) return false; - if (Gt != other.Gt) return false; - if (Gte != other.Gte) return false; - if(!in_.Equals(other.in_)) return false; - if(!notIn_.Equals(other.notIn_)) return false; - if (IgnoreEmpty != other.IgnoreEmpty) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (HasConst) hash ^= Const.GetHashCode(); - if (HasLt) hash ^= Lt.GetHashCode(); - if (HasLte) hash ^= Lte.GetHashCode(); - if (HasGt) hash ^= Gt.GetHashCode(); - if (HasGte) hash ^= Gte.GetHashCode(); - hash ^= in_.GetHashCode(); - hash ^= notIn_.GetHashCode(); - if (HasIgnoreEmpty) hash ^= IgnoreEmpty.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (HasConst) { - output.WriteRawTag(8); - output.WriteUInt32(Const); - } - if (HasLt) { - output.WriteRawTag(16); - output.WriteUInt32(Lt); - } - if (HasLte) { - output.WriteRawTag(24); - output.WriteUInt32(Lte); - } - if (HasGt) { - output.WriteRawTag(32); - output.WriteUInt32(Gt); - } - if (HasGte) { - output.WriteRawTag(40); - output.WriteUInt32(Gte); - } - in_.WriteTo(output, _repeated_in_codec); - notIn_.WriteTo(output, _repeated_notIn_codec); - if (HasIgnoreEmpty) { - output.WriteRawTag(64); - output.WriteBool(IgnoreEmpty); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (HasConst) { - output.WriteRawTag(8); - output.WriteUInt32(Const); - } - if (HasLt) { - output.WriteRawTag(16); - output.WriteUInt32(Lt); - } - if (HasLte) { - output.WriteRawTag(24); - output.WriteUInt32(Lte); - } - if (HasGt) { - output.WriteRawTag(32); - output.WriteUInt32(Gt); - } - if (HasGte) { - output.WriteRawTag(40); - output.WriteUInt32(Gte); - } - in_.WriteTo(ref output, _repeated_in_codec); - notIn_.WriteTo(ref output, _repeated_notIn_codec); - if (HasIgnoreEmpty) { - output.WriteRawTag(64); - output.WriteBool(IgnoreEmpty); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (HasConst) { - size += 1 + pb::CodedOutputStream.ComputeUInt32Size(Const); - } - if (HasLt) { - size += 1 + pb::CodedOutputStream.ComputeUInt32Size(Lt); - } - if (HasLte) { - size += 1 + pb::CodedOutputStream.ComputeUInt32Size(Lte); - } - if (HasGt) { - size += 1 + pb::CodedOutputStream.ComputeUInt32Size(Gt); - } - if (HasGte) { - size += 1 + pb::CodedOutputStream.ComputeUInt32Size(Gte); - } - size += in_.CalculateSize(_repeated_in_codec); - size += notIn_.CalculateSize(_repeated_notIn_codec); - if (HasIgnoreEmpty) { - size += 1 + 1; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(UInt32Rules other) { - if (other == null) { - return; - } - if (other.HasConst) { - Const = other.Const; - } - if (other.HasLt) { - Lt = other.Lt; - } - if (other.HasLte) { - Lte = other.Lte; - } - if (other.HasGt) { - Gt = other.Gt; - } - if (other.HasGte) { - Gte = other.Gte; - } - in_.Add(other.in_); - notIn_.Add(other.notIn_); - if (other.HasIgnoreEmpty) { - IgnoreEmpty = other.IgnoreEmpty; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 8: { - Const = input.ReadUInt32(); - break; - } - case 16: { - Lt = input.ReadUInt32(); - break; - } - case 24: { - Lte = input.ReadUInt32(); - break; - } - case 32: { - Gt = input.ReadUInt32(); - break; - } - case 40: { - Gte = input.ReadUInt32(); - break; - } - case 50: - case 48: { - in_.AddEntriesFrom(input, _repeated_in_codec); - break; - } - case 58: - case 56: { - notIn_.AddEntriesFrom(input, _repeated_notIn_codec); - break; - } - case 64: { - IgnoreEmpty = input.ReadBool(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 8: { - Const = input.ReadUInt32(); - break; - } - case 16: { - Lt = input.ReadUInt32(); - break; - } - case 24: { - Lte = input.ReadUInt32(); - break; - } - case 32: { - Gt = input.ReadUInt32(); - break; - } - case 40: { - Gte = input.ReadUInt32(); - break; - } - case 50: - case 48: { - in_.AddEntriesFrom(ref input, _repeated_in_codec); - break; - } - case 58: - case 56: { - notIn_.AddEntriesFrom(ref input, _repeated_notIn_codec); - break; - } - case 64: { - IgnoreEmpty = input.ReadBool(); - break; - } - } - } - } - #endif - - } - - /// - /// UInt64Rules describes the constraints applied to `uint64` values - /// - public sealed partial class UInt64Rules : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new UInt64Rules()); - private pb::UnknownFieldSet _unknownFields; - private int _hasBits0; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::Validate.ValidateReflection.Descriptor.MessageTypes[6]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public UInt64Rules() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public UInt64Rules(UInt64Rules other) : this() { - _hasBits0 = other._hasBits0; - const_ = other.const_; - lt_ = other.lt_; - lte_ = other.lte_; - gt_ = other.gt_; - gte_ = other.gte_; - in_ = other.in_.Clone(); - notIn_ = other.notIn_.Clone(); - ignoreEmpty_ = other.ignoreEmpty_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public UInt64Rules Clone() { - return new UInt64Rules(this); - } - - /// Field number for the "const" field. - public const int ConstFieldNumber = 1; - private readonly static ulong ConstDefaultValue = 0UL; - - private ulong const_; - /// - /// Const specifies that this field must be exactly the specified value - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ulong Const { - get { if ((_hasBits0 & 1) != 0) { return const_; } else { return ConstDefaultValue; } } - set { - _hasBits0 |= 1; - const_ = value; - } - } - /// Gets whether the "const" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasConst { - get { return (_hasBits0 & 1) != 0; } - } - /// Clears the value of the "const" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearConst() { - _hasBits0 &= ~1; - } - - /// Field number for the "lt" field. - public const int LtFieldNumber = 2; - private readonly static ulong LtDefaultValue = 0UL; - - private ulong lt_; - /// - /// Lt specifies that this field must be less than the specified value, - /// exclusive - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ulong Lt { - get { if ((_hasBits0 & 2) != 0) { return lt_; } else { return LtDefaultValue; } } - set { - _hasBits0 |= 2; - lt_ = value; - } - } - /// Gets whether the "lt" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasLt { - get { return (_hasBits0 & 2) != 0; } - } - /// Clears the value of the "lt" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearLt() { - _hasBits0 &= ~2; - } - - /// Field number for the "lte" field. - public const int LteFieldNumber = 3; - private readonly static ulong LteDefaultValue = 0UL; - - private ulong lte_; - /// - /// Lte specifies that this field must be less than or equal to the - /// specified value, inclusive - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ulong Lte { - get { if ((_hasBits0 & 4) != 0) { return lte_; } else { return LteDefaultValue; } } - set { - _hasBits0 |= 4; - lte_ = value; - } - } - /// Gets whether the "lte" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasLte { - get { return (_hasBits0 & 4) != 0; } - } - /// Clears the value of the "lte" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearLte() { - _hasBits0 &= ~4; - } - - /// Field number for the "gt" field. - public const int GtFieldNumber = 4; - private readonly static ulong GtDefaultValue = 0UL; - - private ulong gt_; - /// - /// Gt specifies that this field must be greater than the specified value, - /// exclusive. If the value of Gt is larger than a specified Lt or Lte, the - /// range is reversed. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ulong Gt { - get { if ((_hasBits0 & 8) != 0) { return gt_; } else { return GtDefaultValue; } } - set { - _hasBits0 |= 8; - gt_ = value; - } - } - /// Gets whether the "gt" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasGt { - get { return (_hasBits0 & 8) != 0; } - } - /// Clears the value of the "gt" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearGt() { - _hasBits0 &= ~8; - } - - /// Field number for the "gte" field. - public const int GteFieldNumber = 5; - private readonly static ulong GteDefaultValue = 0UL; - - private ulong gte_; - /// - /// Gte specifies that this field must be greater than or equal to the - /// specified value, inclusive. If the value of Gte is larger than a - /// specified Lt or Lte, the range is reversed. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ulong Gte { - get { if ((_hasBits0 & 16) != 0) { return gte_; } else { return GteDefaultValue; } } - set { - _hasBits0 |= 16; - gte_ = value; - } - } - /// Gets whether the "gte" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasGte { - get { return (_hasBits0 & 16) != 0; } - } - /// Clears the value of the "gte" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearGte() { - _hasBits0 &= ~16; - } - - /// Field number for the "in" field. - public const int InFieldNumber = 6; - private static readonly pb::FieldCodec _repeated_in_codec - = pb::FieldCodec.ForUInt64(48); - private readonly pbc::RepeatedField in_ = new pbc::RepeatedField(); - /// - /// In specifies that this field must be equal to one of the specified - /// values - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField In { - get { return in_; } - } - - /// Field number for the "not_in" field. - public const int NotInFieldNumber = 7; - private static readonly pb::FieldCodec _repeated_notIn_codec - = pb::FieldCodec.ForUInt64(56); - private readonly pbc::RepeatedField notIn_ = new pbc::RepeatedField(); - /// - /// NotIn specifies that this field cannot be equal to one of the specified - /// values - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField NotIn { - get { return notIn_; } - } - - /// Field number for the "ignore_empty" field. - public const int IgnoreEmptyFieldNumber = 8; - private readonly static bool IgnoreEmptyDefaultValue = false; - - private bool ignoreEmpty_; - /// - /// IgnoreEmpty specifies that the validation rules of this field should be - /// evaluated only if the field is not empty - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool IgnoreEmpty { - get { if ((_hasBits0 & 32) != 0) { return ignoreEmpty_; } else { return IgnoreEmptyDefaultValue; } } - set { - _hasBits0 |= 32; - ignoreEmpty_ = value; - } - } - /// Gets whether the "ignore_empty" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasIgnoreEmpty { - get { return (_hasBits0 & 32) != 0; } - } - /// Clears the value of the "ignore_empty" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearIgnoreEmpty() { - _hasBits0 &= ~32; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as UInt64Rules); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(UInt64Rules other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Const != other.Const) return false; - if (Lt != other.Lt) return false; - if (Lte != other.Lte) return false; - if (Gt != other.Gt) return false; - if (Gte != other.Gte) return false; - if(!in_.Equals(other.in_)) return false; - if(!notIn_.Equals(other.notIn_)) return false; - if (IgnoreEmpty != other.IgnoreEmpty) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (HasConst) hash ^= Const.GetHashCode(); - if (HasLt) hash ^= Lt.GetHashCode(); - if (HasLte) hash ^= Lte.GetHashCode(); - if (HasGt) hash ^= Gt.GetHashCode(); - if (HasGte) hash ^= Gte.GetHashCode(); - hash ^= in_.GetHashCode(); - hash ^= notIn_.GetHashCode(); - if (HasIgnoreEmpty) hash ^= IgnoreEmpty.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (HasConst) { - output.WriteRawTag(8); - output.WriteUInt64(Const); - } - if (HasLt) { - output.WriteRawTag(16); - output.WriteUInt64(Lt); - } - if (HasLte) { - output.WriteRawTag(24); - output.WriteUInt64(Lte); - } - if (HasGt) { - output.WriteRawTag(32); - output.WriteUInt64(Gt); - } - if (HasGte) { - output.WriteRawTag(40); - output.WriteUInt64(Gte); - } - in_.WriteTo(output, _repeated_in_codec); - notIn_.WriteTo(output, _repeated_notIn_codec); - if (HasIgnoreEmpty) { - output.WriteRawTag(64); - output.WriteBool(IgnoreEmpty); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (HasConst) { - output.WriteRawTag(8); - output.WriteUInt64(Const); - } - if (HasLt) { - output.WriteRawTag(16); - output.WriteUInt64(Lt); - } - if (HasLte) { - output.WriteRawTag(24); - output.WriteUInt64(Lte); - } - if (HasGt) { - output.WriteRawTag(32); - output.WriteUInt64(Gt); - } - if (HasGte) { - output.WriteRawTag(40); - output.WriteUInt64(Gte); - } - in_.WriteTo(ref output, _repeated_in_codec); - notIn_.WriteTo(ref output, _repeated_notIn_codec); - if (HasIgnoreEmpty) { - output.WriteRawTag(64); - output.WriteBool(IgnoreEmpty); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (HasConst) { - size += 1 + pb::CodedOutputStream.ComputeUInt64Size(Const); - } - if (HasLt) { - size += 1 + pb::CodedOutputStream.ComputeUInt64Size(Lt); - } - if (HasLte) { - size += 1 + pb::CodedOutputStream.ComputeUInt64Size(Lte); - } - if (HasGt) { - size += 1 + pb::CodedOutputStream.ComputeUInt64Size(Gt); - } - if (HasGte) { - size += 1 + pb::CodedOutputStream.ComputeUInt64Size(Gte); - } - size += in_.CalculateSize(_repeated_in_codec); - size += notIn_.CalculateSize(_repeated_notIn_codec); - if (HasIgnoreEmpty) { - size += 1 + 1; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(UInt64Rules other) { - if (other == null) { - return; - } - if (other.HasConst) { - Const = other.Const; - } - if (other.HasLt) { - Lt = other.Lt; - } - if (other.HasLte) { - Lte = other.Lte; - } - if (other.HasGt) { - Gt = other.Gt; - } - if (other.HasGte) { - Gte = other.Gte; - } - in_.Add(other.in_); - notIn_.Add(other.notIn_); - if (other.HasIgnoreEmpty) { - IgnoreEmpty = other.IgnoreEmpty; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 8: { - Const = input.ReadUInt64(); - break; - } - case 16: { - Lt = input.ReadUInt64(); - break; - } - case 24: { - Lte = input.ReadUInt64(); - break; - } - case 32: { - Gt = input.ReadUInt64(); - break; - } - case 40: { - Gte = input.ReadUInt64(); - break; - } - case 50: - case 48: { - in_.AddEntriesFrom(input, _repeated_in_codec); - break; - } - case 58: - case 56: { - notIn_.AddEntriesFrom(input, _repeated_notIn_codec); - break; - } - case 64: { - IgnoreEmpty = input.ReadBool(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 8: { - Const = input.ReadUInt64(); - break; - } - case 16: { - Lt = input.ReadUInt64(); - break; - } - case 24: { - Lte = input.ReadUInt64(); - break; - } - case 32: { - Gt = input.ReadUInt64(); - break; - } - case 40: { - Gte = input.ReadUInt64(); - break; - } - case 50: - case 48: { - in_.AddEntriesFrom(ref input, _repeated_in_codec); - break; - } - case 58: - case 56: { - notIn_.AddEntriesFrom(ref input, _repeated_notIn_codec); - break; - } - case 64: { - IgnoreEmpty = input.ReadBool(); - break; - } - } - } - } - #endif - - } - - /// - /// SInt32Rules describes the constraints applied to `sint32` values - /// - public sealed partial class SInt32Rules : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SInt32Rules()); - private pb::UnknownFieldSet _unknownFields; - private int _hasBits0; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::Validate.ValidateReflection.Descriptor.MessageTypes[7]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public SInt32Rules() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public SInt32Rules(SInt32Rules other) : this() { - _hasBits0 = other._hasBits0; - const_ = other.const_; - lt_ = other.lt_; - lte_ = other.lte_; - gt_ = other.gt_; - gte_ = other.gte_; - in_ = other.in_.Clone(); - notIn_ = other.notIn_.Clone(); - ignoreEmpty_ = other.ignoreEmpty_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public SInt32Rules Clone() { - return new SInt32Rules(this); - } - - /// Field number for the "const" field. - public const int ConstFieldNumber = 1; - private readonly static int ConstDefaultValue = 0; - - private int const_; - /// - /// Const specifies that this field must be exactly the specified value - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int Const { - get { if ((_hasBits0 & 1) != 0) { return const_; } else { return ConstDefaultValue; } } - set { - _hasBits0 |= 1; - const_ = value; - } - } - /// Gets whether the "const" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasConst { - get { return (_hasBits0 & 1) != 0; } - } - /// Clears the value of the "const" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearConst() { - _hasBits0 &= ~1; - } - - /// Field number for the "lt" field. - public const int LtFieldNumber = 2; - private readonly static int LtDefaultValue = 0; - - private int lt_; - /// - /// Lt specifies that this field must be less than the specified value, - /// exclusive - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int Lt { - get { if ((_hasBits0 & 2) != 0) { return lt_; } else { return LtDefaultValue; } } - set { - _hasBits0 |= 2; - lt_ = value; - } - } - /// Gets whether the "lt" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasLt { - get { return (_hasBits0 & 2) != 0; } - } - /// Clears the value of the "lt" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearLt() { - _hasBits0 &= ~2; - } - - /// Field number for the "lte" field. - public const int LteFieldNumber = 3; - private readonly static int LteDefaultValue = 0; - - private int lte_; - /// - /// Lte specifies that this field must be less than or equal to the - /// specified value, inclusive - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int Lte { - get { if ((_hasBits0 & 4) != 0) { return lte_; } else { return LteDefaultValue; } } - set { - _hasBits0 |= 4; - lte_ = value; - } - } - /// Gets whether the "lte" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasLte { - get { return (_hasBits0 & 4) != 0; } - } - /// Clears the value of the "lte" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearLte() { - _hasBits0 &= ~4; - } - - /// Field number for the "gt" field. - public const int GtFieldNumber = 4; - private readonly static int GtDefaultValue = 0; - - private int gt_; - /// - /// Gt specifies that this field must be greater than the specified value, - /// exclusive. If the value of Gt is larger than a specified Lt or Lte, the - /// range is reversed. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int Gt { - get { if ((_hasBits0 & 8) != 0) { return gt_; } else { return GtDefaultValue; } } - set { - _hasBits0 |= 8; - gt_ = value; - } - } - /// Gets whether the "gt" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasGt { - get { return (_hasBits0 & 8) != 0; } - } - /// Clears the value of the "gt" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearGt() { - _hasBits0 &= ~8; - } - - /// Field number for the "gte" field. - public const int GteFieldNumber = 5; - private readonly static int GteDefaultValue = 0; - - private int gte_; - /// - /// Gte specifies that this field must be greater than or equal to the - /// specified value, inclusive. If the value of Gte is larger than a - /// specified Lt or Lte, the range is reversed. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int Gte { - get { if ((_hasBits0 & 16) != 0) { return gte_; } else { return GteDefaultValue; } } - set { - _hasBits0 |= 16; - gte_ = value; - } - } - /// Gets whether the "gte" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasGte { - get { return (_hasBits0 & 16) != 0; } - } - /// Clears the value of the "gte" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearGte() { - _hasBits0 &= ~16; - } - - /// Field number for the "in" field. - public const int InFieldNumber = 6; - private static readonly pb::FieldCodec _repeated_in_codec - = pb::FieldCodec.ForSInt32(48); - private readonly pbc::RepeatedField in_ = new pbc::RepeatedField(); - /// - /// In specifies that this field must be equal to one of the specified - /// values - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField In { - get { return in_; } - } - - /// Field number for the "not_in" field. - public const int NotInFieldNumber = 7; - private static readonly pb::FieldCodec _repeated_notIn_codec - = pb::FieldCodec.ForSInt32(56); - private readonly pbc::RepeatedField notIn_ = new pbc::RepeatedField(); - /// - /// NotIn specifies that this field cannot be equal to one of the specified - /// values - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField NotIn { - get { return notIn_; } - } - - /// Field number for the "ignore_empty" field. - public const int IgnoreEmptyFieldNumber = 8; - private readonly static bool IgnoreEmptyDefaultValue = false; - - private bool ignoreEmpty_; - /// - /// IgnoreEmpty specifies that the validation rules of this field should be - /// evaluated only if the field is not empty - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool IgnoreEmpty { - get { if ((_hasBits0 & 32) != 0) { return ignoreEmpty_; } else { return IgnoreEmptyDefaultValue; } } - set { - _hasBits0 |= 32; - ignoreEmpty_ = value; - } - } - /// Gets whether the "ignore_empty" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasIgnoreEmpty { - get { return (_hasBits0 & 32) != 0; } - } - /// Clears the value of the "ignore_empty" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearIgnoreEmpty() { - _hasBits0 &= ~32; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as SInt32Rules); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(SInt32Rules other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Const != other.Const) return false; - if (Lt != other.Lt) return false; - if (Lte != other.Lte) return false; - if (Gt != other.Gt) return false; - if (Gte != other.Gte) return false; - if(!in_.Equals(other.in_)) return false; - if(!notIn_.Equals(other.notIn_)) return false; - if (IgnoreEmpty != other.IgnoreEmpty) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (HasConst) hash ^= Const.GetHashCode(); - if (HasLt) hash ^= Lt.GetHashCode(); - if (HasLte) hash ^= Lte.GetHashCode(); - if (HasGt) hash ^= Gt.GetHashCode(); - if (HasGte) hash ^= Gte.GetHashCode(); - hash ^= in_.GetHashCode(); - hash ^= notIn_.GetHashCode(); - if (HasIgnoreEmpty) hash ^= IgnoreEmpty.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (HasConst) { - output.WriteRawTag(8); - output.WriteSInt32(Const); - } - if (HasLt) { - output.WriteRawTag(16); - output.WriteSInt32(Lt); - } - if (HasLte) { - output.WriteRawTag(24); - output.WriteSInt32(Lte); - } - if (HasGt) { - output.WriteRawTag(32); - output.WriteSInt32(Gt); - } - if (HasGte) { - output.WriteRawTag(40); - output.WriteSInt32(Gte); - } - in_.WriteTo(output, _repeated_in_codec); - notIn_.WriteTo(output, _repeated_notIn_codec); - if (HasIgnoreEmpty) { - output.WriteRawTag(64); - output.WriteBool(IgnoreEmpty); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (HasConst) { - output.WriteRawTag(8); - output.WriteSInt32(Const); - } - if (HasLt) { - output.WriteRawTag(16); - output.WriteSInt32(Lt); - } - if (HasLte) { - output.WriteRawTag(24); - output.WriteSInt32(Lte); - } - if (HasGt) { - output.WriteRawTag(32); - output.WriteSInt32(Gt); - } - if (HasGte) { - output.WriteRawTag(40); - output.WriteSInt32(Gte); - } - in_.WriteTo(ref output, _repeated_in_codec); - notIn_.WriteTo(ref output, _repeated_notIn_codec); - if (HasIgnoreEmpty) { - output.WriteRawTag(64); - output.WriteBool(IgnoreEmpty); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (HasConst) { - size += 1 + pb::CodedOutputStream.ComputeSInt32Size(Const); - } - if (HasLt) { - size += 1 + pb::CodedOutputStream.ComputeSInt32Size(Lt); - } - if (HasLte) { - size += 1 + pb::CodedOutputStream.ComputeSInt32Size(Lte); - } - if (HasGt) { - size += 1 + pb::CodedOutputStream.ComputeSInt32Size(Gt); - } - if (HasGte) { - size += 1 + pb::CodedOutputStream.ComputeSInt32Size(Gte); - } - size += in_.CalculateSize(_repeated_in_codec); - size += notIn_.CalculateSize(_repeated_notIn_codec); - if (HasIgnoreEmpty) { - size += 1 + 1; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(SInt32Rules other) { - if (other == null) { - return; - } - if (other.HasConst) { - Const = other.Const; - } - if (other.HasLt) { - Lt = other.Lt; - } - if (other.HasLte) { - Lte = other.Lte; - } - if (other.HasGt) { - Gt = other.Gt; - } - if (other.HasGte) { - Gte = other.Gte; - } - in_.Add(other.in_); - notIn_.Add(other.notIn_); - if (other.HasIgnoreEmpty) { - IgnoreEmpty = other.IgnoreEmpty; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 8: { - Const = input.ReadSInt32(); - break; - } - case 16: { - Lt = input.ReadSInt32(); - break; - } - case 24: { - Lte = input.ReadSInt32(); - break; - } - case 32: { - Gt = input.ReadSInt32(); - break; - } - case 40: { - Gte = input.ReadSInt32(); - break; - } - case 50: - case 48: { - in_.AddEntriesFrom(input, _repeated_in_codec); - break; - } - case 58: - case 56: { - notIn_.AddEntriesFrom(input, _repeated_notIn_codec); - break; - } - case 64: { - IgnoreEmpty = input.ReadBool(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 8: { - Const = input.ReadSInt32(); - break; - } - case 16: { - Lt = input.ReadSInt32(); - break; - } - case 24: { - Lte = input.ReadSInt32(); - break; - } - case 32: { - Gt = input.ReadSInt32(); - break; - } - case 40: { - Gte = input.ReadSInt32(); - break; - } - case 50: - case 48: { - in_.AddEntriesFrom(ref input, _repeated_in_codec); - break; - } - case 58: - case 56: { - notIn_.AddEntriesFrom(ref input, _repeated_notIn_codec); - break; - } - case 64: { - IgnoreEmpty = input.ReadBool(); - break; - } - } - } - } - #endif - - } - - /// - /// SInt64Rules describes the constraints applied to `sint64` values - /// - public sealed partial class SInt64Rules : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SInt64Rules()); - private pb::UnknownFieldSet _unknownFields; - private int _hasBits0; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::Validate.ValidateReflection.Descriptor.MessageTypes[8]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public SInt64Rules() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public SInt64Rules(SInt64Rules other) : this() { - _hasBits0 = other._hasBits0; - const_ = other.const_; - lt_ = other.lt_; - lte_ = other.lte_; - gt_ = other.gt_; - gte_ = other.gte_; - in_ = other.in_.Clone(); - notIn_ = other.notIn_.Clone(); - ignoreEmpty_ = other.ignoreEmpty_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public SInt64Rules Clone() { - return new SInt64Rules(this); - } - - /// Field number for the "const" field. - public const int ConstFieldNumber = 1; - private readonly static long ConstDefaultValue = 0L; - - private long const_; - /// - /// Const specifies that this field must be exactly the specified value - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public long Const { - get { if ((_hasBits0 & 1) != 0) { return const_; } else { return ConstDefaultValue; } } - set { - _hasBits0 |= 1; - const_ = value; - } - } - /// Gets whether the "const" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasConst { - get { return (_hasBits0 & 1) != 0; } - } - /// Clears the value of the "const" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearConst() { - _hasBits0 &= ~1; - } - - /// Field number for the "lt" field. - public const int LtFieldNumber = 2; - private readonly static long LtDefaultValue = 0L; - - private long lt_; - /// - /// Lt specifies that this field must be less than the specified value, - /// exclusive - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public long Lt { - get { if ((_hasBits0 & 2) != 0) { return lt_; } else { return LtDefaultValue; } } - set { - _hasBits0 |= 2; - lt_ = value; - } - } - /// Gets whether the "lt" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasLt { - get { return (_hasBits0 & 2) != 0; } - } - /// Clears the value of the "lt" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearLt() { - _hasBits0 &= ~2; - } - - /// Field number for the "lte" field. - public const int LteFieldNumber = 3; - private readonly static long LteDefaultValue = 0L; - - private long lte_; - /// - /// Lte specifies that this field must be less than or equal to the - /// specified value, inclusive - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public long Lte { - get { if ((_hasBits0 & 4) != 0) { return lte_; } else { return LteDefaultValue; } } - set { - _hasBits0 |= 4; - lte_ = value; - } - } - /// Gets whether the "lte" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasLte { - get { return (_hasBits0 & 4) != 0; } - } - /// Clears the value of the "lte" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearLte() { - _hasBits0 &= ~4; - } - - /// Field number for the "gt" field. - public const int GtFieldNumber = 4; - private readonly static long GtDefaultValue = 0L; - - private long gt_; - /// - /// Gt specifies that this field must be greater than the specified value, - /// exclusive. If the value of Gt is larger than a specified Lt or Lte, the - /// range is reversed. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public long Gt { - get { if ((_hasBits0 & 8) != 0) { return gt_; } else { return GtDefaultValue; } } - set { - _hasBits0 |= 8; - gt_ = value; - } - } - /// Gets whether the "gt" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasGt { - get { return (_hasBits0 & 8) != 0; } - } - /// Clears the value of the "gt" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearGt() { - _hasBits0 &= ~8; - } - - /// Field number for the "gte" field. - public const int GteFieldNumber = 5; - private readonly static long GteDefaultValue = 0L; - - private long gte_; - /// - /// Gte specifies that this field must be greater than or equal to the - /// specified value, inclusive. If the value of Gte is larger than a - /// specified Lt or Lte, the range is reversed. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public long Gte { - get { if ((_hasBits0 & 16) != 0) { return gte_; } else { return GteDefaultValue; } } - set { - _hasBits0 |= 16; - gte_ = value; - } - } - /// Gets whether the "gte" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasGte { - get { return (_hasBits0 & 16) != 0; } - } - /// Clears the value of the "gte" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearGte() { - _hasBits0 &= ~16; - } - - /// Field number for the "in" field. - public const int InFieldNumber = 6; - private static readonly pb::FieldCodec _repeated_in_codec - = pb::FieldCodec.ForSInt64(48); - private readonly pbc::RepeatedField in_ = new pbc::RepeatedField(); - /// - /// In specifies that this field must be equal to one of the specified - /// values - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField In { - get { return in_; } - } - - /// Field number for the "not_in" field. - public const int NotInFieldNumber = 7; - private static readonly pb::FieldCodec _repeated_notIn_codec - = pb::FieldCodec.ForSInt64(56); - private readonly pbc::RepeatedField notIn_ = new pbc::RepeatedField(); - /// - /// NotIn specifies that this field cannot be equal to one of the specified - /// values - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField NotIn { - get { return notIn_; } - } - - /// Field number for the "ignore_empty" field. - public const int IgnoreEmptyFieldNumber = 8; - private readonly static bool IgnoreEmptyDefaultValue = false; - - private bool ignoreEmpty_; - /// - /// IgnoreEmpty specifies that the validation rules of this field should be - /// evaluated only if the field is not empty - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool IgnoreEmpty { - get { if ((_hasBits0 & 32) != 0) { return ignoreEmpty_; } else { return IgnoreEmptyDefaultValue; } } - set { - _hasBits0 |= 32; - ignoreEmpty_ = value; - } - } - /// Gets whether the "ignore_empty" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasIgnoreEmpty { - get { return (_hasBits0 & 32) != 0; } - } - /// Clears the value of the "ignore_empty" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearIgnoreEmpty() { - _hasBits0 &= ~32; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as SInt64Rules); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(SInt64Rules other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Const != other.Const) return false; - if (Lt != other.Lt) return false; - if (Lte != other.Lte) return false; - if (Gt != other.Gt) return false; - if (Gte != other.Gte) return false; - if(!in_.Equals(other.in_)) return false; - if(!notIn_.Equals(other.notIn_)) return false; - if (IgnoreEmpty != other.IgnoreEmpty) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (HasConst) hash ^= Const.GetHashCode(); - if (HasLt) hash ^= Lt.GetHashCode(); - if (HasLte) hash ^= Lte.GetHashCode(); - if (HasGt) hash ^= Gt.GetHashCode(); - if (HasGte) hash ^= Gte.GetHashCode(); - hash ^= in_.GetHashCode(); - hash ^= notIn_.GetHashCode(); - if (HasIgnoreEmpty) hash ^= IgnoreEmpty.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (HasConst) { - output.WriteRawTag(8); - output.WriteSInt64(Const); - } - if (HasLt) { - output.WriteRawTag(16); - output.WriteSInt64(Lt); - } - if (HasLte) { - output.WriteRawTag(24); - output.WriteSInt64(Lte); - } - if (HasGt) { - output.WriteRawTag(32); - output.WriteSInt64(Gt); - } - if (HasGte) { - output.WriteRawTag(40); - output.WriteSInt64(Gte); - } - in_.WriteTo(output, _repeated_in_codec); - notIn_.WriteTo(output, _repeated_notIn_codec); - if (HasIgnoreEmpty) { - output.WriteRawTag(64); - output.WriteBool(IgnoreEmpty); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (HasConst) { - output.WriteRawTag(8); - output.WriteSInt64(Const); - } - if (HasLt) { - output.WriteRawTag(16); - output.WriteSInt64(Lt); - } - if (HasLte) { - output.WriteRawTag(24); - output.WriteSInt64(Lte); - } - if (HasGt) { - output.WriteRawTag(32); - output.WriteSInt64(Gt); - } - if (HasGte) { - output.WriteRawTag(40); - output.WriteSInt64(Gte); - } - in_.WriteTo(ref output, _repeated_in_codec); - notIn_.WriteTo(ref output, _repeated_notIn_codec); - if (HasIgnoreEmpty) { - output.WriteRawTag(64); - output.WriteBool(IgnoreEmpty); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (HasConst) { - size += 1 + pb::CodedOutputStream.ComputeSInt64Size(Const); - } - if (HasLt) { - size += 1 + pb::CodedOutputStream.ComputeSInt64Size(Lt); - } - if (HasLte) { - size += 1 + pb::CodedOutputStream.ComputeSInt64Size(Lte); - } - if (HasGt) { - size += 1 + pb::CodedOutputStream.ComputeSInt64Size(Gt); - } - if (HasGte) { - size += 1 + pb::CodedOutputStream.ComputeSInt64Size(Gte); - } - size += in_.CalculateSize(_repeated_in_codec); - size += notIn_.CalculateSize(_repeated_notIn_codec); - if (HasIgnoreEmpty) { - size += 1 + 1; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(SInt64Rules other) { - if (other == null) { - return; - } - if (other.HasConst) { - Const = other.Const; - } - if (other.HasLt) { - Lt = other.Lt; - } - if (other.HasLte) { - Lte = other.Lte; - } - if (other.HasGt) { - Gt = other.Gt; - } - if (other.HasGte) { - Gte = other.Gte; - } - in_.Add(other.in_); - notIn_.Add(other.notIn_); - if (other.HasIgnoreEmpty) { - IgnoreEmpty = other.IgnoreEmpty; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 8: { - Const = input.ReadSInt64(); - break; - } - case 16: { - Lt = input.ReadSInt64(); - break; - } - case 24: { - Lte = input.ReadSInt64(); - break; - } - case 32: { - Gt = input.ReadSInt64(); - break; - } - case 40: { - Gte = input.ReadSInt64(); - break; - } - case 50: - case 48: { - in_.AddEntriesFrom(input, _repeated_in_codec); - break; - } - case 58: - case 56: { - notIn_.AddEntriesFrom(input, _repeated_notIn_codec); - break; - } - case 64: { - IgnoreEmpty = input.ReadBool(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 8: { - Const = input.ReadSInt64(); - break; - } - case 16: { - Lt = input.ReadSInt64(); - break; - } - case 24: { - Lte = input.ReadSInt64(); - break; - } - case 32: { - Gt = input.ReadSInt64(); - break; - } - case 40: { - Gte = input.ReadSInt64(); - break; - } - case 50: - case 48: { - in_.AddEntriesFrom(ref input, _repeated_in_codec); - break; - } - case 58: - case 56: { - notIn_.AddEntriesFrom(ref input, _repeated_notIn_codec); - break; - } - case 64: { - IgnoreEmpty = input.ReadBool(); - break; - } - } - } - } - #endif - - } - - /// - /// Fixed32Rules describes the constraints applied to `fixed32` values - /// - public sealed partial class Fixed32Rules : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Fixed32Rules()); - private pb::UnknownFieldSet _unknownFields; - private int _hasBits0; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::Validate.ValidateReflection.Descriptor.MessageTypes[9]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Fixed32Rules() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Fixed32Rules(Fixed32Rules other) : this() { - _hasBits0 = other._hasBits0; - const_ = other.const_; - lt_ = other.lt_; - lte_ = other.lte_; - gt_ = other.gt_; - gte_ = other.gte_; - in_ = other.in_.Clone(); - notIn_ = other.notIn_.Clone(); - ignoreEmpty_ = other.ignoreEmpty_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Fixed32Rules Clone() { - return new Fixed32Rules(this); - } - - /// Field number for the "const" field. - public const int ConstFieldNumber = 1; - private readonly static uint ConstDefaultValue = 0; - - private uint const_; - /// - /// Const specifies that this field must be exactly the specified value - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public uint Const { - get { if ((_hasBits0 & 1) != 0) { return const_; } else { return ConstDefaultValue; } } - set { - _hasBits0 |= 1; - const_ = value; - } - } - /// Gets whether the "const" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasConst { - get { return (_hasBits0 & 1) != 0; } - } - /// Clears the value of the "const" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearConst() { - _hasBits0 &= ~1; - } - - /// Field number for the "lt" field. - public const int LtFieldNumber = 2; - private readonly static uint LtDefaultValue = 0; - - private uint lt_; - /// - /// Lt specifies that this field must be less than the specified value, - /// exclusive - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public uint Lt { - get { if ((_hasBits0 & 2) != 0) { return lt_; } else { return LtDefaultValue; } } - set { - _hasBits0 |= 2; - lt_ = value; - } - } - /// Gets whether the "lt" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasLt { - get { return (_hasBits0 & 2) != 0; } - } - /// Clears the value of the "lt" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearLt() { - _hasBits0 &= ~2; - } - - /// Field number for the "lte" field. - public const int LteFieldNumber = 3; - private readonly static uint LteDefaultValue = 0; - - private uint lte_; - /// - /// Lte specifies that this field must be less than or equal to the - /// specified value, inclusive - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public uint Lte { - get { if ((_hasBits0 & 4) != 0) { return lte_; } else { return LteDefaultValue; } } - set { - _hasBits0 |= 4; - lte_ = value; - } - } - /// Gets whether the "lte" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasLte { - get { return (_hasBits0 & 4) != 0; } - } - /// Clears the value of the "lte" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearLte() { - _hasBits0 &= ~4; - } - - /// Field number for the "gt" field. - public const int GtFieldNumber = 4; - private readonly static uint GtDefaultValue = 0; - - private uint gt_; - /// - /// Gt specifies that this field must be greater than the specified value, - /// exclusive. If the value of Gt is larger than a specified Lt or Lte, the - /// range is reversed. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public uint Gt { - get { if ((_hasBits0 & 8) != 0) { return gt_; } else { return GtDefaultValue; } } - set { - _hasBits0 |= 8; - gt_ = value; - } - } - /// Gets whether the "gt" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasGt { - get { return (_hasBits0 & 8) != 0; } - } - /// Clears the value of the "gt" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearGt() { - _hasBits0 &= ~8; - } - - /// Field number for the "gte" field. - public const int GteFieldNumber = 5; - private readonly static uint GteDefaultValue = 0; - - private uint gte_; - /// - /// Gte specifies that this field must be greater than or equal to the - /// specified value, inclusive. If the value of Gte is larger than a - /// specified Lt or Lte, the range is reversed. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public uint Gte { - get { if ((_hasBits0 & 16) != 0) { return gte_; } else { return GteDefaultValue; } } - set { - _hasBits0 |= 16; - gte_ = value; - } - } - /// Gets whether the "gte" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasGte { - get { return (_hasBits0 & 16) != 0; } - } - /// Clears the value of the "gte" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearGte() { - _hasBits0 &= ~16; - } - - /// Field number for the "in" field. - public const int InFieldNumber = 6; - private static readonly pb::FieldCodec _repeated_in_codec - = pb::FieldCodec.ForFixed32(53); - private readonly pbc::RepeatedField in_ = new pbc::RepeatedField(); - /// - /// In specifies that this field must be equal to one of the specified - /// values - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField In { - get { return in_; } - } - - /// Field number for the "not_in" field. - public const int NotInFieldNumber = 7; - private static readonly pb::FieldCodec _repeated_notIn_codec - = pb::FieldCodec.ForFixed32(61); - private readonly pbc::RepeatedField notIn_ = new pbc::RepeatedField(); - /// - /// NotIn specifies that this field cannot be equal to one of the specified - /// values - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField NotIn { - get { return notIn_; } - } - - /// Field number for the "ignore_empty" field. - public const int IgnoreEmptyFieldNumber = 8; - private readonly static bool IgnoreEmptyDefaultValue = false; - - private bool ignoreEmpty_; - /// - /// IgnoreEmpty specifies that the validation rules of this field should be - /// evaluated only if the field is not empty - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool IgnoreEmpty { - get { if ((_hasBits0 & 32) != 0) { return ignoreEmpty_; } else { return IgnoreEmptyDefaultValue; } } - set { - _hasBits0 |= 32; - ignoreEmpty_ = value; - } - } - /// Gets whether the "ignore_empty" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasIgnoreEmpty { - get { return (_hasBits0 & 32) != 0; } - } - /// Clears the value of the "ignore_empty" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearIgnoreEmpty() { - _hasBits0 &= ~32; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as Fixed32Rules); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(Fixed32Rules other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Const != other.Const) return false; - if (Lt != other.Lt) return false; - if (Lte != other.Lte) return false; - if (Gt != other.Gt) return false; - if (Gte != other.Gte) return false; - if(!in_.Equals(other.in_)) return false; - if(!notIn_.Equals(other.notIn_)) return false; - if (IgnoreEmpty != other.IgnoreEmpty) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (HasConst) hash ^= Const.GetHashCode(); - if (HasLt) hash ^= Lt.GetHashCode(); - if (HasLte) hash ^= Lte.GetHashCode(); - if (HasGt) hash ^= Gt.GetHashCode(); - if (HasGte) hash ^= Gte.GetHashCode(); - hash ^= in_.GetHashCode(); - hash ^= notIn_.GetHashCode(); - if (HasIgnoreEmpty) hash ^= IgnoreEmpty.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (HasConst) { - output.WriteRawTag(13); - output.WriteFixed32(Const); - } - if (HasLt) { - output.WriteRawTag(21); - output.WriteFixed32(Lt); - } - if (HasLte) { - output.WriteRawTag(29); - output.WriteFixed32(Lte); - } - if (HasGt) { - output.WriteRawTag(37); - output.WriteFixed32(Gt); - } - if (HasGte) { - output.WriteRawTag(45); - output.WriteFixed32(Gte); - } - in_.WriteTo(output, _repeated_in_codec); - notIn_.WriteTo(output, _repeated_notIn_codec); - if (HasIgnoreEmpty) { - output.WriteRawTag(64); - output.WriteBool(IgnoreEmpty); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (HasConst) { - output.WriteRawTag(13); - output.WriteFixed32(Const); - } - if (HasLt) { - output.WriteRawTag(21); - output.WriteFixed32(Lt); - } - if (HasLte) { - output.WriteRawTag(29); - output.WriteFixed32(Lte); - } - if (HasGt) { - output.WriteRawTag(37); - output.WriteFixed32(Gt); - } - if (HasGte) { - output.WriteRawTag(45); - output.WriteFixed32(Gte); - } - in_.WriteTo(ref output, _repeated_in_codec); - notIn_.WriteTo(ref output, _repeated_notIn_codec); - if (HasIgnoreEmpty) { - output.WriteRawTag(64); - output.WriteBool(IgnoreEmpty); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (HasConst) { - size += 1 + 4; - } - if (HasLt) { - size += 1 + 4; - } - if (HasLte) { - size += 1 + 4; - } - if (HasGt) { - size += 1 + 4; - } - if (HasGte) { - size += 1 + 4; - } - size += in_.CalculateSize(_repeated_in_codec); - size += notIn_.CalculateSize(_repeated_notIn_codec); - if (HasIgnoreEmpty) { - size += 1 + 1; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(Fixed32Rules other) { - if (other == null) { - return; - } - if (other.HasConst) { - Const = other.Const; - } - if (other.HasLt) { - Lt = other.Lt; - } - if (other.HasLte) { - Lte = other.Lte; - } - if (other.HasGt) { - Gt = other.Gt; - } - if (other.HasGte) { - Gte = other.Gte; - } - in_.Add(other.in_); - notIn_.Add(other.notIn_); - if (other.HasIgnoreEmpty) { - IgnoreEmpty = other.IgnoreEmpty; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 13: { - Const = input.ReadFixed32(); - break; - } - case 21: { - Lt = input.ReadFixed32(); - break; - } - case 29: { - Lte = input.ReadFixed32(); - break; - } - case 37: { - Gt = input.ReadFixed32(); - break; - } - case 45: { - Gte = input.ReadFixed32(); - break; - } - case 50: - case 53: { - in_.AddEntriesFrom(input, _repeated_in_codec); - break; - } - case 58: - case 61: { - notIn_.AddEntriesFrom(input, _repeated_notIn_codec); - break; - } - case 64: { - IgnoreEmpty = input.ReadBool(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 13: { - Const = input.ReadFixed32(); - break; - } - case 21: { - Lt = input.ReadFixed32(); - break; - } - case 29: { - Lte = input.ReadFixed32(); - break; - } - case 37: { - Gt = input.ReadFixed32(); - break; - } - case 45: { - Gte = input.ReadFixed32(); - break; - } - case 50: - case 53: { - in_.AddEntriesFrom(ref input, _repeated_in_codec); - break; - } - case 58: - case 61: { - notIn_.AddEntriesFrom(ref input, _repeated_notIn_codec); - break; - } - case 64: { - IgnoreEmpty = input.ReadBool(); - break; - } - } - } - } - #endif - - } - - /// - /// Fixed64Rules describes the constraints applied to `fixed64` values - /// - public sealed partial class Fixed64Rules : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Fixed64Rules()); - private pb::UnknownFieldSet _unknownFields; - private int _hasBits0; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::Validate.ValidateReflection.Descriptor.MessageTypes[10]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Fixed64Rules() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Fixed64Rules(Fixed64Rules other) : this() { - _hasBits0 = other._hasBits0; - const_ = other.const_; - lt_ = other.lt_; - lte_ = other.lte_; - gt_ = other.gt_; - gte_ = other.gte_; - in_ = other.in_.Clone(); - notIn_ = other.notIn_.Clone(); - ignoreEmpty_ = other.ignoreEmpty_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Fixed64Rules Clone() { - return new Fixed64Rules(this); - } - - /// Field number for the "const" field. - public const int ConstFieldNumber = 1; - private readonly static ulong ConstDefaultValue = 0UL; - - private ulong const_; - /// - /// Const specifies that this field must be exactly the specified value - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ulong Const { - get { if ((_hasBits0 & 1) != 0) { return const_; } else { return ConstDefaultValue; } } - set { - _hasBits0 |= 1; - const_ = value; - } - } - /// Gets whether the "const" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasConst { - get { return (_hasBits0 & 1) != 0; } - } - /// Clears the value of the "const" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearConst() { - _hasBits0 &= ~1; - } - - /// Field number for the "lt" field. - public const int LtFieldNumber = 2; - private readonly static ulong LtDefaultValue = 0UL; - - private ulong lt_; - /// - /// Lt specifies that this field must be less than the specified value, - /// exclusive - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ulong Lt { - get { if ((_hasBits0 & 2) != 0) { return lt_; } else { return LtDefaultValue; } } - set { - _hasBits0 |= 2; - lt_ = value; - } - } - /// Gets whether the "lt" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasLt { - get { return (_hasBits0 & 2) != 0; } - } - /// Clears the value of the "lt" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearLt() { - _hasBits0 &= ~2; - } - - /// Field number for the "lte" field. - public const int LteFieldNumber = 3; - private readonly static ulong LteDefaultValue = 0UL; - - private ulong lte_; - /// - /// Lte specifies that this field must be less than or equal to the - /// specified value, inclusive - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ulong Lte { - get { if ((_hasBits0 & 4) != 0) { return lte_; } else { return LteDefaultValue; } } - set { - _hasBits0 |= 4; - lte_ = value; - } - } - /// Gets whether the "lte" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasLte { - get { return (_hasBits0 & 4) != 0; } - } - /// Clears the value of the "lte" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearLte() { - _hasBits0 &= ~4; - } - - /// Field number for the "gt" field. - public const int GtFieldNumber = 4; - private readonly static ulong GtDefaultValue = 0UL; - - private ulong gt_; - /// - /// Gt specifies that this field must be greater than the specified value, - /// exclusive. If the value of Gt is larger than a specified Lt or Lte, the - /// range is reversed. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ulong Gt { - get { if ((_hasBits0 & 8) != 0) { return gt_; } else { return GtDefaultValue; } } - set { - _hasBits0 |= 8; - gt_ = value; - } - } - /// Gets whether the "gt" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasGt { - get { return (_hasBits0 & 8) != 0; } - } - /// Clears the value of the "gt" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearGt() { - _hasBits0 &= ~8; - } - - /// Field number for the "gte" field. - public const int GteFieldNumber = 5; - private readonly static ulong GteDefaultValue = 0UL; - - private ulong gte_; - /// - /// Gte specifies that this field must be greater than or equal to the - /// specified value, inclusive. If the value of Gte is larger than a - /// specified Lt or Lte, the range is reversed. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ulong Gte { - get { if ((_hasBits0 & 16) != 0) { return gte_; } else { return GteDefaultValue; } } - set { - _hasBits0 |= 16; - gte_ = value; - } - } - /// Gets whether the "gte" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasGte { - get { return (_hasBits0 & 16) != 0; } - } - /// Clears the value of the "gte" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearGte() { - _hasBits0 &= ~16; - } - - /// Field number for the "in" field. - public const int InFieldNumber = 6; - private static readonly pb::FieldCodec _repeated_in_codec - = pb::FieldCodec.ForFixed64(49); - private readonly pbc::RepeatedField in_ = new pbc::RepeatedField(); - /// - /// In specifies that this field must be equal to one of the specified - /// values - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField In { - get { return in_; } - } - - /// Field number for the "not_in" field. - public const int NotInFieldNumber = 7; - private static readonly pb::FieldCodec _repeated_notIn_codec - = pb::FieldCodec.ForFixed64(57); - private readonly pbc::RepeatedField notIn_ = new pbc::RepeatedField(); - /// - /// NotIn specifies that this field cannot be equal to one of the specified - /// values - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField NotIn { - get { return notIn_; } - } - - /// Field number for the "ignore_empty" field. - public const int IgnoreEmptyFieldNumber = 8; - private readonly static bool IgnoreEmptyDefaultValue = false; - - private bool ignoreEmpty_; - /// - /// IgnoreEmpty specifies that the validation rules of this field should be - /// evaluated only if the field is not empty - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool IgnoreEmpty { - get { if ((_hasBits0 & 32) != 0) { return ignoreEmpty_; } else { return IgnoreEmptyDefaultValue; } } - set { - _hasBits0 |= 32; - ignoreEmpty_ = value; - } - } - /// Gets whether the "ignore_empty" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasIgnoreEmpty { - get { return (_hasBits0 & 32) != 0; } - } - /// Clears the value of the "ignore_empty" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearIgnoreEmpty() { - _hasBits0 &= ~32; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as Fixed64Rules); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(Fixed64Rules other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Const != other.Const) return false; - if (Lt != other.Lt) return false; - if (Lte != other.Lte) return false; - if (Gt != other.Gt) return false; - if (Gte != other.Gte) return false; - if(!in_.Equals(other.in_)) return false; - if(!notIn_.Equals(other.notIn_)) return false; - if (IgnoreEmpty != other.IgnoreEmpty) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (HasConst) hash ^= Const.GetHashCode(); - if (HasLt) hash ^= Lt.GetHashCode(); - if (HasLte) hash ^= Lte.GetHashCode(); - if (HasGt) hash ^= Gt.GetHashCode(); - if (HasGte) hash ^= Gte.GetHashCode(); - hash ^= in_.GetHashCode(); - hash ^= notIn_.GetHashCode(); - if (HasIgnoreEmpty) hash ^= IgnoreEmpty.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (HasConst) { - output.WriteRawTag(9); - output.WriteFixed64(Const); - } - if (HasLt) { - output.WriteRawTag(17); - output.WriteFixed64(Lt); - } - if (HasLte) { - output.WriteRawTag(25); - output.WriteFixed64(Lte); - } - if (HasGt) { - output.WriteRawTag(33); - output.WriteFixed64(Gt); - } - if (HasGte) { - output.WriteRawTag(41); - output.WriteFixed64(Gte); - } - in_.WriteTo(output, _repeated_in_codec); - notIn_.WriteTo(output, _repeated_notIn_codec); - if (HasIgnoreEmpty) { - output.WriteRawTag(64); - output.WriteBool(IgnoreEmpty); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (HasConst) { - output.WriteRawTag(9); - output.WriteFixed64(Const); - } - if (HasLt) { - output.WriteRawTag(17); - output.WriteFixed64(Lt); - } - if (HasLte) { - output.WriteRawTag(25); - output.WriteFixed64(Lte); - } - if (HasGt) { - output.WriteRawTag(33); - output.WriteFixed64(Gt); - } - if (HasGte) { - output.WriteRawTag(41); - output.WriteFixed64(Gte); - } - in_.WriteTo(ref output, _repeated_in_codec); - notIn_.WriteTo(ref output, _repeated_notIn_codec); - if (HasIgnoreEmpty) { - output.WriteRawTag(64); - output.WriteBool(IgnoreEmpty); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (HasConst) { - size += 1 + 8; - } - if (HasLt) { - size += 1 + 8; - } - if (HasLte) { - size += 1 + 8; - } - if (HasGt) { - size += 1 + 8; - } - if (HasGte) { - size += 1 + 8; - } - size += in_.CalculateSize(_repeated_in_codec); - size += notIn_.CalculateSize(_repeated_notIn_codec); - if (HasIgnoreEmpty) { - size += 1 + 1; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(Fixed64Rules other) { - if (other == null) { - return; - } - if (other.HasConst) { - Const = other.Const; - } - if (other.HasLt) { - Lt = other.Lt; - } - if (other.HasLte) { - Lte = other.Lte; - } - if (other.HasGt) { - Gt = other.Gt; - } - if (other.HasGte) { - Gte = other.Gte; - } - in_.Add(other.in_); - notIn_.Add(other.notIn_); - if (other.HasIgnoreEmpty) { - IgnoreEmpty = other.IgnoreEmpty; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 9: { - Const = input.ReadFixed64(); - break; - } - case 17: { - Lt = input.ReadFixed64(); - break; - } - case 25: { - Lte = input.ReadFixed64(); - break; - } - case 33: { - Gt = input.ReadFixed64(); - break; - } - case 41: { - Gte = input.ReadFixed64(); - break; - } - case 50: - case 49: { - in_.AddEntriesFrom(input, _repeated_in_codec); - break; - } - case 58: - case 57: { - notIn_.AddEntriesFrom(input, _repeated_notIn_codec); - break; - } - case 64: { - IgnoreEmpty = input.ReadBool(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 9: { - Const = input.ReadFixed64(); - break; - } - case 17: { - Lt = input.ReadFixed64(); - break; - } - case 25: { - Lte = input.ReadFixed64(); - break; - } - case 33: { - Gt = input.ReadFixed64(); - break; - } - case 41: { - Gte = input.ReadFixed64(); - break; - } - case 50: - case 49: { - in_.AddEntriesFrom(ref input, _repeated_in_codec); - break; - } - case 58: - case 57: { - notIn_.AddEntriesFrom(ref input, _repeated_notIn_codec); - break; - } - case 64: { - IgnoreEmpty = input.ReadBool(); - break; - } - } - } - } - #endif - - } - - /// - /// SFixed32Rules describes the constraints applied to `sfixed32` values - /// - public sealed partial class SFixed32Rules : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SFixed32Rules()); - private pb::UnknownFieldSet _unknownFields; - private int _hasBits0; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::Validate.ValidateReflection.Descriptor.MessageTypes[11]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public SFixed32Rules() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public SFixed32Rules(SFixed32Rules other) : this() { - _hasBits0 = other._hasBits0; - const_ = other.const_; - lt_ = other.lt_; - lte_ = other.lte_; - gt_ = other.gt_; - gte_ = other.gte_; - in_ = other.in_.Clone(); - notIn_ = other.notIn_.Clone(); - ignoreEmpty_ = other.ignoreEmpty_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public SFixed32Rules Clone() { - return new SFixed32Rules(this); - } - - /// Field number for the "const" field. - public const int ConstFieldNumber = 1; - private readonly static int ConstDefaultValue = 0; - - private int const_; - /// - /// Const specifies that this field must be exactly the specified value - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int Const { - get { if ((_hasBits0 & 1) != 0) { return const_; } else { return ConstDefaultValue; } } - set { - _hasBits0 |= 1; - const_ = value; - } - } - /// Gets whether the "const" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasConst { - get { return (_hasBits0 & 1) != 0; } - } - /// Clears the value of the "const" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearConst() { - _hasBits0 &= ~1; - } - - /// Field number for the "lt" field. - public const int LtFieldNumber = 2; - private readonly static int LtDefaultValue = 0; - - private int lt_; - /// - /// Lt specifies that this field must be less than the specified value, - /// exclusive - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int Lt { - get { if ((_hasBits0 & 2) != 0) { return lt_; } else { return LtDefaultValue; } } - set { - _hasBits0 |= 2; - lt_ = value; - } - } - /// Gets whether the "lt" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasLt { - get { return (_hasBits0 & 2) != 0; } - } - /// Clears the value of the "lt" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearLt() { - _hasBits0 &= ~2; - } - - /// Field number for the "lte" field. - public const int LteFieldNumber = 3; - private readonly static int LteDefaultValue = 0; - - private int lte_; - /// - /// Lte specifies that this field must be less than or equal to the - /// specified value, inclusive - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int Lte { - get { if ((_hasBits0 & 4) != 0) { return lte_; } else { return LteDefaultValue; } } - set { - _hasBits0 |= 4; - lte_ = value; - } - } - /// Gets whether the "lte" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasLte { - get { return (_hasBits0 & 4) != 0; } - } - /// Clears the value of the "lte" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearLte() { - _hasBits0 &= ~4; - } - - /// Field number for the "gt" field. - public const int GtFieldNumber = 4; - private readonly static int GtDefaultValue = 0; - - private int gt_; - /// - /// Gt specifies that this field must be greater than the specified value, - /// exclusive. If the value of Gt is larger than a specified Lt or Lte, the - /// range is reversed. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int Gt { - get { if ((_hasBits0 & 8) != 0) { return gt_; } else { return GtDefaultValue; } } - set { - _hasBits0 |= 8; - gt_ = value; - } - } - /// Gets whether the "gt" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasGt { - get { return (_hasBits0 & 8) != 0; } - } - /// Clears the value of the "gt" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearGt() { - _hasBits0 &= ~8; - } - - /// Field number for the "gte" field. - public const int GteFieldNumber = 5; - private readonly static int GteDefaultValue = 0; - - private int gte_; - /// - /// Gte specifies that this field must be greater than or equal to the - /// specified value, inclusive. If the value of Gte is larger than a - /// specified Lt or Lte, the range is reversed. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int Gte { - get { if ((_hasBits0 & 16) != 0) { return gte_; } else { return GteDefaultValue; } } - set { - _hasBits0 |= 16; - gte_ = value; - } - } - /// Gets whether the "gte" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasGte { - get { return (_hasBits0 & 16) != 0; } - } - /// Clears the value of the "gte" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearGte() { - _hasBits0 &= ~16; - } - - /// Field number for the "in" field. - public const int InFieldNumber = 6; - private static readonly pb::FieldCodec _repeated_in_codec - = pb::FieldCodec.ForSFixed32(53); - private readonly pbc::RepeatedField in_ = new pbc::RepeatedField(); - /// - /// In specifies that this field must be equal to one of the specified - /// values - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField In { - get { return in_; } - } - - /// Field number for the "not_in" field. - public const int NotInFieldNumber = 7; - private static readonly pb::FieldCodec _repeated_notIn_codec - = pb::FieldCodec.ForSFixed32(61); - private readonly pbc::RepeatedField notIn_ = new pbc::RepeatedField(); - /// - /// NotIn specifies that this field cannot be equal to one of the specified - /// values - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField NotIn { - get { return notIn_; } - } - - /// Field number for the "ignore_empty" field. - public const int IgnoreEmptyFieldNumber = 8; - private readonly static bool IgnoreEmptyDefaultValue = false; - - private bool ignoreEmpty_; - /// - /// IgnoreEmpty specifies that the validation rules of this field should be - /// evaluated only if the field is not empty - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool IgnoreEmpty { - get { if ((_hasBits0 & 32) != 0) { return ignoreEmpty_; } else { return IgnoreEmptyDefaultValue; } } - set { - _hasBits0 |= 32; - ignoreEmpty_ = value; - } - } - /// Gets whether the "ignore_empty" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasIgnoreEmpty { - get { return (_hasBits0 & 32) != 0; } - } - /// Clears the value of the "ignore_empty" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearIgnoreEmpty() { - _hasBits0 &= ~32; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as SFixed32Rules); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(SFixed32Rules other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Const != other.Const) return false; - if (Lt != other.Lt) return false; - if (Lte != other.Lte) return false; - if (Gt != other.Gt) return false; - if (Gte != other.Gte) return false; - if(!in_.Equals(other.in_)) return false; - if(!notIn_.Equals(other.notIn_)) return false; - if (IgnoreEmpty != other.IgnoreEmpty) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (HasConst) hash ^= Const.GetHashCode(); - if (HasLt) hash ^= Lt.GetHashCode(); - if (HasLte) hash ^= Lte.GetHashCode(); - if (HasGt) hash ^= Gt.GetHashCode(); - if (HasGte) hash ^= Gte.GetHashCode(); - hash ^= in_.GetHashCode(); - hash ^= notIn_.GetHashCode(); - if (HasIgnoreEmpty) hash ^= IgnoreEmpty.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (HasConst) { - output.WriteRawTag(13); - output.WriteSFixed32(Const); - } - if (HasLt) { - output.WriteRawTag(21); - output.WriteSFixed32(Lt); - } - if (HasLte) { - output.WriteRawTag(29); - output.WriteSFixed32(Lte); - } - if (HasGt) { - output.WriteRawTag(37); - output.WriteSFixed32(Gt); - } - if (HasGte) { - output.WriteRawTag(45); - output.WriteSFixed32(Gte); - } - in_.WriteTo(output, _repeated_in_codec); - notIn_.WriteTo(output, _repeated_notIn_codec); - if (HasIgnoreEmpty) { - output.WriteRawTag(64); - output.WriteBool(IgnoreEmpty); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (HasConst) { - output.WriteRawTag(13); - output.WriteSFixed32(Const); - } - if (HasLt) { - output.WriteRawTag(21); - output.WriteSFixed32(Lt); - } - if (HasLte) { - output.WriteRawTag(29); - output.WriteSFixed32(Lte); - } - if (HasGt) { - output.WriteRawTag(37); - output.WriteSFixed32(Gt); - } - if (HasGte) { - output.WriteRawTag(45); - output.WriteSFixed32(Gte); - } - in_.WriteTo(ref output, _repeated_in_codec); - notIn_.WriteTo(ref output, _repeated_notIn_codec); - if (HasIgnoreEmpty) { - output.WriteRawTag(64); - output.WriteBool(IgnoreEmpty); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (HasConst) { - size += 1 + 4; - } - if (HasLt) { - size += 1 + 4; - } - if (HasLte) { - size += 1 + 4; - } - if (HasGt) { - size += 1 + 4; - } - if (HasGte) { - size += 1 + 4; - } - size += in_.CalculateSize(_repeated_in_codec); - size += notIn_.CalculateSize(_repeated_notIn_codec); - if (HasIgnoreEmpty) { - size += 1 + 1; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(SFixed32Rules other) { - if (other == null) { - return; - } - if (other.HasConst) { - Const = other.Const; - } - if (other.HasLt) { - Lt = other.Lt; - } - if (other.HasLte) { - Lte = other.Lte; - } - if (other.HasGt) { - Gt = other.Gt; - } - if (other.HasGte) { - Gte = other.Gte; - } - in_.Add(other.in_); - notIn_.Add(other.notIn_); - if (other.HasIgnoreEmpty) { - IgnoreEmpty = other.IgnoreEmpty; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 13: { - Const = input.ReadSFixed32(); - break; - } - case 21: { - Lt = input.ReadSFixed32(); - break; - } - case 29: { - Lte = input.ReadSFixed32(); - break; - } - case 37: { - Gt = input.ReadSFixed32(); - break; - } - case 45: { - Gte = input.ReadSFixed32(); - break; - } - case 50: - case 53: { - in_.AddEntriesFrom(input, _repeated_in_codec); - break; - } - case 58: - case 61: { - notIn_.AddEntriesFrom(input, _repeated_notIn_codec); - break; - } - case 64: { - IgnoreEmpty = input.ReadBool(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 13: { - Const = input.ReadSFixed32(); - break; - } - case 21: { - Lt = input.ReadSFixed32(); - break; - } - case 29: { - Lte = input.ReadSFixed32(); - break; - } - case 37: { - Gt = input.ReadSFixed32(); - break; - } - case 45: { - Gte = input.ReadSFixed32(); - break; - } - case 50: - case 53: { - in_.AddEntriesFrom(ref input, _repeated_in_codec); - break; - } - case 58: - case 61: { - notIn_.AddEntriesFrom(ref input, _repeated_notIn_codec); - break; - } - case 64: { - IgnoreEmpty = input.ReadBool(); - break; - } - } - } - } - #endif - - } - - /// - /// SFixed64Rules describes the constraints applied to `sfixed64` values - /// - public sealed partial class SFixed64Rules : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SFixed64Rules()); - private pb::UnknownFieldSet _unknownFields; - private int _hasBits0; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::Validate.ValidateReflection.Descriptor.MessageTypes[12]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public SFixed64Rules() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public SFixed64Rules(SFixed64Rules other) : this() { - _hasBits0 = other._hasBits0; - const_ = other.const_; - lt_ = other.lt_; - lte_ = other.lte_; - gt_ = other.gt_; - gte_ = other.gte_; - in_ = other.in_.Clone(); - notIn_ = other.notIn_.Clone(); - ignoreEmpty_ = other.ignoreEmpty_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public SFixed64Rules Clone() { - return new SFixed64Rules(this); - } - - /// Field number for the "const" field. - public const int ConstFieldNumber = 1; - private readonly static long ConstDefaultValue = 0L; - - private long const_; - /// - /// Const specifies that this field must be exactly the specified value - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public long Const { - get { if ((_hasBits0 & 1) != 0) { return const_; } else { return ConstDefaultValue; } } - set { - _hasBits0 |= 1; - const_ = value; - } - } - /// Gets whether the "const" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasConst { - get { return (_hasBits0 & 1) != 0; } - } - /// Clears the value of the "const" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearConst() { - _hasBits0 &= ~1; - } - - /// Field number for the "lt" field. - public const int LtFieldNumber = 2; - private readonly static long LtDefaultValue = 0L; - - private long lt_; - /// - /// Lt specifies that this field must be less than the specified value, - /// exclusive - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public long Lt { - get { if ((_hasBits0 & 2) != 0) { return lt_; } else { return LtDefaultValue; } } - set { - _hasBits0 |= 2; - lt_ = value; - } - } - /// Gets whether the "lt" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasLt { - get { return (_hasBits0 & 2) != 0; } - } - /// Clears the value of the "lt" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearLt() { - _hasBits0 &= ~2; - } - - /// Field number for the "lte" field. - public const int LteFieldNumber = 3; - private readonly static long LteDefaultValue = 0L; - - private long lte_; - /// - /// Lte specifies that this field must be less than or equal to the - /// specified value, inclusive - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public long Lte { - get { if ((_hasBits0 & 4) != 0) { return lte_; } else { return LteDefaultValue; } } - set { - _hasBits0 |= 4; - lte_ = value; - } - } - /// Gets whether the "lte" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasLte { - get { return (_hasBits0 & 4) != 0; } - } - /// Clears the value of the "lte" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearLte() { - _hasBits0 &= ~4; - } - - /// Field number for the "gt" field. - public const int GtFieldNumber = 4; - private readonly static long GtDefaultValue = 0L; - - private long gt_; - /// - /// Gt specifies that this field must be greater than the specified value, - /// exclusive. If the value of Gt is larger than a specified Lt or Lte, the - /// range is reversed. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public long Gt { - get { if ((_hasBits0 & 8) != 0) { return gt_; } else { return GtDefaultValue; } } - set { - _hasBits0 |= 8; - gt_ = value; - } - } - /// Gets whether the "gt" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasGt { - get { return (_hasBits0 & 8) != 0; } - } - /// Clears the value of the "gt" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearGt() { - _hasBits0 &= ~8; - } - - /// Field number for the "gte" field. - public const int GteFieldNumber = 5; - private readonly static long GteDefaultValue = 0L; - - private long gte_; - /// - /// Gte specifies that this field must be greater than or equal to the - /// specified value, inclusive. If the value of Gte is larger than a - /// specified Lt or Lte, the range is reversed. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public long Gte { - get { if ((_hasBits0 & 16) != 0) { return gte_; } else { return GteDefaultValue; } } - set { - _hasBits0 |= 16; - gte_ = value; - } - } - /// Gets whether the "gte" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasGte { - get { return (_hasBits0 & 16) != 0; } - } - /// Clears the value of the "gte" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearGte() { - _hasBits0 &= ~16; - } - - /// Field number for the "in" field. - public const int InFieldNumber = 6; - private static readonly pb::FieldCodec _repeated_in_codec - = pb::FieldCodec.ForSFixed64(49); - private readonly pbc::RepeatedField in_ = new pbc::RepeatedField(); - /// - /// In specifies that this field must be equal to one of the specified - /// values - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField In { - get { return in_; } - } - - /// Field number for the "not_in" field. - public const int NotInFieldNumber = 7; - private static readonly pb::FieldCodec _repeated_notIn_codec - = pb::FieldCodec.ForSFixed64(57); - private readonly pbc::RepeatedField notIn_ = new pbc::RepeatedField(); - /// - /// NotIn specifies that this field cannot be equal to one of the specified - /// values - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField NotIn { - get { return notIn_; } - } - - /// Field number for the "ignore_empty" field. - public const int IgnoreEmptyFieldNumber = 8; - private readonly static bool IgnoreEmptyDefaultValue = false; - - private bool ignoreEmpty_; - /// - /// IgnoreEmpty specifies that the validation rules of this field should be - /// evaluated only if the field is not empty - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool IgnoreEmpty { - get { if ((_hasBits0 & 32) != 0) { return ignoreEmpty_; } else { return IgnoreEmptyDefaultValue; } } - set { - _hasBits0 |= 32; - ignoreEmpty_ = value; - } - } - /// Gets whether the "ignore_empty" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasIgnoreEmpty { - get { return (_hasBits0 & 32) != 0; } - } - /// Clears the value of the "ignore_empty" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearIgnoreEmpty() { - _hasBits0 &= ~32; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as SFixed64Rules); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(SFixed64Rules other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Const != other.Const) return false; - if (Lt != other.Lt) return false; - if (Lte != other.Lte) return false; - if (Gt != other.Gt) return false; - if (Gte != other.Gte) return false; - if(!in_.Equals(other.in_)) return false; - if(!notIn_.Equals(other.notIn_)) return false; - if (IgnoreEmpty != other.IgnoreEmpty) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (HasConst) hash ^= Const.GetHashCode(); - if (HasLt) hash ^= Lt.GetHashCode(); - if (HasLte) hash ^= Lte.GetHashCode(); - if (HasGt) hash ^= Gt.GetHashCode(); - if (HasGte) hash ^= Gte.GetHashCode(); - hash ^= in_.GetHashCode(); - hash ^= notIn_.GetHashCode(); - if (HasIgnoreEmpty) hash ^= IgnoreEmpty.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (HasConst) { - output.WriteRawTag(9); - output.WriteSFixed64(Const); - } - if (HasLt) { - output.WriteRawTag(17); - output.WriteSFixed64(Lt); - } - if (HasLte) { - output.WriteRawTag(25); - output.WriteSFixed64(Lte); - } - if (HasGt) { - output.WriteRawTag(33); - output.WriteSFixed64(Gt); - } - if (HasGte) { - output.WriteRawTag(41); - output.WriteSFixed64(Gte); - } - in_.WriteTo(output, _repeated_in_codec); - notIn_.WriteTo(output, _repeated_notIn_codec); - if (HasIgnoreEmpty) { - output.WriteRawTag(64); - output.WriteBool(IgnoreEmpty); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (HasConst) { - output.WriteRawTag(9); - output.WriteSFixed64(Const); - } - if (HasLt) { - output.WriteRawTag(17); - output.WriteSFixed64(Lt); - } - if (HasLte) { - output.WriteRawTag(25); - output.WriteSFixed64(Lte); - } - if (HasGt) { - output.WriteRawTag(33); - output.WriteSFixed64(Gt); - } - if (HasGte) { - output.WriteRawTag(41); - output.WriteSFixed64(Gte); - } - in_.WriteTo(ref output, _repeated_in_codec); - notIn_.WriteTo(ref output, _repeated_notIn_codec); - if (HasIgnoreEmpty) { - output.WriteRawTag(64); - output.WriteBool(IgnoreEmpty); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (HasConst) { - size += 1 + 8; - } - if (HasLt) { - size += 1 + 8; - } - if (HasLte) { - size += 1 + 8; - } - if (HasGt) { - size += 1 + 8; - } - if (HasGte) { - size += 1 + 8; - } - size += in_.CalculateSize(_repeated_in_codec); - size += notIn_.CalculateSize(_repeated_notIn_codec); - if (HasIgnoreEmpty) { - size += 1 + 1; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(SFixed64Rules other) { - if (other == null) { - return; - } - if (other.HasConst) { - Const = other.Const; - } - if (other.HasLt) { - Lt = other.Lt; - } - if (other.HasLte) { - Lte = other.Lte; - } - if (other.HasGt) { - Gt = other.Gt; - } - if (other.HasGte) { - Gte = other.Gte; - } - in_.Add(other.in_); - notIn_.Add(other.notIn_); - if (other.HasIgnoreEmpty) { - IgnoreEmpty = other.IgnoreEmpty; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 9: { - Const = input.ReadSFixed64(); - break; - } - case 17: { - Lt = input.ReadSFixed64(); - break; - } - case 25: { - Lte = input.ReadSFixed64(); - break; - } - case 33: { - Gt = input.ReadSFixed64(); - break; - } - case 41: { - Gte = input.ReadSFixed64(); - break; - } - case 50: - case 49: { - in_.AddEntriesFrom(input, _repeated_in_codec); - break; - } - case 58: - case 57: { - notIn_.AddEntriesFrom(input, _repeated_notIn_codec); - break; - } - case 64: { - IgnoreEmpty = input.ReadBool(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 9: { - Const = input.ReadSFixed64(); - break; - } - case 17: { - Lt = input.ReadSFixed64(); - break; - } - case 25: { - Lte = input.ReadSFixed64(); - break; - } - case 33: { - Gt = input.ReadSFixed64(); - break; - } - case 41: { - Gte = input.ReadSFixed64(); - break; - } - case 50: - case 49: { - in_.AddEntriesFrom(ref input, _repeated_in_codec); - break; - } - case 58: - case 57: { - notIn_.AddEntriesFrom(ref input, _repeated_notIn_codec); - break; - } - case 64: { - IgnoreEmpty = input.ReadBool(); - break; - } - } - } - } - #endif - - } - - /// - /// BoolRules describes the constraints applied to `bool` values - /// - public sealed partial class BoolRules : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new BoolRules()); - private pb::UnknownFieldSet _unknownFields; - private int _hasBits0; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::Validate.ValidateReflection.Descriptor.MessageTypes[13]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public BoolRules() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public BoolRules(BoolRules other) : this() { - _hasBits0 = other._hasBits0; - const_ = other.const_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public BoolRules Clone() { - return new BoolRules(this); - } - - /// Field number for the "const" field. - public const int ConstFieldNumber = 1; - private readonly static bool ConstDefaultValue = false; - - private bool const_; - /// - /// Const specifies that this field must be exactly the specified value - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Const { - get { if ((_hasBits0 & 1) != 0) { return const_; } else { return ConstDefaultValue; } } - set { - _hasBits0 |= 1; - const_ = value; - } - } - /// Gets whether the "const" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasConst { - get { return (_hasBits0 & 1) != 0; } - } - /// Clears the value of the "const" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearConst() { - _hasBits0 &= ~1; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as BoolRules); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(BoolRules other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Const != other.Const) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (HasConst) hash ^= Const.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (HasConst) { - output.WriteRawTag(8); - output.WriteBool(Const); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (HasConst) { - output.WriteRawTag(8); - output.WriteBool(Const); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (HasConst) { - size += 1 + 1; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(BoolRules other) { - if (other == null) { - return; - } - if (other.HasConst) { - Const = other.Const; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 8: { - Const = input.ReadBool(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 8: { - Const = input.ReadBool(); - break; - } - } - } - } - #endif - - } - - /// - /// StringRules describe the constraints applied to `string` values - /// - public sealed partial class StringRules : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new StringRules()); - private pb::UnknownFieldSet _unknownFields; - private int _hasBits0; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::Validate.ValidateReflection.Descriptor.MessageTypes[14]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public StringRules() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public StringRules(StringRules other) : this() { - _hasBits0 = other._hasBits0; - const_ = other.const_; - len_ = other.len_; - minLen_ = other.minLen_; - maxLen_ = other.maxLen_; - lenBytes_ = other.lenBytes_; - minBytes_ = other.minBytes_; - maxBytes_ = other.maxBytes_; - pattern_ = other.pattern_; - prefix_ = other.prefix_; - suffix_ = other.suffix_; - contains_ = other.contains_; - notContains_ = other.notContains_; - in_ = other.in_.Clone(); - notIn_ = other.notIn_.Clone(); - strict_ = other.strict_; - ignoreEmpty_ = other.ignoreEmpty_; - switch (other.WellKnownCase) { - case WellKnownOneofCase.Email: - Email = other.Email; - break; - case WellKnownOneofCase.Hostname: - Hostname = other.Hostname; - break; - case WellKnownOneofCase.Ip: - Ip = other.Ip; - break; - case WellKnownOneofCase.Ipv4: - Ipv4 = other.Ipv4; - break; - case WellKnownOneofCase.Ipv6: - Ipv6 = other.Ipv6; - break; - case WellKnownOneofCase.Uri: - Uri = other.Uri; - break; - case WellKnownOneofCase.UriRef: - UriRef = other.UriRef; - break; - case WellKnownOneofCase.Address: - Address = other.Address; - break; - case WellKnownOneofCase.Uuid: - Uuid = other.Uuid; - break; - case WellKnownOneofCase.WellKnownRegex: - WellKnownRegex = other.WellKnownRegex; - break; - } - - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public StringRules Clone() { - return new StringRules(this); - } - - /// Field number for the "const" field. - public const int ConstFieldNumber = 1; - private readonly static string ConstDefaultValue = ""; - - private string const_; - /// - /// Const specifies that this field must be exactly the specified value - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string Const { - get { return const_ ?? ConstDefaultValue; } - set { - const_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - /// Gets whether the "const" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasConst { - get { return const_ != null; } - } - /// Clears the value of the "const" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearConst() { - const_ = null; - } - - /// Field number for the "len" field. - public const int LenFieldNumber = 19; - private readonly static ulong LenDefaultValue = 0UL; - - private ulong len_; - /// - /// Len specifies that this field must be the specified number of - /// characters (Unicode code points). Note that the number of - /// characters may differ from the number of bytes in the string. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ulong Len { - get { if ((_hasBits0 & 16) != 0) { return len_; } else { return LenDefaultValue; } } - set { - _hasBits0 |= 16; - len_ = value; - } - } - /// Gets whether the "len" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasLen { - get { return (_hasBits0 & 16) != 0; } - } - /// Clears the value of the "len" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearLen() { - _hasBits0 &= ~16; - } - - /// Field number for the "min_len" field. - public const int MinLenFieldNumber = 2; - private readonly static ulong MinLenDefaultValue = 0UL; - - private ulong minLen_; - /// - /// MinLen specifies that this field must be the specified number of - /// characters (Unicode code points) at a minimum. Note that the number of - /// characters may differ from the number of bytes in the string. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ulong MinLen { - get { if ((_hasBits0 & 1) != 0) { return minLen_; } else { return MinLenDefaultValue; } } - set { - _hasBits0 |= 1; - minLen_ = value; - } - } - /// Gets whether the "min_len" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasMinLen { - get { return (_hasBits0 & 1) != 0; } - } - /// Clears the value of the "min_len" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearMinLen() { - _hasBits0 &= ~1; - } - - /// Field number for the "max_len" field. - public const int MaxLenFieldNumber = 3; - private readonly static ulong MaxLenDefaultValue = 0UL; - - private ulong maxLen_; - /// - /// MaxLen specifies that this field must be the specified number of - /// characters (Unicode code points) at a maximum. Note that the number of - /// characters may differ from the number of bytes in the string. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ulong MaxLen { - get { if ((_hasBits0 & 2) != 0) { return maxLen_; } else { return MaxLenDefaultValue; } } - set { - _hasBits0 |= 2; - maxLen_ = value; - } - } - /// Gets whether the "max_len" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasMaxLen { - get { return (_hasBits0 & 2) != 0; } - } - /// Clears the value of the "max_len" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearMaxLen() { - _hasBits0 &= ~2; - } - - /// Field number for the "len_bytes" field. - public const int LenBytesFieldNumber = 20; - private readonly static ulong LenBytesDefaultValue = 0UL; - - private ulong lenBytes_; - /// - /// LenBytes specifies that this field must be the specified number of bytes - /// at a minimum - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ulong LenBytes { - get { if ((_hasBits0 & 32) != 0) { return lenBytes_; } else { return LenBytesDefaultValue; } } - set { - _hasBits0 |= 32; - lenBytes_ = value; - } - } - /// Gets whether the "len_bytes" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasLenBytes { - get { return (_hasBits0 & 32) != 0; } - } - /// Clears the value of the "len_bytes" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearLenBytes() { - _hasBits0 &= ~32; - } - - /// Field number for the "min_bytes" field. - public const int MinBytesFieldNumber = 4; - private readonly static ulong MinBytesDefaultValue = 0UL; - - private ulong minBytes_; - /// - /// MinBytes specifies that this field must be the specified number of bytes - /// at a minimum - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ulong MinBytes { - get { if ((_hasBits0 & 4) != 0) { return minBytes_; } else { return MinBytesDefaultValue; } } - set { - _hasBits0 |= 4; - minBytes_ = value; - } - } - /// Gets whether the "min_bytes" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasMinBytes { - get { return (_hasBits0 & 4) != 0; } - } - /// Clears the value of the "min_bytes" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearMinBytes() { - _hasBits0 &= ~4; - } - - /// Field number for the "max_bytes" field. - public const int MaxBytesFieldNumber = 5; - private readonly static ulong MaxBytesDefaultValue = 0UL; - - private ulong maxBytes_; - /// - /// MaxBytes specifies that this field must be the specified number of bytes - /// at a maximum - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ulong MaxBytes { - get { if ((_hasBits0 & 8) != 0) { return maxBytes_; } else { return MaxBytesDefaultValue; } } - set { - _hasBits0 |= 8; - maxBytes_ = value; - } - } - /// Gets whether the "max_bytes" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasMaxBytes { - get { return (_hasBits0 & 8) != 0; } - } - /// Clears the value of the "max_bytes" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearMaxBytes() { - _hasBits0 &= ~8; - } - - /// Field number for the "pattern" field. - public const int PatternFieldNumber = 6; - private readonly static string PatternDefaultValue = ""; - - private string pattern_; - /// - /// Pattern specifes that this field must match against the specified - /// regular expression (RE2 syntax). The included expression should elide - /// any delimiters. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string Pattern { - get { return pattern_ ?? PatternDefaultValue; } - set { - pattern_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - /// Gets whether the "pattern" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasPattern { - get { return pattern_ != null; } - } - /// Clears the value of the "pattern" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearPattern() { - pattern_ = null; - } - - /// Field number for the "prefix" field. - public const int PrefixFieldNumber = 7; - private readonly static string PrefixDefaultValue = ""; - - private string prefix_; - /// - /// Prefix specifies that this field must have the specified substring at - /// the beginning of the string. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string Prefix { - get { return prefix_ ?? PrefixDefaultValue; } - set { - prefix_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - /// Gets whether the "prefix" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasPrefix { - get { return prefix_ != null; } - } - /// Clears the value of the "prefix" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearPrefix() { - prefix_ = null; - } - - /// Field number for the "suffix" field. - public const int SuffixFieldNumber = 8; - private readonly static string SuffixDefaultValue = ""; - - private string suffix_; - /// - /// Suffix specifies that this field must have the specified substring at - /// the end of the string. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string Suffix { - get { return suffix_ ?? SuffixDefaultValue; } - set { - suffix_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - /// Gets whether the "suffix" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasSuffix { - get { return suffix_ != null; } - } - /// Clears the value of the "suffix" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearSuffix() { - suffix_ = null; - } - - /// Field number for the "contains" field. - public const int ContainsFieldNumber = 9; - private readonly static string ContainsDefaultValue = ""; - - private string contains_; - /// - /// Contains specifies that this field must have the specified substring - /// anywhere in the string. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string Contains { - get { return contains_ ?? ContainsDefaultValue; } - set { - contains_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - /// Gets whether the "contains" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasContains { - get { return contains_ != null; } - } - /// Clears the value of the "contains" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearContains() { - contains_ = null; - } - - /// Field number for the "not_contains" field. - public const int NotContainsFieldNumber = 23; - private readonly static string NotContainsDefaultValue = ""; - - private string notContains_; - /// - /// NotContains specifies that this field cannot have the specified substring - /// anywhere in the string. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string NotContains { - get { return notContains_ ?? NotContainsDefaultValue; } - set { - notContains_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - /// Gets whether the "not_contains" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasNotContains { - get { return notContains_ != null; } - } - /// Clears the value of the "not_contains" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearNotContains() { - notContains_ = null; - } - - /// Field number for the "in" field. - public const int InFieldNumber = 10; - private static readonly pb::FieldCodec _repeated_in_codec - = pb::FieldCodec.ForString(82); - private readonly pbc::RepeatedField in_ = new pbc::RepeatedField(); - /// - /// In specifies that this field must be equal to one of the specified - /// values - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField In { - get { return in_; } - } - - /// Field number for the "not_in" field. - public const int NotInFieldNumber = 11; - private static readonly pb::FieldCodec _repeated_notIn_codec - = pb::FieldCodec.ForString(90); - private readonly pbc::RepeatedField notIn_ = new pbc::RepeatedField(); - /// - /// NotIn specifies that this field cannot be equal to one of the specified - /// values - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField NotIn { - get { return notIn_; } - } - - /// Field number for the "email" field. - public const int EmailFieldNumber = 12; - /// - /// Email specifies that the field must be a valid email address as - /// defined by RFC 5322 - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Email { - get { return HasEmail ? (bool) wellKnown_ : false; } - set { - wellKnown_ = value; - wellKnownCase_ = WellKnownOneofCase.Email; - } - } - /// Gets whether the "email" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasEmail { - get { return wellKnownCase_ == WellKnownOneofCase.Email; } - } - /// Clears the value of the oneof if it's currently set to "email" - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearEmail() { - if (HasEmail) { - ClearWellKnown(); - } - } - - /// Field number for the "hostname" field. - public const int HostnameFieldNumber = 13; - /// - /// Hostname specifies that the field must be a valid hostname as - /// defined by RFC 1034. This constraint does not support - /// internationalized domain names (IDNs). - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Hostname { - get { return HasHostname ? (bool) wellKnown_ : false; } - set { - wellKnown_ = value; - wellKnownCase_ = WellKnownOneofCase.Hostname; - } - } - /// Gets whether the "hostname" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasHostname { - get { return wellKnownCase_ == WellKnownOneofCase.Hostname; } - } - /// Clears the value of the oneof if it's currently set to "hostname" - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearHostname() { - if (HasHostname) { - ClearWellKnown(); - } - } - - /// Field number for the "ip" field. - public const int IpFieldNumber = 14; - /// - /// Ip specifies that the field must be a valid IP (v4 or v6) address. - /// Valid IPv6 addresses should not include surrounding square brackets. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Ip { - get { return HasIp ? (bool) wellKnown_ : false; } - set { - wellKnown_ = value; - wellKnownCase_ = WellKnownOneofCase.Ip; - } - } - /// Gets whether the "ip" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasIp { - get { return wellKnownCase_ == WellKnownOneofCase.Ip; } - } - /// Clears the value of the oneof if it's currently set to "ip" - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearIp() { - if (HasIp) { - ClearWellKnown(); - } - } - - /// Field number for the "ipv4" field. - public const int Ipv4FieldNumber = 15; - /// - /// Ipv4 specifies that the field must be a valid IPv4 address. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Ipv4 { - get { return HasIpv4 ? (bool) wellKnown_ : false; } - set { - wellKnown_ = value; - wellKnownCase_ = WellKnownOneofCase.Ipv4; - } - } - /// Gets whether the "ipv4" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasIpv4 { - get { return wellKnownCase_ == WellKnownOneofCase.Ipv4; } - } - /// Clears the value of the oneof if it's currently set to "ipv4" - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearIpv4() { - if (HasIpv4) { - ClearWellKnown(); - } - } - - /// Field number for the "ipv6" field. - public const int Ipv6FieldNumber = 16; - /// - /// Ipv6 specifies that the field must be a valid IPv6 address. Valid - /// IPv6 addresses should not include surrounding square brackets. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Ipv6 { - get { return HasIpv6 ? (bool) wellKnown_ : false; } - set { - wellKnown_ = value; - wellKnownCase_ = WellKnownOneofCase.Ipv6; - } - } - /// Gets whether the "ipv6" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasIpv6 { - get { return wellKnownCase_ == WellKnownOneofCase.Ipv6; } - } - /// Clears the value of the oneof if it's currently set to "ipv6" - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearIpv6() { - if (HasIpv6) { - ClearWellKnown(); - } - } - - /// Field number for the "uri" field. - public const int UriFieldNumber = 17; - /// - /// Uri specifies that the field must be a valid, absolute URI as defined - /// by RFC 3986 - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Uri { - get { return HasUri ? (bool) wellKnown_ : false; } - set { - wellKnown_ = value; - wellKnownCase_ = WellKnownOneofCase.Uri; - } - } - /// Gets whether the "uri" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasUri { - get { return wellKnownCase_ == WellKnownOneofCase.Uri; } - } - /// Clears the value of the oneof if it's currently set to "uri" - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearUri() { - if (HasUri) { - ClearWellKnown(); - } - } - - /// Field number for the "uri_ref" field. - public const int UriRefFieldNumber = 18; - /// - /// UriRef specifies that the field must be a valid URI as defined by RFC - /// 3986 and may be relative or absolute. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool UriRef { - get { return HasUriRef ? (bool) wellKnown_ : false; } - set { - wellKnown_ = value; - wellKnownCase_ = WellKnownOneofCase.UriRef; - } - } - /// Gets whether the "uri_ref" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasUriRef { - get { return wellKnownCase_ == WellKnownOneofCase.UriRef; } - } - /// Clears the value of the oneof if it's currently set to "uri_ref" - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearUriRef() { - if (HasUriRef) { - ClearWellKnown(); - } - } - - /// Field number for the "address" field. - public const int AddressFieldNumber = 21; - /// - /// Address specifies that the field must be either a valid hostname as - /// defined by RFC 1034 (which does not support internationalized domain - /// names or IDNs), or it can be a valid IP (v4 or v6). - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Address { - get { return HasAddress ? (bool) wellKnown_ : false; } - set { - wellKnown_ = value; - wellKnownCase_ = WellKnownOneofCase.Address; - } - } - /// Gets whether the "address" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasAddress { - get { return wellKnownCase_ == WellKnownOneofCase.Address; } - } - /// Clears the value of the oneof if it's currently set to "address" - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearAddress() { - if (HasAddress) { - ClearWellKnown(); - } - } - - /// Field number for the "uuid" field. - public const int UuidFieldNumber = 22; - /// - /// Uuid specifies that the field must be a valid UUID as defined by - /// RFC 4122 - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Uuid { - get { return HasUuid ? (bool) wellKnown_ : false; } - set { - wellKnown_ = value; - wellKnownCase_ = WellKnownOneofCase.Uuid; - } - } - /// Gets whether the "uuid" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasUuid { - get { return wellKnownCase_ == WellKnownOneofCase.Uuid; } - } - /// Clears the value of the oneof if it's currently set to "uuid" - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearUuid() { - if (HasUuid) { - ClearWellKnown(); - } - } - - /// Field number for the "well_known_regex" field. - public const int WellKnownRegexFieldNumber = 24; - /// - /// WellKnownRegex specifies a common well known pattern defined as a regex. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Validate.KnownRegex WellKnownRegex { - get { return HasWellKnownRegex ? (global::Validate.KnownRegex) wellKnown_ : global::Validate.KnownRegex.Unknown; } - set { - wellKnown_ = value; - wellKnownCase_ = WellKnownOneofCase.WellKnownRegex; - } - } - /// Gets whether the "well_known_regex" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasWellKnownRegex { - get { return wellKnownCase_ == WellKnownOneofCase.WellKnownRegex; } - } - /// Clears the value of the oneof if it's currently set to "well_known_regex" - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearWellKnownRegex() { - if (HasWellKnownRegex) { - ClearWellKnown(); - } - } - - /// Field number for the "strict" field. - public const int StrictFieldNumber = 25; - private readonly static bool StrictDefaultValue = true; - - private bool strict_; - /// - /// This applies to regexes HTTP_HEADER_NAME and HTTP_HEADER_VALUE to enable - /// strict header validation. - /// By default, this is true, and HTTP header validations are RFC-compliant. - /// Setting to false will enable a looser validations that only disallows - /// \r\n\0 characters, which can be used to bypass header matching rules. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Strict { - get { if ((_hasBits0 & 64) != 0) { return strict_; } else { return StrictDefaultValue; } } - set { - _hasBits0 |= 64; - strict_ = value; - } - } - /// Gets whether the "strict" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasStrict { - get { return (_hasBits0 & 64) != 0; } - } - /// Clears the value of the "strict" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearStrict() { - _hasBits0 &= ~64; - } - - /// Field number for the "ignore_empty" field. - public const int IgnoreEmptyFieldNumber = 26; - private readonly static bool IgnoreEmptyDefaultValue = false; - - private bool ignoreEmpty_; - /// - /// IgnoreEmpty specifies that the validation rules of this field should be - /// evaluated only if the field is not empty - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool IgnoreEmpty { - get { if ((_hasBits0 & 128) != 0) { return ignoreEmpty_; } else { return IgnoreEmptyDefaultValue; } } - set { - _hasBits0 |= 128; - ignoreEmpty_ = value; - } - } - /// Gets whether the "ignore_empty" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasIgnoreEmpty { - get { return (_hasBits0 & 128) != 0; } - } - /// Clears the value of the "ignore_empty" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearIgnoreEmpty() { - _hasBits0 &= ~128; - } - - private object wellKnown_; - /// Enum of possible cases for the "well_known" oneof. - public enum WellKnownOneofCase { - None = 0, - Email = 12, - Hostname = 13, - Ip = 14, - Ipv4 = 15, - Ipv6 = 16, - Uri = 17, - UriRef = 18, - Address = 21, - Uuid = 22, - WellKnownRegex = 24, - } - private WellKnownOneofCase wellKnownCase_ = WellKnownOneofCase.None; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public WellKnownOneofCase WellKnownCase { - get { return wellKnownCase_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearWellKnown() { - wellKnownCase_ = WellKnownOneofCase.None; - wellKnown_ = null; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as StringRules); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(StringRules other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Const != other.Const) return false; - if (Len != other.Len) return false; - if (MinLen != other.MinLen) return false; - if (MaxLen != other.MaxLen) return false; - if (LenBytes != other.LenBytes) return false; - if (MinBytes != other.MinBytes) return false; - if (MaxBytes != other.MaxBytes) return false; - if (Pattern != other.Pattern) return false; - if (Prefix != other.Prefix) return false; - if (Suffix != other.Suffix) return false; - if (Contains != other.Contains) return false; - if (NotContains != other.NotContains) return false; - if(!in_.Equals(other.in_)) return false; - if(!notIn_.Equals(other.notIn_)) return false; - if (Email != other.Email) return false; - if (Hostname != other.Hostname) return false; - if (Ip != other.Ip) return false; - if (Ipv4 != other.Ipv4) return false; - if (Ipv6 != other.Ipv6) return false; - if (Uri != other.Uri) return false; - if (UriRef != other.UriRef) return false; - if (Address != other.Address) return false; - if (Uuid != other.Uuid) return false; - if (WellKnownRegex != other.WellKnownRegex) return false; - if (Strict != other.Strict) return false; - if (IgnoreEmpty != other.IgnoreEmpty) return false; - if (WellKnownCase != other.WellKnownCase) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (HasConst) hash ^= Const.GetHashCode(); - if (HasLen) hash ^= Len.GetHashCode(); - if (HasMinLen) hash ^= MinLen.GetHashCode(); - if (HasMaxLen) hash ^= MaxLen.GetHashCode(); - if (HasLenBytes) hash ^= LenBytes.GetHashCode(); - if (HasMinBytes) hash ^= MinBytes.GetHashCode(); - if (HasMaxBytes) hash ^= MaxBytes.GetHashCode(); - if (HasPattern) hash ^= Pattern.GetHashCode(); - if (HasPrefix) hash ^= Prefix.GetHashCode(); - if (HasSuffix) hash ^= Suffix.GetHashCode(); - if (HasContains) hash ^= Contains.GetHashCode(); - if (HasNotContains) hash ^= NotContains.GetHashCode(); - hash ^= in_.GetHashCode(); - hash ^= notIn_.GetHashCode(); - if (HasEmail) hash ^= Email.GetHashCode(); - if (HasHostname) hash ^= Hostname.GetHashCode(); - if (HasIp) hash ^= Ip.GetHashCode(); - if (HasIpv4) hash ^= Ipv4.GetHashCode(); - if (HasIpv6) hash ^= Ipv6.GetHashCode(); - if (HasUri) hash ^= Uri.GetHashCode(); - if (HasUriRef) hash ^= UriRef.GetHashCode(); - if (HasAddress) hash ^= Address.GetHashCode(); - if (HasUuid) hash ^= Uuid.GetHashCode(); - if (HasWellKnownRegex) hash ^= WellKnownRegex.GetHashCode(); - if (HasStrict) hash ^= Strict.GetHashCode(); - if (HasIgnoreEmpty) hash ^= IgnoreEmpty.GetHashCode(); - hash ^= (int) wellKnownCase_; - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (HasConst) { - output.WriteRawTag(10); - output.WriteString(Const); - } - if (HasMinLen) { - output.WriteRawTag(16); - output.WriteUInt64(MinLen); - } - if (HasMaxLen) { - output.WriteRawTag(24); - output.WriteUInt64(MaxLen); - } - if (HasMinBytes) { - output.WriteRawTag(32); - output.WriteUInt64(MinBytes); - } - if (HasMaxBytes) { - output.WriteRawTag(40); - output.WriteUInt64(MaxBytes); - } - if (HasPattern) { - output.WriteRawTag(50); - output.WriteString(Pattern); - } - if (HasPrefix) { - output.WriteRawTag(58); - output.WriteString(Prefix); - } - if (HasSuffix) { - output.WriteRawTag(66); - output.WriteString(Suffix); - } - if (HasContains) { - output.WriteRawTag(74); - output.WriteString(Contains); - } - in_.WriteTo(output, _repeated_in_codec); - notIn_.WriteTo(output, _repeated_notIn_codec); - if (HasEmail) { - output.WriteRawTag(96); - output.WriteBool(Email); - } - if (HasHostname) { - output.WriteRawTag(104); - output.WriteBool(Hostname); - } - if (HasIp) { - output.WriteRawTag(112); - output.WriteBool(Ip); - } - if (HasIpv4) { - output.WriteRawTag(120); - output.WriteBool(Ipv4); - } - if (HasIpv6) { - output.WriteRawTag(128, 1); - output.WriteBool(Ipv6); - } - if (HasUri) { - output.WriteRawTag(136, 1); - output.WriteBool(Uri); - } - if (HasUriRef) { - output.WriteRawTag(144, 1); - output.WriteBool(UriRef); - } - if (HasLen) { - output.WriteRawTag(152, 1); - output.WriteUInt64(Len); - } - if (HasLenBytes) { - output.WriteRawTag(160, 1); - output.WriteUInt64(LenBytes); - } - if (HasAddress) { - output.WriteRawTag(168, 1); - output.WriteBool(Address); - } - if (HasUuid) { - output.WriteRawTag(176, 1); - output.WriteBool(Uuid); - } - if (HasNotContains) { - output.WriteRawTag(186, 1); - output.WriteString(NotContains); - } - if (HasWellKnownRegex) { - output.WriteRawTag(192, 1); - output.WriteEnum((int) WellKnownRegex); - } - if (HasStrict) { - output.WriteRawTag(200, 1); - output.WriteBool(Strict); - } - if (HasIgnoreEmpty) { - output.WriteRawTag(208, 1); - output.WriteBool(IgnoreEmpty); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (HasConst) { - output.WriteRawTag(10); - output.WriteString(Const); - } - if (HasMinLen) { - output.WriteRawTag(16); - output.WriteUInt64(MinLen); - } - if (HasMaxLen) { - output.WriteRawTag(24); - output.WriteUInt64(MaxLen); - } - if (HasMinBytes) { - output.WriteRawTag(32); - output.WriteUInt64(MinBytes); - } - if (HasMaxBytes) { - output.WriteRawTag(40); - output.WriteUInt64(MaxBytes); - } - if (HasPattern) { - output.WriteRawTag(50); - output.WriteString(Pattern); - } - if (HasPrefix) { - output.WriteRawTag(58); - output.WriteString(Prefix); - } - if (HasSuffix) { - output.WriteRawTag(66); - output.WriteString(Suffix); - } - if (HasContains) { - output.WriteRawTag(74); - output.WriteString(Contains); - } - in_.WriteTo(ref output, _repeated_in_codec); - notIn_.WriteTo(ref output, _repeated_notIn_codec); - if (HasEmail) { - output.WriteRawTag(96); - output.WriteBool(Email); - } - if (HasHostname) { - output.WriteRawTag(104); - output.WriteBool(Hostname); - } - if (HasIp) { - output.WriteRawTag(112); - output.WriteBool(Ip); - } - if (HasIpv4) { - output.WriteRawTag(120); - output.WriteBool(Ipv4); - } - if (HasIpv6) { - output.WriteRawTag(128, 1); - output.WriteBool(Ipv6); - } - if (HasUri) { - output.WriteRawTag(136, 1); - output.WriteBool(Uri); - } - if (HasUriRef) { - output.WriteRawTag(144, 1); - output.WriteBool(UriRef); - } - if (HasLen) { - output.WriteRawTag(152, 1); - output.WriteUInt64(Len); - } - if (HasLenBytes) { - output.WriteRawTag(160, 1); - output.WriteUInt64(LenBytes); - } - if (HasAddress) { - output.WriteRawTag(168, 1); - output.WriteBool(Address); - } - if (HasUuid) { - output.WriteRawTag(176, 1); - output.WriteBool(Uuid); - } - if (HasNotContains) { - output.WriteRawTag(186, 1); - output.WriteString(NotContains); - } - if (HasWellKnownRegex) { - output.WriteRawTag(192, 1); - output.WriteEnum((int) WellKnownRegex); - } - if (HasStrict) { - output.WriteRawTag(200, 1); - output.WriteBool(Strict); - } - if (HasIgnoreEmpty) { - output.WriteRawTag(208, 1); - output.WriteBool(IgnoreEmpty); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (HasConst) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Const); - } - if (HasLen) { - size += 2 + pb::CodedOutputStream.ComputeUInt64Size(Len); - } - if (HasMinLen) { - size += 1 + pb::CodedOutputStream.ComputeUInt64Size(MinLen); - } - if (HasMaxLen) { - size += 1 + pb::CodedOutputStream.ComputeUInt64Size(MaxLen); - } - if (HasLenBytes) { - size += 2 + pb::CodedOutputStream.ComputeUInt64Size(LenBytes); - } - if (HasMinBytes) { - size += 1 + pb::CodedOutputStream.ComputeUInt64Size(MinBytes); - } - if (HasMaxBytes) { - size += 1 + pb::CodedOutputStream.ComputeUInt64Size(MaxBytes); - } - if (HasPattern) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Pattern); - } - if (HasPrefix) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Prefix); - } - if (HasSuffix) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Suffix); - } - if (HasContains) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Contains); - } - if (HasNotContains) { - size += 2 + pb::CodedOutputStream.ComputeStringSize(NotContains); - } - size += in_.CalculateSize(_repeated_in_codec); - size += notIn_.CalculateSize(_repeated_notIn_codec); - if (HasEmail) { - size += 1 + 1; - } - if (HasHostname) { - size += 1 + 1; - } - if (HasIp) { - size += 1 + 1; - } - if (HasIpv4) { - size += 1 + 1; - } - if (HasIpv6) { - size += 2 + 1; - } - if (HasUri) { - size += 2 + 1; - } - if (HasUriRef) { - size += 2 + 1; - } - if (HasAddress) { - size += 2 + 1; - } - if (HasUuid) { - size += 2 + 1; - } - if (HasWellKnownRegex) { - size += 2 + pb::CodedOutputStream.ComputeEnumSize((int) WellKnownRegex); - } - if (HasStrict) { - size += 2 + 1; - } - if (HasIgnoreEmpty) { - size += 2 + 1; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(StringRules other) { - if (other == null) { - return; - } - if (other.HasConst) { - Const = other.Const; - } - if (other.HasLen) { - Len = other.Len; - } - if (other.HasMinLen) { - MinLen = other.MinLen; - } - if (other.HasMaxLen) { - MaxLen = other.MaxLen; - } - if (other.HasLenBytes) { - LenBytes = other.LenBytes; - } - if (other.HasMinBytes) { - MinBytes = other.MinBytes; - } - if (other.HasMaxBytes) { - MaxBytes = other.MaxBytes; - } - if (other.HasPattern) { - Pattern = other.Pattern; - } - if (other.HasPrefix) { - Prefix = other.Prefix; - } - if (other.HasSuffix) { - Suffix = other.Suffix; - } - if (other.HasContains) { - Contains = other.Contains; - } - if (other.HasNotContains) { - NotContains = other.NotContains; - } - in_.Add(other.in_); - notIn_.Add(other.notIn_); - if (other.HasStrict) { - Strict = other.Strict; - } - if (other.HasIgnoreEmpty) { - IgnoreEmpty = other.IgnoreEmpty; - } - switch (other.WellKnownCase) { - case WellKnownOneofCase.Email: - Email = other.Email; - break; - case WellKnownOneofCase.Hostname: - Hostname = other.Hostname; - break; - case WellKnownOneofCase.Ip: - Ip = other.Ip; - break; - case WellKnownOneofCase.Ipv4: - Ipv4 = other.Ipv4; - break; - case WellKnownOneofCase.Ipv6: - Ipv6 = other.Ipv6; - break; - case WellKnownOneofCase.Uri: - Uri = other.Uri; - break; - case WellKnownOneofCase.UriRef: - UriRef = other.UriRef; - break; - case WellKnownOneofCase.Address: - Address = other.Address; - break; - case WellKnownOneofCase.Uuid: - Uuid = other.Uuid; - break; - case WellKnownOneofCase.WellKnownRegex: - WellKnownRegex = other.WellKnownRegex; - break; - } - - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - Const = input.ReadString(); - break; - } - case 16: { - MinLen = input.ReadUInt64(); - break; - } - case 24: { - MaxLen = input.ReadUInt64(); - break; - } - case 32: { - MinBytes = input.ReadUInt64(); - break; - } - case 40: { - MaxBytes = input.ReadUInt64(); - break; - } - case 50: { - Pattern = input.ReadString(); - break; - } - case 58: { - Prefix = input.ReadString(); - break; - } - case 66: { - Suffix = input.ReadString(); - break; - } - case 74: { - Contains = input.ReadString(); - break; - } - case 82: { - in_.AddEntriesFrom(input, _repeated_in_codec); - break; - } - case 90: { - notIn_.AddEntriesFrom(input, _repeated_notIn_codec); - break; - } - case 96: { - Email = input.ReadBool(); - break; - } - case 104: { - Hostname = input.ReadBool(); - break; - } - case 112: { - Ip = input.ReadBool(); - break; - } - case 120: { - Ipv4 = input.ReadBool(); - break; - } - case 128: { - Ipv6 = input.ReadBool(); - break; - } - case 136: { - Uri = input.ReadBool(); - break; - } - case 144: { - UriRef = input.ReadBool(); - break; - } - case 152: { - Len = input.ReadUInt64(); - break; - } - case 160: { - LenBytes = input.ReadUInt64(); - break; - } - case 168: { - Address = input.ReadBool(); - break; - } - case 176: { - Uuid = input.ReadBool(); - break; - } - case 186: { - NotContains = input.ReadString(); - break; - } - case 192: { - wellKnown_ = input.ReadEnum(); - wellKnownCase_ = WellKnownOneofCase.WellKnownRegex; - break; - } - case 200: { - Strict = input.ReadBool(); - break; - } - case 208: { - IgnoreEmpty = input.ReadBool(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - Const = input.ReadString(); - break; - } - case 16: { - MinLen = input.ReadUInt64(); - break; - } - case 24: { - MaxLen = input.ReadUInt64(); - break; - } - case 32: { - MinBytes = input.ReadUInt64(); - break; - } - case 40: { - MaxBytes = input.ReadUInt64(); - break; - } - case 50: { - Pattern = input.ReadString(); - break; - } - case 58: { - Prefix = input.ReadString(); - break; - } - case 66: { - Suffix = input.ReadString(); - break; - } - case 74: { - Contains = input.ReadString(); - break; - } - case 82: { - in_.AddEntriesFrom(ref input, _repeated_in_codec); - break; - } - case 90: { - notIn_.AddEntriesFrom(ref input, _repeated_notIn_codec); - break; - } - case 96: { - Email = input.ReadBool(); - break; - } - case 104: { - Hostname = input.ReadBool(); - break; - } - case 112: { - Ip = input.ReadBool(); - break; - } - case 120: { - Ipv4 = input.ReadBool(); - break; - } - case 128: { - Ipv6 = input.ReadBool(); - break; - } - case 136: { - Uri = input.ReadBool(); - break; - } - case 144: { - UriRef = input.ReadBool(); - break; - } - case 152: { - Len = input.ReadUInt64(); - break; - } - case 160: { - LenBytes = input.ReadUInt64(); - break; - } - case 168: { - Address = input.ReadBool(); - break; - } - case 176: { - Uuid = input.ReadBool(); - break; - } - case 186: { - NotContains = input.ReadString(); - break; - } - case 192: { - wellKnown_ = input.ReadEnum(); - wellKnownCase_ = WellKnownOneofCase.WellKnownRegex; - break; - } - case 200: { - Strict = input.ReadBool(); - break; - } - case 208: { - IgnoreEmpty = input.ReadBool(); - break; - } - } - } - } - #endif - - } - - /// - /// BytesRules describe the constraints applied to `bytes` values - /// - public sealed partial class BytesRules : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new BytesRules()); - private pb::UnknownFieldSet _unknownFields; - private int _hasBits0; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::Validate.ValidateReflection.Descriptor.MessageTypes[15]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public BytesRules() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public BytesRules(BytesRules other) : this() { - _hasBits0 = other._hasBits0; - const_ = other.const_; - len_ = other.len_; - minLen_ = other.minLen_; - maxLen_ = other.maxLen_; - pattern_ = other.pattern_; - prefix_ = other.prefix_; - suffix_ = other.suffix_; - contains_ = other.contains_; - in_ = other.in_.Clone(); - notIn_ = other.notIn_.Clone(); - ignoreEmpty_ = other.ignoreEmpty_; - switch (other.WellKnownCase) { - case WellKnownOneofCase.Ip: - Ip = other.Ip; - break; - case WellKnownOneofCase.Ipv4: - Ipv4 = other.Ipv4; - break; - case WellKnownOneofCase.Ipv6: - Ipv6 = other.Ipv6; - break; - } - - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public BytesRules Clone() { - return new BytesRules(this); - } - - /// Field number for the "const" field. - public const int ConstFieldNumber = 1; - private readonly static pb::ByteString ConstDefaultValue = pb::ByteString.Empty; - - private pb::ByteString const_; - /// - /// Const specifies that this field must be exactly the specified value - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pb::ByteString Const { - get { return const_ ?? ConstDefaultValue; } - set { - const_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - /// Gets whether the "const" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasConst { - get { return const_ != null; } - } - /// Clears the value of the "const" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearConst() { - const_ = null; - } - - /// Field number for the "len" field. - public const int LenFieldNumber = 13; - private readonly static ulong LenDefaultValue = 0UL; - - private ulong len_; - /// - /// Len specifies that this field must be the specified number of bytes - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ulong Len { - get { if ((_hasBits0 & 4) != 0) { return len_; } else { return LenDefaultValue; } } - set { - _hasBits0 |= 4; - len_ = value; - } - } - /// Gets whether the "len" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasLen { - get { return (_hasBits0 & 4) != 0; } - } - /// Clears the value of the "len" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearLen() { - _hasBits0 &= ~4; - } - - /// Field number for the "min_len" field. - public const int MinLenFieldNumber = 2; - private readonly static ulong MinLenDefaultValue = 0UL; - - private ulong minLen_; - /// - /// MinLen specifies that this field must be the specified number of bytes - /// at a minimum - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ulong MinLen { - get { if ((_hasBits0 & 1) != 0) { return minLen_; } else { return MinLenDefaultValue; } } - set { - _hasBits0 |= 1; - minLen_ = value; - } - } - /// Gets whether the "min_len" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasMinLen { - get { return (_hasBits0 & 1) != 0; } - } - /// Clears the value of the "min_len" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearMinLen() { - _hasBits0 &= ~1; - } - - /// Field number for the "max_len" field. - public const int MaxLenFieldNumber = 3; - private readonly static ulong MaxLenDefaultValue = 0UL; - - private ulong maxLen_; - /// - /// MaxLen specifies that this field must be the specified number of bytes - /// at a maximum - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ulong MaxLen { - get { if ((_hasBits0 & 2) != 0) { return maxLen_; } else { return MaxLenDefaultValue; } } - set { - _hasBits0 |= 2; - maxLen_ = value; - } - } - /// Gets whether the "max_len" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasMaxLen { - get { return (_hasBits0 & 2) != 0; } - } - /// Clears the value of the "max_len" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearMaxLen() { - _hasBits0 &= ~2; - } - - /// Field number for the "pattern" field. - public const int PatternFieldNumber = 4; - private readonly static string PatternDefaultValue = ""; - - private string pattern_; - /// - /// Pattern specifes that this field must match against the specified - /// regular expression (RE2 syntax). The included expression should elide - /// any delimiters. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string Pattern { - get { return pattern_ ?? PatternDefaultValue; } - set { - pattern_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - /// Gets whether the "pattern" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasPattern { - get { return pattern_ != null; } - } - /// Clears the value of the "pattern" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearPattern() { - pattern_ = null; - } - - /// Field number for the "prefix" field. - public const int PrefixFieldNumber = 5; - private readonly static pb::ByteString PrefixDefaultValue = pb::ByteString.Empty; - - private pb::ByteString prefix_; - /// - /// Prefix specifies that this field must have the specified bytes at the - /// beginning of the string. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pb::ByteString Prefix { - get { return prefix_ ?? PrefixDefaultValue; } - set { - prefix_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - /// Gets whether the "prefix" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasPrefix { - get { return prefix_ != null; } - } - /// Clears the value of the "prefix" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearPrefix() { - prefix_ = null; - } - - /// Field number for the "suffix" field. - public const int SuffixFieldNumber = 6; - private readonly static pb::ByteString SuffixDefaultValue = pb::ByteString.Empty; - - private pb::ByteString suffix_; - /// - /// Suffix specifies that this field must have the specified bytes at the - /// end of the string. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pb::ByteString Suffix { - get { return suffix_ ?? SuffixDefaultValue; } - set { - suffix_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - /// Gets whether the "suffix" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasSuffix { - get { return suffix_ != null; } - } - /// Clears the value of the "suffix" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearSuffix() { - suffix_ = null; - } - - /// Field number for the "contains" field. - public const int ContainsFieldNumber = 7; - private readonly static pb::ByteString ContainsDefaultValue = pb::ByteString.Empty; - - private pb::ByteString contains_; - /// - /// Contains specifies that this field must have the specified bytes - /// anywhere in the string. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pb::ByteString Contains { - get { return contains_ ?? ContainsDefaultValue; } - set { - contains_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - /// Gets whether the "contains" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasContains { - get { return contains_ != null; } - } - /// Clears the value of the "contains" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearContains() { - contains_ = null; - } - - /// Field number for the "in" field. - public const int InFieldNumber = 8; - private static readonly pb::FieldCodec _repeated_in_codec - = pb::FieldCodec.ForBytes(66); - private readonly pbc::RepeatedField in_ = new pbc::RepeatedField(); - /// - /// In specifies that this field must be equal to one of the specified - /// values - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField In { - get { return in_; } - } - - /// Field number for the "not_in" field. - public const int NotInFieldNumber = 9; - private static readonly pb::FieldCodec _repeated_notIn_codec - = pb::FieldCodec.ForBytes(74); - private readonly pbc::RepeatedField notIn_ = new pbc::RepeatedField(); - /// - /// NotIn specifies that this field cannot be equal to one of the specified - /// values - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField NotIn { - get { return notIn_; } - } - - /// Field number for the "ip" field. - public const int IpFieldNumber = 10; - /// - /// Ip specifies that the field must be a valid IP (v4 or v6) address in - /// byte format - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Ip { - get { return HasIp ? (bool) wellKnown_ : false; } - set { - wellKnown_ = value; - wellKnownCase_ = WellKnownOneofCase.Ip; - } - } - /// Gets whether the "ip" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasIp { - get { return wellKnownCase_ == WellKnownOneofCase.Ip; } - } - /// Clears the value of the oneof if it's currently set to "ip" - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearIp() { - if (HasIp) { - ClearWellKnown(); - } - } - - /// Field number for the "ipv4" field. - public const int Ipv4FieldNumber = 11; - /// - /// Ipv4 specifies that the field must be a valid IPv4 address in byte - /// format - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Ipv4 { - get { return HasIpv4 ? (bool) wellKnown_ : false; } - set { - wellKnown_ = value; - wellKnownCase_ = WellKnownOneofCase.Ipv4; - } - } - /// Gets whether the "ipv4" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasIpv4 { - get { return wellKnownCase_ == WellKnownOneofCase.Ipv4; } - } - /// Clears the value of the oneof if it's currently set to "ipv4" - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearIpv4() { - if (HasIpv4) { - ClearWellKnown(); - } - } - - /// Field number for the "ipv6" field. - public const int Ipv6FieldNumber = 12; - /// - /// Ipv6 specifies that the field must be a valid IPv6 address in byte - /// format - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Ipv6 { - get { return HasIpv6 ? (bool) wellKnown_ : false; } - set { - wellKnown_ = value; - wellKnownCase_ = WellKnownOneofCase.Ipv6; - } - } - /// Gets whether the "ipv6" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasIpv6 { - get { return wellKnownCase_ == WellKnownOneofCase.Ipv6; } - } - /// Clears the value of the oneof if it's currently set to "ipv6" - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearIpv6() { - if (HasIpv6) { - ClearWellKnown(); - } - } - - /// Field number for the "ignore_empty" field. - public const int IgnoreEmptyFieldNumber = 14; - private readonly static bool IgnoreEmptyDefaultValue = false; - - private bool ignoreEmpty_; - /// - /// IgnoreEmpty specifies that the validation rules of this field should be - /// evaluated only if the field is not empty - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool IgnoreEmpty { - get { if ((_hasBits0 & 8) != 0) { return ignoreEmpty_; } else { return IgnoreEmptyDefaultValue; } } - set { - _hasBits0 |= 8; - ignoreEmpty_ = value; - } - } - /// Gets whether the "ignore_empty" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasIgnoreEmpty { - get { return (_hasBits0 & 8) != 0; } - } - /// Clears the value of the "ignore_empty" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearIgnoreEmpty() { - _hasBits0 &= ~8; - } - - private object wellKnown_; - /// Enum of possible cases for the "well_known" oneof. - public enum WellKnownOneofCase { - None = 0, - Ip = 10, - Ipv4 = 11, - Ipv6 = 12, - } - private WellKnownOneofCase wellKnownCase_ = WellKnownOneofCase.None; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public WellKnownOneofCase WellKnownCase { - get { return wellKnownCase_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearWellKnown() { - wellKnownCase_ = WellKnownOneofCase.None; - wellKnown_ = null; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as BytesRules); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(BytesRules other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Const != other.Const) return false; - if (Len != other.Len) return false; - if (MinLen != other.MinLen) return false; - if (MaxLen != other.MaxLen) return false; - if (Pattern != other.Pattern) return false; - if (Prefix != other.Prefix) return false; - if (Suffix != other.Suffix) return false; - if (Contains != other.Contains) return false; - if(!in_.Equals(other.in_)) return false; - if(!notIn_.Equals(other.notIn_)) return false; - if (Ip != other.Ip) return false; - if (Ipv4 != other.Ipv4) return false; - if (Ipv6 != other.Ipv6) return false; - if (IgnoreEmpty != other.IgnoreEmpty) return false; - if (WellKnownCase != other.WellKnownCase) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (HasConst) hash ^= Const.GetHashCode(); - if (HasLen) hash ^= Len.GetHashCode(); - if (HasMinLen) hash ^= MinLen.GetHashCode(); - if (HasMaxLen) hash ^= MaxLen.GetHashCode(); - if (HasPattern) hash ^= Pattern.GetHashCode(); - if (HasPrefix) hash ^= Prefix.GetHashCode(); - if (HasSuffix) hash ^= Suffix.GetHashCode(); - if (HasContains) hash ^= Contains.GetHashCode(); - hash ^= in_.GetHashCode(); - hash ^= notIn_.GetHashCode(); - if (HasIp) hash ^= Ip.GetHashCode(); - if (HasIpv4) hash ^= Ipv4.GetHashCode(); - if (HasIpv6) hash ^= Ipv6.GetHashCode(); - if (HasIgnoreEmpty) hash ^= IgnoreEmpty.GetHashCode(); - hash ^= (int) wellKnownCase_; - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (HasConst) { - output.WriteRawTag(10); - output.WriteBytes(Const); - } - if (HasMinLen) { - output.WriteRawTag(16); - output.WriteUInt64(MinLen); - } - if (HasMaxLen) { - output.WriteRawTag(24); - output.WriteUInt64(MaxLen); - } - if (HasPattern) { - output.WriteRawTag(34); - output.WriteString(Pattern); - } - if (HasPrefix) { - output.WriteRawTag(42); - output.WriteBytes(Prefix); - } - if (HasSuffix) { - output.WriteRawTag(50); - output.WriteBytes(Suffix); - } - if (HasContains) { - output.WriteRawTag(58); - output.WriteBytes(Contains); - } - in_.WriteTo(output, _repeated_in_codec); - notIn_.WriteTo(output, _repeated_notIn_codec); - if (HasIp) { - output.WriteRawTag(80); - output.WriteBool(Ip); - } - if (HasIpv4) { - output.WriteRawTag(88); - output.WriteBool(Ipv4); - } - if (HasIpv6) { - output.WriteRawTag(96); - output.WriteBool(Ipv6); - } - if (HasLen) { - output.WriteRawTag(104); - output.WriteUInt64(Len); - } - if (HasIgnoreEmpty) { - output.WriteRawTag(112); - output.WriteBool(IgnoreEmpty); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (HasConst) { - output.WriteRawTag(10); - output.WriteBytes(Const); - } - if (HasMinLen) { - output.WriteRawTag(16); - output.WriteUInt64(MinLen); - } - if (HasMaxLen) { - output.WriteRawTag(24); - output.WriteUInt64(MaxLen); - } - if (HasPattern) { - output.WriteRawTag(34); - output.WriteString(Pattern); - } - if (HasPrefix) { - output.WriteRawTag(42); - output.WriteBytes(Prefix); - } - if (HasSuffix) { - output.WriteRawTag(50); - output.WriteBytes(Suffix); - } - if (HasContains) { - output.WriteRawTag(58); - output.WriteBytes(Contains); - } - in_.WriteTo(ref output, _repeated_in_codec); - notIn_.WriteTo(ref output, _repeated_notIn_codec); - if (HasIp) { - output.WriteRawTag(80); - output.WriteBool(Ip); - } - if (HasIpv4) { - output.WriteRawTag(88); - output.WriteBool(Ipv4); - } - if (HasIpv6) { - output.WriteRawTag(96); - output.WriteBool(Ipv6); - } - if (HasLen) { - output.WriteRawTag(104); - output.WriteUInt64(Len); - } - if (HasIgnoreEmpty) { - output.WriteRawTag(112); - output.WriteBool(IgnoreEmpty); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (HasConst) { - size += 1 + pb::CodedOutputStream.ComputeBytesSize(Const); - } - if (HasLen) { - size += 1 + pb::CodedOutputStream.ComputeUInt64Size(Len); - } - if (HasMinLen) { - size += 1 + pb::CodedOutputStream.ComputeUInt64Size(MinLen); - } - if (HasMaxLen) { - size += 1 + pb::CodedOutputStream.ComputeUInt64Size(MaxLen); - } - if (HasPattern) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Pattern); - } - if (HasPrefix) { - size += 1 + pb::CodedOutputStream.ComputeBytesSize(Prefix); - } - if (HasSuffix) { - size += 1 + pb::CodedOutputStream.ComputeBytesSize(Suffix); - } - if (HasContains) { - size += 1 + pb::CodedOutputStream.ComputeBytesSize(Contains); - } - size += in_.CalculateSize(_repeated_in_codec); - size += notIn_.CalculateSize(_repeated_notIn_codec); - if (HasIp) { - size += 1 + 1; - } - if (HasIpv4) { - size += 1 + 1; - } - if (HasIpv6) { - size += 1 + 1; - } - if (HasIgnoreEmpty) { - size += 1 + 1; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(BytesRules other) { - if (other == null) { - return; - } - if (other.HasConst) { - Const = other.Const; - } - if (other.HasLen) { - Len = other.Len; - } - if (other.HasMinLen) { - MinLen = other.MinLen; - } - if (other.HasMaxLen) { - MaxLen = other.MaxLen; - } - if (other.HasPattern) { - Pattern = other.Pattern; - } - if (other.HasPrefix) { - Prefix = other.Prefix; - } - if (other.HasSuffix) { - Suffix = other.Suffix; - } - if (other.HasContains) { - Contains = other.Contains; - } - in_.Add(other.in_); - notIn_.Add(other.notIn_); - if (other.HasIgnoreEmpty) { - IgnoreEmpty = other.IgnoreEmpty; - } - switch (other.WellKnownCase) { - case WellKnownOneofCase.Ip: - Ip = other.Ip; - break; - case WellKnownOneofCase.Ipv4: - Ipv4 = other.Ipv4; - break; - case WellKnownOneofCase.Ipv6: - Ipv6 = other.Ipv6; - break; - } - - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - Const = input.ReadBytes(); - break; - } - case 16: { - MinLen = input.ReadUInt64(); - break; - } - case 24: { - MaxLen = input.ReadUInt64(); - break; - } - case 34: { - Pattern = input.ReadString(); - break; - } - case 42: { - Prefix = input.ReadBytes(); - break; - } - case 50: { - Suffix = input.ReadBytes(); - break; - } - case 58: { - Contains = input.ReadBytes(); - break; - } - case 66: { - in_.AddEntriesFrom(input, _repeated_in_codec); - break; - } - case 74: { - notIn_.AddEntriesFrom(input, _repeated_notIn_codec); - break; - } - case 80: { - Ip = input.ReadBool(); - break; - } - case 88: { - Ipv4 = input.ReadBool(); - break; - } - case 96: { - Ipv6 = input.ReadBool(); - break; - } - case 104: { - Len = input.ReadUInt64(); - break; - } - case 112: { - IgnoreEmpty = input.ReadBool(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - Const = input.ReadBytes(); - break; - } - case 16: { - MinLen = input.ReadUInt64(); - break; - } - case 24: { - MaxLen = input.ReadUInt64(); - break; - } - case 34: { - Pattern = input.ReadString(); - break; - } - case 42: { - Prefix = input.ReadBytes(); - break; - } - case 50: { - Suffix = input.ReadBytes(); - break; - } - case 58: { - Contains = input.ReadBytes(); - break; - } - case 66: { - in_.AddEntriesFrom(ref input, _repeated_in_codec); - break; - } - case 74: { - notIn_.AddEntriesFrom(ref input, _repeated_notIn_codec); - break; - } - case 80: { - Ip = input.ReadBool(); - break; - } - case 88: { - Ipv4 = input.ReadBool(); - break; - } - case 96: { - Ipv6 = input.ReadBool(); - break; - } - case 104: { - Len = input.ReadUInt64(); - break; - } - case 112: { - IgnoreEmpty = input.ReadBool(); - break; - } - } - } - } - #endif - - } - - /// - /// EnumRules describe the constraints applied to enum values - /// - public sealed partial class EnumRules : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new EnumRules()); - private pb::UnknownFieldSet _unknownFields; - private int _hasBits0; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::Validate.ValidateReflection.Descriptor.MessageTypes[16]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public EnumRules() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public EnumRules(EnumRules other) : this() { - _hasBits0 = other._hasBits0; - const_ = other.const_; - definedOnly_ = other.definedOnly_; - in_ = other.in_.Clone(); - notIn_ = other.notIn_.Clone(); - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public EnumRules Clone() { - return new EnumRules(this); - } - - /// Field number for the "const" field. - public const int ConstFieldNumber = 1; - private readonly static int ConstDefaultValue = 0; - - private int const_; - /// - /// Const specifies that this field must be exactly the specified value - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int Const { - get { if ((_hasBits0 & 1) != 0) { return const_; } else { return ConstDefaultValue; } } - set { - _hasBits0 |= 1; - const_ = value; - } - } - /// Gets whether the "const" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasConst { - get { return (_hasBits0 & 1) != 0; } - } - /// Clears the value of the "const" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearConst() { - _hasBits0 &= ~1; - } - - /// Field number for the "defined_only" field. - public const int DefinedOnlyFieldNumber = 2; - private readonly static bool DefinedOnlyDefaultValue = false; - - private bool definedOnly_; - /// - /// DefinedOnly specifies that this field must be only one of the defined - /// values for this enum, failing on any undefined value. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool DefinedOnly { - get { if ((_hasBits0 & 2) != 0) { return definedOnly_; } else { return DefinedOnlyDefaultValue; } } - set { - _hasBits0 |= 2; - definedOnly_ = value; - } - } - /// Gets whether the "defined_only" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasDefinedOnly { - get { return (_hasBits0 & 2) != 0; } - } - /// Clears the value of the "defined_only" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearDefinedOnly() { - _hasBits0 &= ~2; - } - - /// Field number for the "in" field. - public const int InFieldNumber = 3; - private static readonly pb::FieldCodec _repeated_in_codec - = pb::FieldCodec.ForInt32(24); - private readonly pbc::RepeatedField in_ = new pbc::RepeatedField(); - /// - /// In specifies that this field must be equal to one of the specified - /// values - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField In { - get { return in_; } - } - - /// Field number for the "not_in" field. - public const int NotInFieldNumber = 4; - private static readonly pb::FieldCodec _repeated_notIn_codec - = pb::FieldCodec.ForInt32(32); - private readonly pbc::RepeatedField notIn_ = new pbc::RepeatedField(); - /// - /// NotIn specifies that this field cannot be equal to one of the specified - /// values - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField NotIn { - get { return notIn_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as EnumRules); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(EnumRules other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Const != other.Const) return false; - if (DefinedOnly != other.DefinedOnly) return false; - if(!in_.Equals(other.in_)) return false; - if(!notIn_.Equals(other.notIn_)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (HasConst) hash ^= Const.GetHashCode(); - if (HasDefinedOnly) hash ^= DefinedOnly.GetHashCode(); - hash ^= in_.GetHashCode(); - hash ^= notIn_.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (HasConst) { - output.WriteRawTag(8); - output.WriteInt32(Const); - } - if (HasDefinedOnly) { - output.WriteRawTag(16); - output.WriteBool(DefinedOnly); - } - in_.WriteTo(output, _repeated_in_codec); - notIn_.WriteTo(output, _repeated_notIn_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (HasConst) { - output.WriteRawTag(8); - output.WriteInt32(Const); - } - if (HasDefinedOnly) { - output.WriteRawTag(16); - output.WriteBool(DefinedOnly); - } - in_.WriteTo(ref output, _repeated_in_codec); - notIn_.WriteTo(ref output, _repeated_notIn_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (HasConst) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(Const); - } - if (HasDefinedOnly) { - size += 1 + 1; - } - size += in_.CalculateSize(_repeated_in_codec); - size += notIn_.CalculateSize(_repeated_notIn_codec); - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(EnumRules other) { - if (other == null) { - return; - } - if (other.HasConst) { - Const = other.Const; - } - if (other.HasDefinedOnly) { - DefinedOnly = other.DefinedOnly; - } - in_.Add(other.in_); - notIn_.Add(other.notIn_); - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 8: { - Const = input.ReadInt32(); - break; - } - case 16: { - DefinedOnly = input.ReadBool(); - break; - } - case 26: - case 24: { - in_.AddEntriesFrom(input, _repeated_in_codec); - break; - } - case 34: - case 32: { - notIn_.AddEntriesFrom(input, _repeated_notIn_codec); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 8: { - Const = input.ReadInt32(); - break; - } - case 16: { - DefinedOnly = input.ReadBool(); - break; - } - case 26: - case 24: { - in_.AddEntriesFrom(ref input, _repeated_in_codec); - break; - } - case 34: - case 32: { - notIn_.AddEntriesFrom(ref input, _repeated_notIn_codec); - break; - } - } - } - } - #endif - - } - - /// - /// MessageRules describe the constraints applied to embedded message values. - /// For message-type fields, validation is performed recursively. - /// - public sealed partial class MessageRules : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MessageRules()); - private pb::UnknownFieldSet _unknownFields; - private int _hasBits0; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::Validate.ValidateReflection.Descriptor.MessageTypes[17]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public MessageRules() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public MessageRules(MessageRules other) : this() { - _hasBits0 = other._hasBits0; - skip_ = other.skip_; - required_ = other.required_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public MessageRules Clone() { - return new MessageRules(this); - } - - /// Field number for the "skip" field. - public const int SkipFieldNumber = 1; - private readonly static bool SkipDefaultValue = false; - - private bool skip_; - /// - /// Skip specifies that the validation rules of this field should not be - /// evaluated - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Skip { - get { if ((_hasBits0 & 1) != 0) { return skip_; } else { return SkipDefaultValue; } } - set { - _hasBits0 |= 1; - skip_ = value; - } - } - /// Gets whether the "skip" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasSkip { - get { return (_hasBits0 & 1) != 0; } - } - /// Clears the value of the "skip" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearSkip() { - _hasBits0 &= ~1; - } - - /// Field number for the "required" field. - public const int RequiredFieldNumber = 2; - private readonly static bool RequiredDefaultValue = false; - - private bool required_; - /// - /// Required specifies that this field must be set - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Required { - get { if ((_hasBits0 & 2) != 0) { return required_; } else { return RequiredDefaultValue; } } - set { - _hasBits0 |= 2; - required_ = value; - } - } - /// Gets whether the "required" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasRequired { - get { return (_hasBits0 & 2) != 0; } - } - /// Clears the value of the "required" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearRequired() { - _hasBits0 &= ~2; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as MessageRules); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(MessageRules other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Skip != other.Skip) return false; - if (Required != other.Required) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (HasSkip) hash ^= Skip.GetHashCode(); - if (HasRequired) hash ^= Required.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (HasSkip) { - output.WriteRawTag(8); - output.WriteBool(Skip); - } - if (HasRequired) { - output.WriteRawTag(16); - output.WriteBool(Required); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (HasSkip) { - output.WriteRawTag(8); - output.WriteBool(Skip); - } - if (HasRequired) { - output.WriteRawTag(16); - output.WriteBool(Required); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (HasSkip) { - size += 1 + 1; - } - if (HasRequired) { - size += 1 + 1; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(MessageRules other) { - if (other == null) { - return; - } - if (other.HasSkip) { - Skip = other.Skip; - } - if (other.HasRequired) { - Required = other.Required; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 8: { - Skip = input.ReadBool(); - break; - } - case 16: { - Required = input.ReadBool(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 8: { - Skip = input.ReadBool(); - break; - } - case 16: { - Required = input.ReadBool(); - break; - } - } - } - } - #endif - - } - - /// - /// RepeatedRules describe the constraints applied to `repeated` values - /// - public sealed partial class RepeatedRules : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RepeatedRules()); - private pb::UnknownFieldSet _unknownFields; - private int _hasBits0; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::Validate.ValidateReflection.Descriptor.MessageTypes[18]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RepeatedRules() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RepeatedRules(RepeatedRules other) : this() { - _hasBits0 = other._hasBits0; - minItems_ = other.minItems_; - maxItems_ = other.maxItems_; - unique_ = other.unique_; - items_ = other.items_ != null ? other.items_.Clone() : null; - ignoreEmpty_ = other.ignoreEmpty_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RepeatedRules Clone() { - return new RepeatedRules(this); - } - - /// Field number for the "min_items" field. - public const int MinItemsFieldNumber = 1; - private readonly static ulong MinItemsDefaultValue = 0UL; - - private ulong minItems_; - /// - /// MinItems specifies that this field must have the specified number of - /// items at a minimum - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ulong MinItems { - get { if ((_hasBits0 & 1) != 0) { return minItems_; } else { return MinItemsDefaultValue; } } - set { - _hasBits0 |= 1; - minItems_ = value; - } - } - /// Gets whether the "min_items" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasMinItems { - get { return (_hasBits0 & 1) != 0; } - } - /// Clears the value of the "min_items" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearMinItems() { - _hasBits0 &= ~1; - } - - /// Field number for the "max_items" field. - public const int MaxItemsFieldNumber = 2; - private readonly static ulong MaxItemsDefaultValue = 0UL; - - private ulong maxItems_; - /// - /// MaxItems specifies that this field must have the specified number of - /// items at a maximum - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ulong MaxItems { - get { if ((_hasBits0 & 2) != 0) { return maxItems_; } else { return MaxItemsDefaultValue; } } - set { - _hasBits0 |= 2; - maxItems_ = value; - } - } - /// Gets whether the "max_items" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasMaxItems { - get { return (_hasBits0 & 2) != 0; } - } - /// Clears the value of the "max_items" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearMaxItems() { - _hasBits0 &= ~2; - } - - /// Field number for the "unique" field. - public const int UniqueFieldNumber = 3; - private readonly static bool UniqueDefaultValue = false; - - private bool unique_; - /// - /// Unique specifies that all elements in this field must be unique. This - /// contraint is only applicable to scalar and enum types (messages are not - /// supported). - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Unique { - get { if ((_hasBits0 & 4) != 0) { return unique_; } else { return UniqueDefaultValue; } } - set { - _hasBits0 |= 4; - unique_ = value; - } - } - /// Gets whether the "unique" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasUnique { - get { return (_hasBits0 & 4) != 0; } - } - /// Clears the value of the "unique" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearUnique() { - _hasBits0 &= ~4; - } - - /// Field number for the "items" field. - public const int ItemsFieldNumber = 4; - private global::Validate.FieldRules items_; - /// - /// Items specifies the contraints to be applied to each item in the field. - /// Repeated message fields will still execute validation against each item - /// unless skip is specified here. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Validate.FieldRules Items { - get { return items_; } - set { - items_ = value; - } - } - - /// Field number for the "ignore_empty" field. - public const int IgnoreEmptyFieldNumber = 5; - private readonly static bool IgnoreEmptyDefaultValue = false; - - private bool ignoreEmpty_; - /// - /// IgnoreEmpty specifies that the validation rules of this field should be - /// evaluated only if the field is not empty - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool IgnoreEmpty { - get { if ((_hasBits0 & 8) != 0) { return ignoreEmpty_; } else { return IgnoreEmptyDefaultValue; } } - set { - _hasBits0 |= 8; - ignoreEmpty_ = value; - } - } - /// Gets whether the "ignore_empty" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasIgnoreEmpty { - get { return (_hasBits0 & 8) != 0; } - } - /// Clears the value of the "ignore_empty" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearIgnoreEmpty() { - _hasBits0 &= ~8; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as RepeatedRules); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(RepeatedRules other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (MinItems != other.MinItems) return false; - if (MaxItems != other.MaxItems) return false; - if (Unique != other.Unique) return false; - if (!object.Equals(Items, other.Items)) return false; - if (IgnoreEmpty != other.IgnoreEmpty) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (HasMinItems) hash ^= MinItems.GetHashCode(); - if (HasMaxItems) hash ^= MaxItems.GetHashCode(); - if (HasUnique) hash ^= Unique.GetHashCode(); - if (items_ != null) hash ^= Items.GetHashCode(); - if (HasIgnoreEmpty) hash ^= IgnoreEmpty.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (HasMinItems) { - output.WriteRawTag(8); - output.WriteUInt64(MinItems); - } - if (HasMaxItems) { - output.WriteRawTag(16); - output.WriteUInt64(MaxItems); - } - if (HasUnique) { - output.WriteRawTag(24); - output.WriteBool(Unique); - } - if (items_ != null) { - output.WriteRawTag(34); - output.WriteMessage(Items); - } - if (HasIgnoreEmpty) { - output.WriteRawTag(40); - output.WriteBool(IgnoreEmpty); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (HasMinItems) { - output.WriteRawTag(8); - output.WriteUInt64(MinItems); - } - if (HasMaxItems) { - output.WriteRawTag(16); - output.WriteUInt64(MaxItems); - } - if (HasUnique) { - output.WriteRawTag(24); - output.WriteBool(Unique); - } - if (items_ != null) { - output.WriteRawTag(34); - output.WriteMessage(Items); - } - if (HasIgnoreEmpty) { - output.WriteRawTag(40); - output.WriteBool(IgnoreEmpty); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (HasMinItems) { - size += 1 + pb::CodedOutputStream.ComputeUInt64Size(MinItems); - } - if (HasMaxItems) { - size += 1 + pb::CodedOutputStream.ComputeUInt64Size(MaxItems); - } - if (HasUnique) { - size += 1 + 1; - } - if (items_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Items); - } - if (HasIgnoreEmpty) { - size += 1 + 1; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(RepeatedRules other) { - if (other == null) { - return; - } - if (other.HasMinItems) { - MinItems = other.MinItems; - } - if (other.HasMaxItems) { - MaxItems = other.MaxItems; - } - if (other.HasUnique) { - Unique = other.Unique; - } - if (other.items_ != null) { - if (items_ == null) { - Items = new global::Validate.FieldRules(); - } - Items.MergeFrom(other.Items); - } - if (other.HasIgnoreEmpty) { - IgnoreEmpty = other.IgnoreEmpty; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 8: { - MinItems = input.ReadUInt64(); - break; - } - case 16: { - MaxItems = input.ReadUInt64(); - break; - } - case 24: { - Unique = input.ReadBool(); - break; - } - case 34: { - if (items_ == null) { - Items = new global::Validate.FieldRules(); - } - input.ReadMessage(Items); - break; - } - case 40: { - IgnoreEmpty = input.ReadBool(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 8: { - MinItems = input.ReadUInt64(); - break; - } - case 16: { - MaxItems = input.ReadUInt64(); - break; - } - case 24: { - Unique = input.ReadBool(); - break; - } - case 34: { - if (items_ == null) { - Items = new global::Validate.FieldRules(); - } - input.ReadMessage(Items); - break; - } - case 40: { - IgnoreEmpty = input.ReadBool(); - break; - } - } - } - } - #endif - - } - - /// - /// MapRules describe the constraints applied to `map` values - /// - public sealed partial class MapRules : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MapRules()); - private pb::UnknownFieldSet _unknownFields; - private int _hasBits0; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::Validate.ValidateReflection.Descriptor.MessageTypes[19]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public MapRules() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public MapRules(MapRules other) : this() { - _hasBits0 = other._hasBits0; - minPairs_ = other.minPairs_; - maxPairs_ = other.maxPairs_; - noSparse_ = other.noSparse_; - keys_ = other.keys_ != null ? other.keys_.Clone() : null; - values_ = other.values_ != null ? other.values_.Clone() : null; - ignoreEmpty_ = other.ignoreEmpty_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public MapRules Clone() { - return new MapRules(this); - } - - /// Field number for the "min_pairs" field. - public const int MinPairsFieldNumber = 1; - private readonly static ulong MinPairsDefaultValue = 0UL; - - private ulong minPairs_; - /// - /// MinPairs specifies that this field must have the specified number of - /// KVs at a minimum - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ulong MinPairs { - get { if ((_hasBits0 & 1) != 0) { return minPairs_; } else { return MinPairsDefaultValue; } } - set { - _hasBits0 |= 1; - minPairs_ = value; - } - } - /// Gets whether the "min_pairs" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasMinPairs { - get { return (_hasBits0 & 1) != 0; } - } - /// Clears the value of the "min_pairs" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearMinPairs() { - _hasBits0 &= ~1; - } - - /// Field number for the "max_pairs" field. - public const int MaxPairsFieldNumber = 2; - private readonly static ulong MaxPairsDefaultValue = 0UL; - - private ulong maxPairs_; - /// - /// MaxPairs specifies that this field must have the specified number of - /// KVs at a maximum - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ulong MaxPairs { - get { if ((_hasBits0 & 2) != 0) { return maxPairs_; } else { return MaxPairsDefaultValue; } } - set { - _hasBits0 |= 2; - maxPairs_ = value; - } - } - /// Gets whether the "max_pairs" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasMaxPairs { - get { return (_hasBits0 & 2) != 0; } - } - /// Clears the value of the "max_pairs" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearMaxPairs() { - _hasBits0 &= ~2; - } - - /// Field number for the "no_sparse" field. - public const int NoSparseFieldNumber = 3; - private readonly static bool NoSparseDefaultValue = false; - - private bool noSparse_; - /// - /// NoSparse specifies values in this field cannot be unset. This only - /// applies to map's with message value types. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool NoSparse { - get { if ((_hasBits0 & 4) != 0) { return noSparse_; } else { return NoSparseDefaultValue; } } - set { - _hasBits0 |= 4; - noSparse_ = value; - } - } - /// Gets whether the "no_sparse" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasNoSparse { - get { return (_hasBits0 & 4) != 0; } - } - /// Clears the value of the "no_sparse" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearNoSparse() { - _hasBits0 &= ~4; - } - - /// Field number for the "keys" field. - public const int KeysFieldNumber = 4; - private global::Validate.FieldRules keys_; - /// - /// Keys specifies the constraints to be applied to each key in the field. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Validate.FieldRules Keys { - get { return keys_; } - set { - keys_ = value; - } - } - - /// Field number for the "values" field. - public const int ValuesFieldNumber = 5; - private global::Validate.FieldRules values_; - /// - /// Values specifies the constraints to be applied to the value of each key - /// in the field. Message values will still have their validations evaluated - /// unless skip is specified here. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Validate.FieldRules Values { - get { return values_; } - set { - values_ = value; - } - } - - /// Field number for the "ignore_empty" field. - public const int IgnoreEmptyFieldNumber = 6; - private readonly static bool IgnoreEmptyDefaultValue = false; - - private bool ignoreEmpty_; - /// - /// IgnoreEmpty specifies that the validation rules of this field should be - /// evaluated only if the field is not empty - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool IgnoreEmpty { - get { if ((_hasBits0 & 8) != 0) { return ignoreEmpty_; } else { return IgnoreEmptyDefaultValue; } } - set { - _hasBits0 |= 8; - ignoreEmpty_ = value; - } - } - /// Gets whether the "ignore_empty" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasIgnoreEmpty { - get { return (_hasBits0 & 8) != 0; } - } - /// Clears the value of the "ignore_empty" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearIgnoreEmpty() { - _hasBits0 &= ~8; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as MapRules); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(MapRules other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (MinPairs != other.MinPairs) return false; - if (MaxPairs != other.MaxPairs) return false; - if (NoSparse != other.NoSparse) return false; - if (!object.Equals(Keys, other.Keys)) return false; - if (!object.Equals(Values, other.Values)) return false; - if (IgnoreEmpty != other.IgnoreEmpty) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (HasMinPairs) hash ^= MinPairs.GetHashCode(); - if (HasMaxPairs) hash ^= MaxPairs.GetHashCode(); - if (HasNoSparse) hash ^= NoSparse.GetHashCode(); - if (keys_ != null) hash ^= Keys.GetHashCode(); - if (values_ != null) hash ^= Values.GetHashCode(); - if (HasIgnoreEmpty) hash ^= IgnoreEmpty.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (HasMinPairs) { - output.WriteRawTag(8); - output.WriteUInt64(MinPairs); - } - if (HasMaxPairs) { - output.WriteRawTag(16); - output.WriteUInt64(MaxPairs); - } - if (HasNoSparse) { - output.WriteRawTag(24); - output.WriteBool(NoSparse); - } - if (keys_ != null) { - output.WriteRawTag(34); - output.WriteMessage(Keys); - } - if (values_ != null) { - output.WriteRawTag(42); - output.WriteMessage(Values); - } - if (HasIgnoreEmpty) { - output.WriteRawTag(48); - output.WriteBool(IgnoreEmpty); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (HasMinPairs) { - output.WriteRawTag(8); - output.WriteUInt64(MinPairs); - } - if (HasMaxPairs) { - output.WriteRawTag(16); - output.WriteUInt64(MaxPairs); - } - if (HasNoSparse) { - output.WriteRawTag(24); - output.WriteBool(NoSparse); - } - if (keys_ != null) { - output.WriteRawTag(34); - output.WriteMessage(Keys); - } - if (values_ != null) { - output.WriteRawTag(42); - output.WriteMessage(Values); - } - if (HasIgnoreEmpty) { - output.WriteRawTag(48); - output.WriteBool(IgnoreEmpty); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (HasMinPairs) { - size += 1 + pb::CodedOutputStream.ComputeUInt64Size(MinPairs); - } - if (HasMaxPairs) { - size += 1 + pb::CodedOutputStream.ComputeUInt64Size(MaxPairs); - } - if (HasNoSparse) { - size += 1 + 1; - } - if (keys_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Keys); - } - if (values_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Values); - } - if (HasIgnoreEmpty) { - size += 1 + 1; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(MapRules other) { - if (other == null) { - return; - } - if (other.HasMinPairs) { - MinPairs = other.MinPairs; - } - if (other.HasMaxPairs) { - MaxPairs = other.MaxPairs; - } - if (other.HasNoSparse) { - NoSparse = other.NoSparse; - } - if (other.keys_ != null) { - if (keys_ == null) { - Keys = new global::Validate.FieldRules(); - } - Keys.MergeFrom(other.Keys); - } - if (other.values_ != null) { - if (values_ == null) { - Values = new global::Validate.FieldRules(); - } - Values.MergeFrom(other.Values); - } - if (other.HasIgnoreEmpty) { - IgnoreEmpty = other.IgnoreEmpty; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 8: { - MinPairs = input.ReadUInt64(); - break; - } - case 16: { - MaxPairs = input.ReadUInt64(); - break; - } - case 24: { - NoSparse = input.ReadBool(); - break; - } - case 34: { - if (keys_ == null) { - Keys = new global::Validate.FieldRules(); - } - input.ReadMessage(Keys); - break; - } - case 42: { - if (values_ == null) { - Values = new global::Validate.FieldRules(); - } - input.ReadMessage(Values); - break; - } - case 48: { - IgnoreEmpty = input.ReadBool(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 8: { - MinPairs = input.ReadUInt64(); - break; - } - case 16: { - MaxPairs = input.ReadUInt64(); - break; - } - case 24: { - NoSparse = input.ReadBool(); - break; - } - case 34: { - if (keys_ == null) { - Keys = new global::Validate.FieldRules(); - } - input.ReadMessage(Keys); - break; - } - case 42: { - if (values_ == null) { - Values = new global::Validate.FieldRules(); - } - input.ReadMessage(Values); - break; - } - case 48: { - IgnoreEmpty = input.ReadBool(); - break; - } - } - } - } - #endif - - } - - /// - /// AnyRules describe constraints applied exclusively to the - /// `google.protobuf.Any` well-known type - /// - public sealed partial class AnyRules : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new AnyRules()); - private pb::UnknownFieldSet _unknownFields; - private int _hasBits0; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::Validate.ValidateReflection.Descriptor.MessageTypes[20]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public AnyRules() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public AnyRules(AnyRules other) : this() { - _hasBits0 = other._hasBits0; - required_ = other.required_; - in_ = other.in_.Clone(); - notIn_ = other.notIn_.Clone(); - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public AnyRules Clone() { - return new AnyRules(this); - } - - /// Field number for the "required" field. - public const int RequiredFieldNumber = 1; - private readonly static bool RequiredDefaultValue = false; - - private bool required_; - /// - /// Required specifies that this field must be set - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Required { - get { if ((_hasBits0 & 1) != 0) { return required_; } else { return RequiredDefaultValue; } } - set { - _hasBits0 |= 1; - required_ = value; - } - } - /// Gets whether the "required" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasRequired { - get { return (_hasBits0 & 1) != 0; } - } - /// Clears the value of the "required" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearRequired() { - _hasBits0 &= ~1; - } - - /// Field number for the "in" field. - public const int InFieldNumber = 2; - private static readonly pb::FieldCodec _repeated_in_codec - = pb::FieldCodec.ForString(18); - private readonly pbc::RepeatedField in_ = new pbc::RepeatedField(); - /// - /// In specifies that this field's `type_url` must be equal to one of the - /// specified values. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField In { - get { return in_; } - } - - /// Field number for the "not_in" field. - public const int NotInFieldNumber = 3; - private static readonly pb::FieldCodec _repeated_notIn_codec - = pb::FieldCodec.ForString(26); - private readonly pbc::RepeatedField notIn_ = new pbc::RepeatedField(); - /// - /// NotIn specifies that this field's `type_url` must not be equal to any of - /// the specified values. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField NotIn { - get { return notIn_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as AnyRules); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(AnyRules other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Required != other.Required) return false; - if(!in_.Equals(other.in_)) return false; - if(!notIn_.Equals(other.notIn_)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (HasRequired) hash ^= Required.GetHashCode(); - hash ^= in_.GetHashCode(); - hash ^= notIn_.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (HasRequired) { - output.WriteRawTag(8); - output.WriteBool(Required); - } - in_.WriteTo(output, _repeated_in_codec); - notIn_.WriteTo(output, _repeated_notIn_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (HasRequired) { - output.WriteRawTag(8); - output.WriteBool(Required); - } - in_.WriteTo(ref output, _repeated_in_codec); - notIn_.WriteTo(ref output, _repeated_notIn_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (HasRequired) { - size += 1 + 1; - } - size += in_.CalculateSize(_repeated_in_codec); - size += notIn_.CalculateSize(_repeated_notIn_codec); - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(AnyRules other) { - if (other == null) { - return; - } - if (other.HasRequired) { - Required = other.Required; - } - in_.Add(other.in_); - notIn_.Add(other.notIn_); - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 8: { - Required = input.ReadBool(); - break; - } - case 18: { - in_.AddEntriesFrom(input, _repeated_in_codec); - break; - } - case 26: { - notIn_.AddEntriesFrom(input, _repeated_notIn_codec); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 8: { - Required = input.ReadBool(); - break; - } - case 18: { - in_.AddEntriesFrom(ref input, _repeated_in_codec); - break; - } - case 26: { - notIn_.AddEntriesFrom(ref input, _repeated_notIn_codec); - break; - } - } - } - } - #endif - - } - - /// - /// DurationRules describe the constraints applied exclusively to the - /// `google.protobuf.Duration` well-known type - /// - public sealed partial class DurationRules : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DurationRules()); - private pb::UnknownFieldSet _unknownFields; - private int _hasBits0; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::Validate.ValidateReflection.Descriptor.MessageTypes[21]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public DurationRules() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public DurationRules(DurationRules other) : this() { - _hasBits0 = other._hasBits0; - required_ = other.required_; - const_ = other.const_ != null ? other.const_.Clone() : null; - lt_ = other.lt_ != null ? other.lt_.Clone() : null; - lte_ = other.lte_ != null ? other.lte_.Clone() : null; - gt_ = other.gt_ != null ? other.gt_.Clone() : null; - gte_ = other.gte_ != null ? other.gte_.Clone() : null; - in_ = other.in_.Clone(); - notIn_ = other.notIn_.Clone(); - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public DurationRules Clone() { - return new DurationRules(this); - } - - /// Field number for the "required" field. - public const int RequiredFieldNumber = 1; - private readonly static bool RequiredDefaultValue = false; - - private bool required_; - /// - /// Required specifies that this field must be set - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Required { - get { if ((_hasBits0 & 1) != 0) { return required_; } else { return RequiredDefaultValue; } } - set { - _hasBits0 |= 1; - required_ = value; - } - } - /// Gets whether the "required" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasRequired { - get { return (_hasBits0 & 1) != 0; } - } - /// Clears the value of the "required" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearRequired() { - _hasBits0 &= ~1; - } - - /// Field number for the "const" field. - public const int ConstFieldNumber = 2; - private global::Google.Protobuf.WellKnownTypes.Duration const_; - /// - /// Const specifies that this field must be exactly the specified value - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Google.Protobuf.WellKnownTypes.Duration Const { - get { return const_; } - set { - const_ = value; - } - } - - /// Field number for the "lt" field. - public const int LtFieldNumber = 3; - private global::Google.Protobuf.WellKnownTypes.Duration lt_; - /// - /// Lt specifies that this field must be less than the specified value, - /// exclusive - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Google.Protobuf.WellKnownTypes.Duration Lt { - get { return lt_; } - set { - lt_ = value; - } - } - - /// Field number for the "lte" field. - public const int LteFieldNumber = 4; - private global::Google.Protobuf.WellKnownTypes.Duration lte_; - /// - /// Lt specifies that this field must be less than the specified value, - /// inclusive - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Google.Protobuf.WellKnownTypes.Duration Lte { - get { return lte_; } - set { - lte_ = value; - } - } - - /// Field number for the "gt" field. - public const int GtFieldNumber = 5; - private global::Google.Protobuf.WellKnownTypes.Duration gt_; - /// - /// Gt specifies that this field must be greater than the specified value, - /// exclusive - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Google.Protobuf.WellKnownTypes.Duration Gt { - get { return gt_; } - set { - gt_ = value; - } - } - - /// Field number for the "gte" field. - public const int GteFieldNumber = 6; - private global::Google.Protobuf.WellKnownTypes.Duration gte_; - /// - /// Gte specifies that this field must be greater than the specified value, - /// inclusive - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Google.Protobuf.WellKnownTypes.Duration Gte { - get { return gte_; } - set { - gte_ = value; - } - } - - /// Field number for the "in" field. - public const int InFieldNumber = 7; - private static readonly pb::FieldCodec _repeated_in_codec - = pb::FieldCodec.ForMessage(58, global::Google.Protobuf.WellKnownTypes.Duration.Parser); - private readonly pbc::RepeatedField in_ = new pbc::RepeatedField(); - /// - /// In specifies that this field must be equal to one of the specified - /// values - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField In { - get { return in_; } - } - - /// Field number for the "not_in" field. - public const int NotInFieldNumber = 8; - private static readonly pb::FieldCodec _repeated_notIn_codec - = pb::FieldCodec.ForMessage(66, global::Google.Protobuf.WellKnownTypes.Duration.Parser); - private readonly pbc::RepeatedField notIn_ = new pbc::RepeatedField(); - /// - /// NotIn specifies that this field cannot be equal to one of the specified - /// values - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField NotIn { - get { return notIn_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as DurationRules); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(DurationRules other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Required != other.Required) return false; - if (!object.Equals(Const, other.Const)) return false; - if (!object.Equals(Lt, other.Lt)) return false; - if (!object.Equals(Lte, other.Lte)) return false; - if (!object.Equals(Gt, other.Gt)) return false; - if (!object.Equals(Gte, other.Gte)) return false; - if(!in_.Equals(other.in_)) return false; - if(!notIn_.Equals(other.notIn_)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (HasRequired) hash ^= Required.GetHashCode(); - if (const_ != null) hash ^= Const.GetHashCode(); - if (lt_ != null) hash ^= Lt.GetHashCode(); - if (lte_ != null) hash ^= Lte.GetHashCode(); - if (gt_ != null) hash ^= Gt.GetHashCode(); - if (gte_ != null) hash ^= Gte.GetHashCode(); - hash ^= in_.GetHashCode(); - hash ^= notIn_.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (HasRequired) { - output.WriteRawTag(8); - output.WriteBool(Required); - } - if (const_ != null) { - output.WriteRawTag(18); - output.WriteMessage(Const); - } - if (lt_ != null) { - output.WriteRawTag(26); - output.WriteMessage(Lt); - } - if (lte_ != null) { - output.WriteRawTag(34); - output.WriteMessage(Lte); - } - if (gt_ != null) { - output.WriteRawTag(42); - output.WriteMessage(Gt); - } - if (gte_ != null) { - output.WriteRawTag(50); - output.WriteMessage(Gte); - } - in_.WriteTo(output, _repeated_in_codec); - notIn_.WriteTo(output, _repeated_notIn_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (HasRequired) { - output.WriteRawTag(8); - output.WriteBool(Required); - } - if (const_ != null) { - output.WriteRawTag(18); - output.WriteMessage(Const); - } - if (lt_ != null) { - output.WriteRawTag(26); - output.WriteMessage(Lt); - } - if (lte_ != null) { - output.WriteRawTag(34); - output.WriteMessage(Lte); - } - if (gt_ != null) { - output.WriteRawTag(42); - output.WriteMessage(Gt); - } - if (gte_ != null) { - output.WriteRawTag(50); - output.WriteMessage(Gte); - } - in_.WriteTo(ref output, _repeated_in_codec); - notIn_.WriteTo(ref output, _repeated_notIn_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (HasRequired) { - size += 1 + 1; - } - if (const_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Const); - } - if (lt_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Lt); - } - if (lte_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Lte); - } - if (gt_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Gt); - } - if (gte_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Gte); - } - size += in_.CalculateSize(_repeated_in_codec); - size += notIn_.CalculateSize(_repeated_notIn_codec); - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(DurationRules other) { - if (other == null) { - return; - } - if (other.HasRequired) { - Required = other.Required; - } - if (other.const_ != null) { - if (const_ == null) { - Const = new global::Google.Protobuf.WellKnownTypes.Duration(); - } - Const.MergeFrom(other.Const); - } - if (other.lt_ != null) { - if (lt_ == null) { - Lt = new global::Google.Protobuf.WellKnownTypes.Duration(); - } - Lt.MergeFrom(other.Lt); - } - if (other.lte_ != null) { - if (lte_ == null) { - Lte = new global::Google.Protobuf.WellKnownTypes.Duration(); - } - Lte.MergeFrom(other.Lte); - } - if (other.gt_ != null) { - if (gt_ == null) { - Gt = new global::Google.Protobuf.WellKnownTypes.Duration(); - } - Gt.MergeFrom(other.Gt); - } - if (other.gte_ != null) { - if (gte_ == null) { - Gte = new global::Google.Protobuf.WellKnownTypes.Duration(); - } - Gte.MergeFrom(other.Gte); - } - in_.Add(other.in_); - notIn_.Add(other.notIn_); - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 8: { - Required = input.ReadBool(); - break; - } - case 18: { - if (const_ == null) { - Const = new global::Google.Protobuf.WellKnownTypes.Duration(); - } - input.ReadMessage(Const); - break; - } - case 26: { - if (lt_ == null) { - Lt = new global::Google.Protobuf.WellKnownTypes.Duration(); - } - input.ReadMessage(Lt); - break; - } - case 34: { - if (lte_ == null) { - Lte = new global::Google.Protobuf.WellKnownTypes.Duration(); - } - input.ReadMessage(Lte); - break; - } - case 42: { - if (gt_ == null) { - Gt = new global::Google.Protobuf.WellKnownTypes.Duration(); - } - input.ReadMessage(Gt); - break; - } - case 50: { - if (gte_ == null) { - Gte = new global::Google.Protobuf.WellKnownTypes.Duration(); - } - input.ReadMessage(Gte); - break; - } - case 58: { - in_.AddEntriesFrom(input, _repeated_in_codec); - break; - } - case 66: { - notIn_.AddEntriesFrom(input, _repeated_notIn_codec); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 8: { - Required = input.ReadBool(); - break; - } - case 18: { - if (const_ == null) { - Const = new global::Google.Protobuf.WellKnownTypes.Duration(); - } - input.ReadMessage(Const); - break; - } - case 26: { - if (lt_ == null) { - Lt = new global::Google.Protobuf.WellKnownTypes.Duration(); - } - input.ReadMessage(Lt); - break; - } - case 34: { - if (lte_ == null) { - Lte = new global::Google.Protobuf.WellKnownTypes.Duration(); - } - input.ReadMessage(Lte); - break; - } - case 42: { - if (gt_ == null) { - Gt = new global::Google.Protobuf.WellKnownTypes.Duration(); - } - input.ReadMessage(Gt); - break; - } - case 50: { - if (gte_ == null) { - Gte = new global::Google.Protobuf.WellKnownTypes.Duration(); - } - input.ReadMessage(Gte); - break; - } - case 58: { - in_.AddEntriesFrom(ref input, _repeated_in_codec); - break; - } - case 66: { - notIn_.AddEntriesFrom(ref input, _repeated_notIn_codec); - break; - } - } - } - } - #endif - - } - - /// - /// TimestampRules describe the constraints applied exclusively to the - /// `google.protobuf.Timestamp` well-known type - /// - public sealed partial class TimestampRules : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TimestampRules()); - private pb::UnknownFieldSet _unknownFields; - private int _hasBits0; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::Validate.ValidateReflection.Descriptor.MessageTypes[22]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public TimestampRules() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public TimestampRules(TimestampRules other) : this() { - _hasBits0 = other._hasBits0; - required_ = other.required_; - const_ = other.const_ != null ? other.const_.Clone() : null; - lt_ = other.lt_ != null ? other.lt_.Clone() : null; - lte_ = other.lte_ != null ? other.lte_.Clone() : null; - gt_ = other.gt_ != null ? other.gt_.Clone() : null; - gte_ = other.gte_ != null ? other.gte_.Clone() : null; - ltNow_ = other.ltNow_; - gtNow_ = other.gtNow_; - within_ = other.within_ != null ? other.within_.Clone() : null; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public TimestampRules Clone() { - return new TimestampRules(this); - } - - /// Field number for the "required" field. - public const int RequiredFieldNumber = 1; - private readonly static bool RequiredDefaultValue = false; - - private bool required_; - /// - /// Required specifies that this field must be set - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Required { - get { if ((_hasBits0 & 1) != 0) { return required_; } else { return RequiredDefaultValue; } } - set { - _hasBits0 |= 1; - required_ = value; - } - } - /// Gets whether the "required" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasRequired { - get { return (_hasBits0 & 1) != 0; } - } - /// Clears the value of the "required" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearRequired() { - _hasBits0 &= ~1; - } - - /// Field number for the "const" field. - public const int ConstFieldNumber = 2; - private global::Google.Protobuf.WellKnownTypes.Timestamp const_; - /// - /// Const specifies that this field must be exactly the specified value - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Google.Protobuf.WellKnownTypes.Timestamp Const { - get { return const_; } - set { - const_ = value; - } - } - - /// Field number for the "lt" field. - public const int LtFieldNumber = 3; - private global::Google.Protobuf.WellKnownTypes.Timestamp lt_; - /// - /// Lt specifies that this field must be less than the specified value, - /// exclusive - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Google.Protobuf.WellKnownTypes.Timestamp Lt { - get { return lt_; } - set { - lt_ = value; - } - } - - /// Field number for the "lte" field. - public const int LteFieldNumber = 4; - private global::Google.Protobuf.WellKnownTypes.Timestamp lte_; - /// - /// Lte specifies that this field must be less than the specified value, - /// inclusive - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Google.Protobuf.WellKnownTypes.Timestamp Lte { - get { return lte_; } - set { - lte_ = value; - } - } - - /// Field number for the "gt" field. - public const int GtFieldNumber = 5; - private global::Google.Protobuf.WellKnownTypes.Timestamp gt_; - /// - /// Gt specifies that this field must be greater than the specified value, - /// exclusive - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Google.Protobuf.WellKnownTypes.Timestamp Gt { - get { return gt_; } - set { - gt_ = value; - } - } - - /// Field number for the "gte" field. - public const int GteFieldNumber = 6; - private global::Google.Protobuf.WellKnownTypes.Timestamp gte_; - /// - /// Gte specifies that this field must be greater than the specified value, - /// inclusive - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Google.Protobuf.WellKnownTypes.Timestamp Gte { - get { return gte_; } - set { - gte_ = value; - } - } - - /// Field number for the "lt_now" field. - public const int LtNowFieldNumber = 7; - private readonly static bool LtNowDefaultValue = false; - - private bool ltNow_; - /// - /// LtNow specifies that this must be less than the current time. LtNow - /// can only be used with the Within rule. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool LtNow { - get { if ((_hasBits0 & 2) != 0) { return ltNow_; } else { return LtNowDefaultValue; } } - set { - _hasBits0 |= 2; - ltNow_ = value; - } - } - /// Gets whether the "lt_now" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasLtNow { - get { return (_hasBits0 & 2) != 0; } - } - /// Clears the value of the "lt_now" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearLtNow() { - _hasBits0 &= ~2; - } - - /// Field number for the "gt_now" field. - public const int GtNowFieldNumber = 8; - private readonly static bool GtNowDefaultValue = false; - - private bool gtNow_; - /// - /// GtNow specifies that this must be greater than the current time. GtNow - /// can only be used with the Within rule. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool GtNow { - get { if ((_hasBits0 & 4) != 0) { return gtNow_; } else { return GtNowDefaultValue; } } - set { - _hasBits0 |= 4; - gtNow_ = value; - } - } - /// Gets whether the "gt_now" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasGtNow { - get { return (_hasBits0 & 4) != 0; } - } - /// Clears the value of the "gt_now" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearGtNow() { - _hasBits0 &= ~4; - } - - /// Field number for the "within" field. - public const int WithinFieldNumber = 9; - private global::Google.Protobuf.WellKnownTypes.Duration within_; - /// - /// Within specifies that this field must be within this duration of the - /// current time. This constraint can be used alone or with the LtNow and - /// GtNow rules. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Google.Protobuf.WellKnownTypes.Duration Within { - get { return within_; } - set { - within_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as TimestampRules); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(TimestampRules other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Required != other.Required) return false; - if (!object.Equals(Const, other.Const)) return false; - if (!object.Equals(Lt, other.Lt)) return false; - if (!object.Equals(Lte, other.Lte)) return false; - if (!object.Equals(Gt, other.Gt)) return false; - if (!object.Equals(Gte, other.Gte)) return false; - if (LtNow != other.LtNow) return false; - if (GtNow != other.GtNow) return false; - if (!object.Equals(Within, other.Within)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (HasRequired) hash ^= Required.GetHashCode(); - if (const_ != null) hash ^= Const.GetHashCode(); - if (lt_ != null) hash ^= Lt.GetHashCode(); - if (lte_ != null) hash ^= Lte.GetHashCode(); - if (gt_ != null) hash ^= Gt.GetHashCode(); - if (gte_ != null) hash ^= Gte.GetHashCode(); - if (HasLtNow) hash ^= LtNow.GetHashCode(); - if (HasGtNow) hash ^= GtNow.GetHashCode(); - if (within_ != null) hash ^= Within.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (HasRequired) { - output.WriteRawTag(8); - output.WriteBool(Required); - } - if (const_ != null) { - output.WriteRawTag(18); - output.WriteMessage(Const); - } - if (lt_ != null) { - output.WriteRawTag(26); - output.WriteMessage(Lt); - } - if (lte_ != null) { - output.WriteRawTag(34); - output.WriteMessage(Lte); - } - if (gt_ != null) { - output.WriteRawTag(42); - output.WriteMessage(Gt); - } - if (gte_ != null) { - output.WriteRawTag(50); - output.WriteMessage(Gte); - } - if (HasLtNow) { - output.WriteRawTag(56); - output.WriteBool(LtNow); - } - if (HasGtNow) { - output.WriteRawTag(64); - output.WriteBool(GtNow); - } - if (within_ != null) { - output.WriteRawTag(74); - output.WriteMessage(Within); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (HasRequired) { - output.WriteRawTag(8); - output.WriteBool(Required); - } - if (const_ != null) { - output.WriteRawTag(18); - output.WriteMessage(Const); - } - if (lt_ != null) { - output.WriteRawTag(26); - output.WriteMessage(Lt); - } - if (lte_ != null) { - output.WriteRawTag(34); - output.WriteMessage(Lte); - } - if (gt_ != null) { - output.WriteRawTag(42); - output.WriteMessage(Gt); - } - if (gte_ != null) { - output.WriteRawTag(50); - output.WriteMessage(Gte); - } - if (HasLtNow) { - output.WriteRawTag(56); - output.WriteBool(LtNow); - } - if (HasGtNow) { - output.WriteRawTag(64); - output.WriteBool(GtNow); - } - if (within_ != null) { - output.WriteRawTag(74); - output.WriteMessage(Within); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (HasRequired) { - size += 1 + 1; - } - if (const_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Const); - } - if (lt_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Lt); - } - if (lte_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Lte); - } - if (gt_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Gt); - } - if (gte_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Gte); - } - if (HasLtNow) { - size += 1 + 1; - } - if (HasGtNow) { - size += 1 + 1; - } - if (within_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Within); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(TimestampRules other) { - if (other == null) { - return; - } - if (other.HasRequired) { - Required = other.Required; - } - if (other.const_ != null) { - if (const_ == null) { - Const = new global::Google.Protobuf.WellKnownTypes.Timestamp(); - } - Const.MergeFrom(other.Const); - } - if (other.lt_ != null) { - if (lt_ == null) { - Lt = new global::Google.Protobuf.WellKnownTypes.Timestamp(); - } - Lt.MergeFrom(other.Lt); - } - if (other.lte_ != null) { - if (lte_ == null) { - Lte = new global::Google.Protobuf.WellKnownTypes.Timestamp(); - } - Lte.MergeFrom(other.Lte); - } - if (other.gt_ != null) { - if (gt_ == null) { - Gt = new global::Google.Protobuf.WellKnownTypes.Timestamp(); - } - Gt.MergeFrom(other.Gt); - } - if (other.gte_ != null) { - if (gte_ == null) { - Gte = new global::Google.Protobuf.WellKnownTypes.Timestamp(); - } - Gte.MergeFrom(other.Gte); - } - if (other.HasLtNow) { - LtNow = other.LtNow; - } - if (other.HasGtNow) { - GtNow = other.GtNow; - } - if (other.within_ != null) { - if (within_ == null) { - Within = new global::Google.Protobuf.WellKnownTypes.Duration(); - } - Within.MergeFrom(other.Within); - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 8: { - Required = input.ReadBool(); - break; - } - case 18: { - if (const_ == null) { - Const = new global::Google.Protobuf.WellKnownTypes.Timestamp(); - } - input.ReadMessage(Const); - break; - } - case 26: { - if (lt_ == null) { - Lt = new global::Google.Protobuf.WellKnownTypes.Timestamp(); - } - input.ReadMessage(Lt); - break; - } - case 34: { - if (lte_ == null) { - Lte = new global::Google.Protobuf.WellKnownTypes.Timestamp(); - } - input.ReadMessage(Lte); - break; - } - case 42: { - if (gt_ == null) { - Gt = new global::Google.Protobuf.WellKnownTypes.Timestamp(); - } - input.ReadMessage(Gt); - break; - } - case 50: { - if (gte_ == null) { - Gte = new global::Google.Protobuf.WellKnownTypes.Timestamp(); - } - input.ReadMessage(Gte); - break; - } - case 56: { - LtNow = input.ReadBool(); - break; - } - case 64: { - GtNow = input.ReadBool(); - break; - } - case 74: { - if (within_ == null) { - Within = new global::Google.Protobuf.WellKnownTypes.Duration(); - } - input.ReadMessage(Within); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 8: { - Required = input.ReadBool(); - break; - } - case 18: { - if (const_ == null) { - Const = new global::Google.Protobuf.WellKnownTypes.Timestamp(); - } - input.ReadMessage(Const); - break; - } - case 26: { - if (lt_ == null) { - Lt = new global::Google.Protobuf.WellKnownTypes.Timestamp(); - } - input.ReadMessage(Lt); - break; - } - case 34: { - if (lte_ == null) { - Lte = new global::Google.Protobuf.WellKnownTypes.Timestamp(); - } - input.ReadMessage(Lte); - break; - } - case 42: { - if (gt_ == null) { - Gt = new global::Google.Protobuf.WellKnownTypes.Timestamp(); - } - input.ReadMessage(Gt); - break; - } - case 50: { - if (gte_ == null) { - Gte = new global::Google.Protobuf.WellKnownTypes.Timestamp(); - } - input.ReadMessage(Gte); - break; - } - case 56: { - LtNow = input.ReadBool(); - break; - } - case 64: { - GtNow = input.ReadBool(); - break; - } - case 74: { - if (within_ == null) { - Within = new global::Google.Protobuf.WellKnownTypes.Duration(); - } - input.ReadMessage(Within); - break; - } - } - } - } - #endif - - } - - #endregion - -} - -#endregion Designer generated code diff --git a/src/Nitric.Sdk/Queue/FailedTask.cs b/src/Nitric.Sdk/Queue/FailedTask.cs deleted file mode 100644 index ac83300..0000000 --- a/src/Nitric.Sdk/Queue/FailedTask.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -namespace Nitric.Sdk.Queue -{ - /// - /// Represents a task that was unable to be sent to a queue. - /// - public class FailedTask - { - /// - /// The error message. - /// - public string Message { get; set; } - - /// - /// The task that failed to be sent. - /// - public Task Task { get; set; } - - /// - /// Return a string representation of the failed task. - /// - /// - public override string ToString() - { - return GetType().Name + "[task=" + Task + ", message=" + Message + "]"; - } - } -} diff --git a/src/Nitric.Sdk/Queue/Task.cs b/src/Nitric.Sdk/Queue/Message.cs similarity index 54% rename from src/Nitric.Sdk/Queue/Task.cs rename to src/Nitric.Sdk/Queue/Message.cs index bcb778d..73fa22d 100644 --- a/src/Nitric.Sdk/Queue/Task.cs +++ b/src/Nitric.Sdk/Queue/Message.cs @@ -13,66 +13,29 @@ // limitations under the License. using System; -using Google.Protobuf; -using Google.Protobuf.WellKnownTypes; -using Newtonsoft.Json; -using Nitric.Proto.Queue.v1; using Nitric.Sdk.Common; +using Nitric.Proto.Queues.v1; +using System.Threading.Tasks; namespace Nitric.Sdk.Queue { /// - /// Represents a Message to be delivered via a Queue. - /// - public class Task - { - public string Id { get; set; } - public string PayloadType { get; set; } - public T Payload { get; set; } - - public Task() - { - } - - /// - /// Return a string representation of the task. - /// - /// A string - public override string ToString() - { - return GetType().Name + "[ID=" + this.Id + "]"; - } - - internal NitricTask ToWire() - { - Struct payload = null; - if (this.Payload != null) - { - var jsonPayload = JsonConvert.SerializeObject(this.Payload); - payload = JsonParser.Default.Parse(jsonPayload); - } - - return new NitricTask - { - Id = this.Id ?? "", - PayloadType = this.PayloadType ?? "", - Payload = payload - }; - } - } - - /// - /// Represents a task received locally for processing. + /// Represents a message received locally for processing. /// - /// Since received tasks are on a limited time lease they include a lease ID. + /// Since received messages are on a limited time lease they include a lease ID. /// Received tasks must be completed to be removed from the queue and avoid reprocessing /// - public class ReceivedTask : Task + public class ReceivedMessage { /// /// The queue that was the source of this task. /// - public Queue Queue { get; set; } + internal Queue Queue { get; set; } + + /// + /// The message that was on the queue. + /// + public T Message { get; set; } /// /// The unique lease id for this task lease. @@ -84,26 +47,56 @@ public class ReceivedTask : Task /// /// /// - public void Complete() + public async Task Complete() { - if (string.IsNullOrEmpty(this.LeaseId)) - { - throw new ArgumentNullException(nameof(this.LeaseId)); - } - var request = new QueueCompleteRequest { - Queue = this.Queue.Name, + QueueName = this.Queue.Name, LeaseId = this.LeaseId, }; + try { - Queue.QueuesClient.Client.Complete(request); + await Queue.Client.CompleteAsync(request); } catch (Grpc.Core.RpcException re) { throw NitricException.FromRpcException(re); } } + + /// + /// Return a string representation of the message. + /// + /// + public override string ToString() + { + return GetType().Name + "[leaseId=" + LeaseId + "]"; + } + } + + /// + /// Represents a task that was unable to be sent to a queue. + /// + public class FailedMessage + { + /// + /// The error message. + /// + public string Details { get; set; } + + /// + /// The message that failed to be sent. + /// + public T Message { get; set; } + + /// + /// Return a string representation of the failed message. + /// + /// + public override string ToString() + { + return GetType().Name + "[details=" + Details + "]"; + } } } diff --git a/src/Nitric.Sdk/Queue/Queue.cs b/src/Nitric.Sdk/Queue/Queue.cs index c702523..12339a9 100644 --- a/src/Nitric.Sdk/Queue/Queue.cs +++ b/src/Nitric.Sdk/Queue/Queue.cs @@ -14,10 +14,10 @@ using System; using System.Collections.Generic; using System.Linq; -using Google.Protobuf.Collections; -using Newtonsoft.Json; -using Nitric.Proto.Queue.v1; using Nitric.Sdk.Common; +using Nitric.Proto.Queues.v1; +using System.Threading.Tasks; +using GrpcClient = Nitric.Proto.Queues.v1.Queues.QueuesClient; namespace Nitric.Sdk.Queue { @@ -31,117 +31,55 @@ public class Queue /// public string Name { get; internal set; } - internal readonly QueuesClient QueuesClient; + internal readonly GrpcClient Client; - internal Queue(QueuesClient client, string name) + public Queue(string name, GrpcClient client = null) { + if (string.IsNullOrEmpty(name)) + { + throw new ArgumentNullException(nameof(name)); + } this.Name = name; - this.QueuesClient = client; + this.Client = client; } /// /// Send a task to this queue. /// - /// The task to send. + /// The tasks to push to the queue. /// /// - public void Send(Task task) + public async Task>> Enqueue(T task, params T[] tasks) { if (task == null) { throw new ArgumentNullException(nameof(task)); } + var taskList = new List() { task }; - var request = new QueueSendRequest - { - Queue = this.Name, - Task = task.ToWire() - }; - try - { - QueuesClient.Client.Send(request); - } - catch (Grpc.Core.RpcException re) - { - throw NitricException.FromRpcException(re); - } - } - - /// - /// Send a task to this queue. - /// - /// The payload of the task to send. - /// - /// - public void Send(T payload) - { - var task = new Task { Payload = payload }; + taskList.AddRange(tasks); - var request = new QueueSendRequest + var request = new QueueEnqueueRequest { - Queue = this.Name, - Task = task.ToWire() + QueueName = Name, }; - try - { - QueuesClient.Client.Send(request); - } - catch (Grpc.Core.RpcException re) - { - throw NitricException.FromRpcException(re); - } - } - /// - /// Send multiple tasks to this queue. - /// - /// The tasks to send. - /// Results of sending tasks to the queue, including any tasks that failed to be sent. - /// - public List> Send(params Task[] tasks) - { - var wireEvents = new RepeatedField(); - foreach (var task in tasks) + var messages = taskList.Select(task => new QueueMessage { - wireEvents.Add(task.ToWire()); - } + StructPayload = Struct.FromJsonSerializable(task) + }); - var request = new QueueSendBatchRequest { Queue = this.Name }; - request.Tasks.AddRange(wireEvents); - try - { - var response = QueuesClient.Client.SendBatch(request); - var failedTasks = response.FailedTasks.Select(WireToFailedTask).ToList(); - return failedTasks; - } - catch (Grpc.Core.RpcException re) - { - throw NitricException.FromRpcException(re); - } - } + request.Messages.AddRange(messages); - /// - /// Send multiple tasks to this queue. - /// - /// The tasks to send. - /// Results of sending tasks to the queue, including any tasks that failed to be sent. - /// - public List> Send(params T[] payloads) - { - var wireEvents = new RepeatedField(); - foreach (var payload in payloads) - { - var task = new Task { Payload = payload }; - wireEvents.Add(task.ToWire()); - } - - var request = new QueueSendBatchRequest { Queue = this.Name }; - request.Tasks.AddRange(wireEvents); try { - var response = QueuesClient.Client.SendBatch(request); - var failedTasks = response.FailedTasks.Select(WireToFailedTask).ToList(); - return failedTasks; + var response = await this.Client.EnqueueAsync(request); + + return response.FailedMessages.Select(failedMessage => new FailedMessage + { + Details = failedMessage.Details, + Message = Struct.ToJsonSerializable(failedMessage.Message.StructPayload), + }).ToList(); } catch (Grpc.Core.RpcException re) { @@ -150,26 +88,32 @@ public List> Send(params T[] payloads) } /// - /// Request tasks from the queue to process. + /// Dequeue tasks from the queue to process. /// /// The number of tasks returned will be the same or less than the requested depth, based on the number of tasks /// available on the queue. /// - /// The maximum number of tasks to receive. - /// Tasks received from the queue. + /// The maximum number of tasks to dequeue. + /// Tasks dequeued from the queue. /// - public List> Receive(int depth = 1) + public async Task>> Dequeue(int depth = 1) { - if (depth < 1) + var request = new QueueDequeueRequest { - depth = 1; - } + QueueName = this.Name, + Depth = Math.Max(depth, 1) + }; - var request = new QueueReceiveRequest { Queue = this.Name, Depth = depth }; try { - var response = this.QueuesClient.Client.Receive(request); - return response.Tasks.Select(WireToQueueItem).ToList(); + var response = await this.Client.DequeueAsync(request); + + return response.Messages.Select(message => new ReceivedMessage + { + Queue = this, + LeaseId = message.LeaseId, + Message = Struct.ToJsonSerializable(message.Message.StructPayload) + }).ToList(); } catch (Grpc.Core.RpcException re) { @@ -177,34 +121,15 @@ public List> Receive(int depth = 1) } } - private ReceivedTask WireToQueueItem(NitricTask nitricTask) - { - var protoPayload = JsonConvert.SerializeObject(nitricTask.Payload); - - return new ReceivedTask - { - Id = nitricTask.Id, - PayloadType = nitricTask.PayloadType, - Payload = JsonConvert.DeserializeObject(protoPayload), - LeaseId = nitricTask.LeaseId, - Queue = this, - }; - } - - private static FailedTask WireToFailedTask(Proto.Queue.v1.FailedTask protoFailedEvent) + /// + /// Return a string representation of the queue. + /// + /// + public override string ToString() { - var protoPayload = JsonConvert.SerializeObject(protoFailedEvent.Task.Payload); - - return new FailedTask - { - Message = protoFailedEvent.Message, - Task = new Task - { - Id = protoFailedEvent.Task.Id, - PayloadType = protoFailedEvent.Task.PayloadType, - Payload = JsonConvert.DeserializeObject(protoPayload), - } - }; + return GetType().Name + "[name=" + Name + "]"; } } } + + diff --git a/src/Nitric.Sdk/Queue/QueuesClient.cs b/src/Nitric.Sdk/Queue/QueuesClient.cs deleted file mode 100644 index 7d844d6..0000000 --- a/src/Nitric.Sdk/Queue/QueuesClient.cs +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -using GrpcClient = Nitric.Proto.Queue.v1.QueueService.QueueServiceClient; -using Nitric.Sdk.Common; -using System; - -namespace Nitric.Sdk.Queue -{ - /// - /// A queues service client. - /// - public class QueuesClient - { - internal GrpcClient Client { get; private set; } - - /// - /// Create a new queues service client. - /// - /// - public QueuesClient(GrpcClient client = null) - { - this.Client = client ?? new GrpcClient(GrpcChannelProvider.GetChannel()); - } - - /// - /// Create a reference to the queue in the queues service. - /// - /// The queue's name - /// A new queue reference for sending or receiving tasks. - /// - public Queue Queue(string queueName) - { - if (string.IsNullOrEmpty(queueName)) - { - throw new ArgumentNullException(nameof(queueName)); - } - - return new Queue(this, queueName); - } - } -} diff --git a/src/Nitric.Sdk/Resource/ApiResource.cs b/src/Nitric.Sdk/Resource/ApiResource.cs index 7a60e7c..bafde98 100644 --- a/src/Nitric.Sdk/Resource/ApiResource.cs +++ b/src/Nitric.Sdk/Resource/ApiResource.cs @@ -13,228 +13,171 @@ // limitations under the License. using System; using System.Linq; -using System.Collections.Generic; +using Nitric.Proto.Resources.v1; +using Nitric.Proto.Apis.v1; +using Nitric.Sdk.Service; +using Nitric.Sdk.Worker; +using NitricResource = Nitric.Proto.Resources.v1.ResourceIdentifier; +using ProtoApiResource = Nitric.Proto.Resources.v1.ApiResource; +using System.Net.Http; +using System.Runtime.InteropServices; using System.Threading.Tasks; -using Google.Api; -using Nitric.Proto.Resource.v1; -using Nitric.Sdk.Function; -using GrpcClient = Nitric.Proto.Secret.v1.SecretService.SecretServiceClient; -using NitricResource = Nitric.Proto.Resource.v1.Resource; -using ProtoApiResource = Nitric.Proto.Resource.v1.ApiResource; -using ProtoSecurityDefinition = Nitric.Proto.Resource.v1.ApiSecurityDefinition; -using ProtoSecurityDefinitionJwt = Nitric.Proto.Resource.v1.ApiSecurityDefinitionJwt; - namespace Nitric.Sdk.Resource { - public abstract class SecurityDefinition { - internal string Kind { get; private set; } - - internal SecurityDefinition(string kind) - { - this.Kind = kind; - } - } - - public class JwtSecurityDefinition : SecurityDefinition + public class ApiDetails { - internal string Issuer { get; private set; } - internal string[] Audiences { get; private set; } - - internal JwtSecurityDefinition(string Issuer, string[] Audiences) : base("jwt") - { - this.Issuer = Issuer; - this.Audiences = Audiences; - } - } - - public class ApiDetails { internal string ID { get; set; } internal string Provider { get; set; } internal string Service { get; set; } internal string URL { get; set; } } - public class ApiOptions { - public Dictionary SecurityDefinitions { get; private set; } - public Dictionary Security { get; private set; } + public OidcOptions[] Security { get; private set; } public string BasePath { get; private set; } public Middleware[] Middleware { get; private set; } public ApiOptions( - Dictionary securityDefinitions = null, - Dictionary security = null, + OidcOptions[] security = null, string basePath = "", Middleware[] middleware = null ) { - this.SecurityDefinitions = securityDefinitions ?? new Dictionary(); - this.Security = security ?? new Dictionary(); + this.Security = security ?? Array.Empty(); this.BasePath = basePath; - this.Middleware = middleware ?? new Middleware[] { }; + this.Middleware = middleware ?? Array.Empty>(); } } - public class ApiResource : BaseResource { - internal readonly ApiOptions Opts; + public readonly ApiOptions Opts; internal ApiResource(string name, ApiOptions options = null) : base(name, ResourceType.Api) { - this.Opts = options ?? new ApiOptions(); + Opts = options ?? new ApiOptions(); } - internal ApiResource Method(string route, HttpMethod[] methods, Func handler) + internal void AttachOidc(OidcOptions opts) { - var opts = new MethodOptions - { - Security = this.Opts.Security, - SecurityDefs = this.Opts.SecurityDefinitions - }; - - var faas = new Faas(new ApiWorkerOptions - { - Api = this.Name, - Route = this.Opts.BasePath + route, - Methods = methods.ToHashSet(), - Options = opts - }); - - faas.Http(this.Opts.Middleware); - - faas.Http(handler); - - Nitric.RegisterWorker(faas); - return this; - } - - internal ApiResource Method(string route, HttpMethod[] methods, Middleware[] middleware) - { - var opts = new MethodOptions - { - Security = this.Opts.Security, - SecurityDefs = this.Opts.SecurityDefinitions - }; - - var faas = new Faas(new ApiWorkerOptions - { - Api = this.Name, - Route = this.Opts.BasePath + route, - Methods = methods.ToHashSet(), - Options = opts - }); - - var combinedMiddleware = this.Opts.Middleware.Concat(middleware).ToArray(); - - faas.Http(combinedMiddleware); - - Nitric.RegisterWorker(faas); - return this; + var oidcName = string.Format("{0}-{1}", opts.Name, this.Name); + Nitric.Register(oidcName, _ => new OidcResource(oidcName, this.Name, opts)); } /// /// Create a new GET handler on the specified route. /// - /// - /// - public ApiResource Get(string route, Func handler) => Method(route, new HttpMethod[] { HttpMethod.GET }, handler); + /// The path to match on. + /// The handler to run. + /// Security rules to override API-level security. + public void Get(string route, Func> handler, OidcOptions[] security = null) => Route(route, new RouteOptions(security: security)).Get(handler); /// /// Create a new GET handler on the specified route. /// - /// - /// - public ApiResource Get(string route, params Middleware[] handlers) => Method(route, new HttpMethod[] { HttpMethod.GET }, handlers); + /// The path to match on. + /// The handler to run. + /// Security rules to override API-level security. + public void Get(string route, Middleware[] handlers, OidcOptions[] security = null) => Route(route, new RouteOptions(security: security)).Get(handlers); /// /// Create a new POST handler on the specified route. /// - /// - /// - public ApiResource Post(string route, Func handler) => Method(route, new HttpMethod[] { HttpMethod.POST }, handler); + /// The path to match on. + /// The handler to run. + /// Security rules to override API-level security. + public void Post(string route, Func> handler, OidcOptions[] security = null) => Route(route, new RouteOptions(security: security)).Post(handler); /// /// Create a new POST handler on the specified route. /// - /// - /// - public ApiResource Post(string route, params Middleware[] handlers) => Method(route, new HttpMethod[] { HttpMethod.POST }, handlers); + /// The path to match on. + /// The handler to run. + /// Security rules to override API-level security. + public void Post(string route, Middleware[] handlers, OidcOptions[] security = null) => Route(route, new RouteOptions(security: security)).Post(handlers); /// /// Create a new PUT handler on the specified route. /// - /// - /// - public ApiResource Put(string route, Func handler) => Method(route, new HttpMethod[] { HttpMethod.PUT }, handler); + /// The path to match on. + /// The handler to run. + /// Security rules to override API-level security. + public void Put(string route, Func> handler, OidcOptions[] security = null) => Route(route, new RouteOptions(security: security)).Put(handler); /// /// Create a new PUT handler on the specified route. /// - /// - /// - public ApiResource Put(string route, params Middleware[] handlers) => Method(route, new HttpMethod[] { HttpMethod.PUT }, handlers); + /// The path to match on. + /// The handler to run. + /// Security rules to override API-level security. + public void Put(string route, Middleware[] handlers, OidcOptions[] security = null) => Route(route, new RouteOptions(security: security)).Put(handlers); /// /// Create a new DELETE handler on the specified route. /// - /// - /// - public ApiResource Delete(string route, Func handler) => Method(route, new HttpMethod[] { HttpMethod.DELETE }, handler); + /// The path to match on. + /// The handler to run. + /// Security rules to override API-level security. + public void Delete(string route, Func> handler, OidcOptions[] security = null) => Route(route, new RouteOptions(security: security)).Delete(handler); /// /// Create a new DELETE handler on the specified route. /// - /// - /// - public ApiResource Delete(string route, params Middleware[] handlers) => Method(route, new HttpMethod[] { HttpMethod.DELETE }, handlers); + /// The path to match on. + /// The handler to run. + /// Security rules to override API-level security. + public void Delete(string route, Middleware[] handlers, OidcOptions[] security = null) => Route(route, new RouteOptions(security: security)).Delete(handlers); /// /// Create a new OPTIONS handler on the specified route. /// - /// - /// - public ApiResource Options(string route, Func handler) => Method(route, new HttpMethod[] { HttpMethod.OPTIONS }, handler); + /// The path to match on. + /// The handler to run. + /// Security rules to override API-level security. + public void Options(string route, Func> handler, OidcOptions[] security = null) => Route(route, new RouteOptions(security: security)).Options(handler); /// /// Create a new OPTIONS handler on the specified route. /// - /// - /// - public ApiResource Options(string route, params Middleware[] handlers) => Method(route, new HttpMethod[] { HttpMethod.OPTIONS }, handlers); + /// The path to match on. + /// The handler to run. + /// Security rules to override API-level security. + public void Options(string route, Middleware[] handlers, OidcOptions[] security = null) => Route(route, new RouteOptions(security: security)).Options(handlers); /// /// Create a new handler on the specified route for every HTTP verb. /// - /// - /// - public ApiResource All(string route, Func handler) => Method(route, (HttpMethod[])Enum.GetValues(typeof(HttpMethod)), handler); + /// The path to match on. + /// The handler to run. + /// Security rules to override API-level security. + public void All(string route, Func> handler, OidcOptions[] security = null) => Route(route, new RouteOptions(security: security)).All(handler); /// /// Create a new handler on the specified route for every HTTP verb. /// - /// - /// - public ApiResource All(string route, params Middleware[] handlers) => Method(route, (HttpMethod[])Enum.GetValues(typeof(HttpMethod)), handlers); + /// The path to match on. + /// The handler to run. + /// Security rules to override API-level security. + public void All(string route, Middleware[] handlers, OidcOptions[] security = null) => Route(route, new RouteOptions(security)).All(handlers); /// /// Create a new route on a specified path. /// /// An ApiRoute that handlers can be added to. - /// + /// The path to match on. public ApiRoute Route(string path) { - return new ApiRoute(this, this.Opts.BasePath + path, new RouteOptions()); + return new ApiRoute(this, this.Opts.BasePath + path, new RouteOptions(security: this.Opts.Security)); } /// /// Create a new route on a specified path. /// /// An ApiRoute that handlers can be added to. - /// - /// + /// The path to match on. + /// Optional middleware and security rules to apply to the route. public ApiRoute Route(string path, RouteOptions options) { return new ApiRoute(this, this.Opts.BasePath + path, options); @@ -245,62 +188,20 @@ internal override BaseResource Register() var resource = new NitricResource { Name = this.Name, Type = ResourceType.Api }; var apiResource = new ProtoApiResource(); - foreach (KeyValuePair kv in this.Opts.Security) + foreach (var oidcOption in this.Opts.Security) { - var scopes = new ApiScopes(); - - scopes.Scopes.Add(kv.Value); + this.AttachOidc(oidcOption); - apiResource.Security.Add(kv.Key, scopes); - } - - foreach (KeyValuePair kv in this.Opts.SecurityDefinitions) { - var definition = new ProtoSecurityDefinition(); - - if (kv.Value.Kind == "jwt") - { - var jwtSecurityDefinition = kv.Value as JwtSecurityDefinition; - var secDef = new ApiSecurityDefinitionJwt - { - Issuer = jwtSecurityDefinition.Issuer - }; - - secDef.Audiences.AddRange(jwtSecurityDefinition.Audiences); - - definition.Jwt = secDef; - } - - apiResource.SecurityDefinitions.Add(kv.Key, definition); + var scopes = new ApiScopes(); + scopes.Scopes.Add(oidcOption.Scopes); + apiResource.Security.Add(oidcOption.Name, scopes); } - var request = new ResourceDeclareRequest { Resource = resource, Api = apiResource }; - BaseResource.client.Declare(request); + var request = new ResourceDeclareRequest { Id = resource, Api = apiResource }; + client.Declare(request); return this; } - - /// - /// Retrieve details about the deployed API at runtime. These details include: - /// - ID: the identifier for the resource. - /// - Provider: the cloud provider that this API is deployed to. - /// - Service: the cloud service that is running this API (i.e. AWS API Gateway). - /// - URL: the url of the deployed API. - /// - /// The details of the API - public ApiDetails Details() { - var resource = new NitricResource { Name = this.Name, Type = ResourceType.Api }; - - var request = new ResourceDetailsRequest { Resource = resource }; - var response = client.Details(request); - - return new ApiDetails - { - ID = response.Id, - Provider = response.Provider, - Service = response.Service, - URL = response.Api.Url, - }; - } } public class RouteOptions @@ -309,7 +210,16 @@ public class RouteOptions public Middleware[] Middlewares { get; set; } // Security rules to apply to this specific route - public Dictionary Security { get; set; } + public OidcOptions[] Security { get; set; } + + public RouteOptions( + OidcOptions[] security = null, + Middleware[] middleware = null + ) + { + this.Security = security ?? Array.Empty(); + this.Middlewares = middleware ?? new Middleware[] { }; + } } public class ApiRoute @@ -328,20 +238,24 @@ internal ApiRoute(ApiResource api, string path, RouteOptions opts) this.api = api; this.Path = path; - var composedMiddleware = this.api.Opts.Middleware.Concat(opts.Middlewares).ToArray(); - this.Opts = new RouteOptions { + var composedMiddleware = this.api.Opts.Middleware + .Concat(opts.Middlewares) + .ToArray(); + + this.Opts = new RouteOptions + { Middlewares = composedMiddleware, Security = opts.Security }; } - private Middleware[] ConcatMiddleware(Func handler) + private Middleware[] ConcatMiddleware(Func> handler) { - HttpContext ComposedMiddleware(HttpContext context, Func next) + async Task ComposedMiddleware(HttpContext context, Func> next) { - context = handler(context); - return next(context); - }; + context = await handler(context); + return await next(context); + } return this.Opts.Middlewares.Append(ComposedMiddleware).ToArray(); } @@ -353,73 +267,127 @@ private Middleware[] ConcatMiddleware(Middleware[] mid /// /// Create a new GET handler on the specified route. /// - /// - public ApiResource Get(Func handler) => this.api.Method(this.Path, new HttpMethod[] { HttpMethod.GET }, ConcatMiddleware(handler)); + /// The handler to run. + public void Get(Func> handler) => Method(this.Path, new HttpMethod[] { HttpMethod.Get }, this.Opts, ConcatMiddleware(handler)); /// /// Create a new GET middleware chain on the specified route. /// - /// - public ApiResource Get(params Middleware[] handlers) => this.api.Method(this.Path, new HttpMethod[] { HttpMethod.GET }, ConcatMiddleware(handlers)); + /// The handler to run. + public void Get(params Middleware[] handlers) => Method(this.Path, new HttpMethod[] { HttpMethod.Get }, this.Opts, ConcatMiddleware(handlers)); /// /// Create a new POST handler on the specified route. /// - /// - public ApiResource Post(Func handler) => this.api.Method(this.Path, new HttpMethod[] { HttpMethod.POST }, ConcatMiddleware(handler)); + /// The handler to run. + public void Post(Func> handler) => Method(this.Path, new HttpMethod[] { HttpMethod.Post }, this.Opts, ConcatMiddleware(handler)); /// /// Create a new POST middleware chain on the specified route. /// - /// - public ApiResource Post(params Middleware[] handlers) => this.api.Method(this.Path, new HttpMethod[] { HttpMethod.POST}, ConcatMiddleware(handlers)); + /// The handler to run. + public void Post(params Middleware[] handlers) => Method(this.Path, new HttpMethod[] { HttpMethod.Post }, this.Opts, ConcatMiddleware(handlers)); /// /// Create a new PUT handler on the specified route. /// - /// - public ApiResource Put(Func handler) => this.api.Method(this.Path, new HttpMethod[] { HttpMethod.PUT}, ConcatMiddleware(handler)); + /// The handler to run. + public void Put(Func> handler) => Method(this.Path, new HttpMethod[] { HttpMethod.Put }, this.Opts, ConcatMiddleware(handler)); /// /// Create a new PUT middleware chain on the specified route. /// - /// - public ApiResource Put(params Middleware[] handlers) => this.api.Method(this.Path, new HttpMethod[] { HttpMethod.POST }, ConcatMiddleware(handlers)); + /// The handler to run. + public void Put(params Middleware[] handlers) => Method(this.Path, new HttpMethod[] { HttpMethod.Post }, this.Opts, ConcatMiddleware(handlers)); /// /// Create a new DELETE handler on the specified route. /// - /// - public ApiResource Delete(Func handler) => this.api.Method(this.Path, new HttpMethod[] { HttpMethod.DELETE }, ConcatMiddleware(handler)); + /// The handler to run. + public void Delete(Func> handler) => Method(this.Path, new HttpMethod[] { HttpMethod.Delete }, this.Opts, ConcatMiddleware(handler)); /// /// Create a new DELETE middleware chain on the specified route. /// - /// - public ApiResource Delete(params Middleware[] handlers) => this.api.Method(this.Path, new HttpMethod[] { HttpMethod.DELETE }, ConcatMiddleware(handlers)); + /// The handler to run. + public void Delete(params Middleware[] handlers) => Method(this.Path, new HttpMethod[] { HttpMethod.Delete }, this.Opts, ConcatMiddleware(handlers)); + + /// + /// Create a new OPTIONS handler on the specified route. + /// + /// The handler to run. + public void Options(Func> handler) => Method(this.Path, new HttpMethod[] { HttpMethod.Options }, this.Opts, ConcatMiddleware(handler)); + + /// + /// Create a new OPTIONS middleware chain on the specified route. + /// + /// The handler to run. + public void Options(params Middleware[] handlers) => Method(this.Path, new HttpMethod[] { HttpMethod.Options }, this.Opts, ConcatMiddleware(handlers)); /// /// Create a new OPTIONS handler on the specified route. /// /// - public ApiResource Options(Func handler) => this.api.Method(this.Path, new HttpMethod[] { HttpMethod.OPTIONS }, ConcatMiddleware(handler)); + public void Patch(Func> handler) => Method(this.Path, new HttpMethod[] { HttpMethod.Patch }, this.Opts, ConcatMiddleware(handler)); /// /// Create a new OPTIONS middleware chain on the specified route. /// /// - public ApiResource Options(params Middleware[] handlers) => this.api.Method(this.Path, new HttpMethod[] { HttpMethod.OPTIONS }, ConcatMiddleware(handlers)); + public void Patch(params Middleware[] handlers) => Method(this.Path, new HttpMethod[] { HttpMethod.Patch }, this.Opts, ConcatMiddleware(handlers)); + + HttpMethod[] httpMethods = new HttpMethod[] + { + HttpMethod.Get, + HttpMethod.Post, + HttpMethod.Put, + HttpMethod.Delete, + HttpMethod.Head, + HttpMethod.Options, + HttpMethod.Patch + }; /// /// Create a new handler on the specified route for every HTTP verb. /// - /// - public ApiResource All(Func handler) => this.api.Method(this.Path, (HttpMethod[])Enum.GetValues(typeof(HttpMethod)), ConcatMiddleware(handler)); + /// The handler to run. + public void All(Func> handler) => Method(this.Path, httpMethods, this.Opts, ConcatMiddleware(handler)); /// /// Create a new chain of middleware on the specified route for every HTTP verb. /// - /// - public ApiResource All(params Middleware[] handlers) => this.api.Method(this.Path, (HttpMethod[])Enum.GetValues(typeof(HttpMethod)), ConcatMiddleware(handlers)); + /// The handler to run. + public void All(params Middleware[] handlers) => Method(this.Path, httpMethods, this.Opts, ConcatMiddleware(handlers)); + + internal void Method(string route, HttpMethod[] methods, RouteOptions options, Middleware[] middlewares) + { + var opts = new ApiWorkerOptions + { + SecurityDisabled = options.Security.Count() == 0 + }; + + foreach (var oidcOption in options.Security) + { + var scopes = new ApiWorkerScopes(); + scopes.Scopes.Add(oidcOption.Scopes); + opts.Security.Add(oidcOption.Name, scopes); + this.api.AttachOidc(oidcOption); + } + + var registrationRequest = new RegistrationRequest + { + Api = this.api.Name, + Options = opts, + Path = route, + }; + + registrationRequest.Methods.AddRange(methods.Select((method) => method.Method).ToHashSet()); + + var orderedMiddlewares = middlewares.Reverse().ToArray(); + + var apiWorker = new ApiWorker(registrationRequest, orderedMiddlewares); + + Nitric.RegisterWorker(apiWorker); + } } -} +} \ No newline at end of file diff --git a/src/Nitric.Sdk/Resource/BaseResource.cs b/src/Nitric.Sdk/Resource/BaseResource.cs index 8b1756f..a4c0cda 100644 --- a/src/Nitric.Sdk/Resource/BaseResource.cs +++ b/src/Nitric.Sdk/Resource/BaseResource.cs @@ -11,10 +11,10 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -using Nitric.Proto.Resource.v1; +using Nitric.Proto.Resources.v1; using Nitric.Sdk.Common; -using GrpcClient = Nitric.Proto.Resource.v1.ResourceService.ResourceServiceClient; -using ProtoResource = Nitric.Proto.Resource.v1.Resource; +using GrpcClient = Nitric.Proto.Resources.v1.Resources.ResourcesClient; +using ProtoResource = Nitric.Proto.Resources.v1.ResourceIdentifier; namespace Nitric.Sdk.Resource { @@ -28,7 +28,7 @@ public BaseResource(string name, ResourceType type) { this.Name = name; this.type = type; - BaseResource.client = (BaseResource.client == null) ? new GrpcClient(GrpcChannelProvider.GetChannel()) : client; + client = (client == null) ? new GrpcClient(GrpcChannelProvider.GetChannel()) : client; } internal ProtoResource AsProtoResource() diff --git a/src/Nitric.Sdk/Resource/BatchResource.cs b/src/Nitric.Sdk/Resource/BatchResource.cs new file mode 100644 index 0000000..97f5d0e --- /dev/null +++ b/src/Nitric.Sdk/Resource/BatchResource.cs @@ -0,0 +1,132 @@ +// Copyright 2021, Nitric Technologies Pty Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +using System; +using Nitric.Sdk.Service; +using Nitric.Sdk.Worker; +using Nitric.Sdk.Job; +using Nitric.Proto.Batch.v1; +using Nitric.Proto.Resources.v1; +using ResourceType = Nitric.Proto.Resources.v1.ResourceType; +using System.Collections.Generic; +using Action = Nitric.Proto.Resources.v1.Action; +using System.Linq; +using GrpcClient = Nitric.Proto.Batch.v1.Batch.BatchClient; +using Nitric.Sdk.Common; +using System.Threading.Tasks; + +namespace Nitric.Sdk.Resource +{ + /// + /// Available permissions for job resources. + /// + public enum JobPermission + { + /// + /// Enables submitting jobs to the batch service + /// + Submit, + } + + public class JobResourceRequirements + { + /// + /// The amount of CPUs to allocate for this job + /// + public int Cpus { get; private set; } + + /// + /// The amount of memory to allocate for this job (in MB) + /// + public int Memory { get; private set; } + + /// + /// + /// + public int Gpus { get; private set; } + + + + public JobResourceRequirements(int cpus = 1, int memory = 1024, int gpus = 0) + { + this.Cpus = cpus; + this.Memory = memory; + this.Gpus = gpus; + } + } + + public class JobResource : SecureResource + { + internal readonly GrpcClient Client; + + internal JobResource(string name, GrpcClient client = null) : base(name, ResourceType.Batch) + { + this.Client = client ?? new GrpcClient(GrpcChannelProvider.GetChannel()); + } + + internal override BaseResource Register() + { + var request = new ResourceDeclareRequest { Id = this.AsProtoResource() }; + BaseResource.client.Declare(request); + return this; + } + + protected override IEnumerable PermissionsToActions(IEnumerable permissions) + { + var actionMap = new Dictionary> + { + { + JobPermission.Submit, + new List { Action.JobSubmit } + } + }; + + return permissions.Aggregate((IEnumerable)new List(), (acc, x) => acc.Concat(actionMap[x])).Distinct(); + } + + public void Handler(Func, Task>> middlewares, JobResourceRequirements requirements = null) + { + requirements ??= new JobResourceRequirements(); + + var registrationRequest = new RegistrationRequest + { + JobName = this.Name, + Requirements = new Proto.Batch.v1.JobResourceRequirements + { + Cpus = requirements.Cpus, + Memory = requirements.Memory, + Gpus = requirements.Gpus, + } + }; + + var apiWorker = new JobWorker(registrationRequest, middlewares); + + Nitric.RegisterWorker(apiWorker); + } + + /// + /// Request specific access to this job. + /// + /// The permissions that the function has to access the job. + /// A reference to the job. + public Job Allow(JobPermission permission, params JobPermission[] permissions) + { + var allPerms = new List { permission }; + allPerms.AddRange(permissions); + + this.RegisterPolicy(allPerms); + + return new Job(this.Name, this.Client); + } + } +} diff --git a/src/Nitric.Sdk/Resource/BucketResource.cs b/src/Nitric.Sdk/Resource/BucketResource.cs index 08c8e05..264f8ad 100644 --- a/src/Nitric.Sdk/Resource/BucketResource.cs +++ b/src/Nitric.Sdk/Resource/BucketResource.cs @@ -15,11 +15,15 @@ using System; using System.Collections.Generic; using System.Linq; -using Nitric.Proto.Resource.v1; -using Nitric.Sdk.Function; +using Nitric.Proto.Resources.v1; +using Nitric.Sdk.Service; using Nitric.Sdk.Storage; -using Action = Nitric.Proto.Resource.v1.Action; -using NitricResource = Nitric.Proto.Resource.v1.Resource; +using Nitric.Sdk.Worker; +using Nitric.Proto.Storage.v1; +using Action = Nitric.Proto.Resources.v1.Action; +using Nitric.Sdk.Common; +using GrpcClient = Nitric.Proto.Storage.v1.Storage.StorageClient; +using System.Threading.Tasks; namespace Nitric.Sdk.Resource { @@ -31,27 +35,29 @@ public enum BucketPermission /// /// Enables listing and reading files in the bucket. /// - Reading, + Read, /// /// Enables adding or updating files in the bucket. /// - Writing, + Write, /// /// Enables deleting files from the bucket. /// - Deleting + Delete } public class BucketResource : SecureResource { - internal BucketResource(string name) : base(name, ResourceType.Bucket) + internal readonly GrpcClient Client; + + internal BucketResource(string name, GrpcClient client = null) : base(name, ResourceType.Bucket) { + this.Client = client ?? new GrpcClient(GrpcChannelProvider.GetChannel()); } internal override BaseResource Register() { - var resource = new NitricResource { Name = this.Name, Type = ResourceType.Bucket }; - var request = new ResourceDeclareRequest { Resource = resource }; + var request = new ResourceDeclareRequest { Id = this.AsProtoResource() }; BaseResource.client.Declare(request); return this; } @@ -61,15 +67,15 @@ protected override IEnumerable PermissionsToActions(IEnumerable> { { - BucketPermission.Reading, + BucketPermission.Read, new List { Action.BucketFileList, Action.BucketFileGet } }, { - BucketPermission.Writing, + BucketPermission.Write, new List { Action.BucketFilePut } }, { - BucketPermission.Deleting, + BucketPermission.Delete, new List { Action.BucketFileDelete } } }; @@ -79,21 +85,21 @@ protected override IEnumerable PermissionsToActions(IEnumerable /// Registers handlers to be called whenever a file triggers an event in the bucket /// - /// The type of events that should trigger events, Write or Delete - /// The prefix of file names that should trigger events + /// The type of events that should trigger events, Write or Delete + /// The prefix of file names that should trigger events /// The handlers to call to process notification events public void On( - BucketNotificationType notificationType, - string notificationPrefixFilter, - params Middleware[] middleware) + Service.BlobEventType blobEventType, + string keyPrefixFilter, + params Middleware[] middlewares) { - var notificationWorker = new Faas(new BucketNotificationWorkerOptions( - this.Name, - notificationType, - notificationPrefixFilter - )); - - notificationWorker.BucketNotification(middleware); + var request = new RegistrationRequest + { + BucketName = this.Name, + KeyPrefixFilter = keyPrefixFilter, + BlobEventType = blobEventType.ToGrpc(), + }; + var notificationWorker = new BlobEventWorker(request, middlewares); Nitric.RegisterWorker(notificationWorker); } @@ -101,21 +107,21 @@ public void On( /// /// Registers a handler to be called whenever a file triggers an event in the bucket /// - /// The type of events that should trigger events, Write or Delete - /// The prefix of file names that should trigger events + /// The type of events that should trigger events, Write or Delete + /// The prefix of file names that should trigger events /// The handler to call to process notification events public void On( - BucketNotificationType notificationType, - string notificationPrefixFilter, - Func handler) + Service.BlobEventType blobEventType, + string keyPrefixFilter, + Func> handler) { - var notificationWorker = new Faas(new BucketNotificationWorkerOptions( - this.Name, - notificationType, - notificationPrefixFilter - )); - - notificationWorker.BucketNotification(handler); + var request = new RegistrationRequest + { + BucketName = this.Name, + KeyPrefixFilter = keyPrefixFilter, + BlobEventType = blobEventType.ToGrpc(), + }; + var notificationWorker = new BlobEventWorker(request, handler); Nitric.RegisterWorker(notificationWorker); } @@ -125,13 +131,14 @@ public void On( /// /// The permissions that the function has to access the bucket. /// A reference to the bucket. - public Bucket With(BucketPermission permission, params BucketPermission[] permissions) + public Bucket Allow(BucketPermission permission, params BucketPermission[] permissions) { var allPerms = new List { permission }; allPerms.AddRange(permissions); this.RegisterPolicy(allPerms); - return new Storage.Storage().Bucket(this.Name); + + return new Bucket(this.Name, this.Client); } } } diff --git a/src/Nitric.Sdk/Resource/CollectionResource.cs b/src/Nitric.Sdk/Resource/CollectionResource.cs deleted file mode 100644 index b076d9e..0000000 --- a/src/Nitric.Sdk/Resource/CollectionResource.cs +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -using System.Collections.Generic; -using System.Linq; -using Nitric.Proto.Resource.v1; -using Nitric.Sdk.Document; -using Action = Nitric.Proto.Resource.v1.Action; -using NitricResource = Nitric.Proto.Resource.v1.Resource; - -namespace Nitric.Sdk.Resource -{ - /// - /// Available permissions for collection resources. - /// - public enum CollectionPermission - { - /// - /// Enables writing documents to the collection,. - /// - Writing, - /// - /// Enables reading documents from the collection. - /// - Reading, - /// - /// Enables deleting documents from the collection. - /// - Deleting, - } - - public class CollectionResource : SecureResource - { - internal CollectionResource(string name) : base(name, ResourceType.Collection) - { - } - - internal override BaseResource Register() - { - var resource = new NitricResource { Name = this.Name, Type = ResourceType.Collection }; - var request = new ResourceDeclareRequest { Resource = resource }; - client.Declare(request); - return this; - } - - protected override IEnumerable PermissionsToActions(IEnumerable permissions) - { - var actionMap = new Dictionary> - { - { - CollectionPermission.Writing, - new List { Action.CollectionDocumentWrite } - }, - { - CollectionPermission.Reading, - new List { Action.CollectionList, Action.CollectionQuery, Action.CollectionDocumentRead } - }, - { - CollectionPermission.Deleting, - new List { Action.CollectionDocumentDelete } - } - }; - return permissions.Aggregate((IEnumerable)new List(), (acc, x) => acc.Concat(actionMap[x])) - .Distinct(); - } - - public CollectionRef With(CollectionPermission permission, params CollectionPermission[] permissions) - { - var allPerms = new List { permission }; - allPerms.AddRange(permissions); - - this.RegisterPolicy(allPerms); - return new DocumentsClient().Collection(this.Name); - } - } -} diff --git a/src/Nitric.Sdk/Resource/KeyValueStoreResource.cs b/src/Nitric.Sdk/Resource/KeyValueStoreResource.cs new file mode 100644 index 0000000..d2c001f --- /dev/null +++ b/src/Nitric.Sdk/Resource/KeyValueStoreResource.cs @@ -0,0 +1,92 @@ +// Copyright 2021, Nitric Technologies Pty Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +using System.Collections.Generic; +using System.Linq; +using Nitric.Proto.Resources.v1; +using Nitric.Sdk.KeyValueStore; +using Action = Nitric.Proto.Resources.v1.Action; +using ResourceType = Nitric.Proto.Resources.v1.ResourceType; +using GrpcClient = Nitric.Proto.KvStore.v1.KvStore.KvStoreClient; +using Nitric.Sdk.Common; +using System; + +namespace Nitric.Sdk.Resource +{ + /// + /// Available permissions for collection resources. + /// + public enum KeyValueStorePermission + { + /// + /// Enables setting values to the key value store,. + /// + Set, + /// + /// Enables getting values from the key value store. + /// + Get, + /// + /// Enables deleting values from the key value store. + /// + Delete, + } + + public class KeyValueStoreResource : SecureResource + { + internal readonly GrpcClient Client; + + internal KeyValueStoreResource(string name, GrpcClient client = null) : base(name, ResourceType.KeyValueStore) + { + this.Client = client ?? new GrpcClient(GrpcChannelProvider.GetChannel()); + } + + internal override BaseResource Register() + { + var request = new ResourceDeclareRequest { Id = this.AsProtoResource() }; + client.Declare(request); + return this; + } + + protected override IEnumerable PermissionsToActions(IEnumerable permissions) + { + var actionMap = new Dictionary> + { + { + KeyValueStorePermission.Set, + new List { Action.KeyValueStoreWrite } + }, + { + KeyValueStorePermission.Get, + new List { Action.KeyValueStoreRead } + }, + { + KeyValueStorePermission.Delete, + new List { Action.KeyValueStoreDelete } + } + }; + return permissions.Aggregate((IEnumerable)new List(), (acc, x) => acc.Concat(actionMap[x])) + .Distinct(); + } + + public KeyValueStore Allow(KeyValueStorePermission permission, params KeyValueStorePermission[] permissions) + { + var allPerms = new List { permission }; + allPerms.AddRange(permissions); + + this.RegisterPolicy(allPerms); + + return new KeyValueStore(this.Name, this.Client); + } + } +} diff --git a/src/Nitric.Sdk/Resource/OidcResource.cs b/src/Nitric.Sdk/Resource/OidcResource.cs new file mode 100644 index 0000000..84794d9 --- /dev/null +++ b/src/Nitric.Sdk/Resource/OidcResource.cs @@ -0,0 +1,78 @@ +// Copyright 2021, Nitric Technologies Pty Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using Nitric.Proto.Resources.v1; + +namespace Nitric.Sdk.Resource +{ + public delegate OidcOptions OidcScopes(params string[] scopes); + + public class OidcOptions + { + public string Name { get; set; } + public string Issuer { get; set; } + public string[] Audiences { get; set; } + public string[] Scopes { get; set; } + + public OidcOptions(string name, string issuer, string[] audiences, string[] scopes) + { + this.Name = name; + this.Issuer = issuer; + this.Audiences = audiences; + this.Scopes = scopes; + } + } + + public class OidcResource : BaseResource + { + private string ApiName { get; set; } + private string Issuer { get; set; } + private string[] Audiences { get; set; } + private string RuleName { get; set; } + + public OidcResource(string name, string apiName, OidcOptions options) : base(name, ResourceType.ApiSecurityDefinition) + { + this.ApiName = apiName; + this.Issuer = options.Issuer; + this.Audiences = options.Audiences; + this.RuleName = options.Name; + } + + internal override BaseResource Register() + { + var resource = new ResourceIdentifier + { + Name = this.RuleName, + Type = ResourceType.ApiSecurityDefinition, + }; + + var oidcRes = new ApiOpenIdConnectionDefinition + { + Issuer = this.Issuer, + }; + oidcRes.Audiences.AddRange(this.Audiences); + + var secDef = new ApiSecurityDefinitionResource + { + ApiName = this.ApiName, + Oidc = oidcRes + }; + + var request = new ResourceDeclareRequest { Id = resource, ApiSecurityDefinition = secDef }; + BaseResource.client.Declare(request); + + return this; + } + } +} \ No newline at end of file diff --git a/src/Nitric.Sdk/Resource/QueueResource.cs b/src/Nitric.Sdk/Resource/QueueResource.cs index b0a5e03..e606a75 100644 --- a/src/Nitric.Sdk/Resource/QueueResource.cs +++ b/src/Nitric.Sdk/Resource/QueueResource.cs @@ -11,12 +11,13 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +using System; using System.Collections.Generic; using System.Linq; -using Nitric.Proto.Resource.v1; -using Nitric.Sdk.Queue; -using Action = Nitric.Proto.Resource.v1.Action; -using NitricResource = Nitric.Proto.Resource.v1.Resource; +using Nitric.Proto.Resources.v1; +using Nitric.Sdk.Common; +using Action = Nitric.Proto.Resources.v1.Action; +using GrpcClient = Nitric.Proto.Queues.v1.Queues.QueuesClient; namespace Nitric.Sdk.Resource { @@ -28,23 +29,24 @@ public enum QueuePermission /// /// Enables pushing new tasks to the queue. /// - Sending, + Enqueue, /// /// Enables pulling and completing tasks on the queue. /// - Receiving + Dequeue } public class QueueResource : SecureResource { - internal QueueResource(string name) : base(name, ResourceType.Queue) + internal readonly GrpcClient Client; + internal QueueResource(string name, GrpcClient client = null) : base(name, ResourceType.Queue) { + this.Client = client ?? new GrpcClient(GrpcChannelProvider.GetChannel()); } internal override BaseResource Register() { - var resource = new NitricResource { Name = this.Name, Type = ResourceType.Queue }; - var request = new ResourceDeclareRequest { Resource = resource }; + var request = new ResourceDeclareRequest { Id = this.AsProtoResource() }; client.Declare(request); return this; } @@ -54,12 +56,12 @@ protected override IEnumerable PermissionsToActions(IEnumerable> { { - QueuePermission.Sending, - new List { Action.QueueSend, Action.QueueDetail, Action.QueueList } + QueuePermission.Enqueue, + new List { Action.QueueEnqueue } }, { - QueuePermission.Receiving, - new List { Action.QueueReceive, Action.QueueDetail, Action.QueueList } + QueuePermission.Dequeue, + new List { Action.QueueDequeue } } }; return permissions.Aggregate((IEnumerable)new List(), (acc, x) => acc.Concat(actionMap[x])).Distinct(); @@ -70,13 +72,14 @@ protected override IEnumerable PermissionsToActions(IEnumerable /// The permissions that the function has to access the queue. /// A reference to the queue. - public Queue.Queue With(QueuePermission permission, params QueuePermission[] permissions) + public Queue.Queue Allow(QueuePermission permission, params QueuePermission[] permissions) { var allPerms = new List { permission }; allPerms.AddRange(permissions); this.RegisterPolicy(allPerms); - return new QueuesClient().Queue(this.Name); + + return new Queue.Queue(this.Name, this.Client); } } } diff --git a/src/Nitric.Sdk/Resource/ScheduleResource.cs b/src/Nitric.Sdk/Resource/ScheduleResource.cs index 1206261..329aed2 100644 --- a/src/Nitric.Sdk/Resource/ScheduleResource.cs +++ b/src/Nitric.Sdk/Resource/ScheduleResource.cs @@ -12,57 +12,62 @@ // See the License for the specific language governing permissions and // limitations under the License. using System; -using Nitric.Sdk.Function; +using Nitric.Sdk.Service; +using Nitric.Sdk.Worker; +using Nitric.Proto.Schedules.v1; +using Nitric.Proto.Resources.v1; +using ResourceType = Nitric.Proto.Resources.v1.ResourceType; +using System.Threading.Tasks; namespace Nitric.Sdk.Resource { - public class ScheduleResource + public class ScheduleResource : BaseResource { - private string name; + internal ScheduleResource(string name) : base(name, ResourceType.Schedule) + { + + } - internal ScheduleResource(string name) + internal override BaseResource Register() { - this.name = name; + var request = new ResourceDeclareRequest { Id = this.AsProtoResource() }; + BaseResource.client.Declare(request); + return this; } /// /// Run code at a specific time, represented by a rate and a frequency. e.g. every 7 days /// - /// The interval for the schedule running. e.g. 7 for every '7 days' - /// The frequency for the schedule running. e.g. Days for every '7 days' + /// The interval for the schedule running. e.g. '7 days', '1 hour', '5 minutes' /// The middleware (code) to run on a schedule. - public void Every(int rate, Frequency frequency, Func middleware) + public void Every(string rate, Func> middleware) { - var faas = new Faas(new ScheduleRateWorkerOptions + var registration = new RegistrationRequest { - Rate = rate, - Frequency = frequency, - Description = this.name - }); + ScheduleName = this.Name, + Every = new ScheduleEvery { Rate = rate } + }; - faas.Event(middleware); + var worker = new ScheduleWorker(registration, middleware); - Nitric.RegisterWorker(faas); + Nitric.RegisterWorker(worker); } /// /// Run code at a specific time, represented by a rate and a frequency. e.g. every 7 days /// - /// The interval for the schedule running. e.g. 7 for every '7 days' - /// The frequency for the schedule running. e.g. Days for every '7 days' + /// The interval for the schedule running. e.g. '7 days', '1 hour', '5 minutes' /// The middlewares (code) to run on a schedule. - public void Every(int rate, Frequency frequency, params Middleware[] middleware) + public void Every(string rate, params Middleware[] middleware) { - var faas = new Faas(new ScheduleRateWorkerOptions + var registration = new RegistrationRequest { - Rate = rate, - Frequency = frequency, - Description = this.name - }); + ScheduleName = this.Name, + Every = new ScheduleEvery { Rate = rate } + }; + var worker = new ScheduleWorker(registration, middleware); - faas.Event(middleware); - - Nitric.RegisterWorker(faas); + Nitric.RegisterWorker(worker); } /// @@ -70,17 +75,16 @@ public void Every(int rate, Frequency frequency, params Middleware /// /// The cron expression representing when the schedule should run. /// The middleware (code) to run on a schedule. - public void Cron(string expression, Func middleware) + public void Cron(string expression, Func> middleware) { - var faas = new Faas(new ScheduleCronWorkerOptions + var registration = new RegistrationRequest { - Description = this.name, - Cron = expression - }); - - faas.Event(middleware); + ScheduleName = this.Name, + Cron = new ScheduleCron { Expression = expression } + }; + var worker = new ScheduleWorker(registration, middleware); - Nitric.RegisterWorker(faas); + Nitric.RegisterWorker(worker); } /// @@ -88,17 +92,16 @@ public void Cron(string expression, Func middleware) /// /// The cron expression representing when the schedule should run. /// The middlewares (code) to run on a schedule. - public void Cron(string expression, params Middleware[] middleware) + public void Cron(string expression, params Middleware[] middleware) { - var faas = new Faas(new ScheduleCronWorkerOptions + var registration = new RegistrationRequest { - Description = this.name, - Cron = expression - }); - - faas.Event(middleware); + ScheduleName = this.Name, + Cron = new ScheduleCron { Expression = expression } + }; + var worker = new ScheduleWorker(registration, middleware); - Nitric.RegisterWorker(faas); + Nitric.RegisterWorker(worker); } } } diff --git a/src/Nitric.Sdk/Resource/SecretResource.cs b/src/Nitric.Sdk/Resource/SecretResource.cs index f0837dd..5747301 100644 --- a/src/Nitric.Sdk/Resource/SecretResource.cs +++ b/src/Nitric.Sdk/Resource/SecretResource.cs @@ -11,12 +11,14 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +using System; using System.Collections.Generic; using System.Linq; -using Nitric.Proto.Resource.v1; -using Nitric.Sdk.Secret; -using Action = Nitric.Proto.Resource.v1.Action; -using NitricResource = Nitric.Proto.Resource.v1.Resource; +using Nitric.Proto.Resources.v1; +using NitricSecret = Nitric.Sdk.Secret.Secret; +using Action = Nitric.Proto.Resources.v1.Action; +using GrpcClient = Nitric.Proto.Secrets.v1.SecretManager.SecretManagerClient; +using Nitric.Sdk.Common; namespace Nitric.Sdk.Resource { @@ -28,23 +30,25 @@ public enum SecretPermission /// /// Enables putting secrets to the secret store. /// - Putting, + Put, /// /// Enables accessing secrets from the secret store. /// - Accessing + Access } public class SecretResource : SecureResource { - internal SecretResource(string name) : base(name, ResourceType.Secret) + internal readonly GrpcClient Client; + + internal SecretResource(string name, GrpcClient client = null) : base(name, ResourceType.Secret) { + this.Client = client ?? new GrpcClient(GrpcChannelProvider.GetChannel()); } internal override BaseResource Register() { - var resource = new NitricResource { Name = this.Name, Type = ResourceType.Secret }; - var request = new ResourceDeclareRequest { Resource = resource }; + var request = new ResourceDeclareRequest { Id = this.AsProtoResource() }; client.Declare(request); return this; } @@ -54,24 +58,25 @@ protected override IEnumerable PermissionsToActions(IEnumerable> { { - SecretPermission.Putting, + SecretPermission.Put, new List { Action.SecretPut } }, { - SecretPermission.Accessing, + SecretPermission.Access, new List { Action.SecretAccess } } }; return permissions.Aggregate((IEnumerable)new List(), (acc, x) => acc.Concat(actionMap[x])).Distinct(); } - public Secret.Secret With(SecretPermission permission, params SecretPermission[] permissions) + public NitricSecret Allow(SecretPermission permission, params SecretPermission[] permissions) { var allPerms = new List { permission }; allPerms.AddRange(permissions); this.RegisterPolicy(allPerms); - return new SecretsClient().Secret(this.Name); + + return new NitricSecret(this.Name, this.Client); } } } diff --git a/src/Nitric.Sdk/Resource/SecureResource.cs b/src/Nitric.Sdk/Resource/SecureResource.cs index f8b850e..d82d158 100644 --- a/src/Nitric.Sdk/Resource/SecureResource.cs +++ b/src/Nitric.Sdk/Resource/SecureResource.cs @@ -12,9 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. using System.Collections.Generic; -using Nitric.Proto.Resource.v1; -using Action = Nitric.Proto.Resource.v1.Action; -using GrpcClient = Nitric.Proto.Secret.v1.SecretService.SecretServiceClient; +using Nitric.Proto.Resources.v1; +using Action = Nitric.Proto.Resources.v1.Action; namespace Nitric.Sdk.Resource { @@ -45,15 +44,15 @@ protected SecureResource(string name, ResourceType type) : base(name, type) /// The permissions to include with the resource policy. protected void RegisterPolicy(IEnumerable permissions) { - var policyResource = new Proto.Resource.v1.Resource { Type = ResourceType.Policy }; - var defaultPrincipal = new Proto.Resource.v1.Resource { Type = ResourceType.Function }; + var policyResource = new ResourceIdentifier { Type = ResourceType.Policy }; + var defaultPrincipal = new ResourceIdentifier { Type = ResourceType.Service }; var actions = this.PermissionsToActions(permissions); var policy = new PolicyResource { Principals = { defaultPrincipal }, Actions = { actions } }; policy.Resources.Add(this.AsProtoResource()); - var request = new ResourceDeclareRequest { Resource = policyResource, Policy = policy }; + var request = new ResourceDeclareRequest { Id = policyResource, Policy = policy }; BaseResource.client.Declare(request); } } diff --git a/src/Nitric.Sdk/Resource/SqlResource.cs b/src/Nitric.Sdk/Resource/SqlResource.cs new file mode 100644 index 0000000..69795eb --- /dev/null +++ b/src/Nitric.Sdk/Resource/SqlResource.cs @@ -0,0 +1,80 @@ +// Copyright 2021, Nitric Technologies Pty Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System; +using Nitric.Proto.Sql.v1; +using GrpcClient = Nitric.Proto.Sql.v1.Sql.SqlClient; +using Nitric.Proto.Resources.v1; +using ResourceType = Nitric.Proto.Resources.v1.ResourceType; +using Nitric.Sdk.Common; +using System.Threading.Tasks; + +namespace Nitric.Sdk.Resource +{ + public class SqlResource : BaseResource + { + internal readonly GrpcClient Client; + + string Migrations; + + internal SqlResource(string name, string migrations, GrpcClient client = null) : base(name, ResourceType.SqlDatabase) + { + this.Client = client ?? new GrpcClient(GrpcChannelProvider.GetChannel()); + this.Migrations = migrations; + } + + internal override BaseResource Register() + { + var request = new ResourceDeclareRequest + { + Id = this.AsProtoResource(), + SqlDatabase = new SqlDatabaseResource + { + Migrations = new SqlDatabaseMigrations + { + MigrationsPath = this.Migrations + } + } + }; + BaseResource.client.Declare(request); + return this; + } + + /// + /// Retrieves the connection string of this SQL Database at runtime. + /// + /// The connection string of this SQL Database + public string ConnectionString() + { + var request = new SqlConnectionStringRequest { DatabaseName = this.Name }; + + var resp = this.Client.ConnectionString(request); + + return resp.ConnectionString; + } + + /// + /// Retrieves the connection string of this SQL Database at runtime. + /// + /// The connection string of this SQL Database + public async Task ConnectionStringAsync() + { + var request = new SqlConnectionStringRequest { DatabaseName = this.Name }; + + var resp = await this.Client.ConnectionStringAsync(request); + + return resp.ConnectionString; + } + } +} diff --git a/src/Nitric.Sdk/Resource/TopicResource.cs b/src/Nitric.Sdk/Resource/TopicResource.cs index f456de3..8b12ba5 100644 --- a/src/Nitric.Sdk/Resource/TopicResource.cs +++ b/src/Nitric.Sdk/Resource/TopicResource.cs @@ -14,11 +14,16 @@ using System; using System.Collections.Generic; using System.Linq; -using Nitric.Proto.Resource.v1; -using Nitric.Sdk.Event; -using Nitric.Sdk.Function; -using Action = Nitric.Proto.Resource.v1.Action; -using NitricResource = Nitric.Proto.Resource.v1.Resource; +using Nitric.Proto.Resources.v1; +using Nitric.Proto.Topics.v1; +using Nitric.Sdk.Common; +using Nitric.Sdk.Service; +using Nitric.Sdk.Topics; +using Nitric.Sdk.Worker; +using Action = Nitric.Proto.Resources.v1.Action; +using ResourceType = Nitric.Proto.Resources.v1.ResourceType; +using GrpcClient = Nitric.Proto.Topics.v1.Topics.TopicsClient; +using System.Threading.Tasks; namespace Nitric.Sdk.Resource { @@ -28,22 +33,24 @@ namespace Nitric.Sdk.Resource public enum TopicPermission { /// - /// Enables pushing new events to the topic. + /// Enables publishing new events to the topic. /// - Publishing + Publish } public class TopicResource : SecureResource { - internal TopicResource(string name) : base(name, ResourceType.Topic) + internal readonly GrpcClient Client; + + internal TopicResource(string name, GrpcClient client = null) : base(name, ResourceType.Topic) { + this.Client = client ?? new GrpcClient(GrpcChannelProvider.GetChannel()); } internal override BaseResource Register() { - var resource = new NitricResource { Name = this.Name, Type = ResourceType.Topic }; - var request = new ResourceDeclareRequest { Resource = resource }; - BaseResource.client.Declare(request); + var request = new ResourceDeclareRequest { Id = this.AsProtoResource() }; + client.Declare(request); return this; } @@ -52,8 +59,8 @@ protected override IEnumerable PermissionsToActions(IEnumerable> { { - TopicPermission.Publishing, - new List { Action.TopicEventPublish, Action.TopicList, Action.TopicDetail } + TopicPermission.Publish, + new List { Action.TopicPublish } } }; return permissions.Aggregate((IEnumerable)new List(), (acc, x) => acc.Concat(actionMap[x])) @@ -64,11 +71,11 @@ protected override IEnumerable PermissionsToActions(IEnumerable /// The middleware to call to process events - public void Subscribe(params Middleware[] middleware) + public void Subscribe(params Middleware>[] middleware) { - var subWorker = new Faas(new SubscriptionWorkerOptions { Topic = this.Name }); + var registrationRequest = new RegistrationRequest { TopicName = this.Name }; - subWorker.Event(middleware); + var subWorker = new SubscriptionWorker(registrationRequest, middleware); Nitric.RegisterWorker(subWorker); } @@ -77,11 +84,12 @@ public void Subscribe(params Middleware[] middleware) /// Registers a handler to be called whenever a new event is published to this topic. /// /// The handler to call to process events - public void Subscribe(Func handler) + public void Subscribe(Func, Task>> handler) { - var subWorker = new Faas(new SubscriptionWorkerOptions { Topic = this.Name }); + var registrationRequest = new RegistrationRequest { TopicName = this.Name }; + + var subWorker = new SubscriptionWorker(registrationRequest, handler); - subWorker.Event(handler); Nitric.RegisterWorker(subWorker); } @@ -90,13 +98,14 @@ public void Subscribe(Func handler) /// /// The permissions that the function has to access the topic. /// A reference to the topic. - public Topic With(TopicPermission permission, params TopicPermission[] permissions) + public Topic Allow(TopicPermission permission, params TopicPermission[] permissions) { var allPerms = new List { permission }; allPerms.AddRange(permissions); this.RegisterPolicy(allPerms); - return new EventsClient().Topic(this.Name); + + return new Topic(this.Name, this.Client); } } } diff --git a/src/Nitric.Sdk/Resource/WebsocketResource.cs b/src/Nitric.Sdk/Resource/WebsocketResource.cs index cfcef53..b64de1b 100644 --- a/src/Nitric.Sdk/Resource/WebsocketResource.cs +++ b/src/Nitric.Sdk/Resource/WebsocketResource.cs @@ -15,14 +15,15 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Runtime.CompilerServices; -using Nitric.Proto.Resource.v1; +using Nitric.Proto.Resources.v1; using Nitric.Sdk.Common; -using Nitric.Sdk.Function; +using Nitric.Sdk.Service; using Nitric.Sdk.Websocket; -using Action = Nitric.Proto.Resource.v1.Action; -using NitricResource = Nitric.Proto.Resource.v1.Resource; -using GrpcClient = Nitric.Proto.Websocket.v1.WebsocketService.WebsocketServiceClient; +using Action = Nitric.Proto.Resources.v1.Action; +using GrpcClient = Nitric.Proto.Websockets.v1.Websocket.WebsocketClient; +using Nitric.Sdk.Worker; +using Nitric.Proto.Websockets.v1; +using System.Threading.Tasks; namespace Nitric.Sdk.Resource { @@ -39,17 +40,16 @@ public enum WebsocketPermission public class WebsocketResource : SecureResource { - private readonly WebsocketClient wsClient; + private readonly GrpcClient Client; - internal WebsocketResource(string name) : base(name, ResourceType.Websocket) + internal WebsocketResource(string name, GrpcClient client = null) : base(name, ResourceType.Websocket) { - this.wsClient = new WebsocketClient(new GrpcClient(GrpcChannelProvider.GetChannel())); + this.Client = client ?? new GrpcClient(GrpcChannelProvider.GetChannel()); } internal override BaseResource Register() { - var resource = new NitricResource { Name = this.Name, Type = ResourceType.Websocket }; - var request = new ResourceDeclareRequest { Resource = resource }; + var request = new ResourceDeclareRequest { Id = this.AsProtoResource() }; BaseResource.client.Declare(request); return this; } @@ -70,34 +70,51 @@ protected override IEnumerable PermissionsToActions(IEnumerable /// Registers a chain of middleware to be called whenever a new event is published to this topic. /// - /// The type of websocket event listener + /// The type of websocket event listener /// The middleware to call to process events - public void On(WebsocketEventType notificationType, params Middleware[] middleware) + public void On(Service.WebsocketEventType eventType, params Middleware[] middlewares) { - var websocketWorker = new Faas(new WebsocketWorkerOptions(this.Name, notificationType)); + var registrationRequest = new RegistrationRequest + { + SocketName = Name, + EventType = eventType.ToGrpc() + }; - websocketWorker.Websocket(middleware); + var websocketWorker = new WebsocketWorker(registrationRequest, middlewares); Nitric.RegisterWorker(websocketWorker); } /// - /// Registers a handler to be called whenever a new event is published to this websocket. + /// Registers a handler to be called whenever an event is published to this websocket. /// - /// The type of websocket event /// The handler to call to process websocket events - public void On(WebsocketEventType notificationType, Func handler) + public void On(Service.WebsocketEventType eventType, Func> handler) { - var websocketWorker = new Faas(new WebsocketWorkerOptions(this.Name, notificationType)); + var registrationRequest = new RegistrationRequest + { + SocketName = Name, + EventType = eventType.ToGrpc() + }; - websocketWorker.Websocket(handler); + var websocketWorker = new WebsocketWorker(registrationRequest, handler); Nitric.RegisterWorker(websocketWorker); } - public Connection Connection(string connectionId) + public Connection Connection(string socket, string connectionId) { - return this.wsClient.Connection(this.Name, connectionId); + if (string.IsNullOrEmpty(socket)) + { + throw new ArgumentNullException(nameof(socket)); + } + + if (string.IsNullOrEmpty(connectionId)) + { + throw new ArgumentNullException(nameof(connectionId)); + } + + return new Connection(connectionId, socket, this.Client); } } } diff --git a/src/Nitric.Sdk/Secret/Secret.cs b/src/Nitric.Sdk/Secret/Secret.cs index 21d4e84..bc01afc 100644 --- a/src/Nitric.Sdk/Secret/Secret.cs +++ b/src/Nitric.Sdk/Secret/Secret.cs @@ -14,9 +14,10 @@ using System; using System.Text; -using Nitric.Proto.Secret.v1; +using System.Threading.Tasks; +using Nitric.Proto.Secrets.v1; using Nitric.Sdk.Common; -using GrpcClient = Nitric.Proto.Secret.v1.SecretService.SecretServiceClient; +using GrpcClient = Nitric.Proto.Secrets.v1.SecretManager.SecretManagerClient; namespace Nitric.Sdk.Secret { @@ -34,8 +35,13 @@ public class Secret /// public readonly string Name; - internal Secret(GrpcClient client, string name) + public Secret(string name, GrpcClient client = null) { + if (string.IsNullOrEmpty(name)) + { + throw new ArgumentNullException(nameof(name)); + } + this.Client = client; this.Name = name; } @@ -68,63 +74,47 @@ public SecretVersion Latest() /// /// Create a new version of this secret containing the provided value and set it as the latest version. /// - /// The secret value to store from an array of bytes. + /// The secret value to store from a string. /// A reference to the specific version of the secret containing the provided value. /// /// - public SecretVersion Put(byte[] value) + public async Task Put(string value) { - if (value == null || value.Length == 0) + if (string.IsNullOrEmpty(value)) { throw new ArgumentNullException(nameof(value)); } var request = new SecretPutRequest { - Secret = new Proto.Secret.v1.Secret { Name = this.Name }, - Value = Google.Protobuf.ByteString.CopyFrom(value), + Secret = new Proto.Secrets.v1.Secret { Name = this.Name }, + Value = Google.Protobuf.ByteString.CopyFrom(Encoding.UTF8.GetBytes(value)), }; + try { - var secretResponse = Client.Put(request); + var secretResponse = await Client.PutAsync(request); return new SecretVersion( new Secret( - this.Client, - secretResponse.SecretVersion.Secret.Name + secretResponse.SecretVersion.Secret.Name, + this.Client ), secretResponse.SecretVersion.Version ); } catch (Grpc.Core.RpcException re) { - throw Common.NitricException.FromRpcException(re); - } - } - - /// - /// Create a new version of this secret containing the provided value and set it as the latest version. - /// - /// The secret value to store from a string. - /// A reference to the specific version of the secret containing the provided value. - /// - /// - public SecretVersion Put(string value) - { - if (string.IsNullOrEmpty(value)) - { - throw new ArgumentNullException("value"); + throw NitricException.FromRpcException(re); } - - return Put(Encoding.UTF8.GetBytes(value)); } /// - /// A string representing this secret. Will not contain the value of the secret. + /// Return a string representation of this secret. Will not contain the secret contents. /// /// public override string ToString() { - return "[name=" + this.Name + "]"; + return GetType().Name + "[name=" + Name + "]"; } } } diff --git a/src/Nitric.Sdk/Secret/SecretVersion.cs b/src/Nitric.Sdk/Secret/SecretVersion.cs index f7b7a19..fedd828 100644 --- a/src/Nitric.Sdk/Secret/SecretVersion.cs +++ b/src/Nitric.Sdk/Secret/SecretVersion.cs @@ -13,7 +13,8 @@ // limitations under the License. using System; -using Nitric.Proto.Secret.v1; +using System.Threading.Tasks; +using Nitric.Proto.Secrets.v1; using Nitric.Sdk.Common; namespace Nitric.Sdk.Secret @@ -35,16 +36,6 @@ public class SecretVersion internal SecretVersion(Secret secret, string id) { - if (secret == null || string.IsNullOrEmpty(secret.Name)) - { - throw new ArgumentNullException(nameof(secret)); - } - - if (string.IsNullOrEmpty(id)) - { - throw new ArgumentNullException(nameof(id)); - } - this.Secret = secret; this.Id = id; } @@ -54,19 +45,21 @@ internal SecretVersion(Secret secret, string id) /// /// The secret value from the secrets store. /// - public SecretValue Access() + public async Task Access() { var secret = new SecretAccessRequest { - SecretVersion = new Proto.Secret.v1.SecretVersion + SecretVersion = new Proto.Secrets.v1.SecretVersion { - Secret = new Proto.Secret.v1.Secret { Name = this.Secret.Name }, + Secret = new Proto.Secrets.v1.Secret { Name = this.Secret.Name }, Version = this.Id, } }; + try { - var response = this.Secret.Client.Access(secret); + var response = await this.Secret.Client.AccessAsync(secret); + var value = response.Value.ToByteArray(); //Return a new secret value with a reference to this secret version return new SecretValue( diff --git a/src/Nitric.Sdk/Secret/SecretsClient.cs b/src/Nitric.Sdk/Secret/SecretsClient.cs deleted file mode 100644 index f8238ca..0000000 --- a/src/Nitric.Sdk/Secret/SecretsClient.cs +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -using System; -using Nitric.Sdk.Common; -using GrpcClient = Nitric.Proto.Secret.v1.SecretService.SecretServiceClient; - -namespace Nitric.Sdk.Secret -{ - /// - /// The secrets service client. - /// - public class SecretsClient - { - private readonly GrpcClient secretServiceClient; - - /// - /// Create a new secrets service client. - /// - /// - public SecretsClient(GrpcClient client = null) - { - this.secretServiceClient = client ?? new GrpcClient(GrpcChannelProvider.GetChannel()); - } - - /// - /// Create a reference to a specific secret in the secret store. - /// - /// The name of the secret - /// The secret reference. - /// - public Secret Secret(string name) - { - if (string.IsNullOrEmpty(name)) - { - throw new ArgumentNullException(nameof(name)); - } - - return new Secret(this.secretServiceClient, name); - } - } -} diff --git a/src/Nitric.Sdk/Service/BlobEventContext.cs b/src/Nitric.Sdk/Service/BlobEventContext.cs new file mode 100644 index 0000000..d40fcf5 --- /dev/null +++ b/src/Nitric.Sdk/Service/BlobEventContext.cs @@ -0,0 +1,169 @@ +// Copyright 2021, Nitric Technologies Pty Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System; +using Nitric.Proto.Storage.v1; +using ProtoBlobEventResponse = Nitric.Proto.Storage.v1.BlobEventResponse; +using ProtoBlobEventType = Nitric.Proto.Storage.v1.BlobEventType; + +namespace Nitric.Sdk.Service +{ + /// + /// Extension class for methods converting blob event types to and from gRPC calls. + /// + internal static class BlobEventTypeExtension + { + /// + /// Convert a SDK blob event type into a gRPC blob event type. + /// + /// + /// + /// + internal static ProtoBlobEventType ToGrpc( + this BlobEventType blobEventType) + { + return blobEventType switch + { + BlobEventType.Write => ProtoBlobEventType.Created, + BlobEventType.Delete => ProtoBlobEventType.Deleted, + _ => throw new ArgumentException("Unsupported blob event type") + }; + } + } + + /// + /// Available blob event trigger types. + /// + public enum BlobEventType + { + /// + /// Trigger a blob event on a write event. + /// + Write, + /// + /// Trigger a blob event on a delete event. + /// + Delete + } + + /// + /// Represents a bucket notification being created by a write or delete event in the bucket + /// + public class BlobEventRequest : TriggerRequest + { + /// + /// A reference to the file that triggered this request + /// + public string Key { get; private set; } + + /// + /// The type of event that triggered this request + /// + /// + public BlobEventType NotificationType { get; private set; } + + /// + /// Construct a bucket notification request + /// + /// the file that triggered the notification + /// the type of bucket notification + public BlobEventRequest(string key, BlobEventType notificationType) : base() + { + this.Key = key; + this.NotificationType = notificationType; + } + } + + /// + /// Represents the results of processing a bucket notification. + /// + public class BlobEventResponse : TriggerResponse + { + /// + /// Indicates whether the event was successfully processed. + /// + /// If this value is false, the event may be resent. + /// + public bool Success { get; set; } + + /// + /// Construct a bucket notification response. + /// + /// Indicates whether the event was successfully processed. + public BlobEventResponse(bool success) + { + this.Success = success; + } + } + + /// + /// Represents the request/response context for a bucket notification. + /// + public class BlobEventContext : TriggerContext + { + /// + /// Construct a new BucketNotificationContext. + /// + /// The request object + /// The response object + public BlobEventContext(string id, BlobEventRequest req, BlobEventResponse res) : base(id, req, res) + { + } + + /// + /// Construct a bucket notification context from a trigger request gRPC object. + /// + /// The trigger to convert into a BucketNotificationContext. + /// The bucket notification worker options describing the worker options. + /// the new bucket notification context + public static BlobEventContext FromRequest(ServerMessage trigger) + { + var notificationType = FromGrpcBlobEventType(trigger.BlobEventRequest.BlobEvent.Type); + + return new BlobEventContext( + trigger.Id, + new BlobEventRequest( + trigger.BlobEventRequest.BlobEvent.Key, + notificationType + ), + new BlobEventResponse(true)); + } + + /// + /// Convert a gRPC blob event type into a SDK blob event type. + /// + /// + /// + /// + private static BlobEventType FromGrpcBlobEventType( + ProtoBlobEventType blobEventType) + { + return blobEventType switch + { + ProtoBlobEventType.Created => BlobEventType.Write, + ProtoBlobEventType.Deleted => BlobEventType.Delete, + _ => throw new ArgumentException("Unsupported blob event type") + }; + } + + /// + /// Create a gRPC trigger response from this context. + /// + /// the new trigger response + public ClientMessage ToResponse() + { + return new ClientMessage { Id = Id, BlobEventResponse = new ProtoBlobEventResponse { Success = this.Res.Success } }; + } + } +} diff --git a/src/Nitric.Sdk/Service/FileEventContext.cs b/src/Nitric.Sdk/Service/FileEventContext.cs new file mode 100644 index 0000000..4606501 --- /dev/null +++ b/src/Nitric.Sdk/Service/FileEventContext.cs @@ -0,0 +1,132 @@ +// Copyright 2021, Nitric Technologies Pty Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System; +using Nitric.Proto.Storage.v1; +using Nitric.Sdk.Storage; +using ProtoBlobEventResponse = Nitric.Proto.Storage.v1.BlobEventResponse; +using ProtoBlobEventType = Nitric.Proto.Storage.v1.BlobEventType; + +namespace Nitric.Sdk.Service +{ + /// + /// Represents a bucket notification being created by a write or delete event in the bucket + /// + public class FileEventRequest : TriggerRequest + { + /// + /// A reference to the file that triggered this request + /// + public File File { get; private set; } + + /// + /// The type of event that triggered this request + /// + /// + public BlobEventType NotificationType { get; private set; } + + /// + /// Construct a bucket notification request + /// + /// the file that triggered the notification + /// the type of bucket notification + public FileEventRequest(File file, BlobEventType notificationType) : base() + { + this.File = file; + this.NotificationType = notificationType; + } + } + + /// + /// Represents the results of processing a bucket notification. + /// + public class FileEventResponse : TriggerResponse + { + /// + /// Indicates whether the event was successfully processed. + /// + /// If this value is false, the event may be resent. + /// + public bool Success { get; set; } + + /// + /// Construct a bucket notification response. + /// + /// Indicates whether the event was successfully processed. + public FileEventResponse(bool success) + { + this.Success = success; + } + } + + /// + /// Represents the request/response context for a permissioned bucket notification. + /// + public class FileEventContext : TriggerContext + { + /// + /// Construct a new BucketNotificationContext. + /// + /// The request object + /// The response object + public FileEventContext(string id, FileEventRequest req, FileEventResponse res) : base(id, req, res) + { + } + + /// + /// Construct a bucket notification context from a trigger request gRPC object. + /// + /// The trigger to convert into a BucketNotificationContext. + /// The bucket notification worker options describing the worker options. + /// the new bucket notification context + public static FileEventContext FromRequest(ServerMessage trigger, Bucket bucket) + { + var notificationType = FromGrpcBlobEventType(trigger.BlobEventRequest.BlobEvent.Type); + + return new FileEventContext( + trigger.Id, + new FileEventRequest( + bucket.File(trigger.BlobEventRequest.BlobEvent.Key), + notificationType + ), + new FileEventResponse(true)); + } + + /// + /// Convert a gRPC blob event type into a SDK blob event type. + /// + /// + /// + /// + private static BlobEventType FromGrpcBlobEventType( + ProtoBlobEventType blobEventType) + { + return blobEventType switch + { + ProtoBlobEventType.Created => BlobEventType.Write, + ProtoBlobEventType.Deleted => BlobEventType.Delete, + _ => throw new ArgumentException("Unsupported blob event type") + }; + } + + /// + /// Create a gRPC trigger response from this context. + /// + /// the new trigger response + public ClientMessage ToResponse() + { + return new ClientMessage { Id = Id, BlobEventResponse = new ProtoBlobEventResponse { Success = this.Res.Success } }; + } + } +} diff --git a/src/Nitric.Sdk/Function/Frequency.cs b/src/Nitric.Sdk/Service/Frequency.cs similarity index 96% rename from src/Nitric.Sdk/Function/Frequency.cs rename to src/Nitric.Sdk/Service/Frequency.cs index f5abd5d..1bb518b 100644 --- a/src/Nitric.Sdk/Function/Frequency.cs +++ b/src/Nitric.Sdk/Service/Frequency.cs @@ -11,7 +11,8 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -namespace Nitric.Sdk.Function + +namespace Nitric.Sdk.Service { /// /// Represents schedule frequency value. diff --git a/src/Nitric.Sdk/Function/HttpContext.cs b/src/Nitric.Sdk/Service/HttpContext.cs similarity index 79% rename from src/Nitric.Sdk/Function/HttpContext.cs rename to src/Nitric.Sdk/Service/HttpContext.cs index a971047..c32894e 100644 --- a/src/Nitric.Sdk/Function/HttpContext.cs +++ b/src/Nitric.Sdk/Service/HttpContext.cs @@ -18,16 +18,20 @@ using Google.Protobuf; using Google.Protobuf.Collections; using Newtonsoft.Json; -using Nitric.Proto.Faas.v1; -using TriggerRequestProto = Nitric.Proto.Faas.v1.TriggerRequest; +using Nitric.Proto.Apis.v1; -namespace Nitric.Sdk.Function +namespace Nitric.Sdk.Service { /// /// Represents a HTTP request. /// - public class HttpRequest : AbstractRequest + public class HttpRequest : TriggerRequest { + /// + /// The raw bytes. + /// + private byte[] data; + /// /// The HTTP Method that generated this request. E.g. GET, POST, PUT, DELETE. /// @@ -59,14 +63,15 @@ public class HttpRequest : AbstractRequest /// Convert the payload of the request to a string, assuming UTF-8 encoding. /// /// - public string Text => System.Text.Encoding.UTF8.GetString(this.data, 0, this.data.Length); + public string Text => Encoding.UTF8.GetString(this.data, 0, this.data.Length); /// /// Get the HTTP body data encoded from json. /// /// The object is converted from a JSON string to a type T. /// - public T Json() { + public T Json() + { return JsonConvert.DeserializeObject(Encoding.Default.GetString(this.data)); } @@ -81,8 +86,9 @@ public T Json() { /// any provided HTTP headers public HttpRequest(byte[] data, string method, string path, Dictionary pathParams, Dictionary> queryParams, - Dictionary> headers) : base(data) + Dictionary> headers) : base() { + this.data = data; this.Path = path; this.PathParams = pathParams; this.QueryParams = queryParams; @@ -93,7 +99,7 @@ public HttpRequest(byte[] data, string method, string path, Dictionary /// The response to an HTTP trigger. /// - public class HttpResponse + public class HttpResponse : TriggerResponse { /// /// The HTTP status code of the response. @@ -103,7 +109,7 @@ public class HttpResponse /// /// The HTTP body data to be returned.ß /// - public byte[] Body { get; set; } = {}; + public byte[] Body { get; set; } = { }; /// /// The HTTP header to be included in the response. @@ -131,6 +137,13 @@ public void Text(string text) this.Body = Encoding.UTF8.GetBytes(text); this.Headers["Content-Type"] = new List { "text/plain" }; } + + public void WithError(System.Exception exception) + { + this.Status = 500; + this.Body = Encoding.UTF8.GetBytes(exception.ToString()); + this.Headers["Content-Type"] = new List { "text/plain" }; + } } /// @@ -143,7 +156,7 @@ public class HttpContext : TriggerContext /// /// The context's request /// The context's response - public HttpContext(HttpRequest req, HttpResponse res) : base(req, res) + public HttpContext(string id, HttpRequest req, HttpResponse res) : base(id, req, res) { } @@ -152,26 +165,27 @@ public HttpContext(HttpRequest req, HttpResponse res) : base(req, res) /// /// /// - public static HttpContext FromGrpcTriggerRequest(TriggerRequestProto trigger) + internal static HttpContext FromRequest(ServerMessage trigger) { var headers = new Dictionary>(); - foreach (var kv in trigger.Http.Headers) + foreach (var kv in trigger.HttpRequest.Headers) { var values = headers.GetValueOrDefault(kv.Key, new List()); headers.Add(kv.Key, values.Concat(kv.Value.Value)); } var queryParams = new Dictionary>(); - foreach (var kv in trigger.Http.QueryParams) + foreach (var kv in trigger.HttpRequest.QueryParams) { var values = queryParams.GetValueOrDefault(kv.Key, new List()); queryParams.Add(kv.Key, values.Concat(kv.Value.Value)); } - var pathParams = trigger.Http.PathParams.ToDictionary(kv => kv.Key, kv => kv.Value); + var pathParams = trigger.HttpRequest.PathParams.ToDictionary(kv => kv.Key, kv => kv.Value); return new HttpContext( - new HttpRequest(trigger.Data.ToByteArray(), trigger.Http.Method, trigger.Http.Path, pathParams, + trigger.Id, + new HttpRequest(trigger.HttpRequest.Body.ToByteArray(), trigger.HttpRequest.Method, trigger.HttpRequest.Path, pathParams, queryParams, headers), new HttpResponse() ); @@ -181,7 +195,7 @@ public static HttpContext FromGrpcTriggerRequest(TriggerRequestProto trigger) /// Create a gRPC trigger response from this context. /// /// - public override TriggerResponse ToGrpcTriggerContext() + internal ClientMessage ToResponse() { var responseHeaders = new MapField { @@ -192,10 +206,18 @@ public override TriggerResponse ToGrpcTriggerContext() return hv; }) }; - var triggerResponse = new TriggerResponse - { Http = new HttpResponseContext { Status = this.Res.Status } }; - triggerResponse.Http.Headers.Add(responseHeaders); - triggerResponse.Data = ByteString.CopyFrom(this.Res.Body); + + var triggerResponse = new ClientMessage + { + Id = Id, + HttpResponse = new Proto.Apis.v1.HttpResponse + { + Status = this.Res.Status, + Body = ByteString.CopyFrom(this.Res.Body), + } + }; + + triggerResponse.HttpResponse.Headers.Add(responseHeaders); return triggerResponse; } diff --git a/src/Nitric.Sdk/Service/IntervalContext.cs b/src/Nitric.Sdk/Service/IntervalContext.cs new file mode 100644 index 0000000..3152553 --- /dev/null +++ b/src/Nitric.Sdk/Service/IntervalContext.cs @@ -0,0 +1,78 @@ +// Copyright 2021, Nitric Technologies Pty Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using Nitric.Proto.Schedules.v1; + +namespace Nitric.Sdk.Service +{ + /// + /// Represents a message pushed to a subscriber via a topic. + /// + public class IntervalRequest : TriggerRequest + { + /// + /// The name of the schedule that triggered this request + /// + public string ScheduleName { get; private set; } + + /// + /// Construct an interval request + /// + /// the source schedule + public IntervalRequest(string scheduleName) : base() + { + this.ScheduleName = scheduleName; + } + } + + /// + /// Represents the results of processing an event. + /// + public class IntervalResponse : TriggerResponse { } + + /// + /// Represents the request/response context for an event. + /// + public class IntervalContext : TriggerContext + { + /// + /// Construct a new IntervalContext. + /// + /// The request object + /// The response object + public IntervalContext(string id, IntervalRequest req, IntervalResponse res) : base(id, req, res) + { + } + + /// + /// Construct an event topic from a trigger request gRPC object. + /// + /// The trigger to convert into an EventContext. + /// the new event context + internal static IntervalContext FromRequest(ServerMessage trigger) + { + return new IntervalContext(trigger.Id, new IntervalRequest(trigger.IntervalRequest.ScheduleName), + new IntervalResponse()); + } + + /// + /// Create a gRPC trigger response from this context. + /// + /// + internal ClientMessage ToResponse() + { + return new ClientMessage { Id = Id, IntervalResponse = new Proto.Schedules.v1.IntervalResponse() }; + } + } +} diff --git a/src/Nitric.Sdk/Service/JobContext.cs b/src/Nitric.Sdk/Service/JobContext.cs new file mode 100644 index 0000000..da27972 --- /dev/null +++ b/src/Nitric.Sdk/Service/JobContext.cs @@ -0,0 +1,105 @@ +// Copyright 2021, Nitric Technologies Pty Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using Nitric.Sdk.Common; +using Nitric.Proto.Batch.v1; +using ProtoMessageResponse = Nitric.Proto.Batch.v1.JobResponse; + +namespace Nitric.Sdk.Service +{ + /// + /// Represents an event pushed to a job via a publish. + /// + public class JobRequest : TriggerRequest + { + /// + /// The name of the job that this event belongs to + /// + public string JobName { get; private set; } + + public T Data { get; private set; } + + /// + /// Construct an event request + /// + /// The name of the job that this event belongs to + /// the event payload + public JobRequest(string jobName, JobData job) : base() + { + this.JobName = jobName; + this.Data = Struct.ToJsonSerializable(job.Struct); + } + } + + /// + /// Represents the results of processing an event. + /// + public class JobResponse : TriggerResponse + { + /// + /// Indicates whether the event was successfully processed. + /// + /// If this value is false, the event may be resent. + /// + public bool Success { get; set; } + + /// + /// Construct an event response. + /// + /// Indicates whether the event was successfully processed. + public JobResponse(bool success) + { + this.Success = success; + } + } + + /// + /// Represents the request/response context for an event. + /// + public class JobContext : TriggerContext, JobResponse> + { + /// + /// Construct a new EventContext. + /// + /// The request object + /// The response object + public JobContext(string id, JobRequest req, JobResponse res) : base(id, req, res) + { + } + + /// + /// Construct an event topic from a trigger request gRPC object. + /// + /// The trigger to convert into an EventContext. + /// the new event context + internal static JobContext FromRequest(ServerMessage trigger) + { + return new JobContext(trigger.Id, new JobRequest(trigger.JobRequest.JobName, trigger.JobRequest.Data), + new JobResponse(true)); + } + + /// + /// Create a gRPC trigger response from this context. + /// + /// + internal ClientMessage ToResponse() + { + return new ClientMessage + { + Id = Id, + JobResponse = new ProtoMessageResponse { Success = Res.Success }, + }; + } + } +} diff --git a/src/Nitric.Sdk/Function/EventContext.cs b/src/Nitric.Sdk/Service/MessageContext.cs similarity index 61% rename from src/Nitric.Sdk/Function/EventContext.cs rename to src/Nitric.Sdk/Service/MessageContext.cs index cde9616..91d32a0 100644 --- a/src/Nitric.Sdk/Function/EventContext.cs +++ b/src/Nitric.Sdk/Service/MessageContext.cs @@ -12,41 +12,40 @@ // See the License for the specific language governing permissions and // limitations under the License. -using Nitric.Proto.Faas.v1; -using TriggerRequestProto = Nitric.Proto.Faas.v1.TriggerRequest; +using Nitric.Sdk.Common; +using Nitric.Proto.Topics.v1; +using ProtoMessageResponse = Nitric.Proto.Topics.v1.MessageResponse; -namespace Nitric.Sdk.Function +namespace Nitric.Sdk.Service { /// /// Represents a message pushed to a subscriber via a topic. /// - public class EventRequest : AbstractRequest + public class MessageRequest : TriggerRequest { /// /// The name of the topic that triggered this request /// - public string Topic { get; private set; } + public string TopicName { get; private set; } + + public T Message { get; private set; } /// /// Construct an event request /// - /// the payload of the message - /// the source topic - public EventRequest(byte[] data, string topic) : base(data) - { - this.Topic = topic; - } - - public Event.Event Payload() + /// the source topic + /// the message payload + public MessageRequest(string topicName, TopicMessage message) : base() { - return Event.Event.FromPayload(this.data); + this.TopicName = topicName; + this.Message = Struct.ToJsonSerializable(message.StructPayload); } } /// /// Represents the results of processing an event. /// - public class EventResponse + public class MessageResponse : TriggerResponse { /// /// Indicates whether the event was successfully processed. @@ -59,7 +58,7 @@ public class EventResponse /// Construct an event response. /// /// Indicates whether the event was successfully processed. - public EventResponse(bool success) + public MessageResponse(bool success) { this.Success = success; } @@ -68,14 +67,14 @@ public EventResponse(bool success) /// /// Represents the request/response context for an event. /// - public class EventContext : TriggerContext + public class MessageContext : TriggerContext, MessageResponse> { /// /// Construct a new EventContext. /// /// The request object /// The response object - public EventContext(EventRequest req, EventResponse res) : base(req, res) + public MessageContext(string id, MessageRequest req, MessageResponse res) : base(id, req, res) { } @@ -84,19 +83,23 @@ public EventContext(EventRequest req, EventResponse res) : base(req, res) /// /// The trigger to convert into an EventContext. /// the new event context - public static EventContext FromGrpcTriggerRequest(TriggerRequestProto trigger) + internal static MessageContext FromRequest(ServerMessage trigger) { - return new EventContext(new EventRequest(trigger.Data.ToByteArray(), trigger.Topic.Topic), - new EventResponse(true)); + return new MessageContext(trigger.Id, new MessageRequest(trigger.MessageRequest.TopicName, trigger.MessageRequest.Message), + new MessageResponse(true)); } /// /// Create a gRPC trigger response from this context. /// /// - public override TriggerResponse ToGrpcTriggerContext() + internal ClientMessage ToResponse() { - return new TriggerResponse { Topic = new TopicResponseContext { Success = this.Res.Success } }; + return new ClientMessage + { + Id = Id, + MessageResponse = new ProtoMessageResponse { Success = Res.Success }, + }; } } } diff --git a/src/Nitric.Sdk/Function/Middleware.cs b/src/Nitric.Sdk/Service/Middleware.cs similarity index 84% rename from src/Nitric.Sdk/Function/Middleware.cs rename to src/Nitric.Sdk/Service/Middleware.cs index da4a558..e4dc946 100644 --- a/src/Nitric.Sdk/Function/Middleware.cs +++ b/src/Nitric.Sdk/Service/Middleware.cs @@ -11,14 +11,15 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. + using System; +using System.Threading.Tasks; -namespace Nitric.Sdk.Function +namespace Nitric.Sdk.Service { /// /// Represents a chainable handler for incoming requests. Useful for decorating existing handlers. /// /// The request context. - - public delegate TCtx Middleware(TCtx ctx, Func next); + public delegate Task Middleware(TCtx ctx, Func> next); } diff --git a/src/Nitric.Sdk/Service/TriggerContext.cs b/src/Nitric.Sdk/Service/TriggerContext.cs new file mode 100644 index 0000000..403ad62 --- /dev/null +++ b/src/Nitric.Sdk/Service/TriggerContext.cs @@ -0,0 +1,49 @@ +// Copyright 2021, Nitric Technologies Pty Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +namespace Nitric.Sdk.Service +{ + /// + /// The base request structure, common to HTTP and Event requests. + /// + public abstract class TriggerRequest { } + + public abstract class TriggerResponse { } + + /// + /// The base context structure, common to HTTP and Event contexts. + /// + /// The context's request. + /// The context's response. + public abstract class TriggerContext + where Request : TriggerRequest + where Response : TriggerResponse + { + protected string Id; + public Request Req; + public Response Res; + + /// + /// Create a new trigger context with the provided request and response objects. + /// + /// The request object that initiated the trigger + /// The response to be returned from processing the trigger + protected TriggerContext(string id, Request req, Response res) + { + this.Id = id; + this.Req = req; + this.Res = res; + } + } +} diff --git a/src/Nitric.Sdk/Function/WebsocketContext.cs b/src/Nitric.Sdk/Service/WebsocketContext.cs similarity index 54% rename from src/Nitric.Sdk/Function/WebsocketContext.cs rename to src/Nitric.Sdk/Service/WebsocketContext.cs index ac956a2..c0fce3a 100644 --- a/src/Nitric.Sdk/Function/WebsocketContext.cs +++ b/src/Nitric.Sdk/Service/WebsocketContext.cs @@ -14,15 +14,40 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Runtime.CompilerServices; using System.Text; using Newtonsoft.Json; -using Nitric.Proto.Faas.v1; -using TriggerRequestProto = Nitric.Proto.Faas.v1.TriggerRequest; -using WebsocketNotificationTypeProto = Nitric.Proto.Faas.v1.WebsocketEvent; +using Nitric.Proto.Websockets.v1; +using WebsocketEventTypeProto = Nitric.Proto.Websockets.v1.WebsocketEventRequest.WebsocketEventOneofCase; +using Google.Protobuf.Collections; +using ProtoWebsocketEventType = Nitric.Proto.Websockets.v1.WebsocketEventType; +using Google.Api; -namespace Nitric.Sdk.Function +namespace Nitric.Sdk.Service { + /// + /// Extension class for methods converting blob event types to and from gRPC calls. + /// + internal static class WebsocketEventTypeExtension + { + /// + /// Convert a SDK websocket event type into a gRPC blob event type. + /// + /// + /// + /// + internal static ProtoWebsocketEventType ToGrpc( + this WebsocketEventType websocketEventType) + { + return websocketEventType switch + { + WebsocketEventType.Connected => ProtoWebsocketEventType.Connect, + WebsocketEventType.Disconnected => ProtoWebsocketEventType.Disconnect, + WebsocketEventType.Message => ProtoWebsocketEventType.Message, + _ => throw new ArgumentException("Unsupported websocket event type") + }; + } + } + public enum WebsocketEventType { Connected, @@ -30,12 +55,17 @@ public enum WebsocketEventType Message } - public class WebsocketRequest : AbstractRequest + public class WebsocketRequest : TriggerRequest { + /// + /// The raw message bytes + /// + private byte[] data; + /// /// The name of the websocket that triggered this request /// - public string Socket { get; private set; } + public string SocketName { get; private set; } /// /// The type of websocket notification @@ -59,21 +89,21 @@ public class WebsocketRequest : AbstractRequest /// /// Construct an event request /// - /// the payload of the message - /// the source websocket + /// the source websocket /// the type of websocket notification /// the id of the individual connection /// the websocket query parameters - public WebsocketRequest(byte[] data, string socket, WebsocketEventType notificationType, string connectionId, Dictionary query) : base(data) + public WebsocketRequest(byte[] data, string socketName, WebsocketEventType notificationType, string connectionId, Dictionary query) : base() { - this.Socket = socket; + this.data = data; + this.SocketName = socketName; this.NotificationType = notificationType; this.ConnectionId = connectionId; this.Query = query; } } - public class WebsocketResponse + public class WebsocketResponse : TriggerResponse { /// /// Indicates whether the event was successfully processed. @@ -99,7 +129,7 @@ public class WebsocketContext : TriggerContext /// The request object /// The response object - public WebsocketContext(WebsocketRequest req, WebsocketResponse res) : base(req, res) + public WebsocketContext(string id, WebsocketRequest req, WebsocketResponse res) : base(id, req, res) { } @@ -108,26 +138,40 @@ public WebsocketContext(WebsocketRequest req, WebsocketResponse res) : base(req, /// /// The trigger to convert into an EventContext. /// the new event context - public static WebsocketContext FromGrpcTriggerRequest(TriggerRequestProto trigger) + public static WebsocketContext FromRequest(ServerMessage trigger) + { + var type = FromGrpcWebsocketNotificationType(trigger.WebsocketEventRequest.WebsocketEventCase); + var queryParams = GetQueryParams(trigger.WebsocketEventRequest.Connection.QueryParams); + var body = trigger.WebsocketEventRequest.Message != null ? trigger.WebsocketEventRequest.Message.Body.ToByteArray() : new byte[0]; + + return new WebsocketContext( + trigger.Id, + new WebsocketRequest( + body, + trigger.WebsocketEventRequest.SocketName, + type, + trigger.WebsocketEventRequest.ConnectionId, + queryParams + ), + new WebsocketResponse(true)); + } + + private static Dictionary GetQueryParams(MapField queryParams) { - var type = FromGrpcWebsocketNotificationType(trigger.Websocket.Event); - Dictionary query = trigger.Websocket.QueryParams.Select + return queryParams.Select (kv => new KeyValuePair(kv.Key, kv.Value.Value.ToArray()) ).ToDictionary(x => x.Key, x => x.Value); - return new WebsocketContext( - new WebsocketRequest(trigger.Data.ToByteArray(), trigger.Websocket.Socket, type, trigger.Websocket.ConnectionId, query), - new WebsocketResponse(true)); } private static WebsocketEventType FromGrpcWebsocketNotificationType( - WebsocketNotificationTypeProto notificationType) + WebsocketEventTypeProto notificationType) { return notificationType switch { - WebsocketNotificationTypeProto.Connect => WebsocketEventType.Connected, - WebsocketNotificationTypeProto.Disconnect => WebsocketEventType.Disconnected, - WebsocketNotificationTypeProto.Message => WebsocketEventType.Message, + WebsocketEventTypeProto.Connection => WebsocketEventType.Connected, + WebsocketEventTypeProto.Disconnection => WebsocketEventType.Disconnected, + WebsocketEventTypeProto.Message => WebsocketEventType.Message, _ => throw new ArgumentException("Unsupported bucket notification type") }; } @@ -136,9 +180,9 @@ private static WebsocketEventType FromGrpcWebsocketNotificationType( /// Create a gRPC trigger response from this context. /// /// - public override TriggerResponse ToGrpcTriggerContext() + public ClientMessage ToResponse() { - return new TriggerResponse { Websocket = new WebsocketResponseContext { Success = this.Res.Success } }; + return new ClientMessage { Id = Id, WebsocketEventResponse = new WebsocketEventResponse { } }; } } } diff --git a/src/Nitric.Sdk/Storage/Bucket.cs b/src/Nitric.Sdk/Storage/Bucket.cs index a9d79f2..355f7ba 100644 --- a/src/Nitric.Sdk/Storage/Bucket.cs +++ b/src/Nitric.Sdk/Storage/Bucket.cs @@ -11,12 +11,15 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. + using System; using System.Collections.Generic; +using System.Threading.Tasks; using Nitric.Proto.Storage.v1; -using Nitric.Sdk.Function; -using ProtoFile = Nitric.Proto.Storage.v1.File; - +using Nitric.Sdk.Service; +using Nitric.Sdk.Worker; +using ProtoBlob = Nitric.Proto.Storage.v1.Blob; +using GrpcClient = Nitric.Proto.Storage.v1.Storage.StorageClient; namespace Nitric.Sdk.Storage { @@ -25,24 +28,29 @@ namespace Nitric.Sdk.Storage /// public class Bucket { - private readonly Storage storage; + internal readonly GrpcClient Client; /// /// The name of the bucket. /// public string Name { get; private set; } - internal Bucket(Storage storage, string name) + public Bucket(string name, GrpcClient client = null) { - this.storage = storage; + if (string.IsNullOrEmpty(name)) + { + throw new ArgumentNullException(nameof(name)); + } + + this.Client = client; this.Name = name; } /// - /// Create a reference to a file in the bucket. + /// Create a reference to a blob in the bucket. /// - /// The files name/path - /// The file reference. + /// The blobs name/path + /// The blob reference. /// public File File(string key) { @@ -51,74 +59,92 @@ public File File(string key) throw new ArgumentNullException(nameof(key)); } - return new File(storage, this, key); + return new File(this, key); } /// /// Get a list of files in a bucket. /// + /// The prefix to filter file names by. /// All the files in the bucket as Nitric file references. - public List Files() + public async Task> Files(string prefix = "") { - var request = new StorageListFilesRequest + var request = new StorageListBlobsRequest { BucketName = this.Name, + Prefix = prefix, }; - var resp = this.storage.Client.ListFiles(request); + try + { + var resp = await this.Client.ListBlobsAsync(request); - List files = new List(); + var files = new List(); - foreach (ProtoFile file in resp.Files) + foreach (ProtoBlob file in resp.Blobs) + { + files.Add(new File(this, file.Key)); + } + + return files; + } + catch (Grpc.Core.RpcException e) { - files.Add(new File(this.storage, this, file.Key)); + throw Common.NitricException.FromRpcException(e); } - - return files; } /// - /// Registers handlers to be called whenever a file triggers an event in the bucket + /// Registers handlers to be called whenever a blob triggers an event in the bucket /// - /// The type of events that should trigger events, Write or Delete - /// The prefix of file names that should trigger events - /// The handlers to call to process notification events + /// The type of events that should trigger events, Write or Delete + /// The prefix of blob names that should trigger events + /// The handlers to call to process notification events public void On( - BucketNotificationType notificationType, - string notificationPrefixFilter, - params Middleware[] middleware) + Service.BlobEventType blobEventType, + string keyPrefixFilter, + params Middleware[] middlewares) { - var notificationWorker = new Faas(new FileNotificationWorkerOptions( - this, - notificationType, - notificationPrefixFilter - )); - - notificationWorker.FileNotification(middleware); + var request = new RegistrationRequest + { + BucketName = this.Name, + KeyPrefixFilter = keyPrefixFilter, + BlobEventType = blobEventType.ToGrpc(), + }; + var notificationWorker = new BlobEventWorker(request, middlewares); Nitric.RegisterWorker(notificationWorker); } /// - /// Registers a handler to be called whenever a file triggers an event in the bucket + /// Registers a handler to be called whenever a blob triggers an event in the bucket /// - /// The type of events that should trigger events, Write or Delete - /// The prefix of file names that should trigger events + /// The type of events that should trigger events, Write or Delete + /// The prefix of blob names that should trigger events /// The handler to call to process notification events public void On( - BucketNotificationType notificationType, - string notificationPrefixFilter, - Func handler) + Service.BlobEventType blobEventType, + string keyPrefixFilter, + Func> handler) { - var notificationWorker = new Faas(new FileNotificationWorkerOptions( - this, - notificationType, - notificationPrefixFilter - )); - - notificationWorker.FileNotification(handler); + var request = new RegistrationRequest + { + BucketName = this.Name, + KeyPrefixFilter = keyPrefixFilter, + BlobEventType = blobEventType.ToGrpc(), + }; + var notificationWorker = new BlobEventWorker(request, handler); Nitric.RegisterWorker(notificationWorker); } + + /// + /// Return a string representation of the bucket. + /// + /// + public override string ToString() + { + return GetType().Name + "[name=" + Name + "]"; + } } } diff --git a/src/Nitric.Sdk/Storage/File.cs b/src/Nitric.Sdk/Storage/File.cs index 37aaff2..97ba0ad 100644 --- a/src/Nitric.Sdk/Storage/File.cs +++ b/src/Nitric.Sdk/Storage/File.cs @@ -13,19 +13,18 @@ // limitations under the License. using System; -using System.Text; +using System.Threading.Tasks; using Google.Protobuf; +using Google.Protobuf.WellKnownTypes; using Nitric.Proto.Storage.v1; using Nitric.Sdk.Common; -using Nitric.Sdk.Function; -using ProtoFile = Nitric.Proto.Storage.v1.File; namespace Nitric.Sdk.Storage { /// /// Available operations for signing a url. /// - public enum FileMode + public enum SignedMode { /// /// Download a file from a bucket. @@ -42,15 +41,12 @@ public enum FileMode /// public class File { - private readonly Storage storage; - private readonly Bucket bucket; + private readonly Bucket Bucket; public string Name { get; private set; } - - internal File(Storage storage, Bucket bucket, string key) + internal File(Bucket bucket, string key) { - this.storage = storage; - this.bucket = bucket; + this.Bucket = bucket; this.Name = key; } @@ -59,17 +55,17 @@ internal File(Storage storage, Bucket bucket, string key) /// /// The contents to write. /// - public void Write(byte[] body) + public async Task Write(byte[] body) { var request = new StorageWriteRequest { - BucketName = bucket.Name, + BucketName = Bucket.Name, Key = this.Name, Body = ByteString.CopyFrom(body) }; try { - storage.Client.Write(request); + await this.Bucket.Client.WriteAsync(request); } catch (Grpc.Core.RpcException re) { @@ -82,17 +78,17 @@ public void Write(byte[] body) /// /// The contents to write. /// - public void Write(string body) + public async Task Write(string body) { var request = new StorageWriteRequest { - BucketName = bucket.Name, + BucketName = Bucket.Name, Key = this.Name, Body = ByteString.CopyFromUtf8(body) }; try { - storage.Client.Write(request); + await this.Bucket.Client.WriteAsync(request); } catch (Grpc.Core.RpcException re) { @@ -105,16 +101,16 @@ public void Write(string body) /// /// The file contents. /// - public byte[] Read() + public async Task Read() { var request = new StorageReadRequest { - BucketName = bucket.Name, + BucketName = Bucket.Name, Key = this.Name }; try { - var response = storage.Client.Read(request); + var response = await this.Bucket.Client.ReadAsync(request); return response.Body.ToByteArray(); } catch (Grpc.Core.RpcException re) @@ -127,16 +123,16 @@ public byte[] Read() /// Delete the file. /// /// - public void Delete() + public async Task Delete() { var request = new StorageDeleteRequest { - BucketName = bucket.Name, + BucketName = Bucket.Name, Key = this.Name }; try { - storage.Client.Delete(request); + await this.Bucket.Client.DeleteAsync(request); } catch (Grpc.Core.RpcException re) { @@ -144,60 +140,64 @@ public void Delete() } } + /// + /// Create a presigned URL for reading a given file reference. + /// + /// How long the URL should be valid for in seconds. Defaults to 600 seconds (10 minutes). + /// The signed URL for reading. + public async Task GetDownloadUrl(int expiry = 600) + { + return await this.PreSignUrl(SignedMode.Read, expiry); + } + + + /// + /// Create a presigned URL for writing to a given file reference. + /// + /// How long the URL should be valid for in seconds. Defaults to 600 seconds (10 minutes). + /// The signed URL for writing. + public async Task GetUploadUrl(int expiry = 600) + { + return await this.PreSignUrl(SignedMode.Write, expiry); + } + /// /// Create a presigned URL for reading or writing for the given file reference. /// /// The mode the URL will access the file with. E.g. reading or writing. - /// How long the URL should be valid for in seconds. + /// How long the URL should be valid for in seconds (max of 604800). /// The signed URL for reading or writing - internal string PreSignUrl(FileMode mode, int expiry) + internal async Task PreSignUrl(SignedMode mode, int expiry) { var request = new StoragePreSignUrlRequest { - BucketName = this.bucket.Name, + BucketName = this.Bucket.Name, Key = this.Name, - Operation = mode == FileMode.Read ? StoragePreSignUrlRequest.Types.Operation.Read : StoragePreSignUrlRequest.Types.Operation.Write, - Expiry = expiry < 0 ? 0 : (uint)expiry, - + Operation = mode == SignedMode.Read ? StoragePreSignUrlRequest.Types.Operation.Read : StoragePreSignUrlRequest.Types.Operation.Write, + Expiry = new Duration + { + Seconds = Math.Clamp(expiry, 0, 604800), + } }; try { - var resp = storage.Client.PreSignUrl(request); + var resp = await this.Bucket.Client.PreSignUrlAsync(request); return resp.Url; - } catch (Grpc.Core.RpcException re) + } + catch (Grpc.Core.RpcException re) { throw NitricException.FromRpcException(re); } } - /// - /// Create a presigned URL for reading a given file reference. - /// - /// How long the URL should be valid for in seconds. Defaults to 600 seconds (10 minutes). - /// The signed URL for reading. - public string GetDownloadUrl(int expiry = 600) - { - return this.PreSignUrl(FileMode.Write, expiry); - } - - /// - /// Create a presigned URL for writing to a given file reference. - /// - /// How long the URL should be valid for in seconds. Defaults to 600 seconds (10 minutes). - /// The signed URL for writing. - public string GetUploadUrl(int expiry = 600) - { - return this.PreSignUrl(FileMode.Read, expiry); - } - /// /// Return a string representation of the file. Will not contain the file contents. /// /// public override string ToString() { - return GetType().Name + "[name=" + Name + "\nbucket=" + bucket.Name + "]"; + return GetType().Name + "[name=" + Name + "\nbucket=" + Bucket.Name + "]"; } } } diff --git a/src/Nitric.Sdk/Storage/StorageClient.cs b/src/Nitric.Sdk/Storage/StorageClient.cs deleted file mode 100644 index 0203a23..0000000 --- a/src/Nitric.Sdk/Storage/StorageClient.cs +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -using System; -using Nitric.Sdk.Common; -using GrpcClient = Nitric.Proto.Storage.v1.StorageService.StorageServiceClient; - -namespace Nitric.Sdk.Storage -{ - /// - /// A storage client. - /// - public class Storage - { - internal readonly GrpcClient Client; - - /// - /// Create a new storage client. - /// - /// Optional internal gRPC client to reuse. - public Storage(GrpcClient client = null) - { - this.Client = client ?? new GrpcClient(GrpcChannelProvider.GetChannel()); - } - - /// - /// Create a reference to a bucket in the storage service. - /// - /// The name of the bucket. - /// The new bucket reference. - /// - public Bucket Bucket(string bucketName) - { - if (string.IsNullOrEmpty(bucketName)) - { - throw new ArgumentNullException(nameof(bucketName)); - } - - return new Bucket(this, bucketName); - } - } -} diff --git a/src/Nitric.Sdk/Event/Topic.cs b/src/Nitric.Sdk/Topics/Topic.cs similarity index 50% rename from src/Nitric.Sdk/Event/Topic.cs rename to src/Nitric.Sdk/Topics/Topic.cs index 68ac657..151d80f 100644 --- a/src/Nitric.Sdk/Event/Topic.cs +++ b/src/Nitric.Sdk/Topics/Topic.cs @@ -12,42 +12,54 @@ // See the License for the specific language governing permissions and // limitations under the License. -using Nitric.Proto.Event.v1; +using System; +using System.Threading.Tasks; +using Nitric.Proto.Topics.v1; using Nitric.Sdk.Common; +using GrpcClient = Nitric.Proto.Topics.v1.Topics.TopicsClient; -namespace Nitric.Sdk.Event +namespace Nitric.Sdk.Topics { /// /// Represents a reference to a topic. /// public class Topic { - private readonly EventsClient eventsClient; + private readonly GrpcClient Client; /// /// The name of topic. /// public string Name { get; private set; } - internal Topic(EventsClient eventsClient, string name) + public Topic(string name, GrpcClient client = null) { - this.eventsClient = eventsClient; + if (string.IsNullOrEmpty(name)) + { + throw new ArgumentNullException(nameof(name)); + } + + this.Client = client; this.Name = name; } /// - /// Publish a new event to this topic. + /// Publish a new message to this topic. /// - /// The event to publish - /// The unique id of the published event. + /// The message to publish /// - public string Publish(Event evt) + public async Task Publish(T message) { - var request = new EventPublishRequest { Topic = this.Name, Event = evt.ToWire() }; + var structPayload = Struct.FromJsonSerializable(message); + + var request = new TopicPublishRequest + { + TopicName = this.Name, + Message = new TopicMessage { StructPayload = structPayload } + }; try { - var response = this.eventsClient.EventClient.Publish(request); - return response.Id; + await this.Client.PublishAsync(request); } catch (Grpc.Core.RpcException re) { @@ -56,25 +68,12 @@ public string Publish(Event evt) } /// - /// Publish a new event to this topic. + /// Return a string representation of the topic /// - /// The payload of the event - /// The unique id of the published event. - /// - public string Publish(T payload) + /// + public override string ToString() { - var evt = new Event { Payload = payload }; - var request = new EventPublishRequest { Topic = this.Name, Event = evt.ToWire() }; - - try - { - var response = this.eventsClient.EventClient.Publish(request); - return response.Id; - } - catch (Grpc.Core.RpcException re) - { - throw NitricException.FromRpcException(re); - } + return GetType().Name + "[name=" + Name + "]"; } } } diff --git a/src/Nitric.Sdk/Websocket/Connection.cs b/src/Nitric.Sdk/Websocket/Connection.cs index 4ca284e..6750fa7 100644 --- a/src/Nitric.Sdk/Websocket/Connection.cs +++ b/src/Nitric.Sdk/Websocket/Connection.cs @@ -11,11 +11,13 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +using System; +using System.Threading.Tasks; using Google.Protobuf; using Grpc.Core; -using Nitric.Proto.Websocket.v1; +using Nitric.Proto.Websockets.v1; using Nitric.Sdk.Common; -using Nitric.Sdk.Resource; +using GrpcClient = Nitric.Proto.Websockets.v1.Websocket.WebsocketClient; namespace Nitric.Sdk.Websocket { @@ -26,28 +28,40 @@ public class Connection /// public string Id { get; set; } - public string Socket { get; set; } + public string SocketName { get; set; } - private readonly WebsocketClient websocket; + private readonly GrpcClient Client; - internal Connection(WebsocketClient websocket, string id, string socket) + public Connection(string connectionId, string socketName, GrpcClient client = null) { - this.websocket = websocket; - this.Id = id; - this.Socket = socket; + if (string.IsNullOrEmpty(connectionId)) + { + throw new ArgumentNullException(nameof(connectionId)); + } + if (string.IsNullOrEmpty(socketName)) + { + throw new ArgumentNullException(nameof(socketName)); + } + this.Client = client; + this.Id = connectionId; + this.SocketName = socketName; } - public void Send(string data) + /// + /// Send a message to the websocket. + /// + /// The message to be sent + public async Task SendMessage(string message) { var request = new WebsocketSendRequest { ConnectionId = this.Id, - Socket = this.Socket, - Data = ByteString.CopyFromUtf8(data) + SocketName = this.SocketName, + Data = ByteString.CopyFromUtf8(message) }; try { - this.websocket.client.Send(request); + await this.Client.SendMessageAsync(request); } catch (RpcException e) { @@ -55,22 +69,34 @@ public void Send(string data) } } - public void Close() + /// + /// Close the connection to the websocket. + /// + public async Task CloseConnection() { - var request = new WebsocketCloseRequest + var request = new WebsocketCloseConnectionRequest { ConnectionId = this.Id, - Socket = this.Socket, + SocketName = this.SocketName, }; try { - this.websocket.client.Close(request); + await this.Client.CloseConnectionAsync(request); } catch (RpcException e) { throw NitricException.FromRpcException(e); } } + + /// + /// Return a string representation of the connection + /// + /// + public override string ToString() + { + return GetType().Name + "[socketName=" + SocketName + ",connectionId=" + Id + "]"; + } } } diff --git a/src/Nitric.Sdk/Websocket/WebsocketClient.cs b/src/Nitric.Sdk/Websocket/WebsocketClient.cs deleted file mode 100644 index 5cebeab..0000000 --- a/src/Nitric.Sdk/Websocket/WebsocketClient.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -using System; -using Nitric.Sdk.Common; -using GrpcClient = Nitric.Proto.Websocket.v1.WebsocketService.WebsocketServiceClient; - -namespace Nitric.Sdk.Websocket -{ - public class WebsocketClient - { - internal readonly GrpcClient client; - - public WebsocketClient(GrpcClient client = null) - { - this.client = client ?? new GrpcClient(GrpcChannelProvider.GetChannel()); - } - - public Connection Connection(string socket, string connectionId) - { - if (string.IsNullOrEmpty(socket)) - { - throw new ArgumentNullException(nameof(socket)); - } - - if (string.IsNullOrEmpty(connectionId)) - { - throw new ArgumentNullException(nameof(connectionId)); - } - return new Connection(this, connectionId, socket); - } - } -} diff --git a/src/Nitric.Sdk/Worker/ApiWorker.cs b/src/Nitric.Sdk/Worker/ApiWorker.cs new file mode 100644 index 0000000..5f234bb --- /dev/null +++ b/src/Nitric.Sdk/Worker/ApiWorker.cs @@ -0,0 +1,75 @@ +// Copyright 2021, Nitric Technologies Pty Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System.Threading; +using System.Threading.Tasks; +using Nitric.Sdk.Common; +using Nitric.Proto.Apis.v1; +using GrpcClient = Nitric.Proto.Apis.v1.Api.ApiClient; +using Nitric.Sdk.Service; +using System; + +namespace Nitric.Sdk.Worker +{ + public class ApiWorker : AbstractWorker + { + readonly private RegistrationRequest RegistrationRequest; + public GrpcClient GrpcClient { private get; set; } + + public ApiWorker(RegistrationRequest request, Func> middleware) : base(middleware) + { + this.RegistrationRequest = request; + this.GrpcClient = new GrpcClient(GrpcChannelProvider.GetChannel()); + } + + public ApiWorker(RegistrationRequest request, params Middleware[] middlewares) : base(middlewares) + { + this.RegistrationRequest = request; + this.GrpcClient = new GrpcClient(GrpcChannelProvider.GetChannel()); + } + + public override async Task Start(CancellationToken cancellationToken = default) + { + var stream = this.GrpcClient.Serve(); + + await stream.RequestStream.WriteAsync(new ClientMessage { RegistrationRequest = RegistrationRequest }); + + while (await stream.ResponseStream.MoveNext(cancellationToken)) + { + var req = stream.ResponseStream.Current; + + if (req.HttpRequest != null) + { + var ctx = HttpContext.FromRequest(req); + + try + { + ctx = await this.Middleware(ctx); + } + catch (Exception err) + { + ctx.Res.WithError(err); + } + + await stream.RequestStream.WriteAsync(ctx.ToResponse()); + } + + cancellationToken.ThrowIfCancellationRequested(); + } + + await stream.RequestStream.CompleteAsync(); + } + } +} + diff --git a/src/Nitric.Sdk/Worker/BlobEventWorker.cs b/src/Nitric.Sdk/Worker/BlobEventWorker.cs new file mode 100644 index 0000000..c29808a --- /dev/null +++ b/src/Nitric.Sdk/Worker/BlobEventWorker.cs @@ -0,0 +1,76 @@ +// Copyright 2021, Nitric Technologies Pty Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System.Threading; +using System.Threading.Tasks; +using Nitric.Sdk.Common; +using Nitric.Proto.Storage.v1; +using GrpcClient = Nitric.Proto.Storage.v1.StorageListener.StorageListenerClient; +using Nitric.Sdk.Service; +using System; + +namespace Nitric.Sdk.Worker +{ + public class BlobEventWorker : AbstractWorker + { + readonly private RegistrationRequest RegistrationRequest; + public GrpcClient GrpcClient { private get; set; } + + public BlobEventWorker(RegistrationRequest request, Func> middleware) : base(middleware) + { + this.RegistrationRequest = request; + this.GrpcClient = new GrpcClient(GrpcChannelProvider.GetChannel()); + } + + public BlobEventWorker(RegistrationRequest request, params Middleware[] middlewares) : base(middlewares) + { + this.RegistrationRequest = request; + this.GrpcClient = new GrpcClient(GrpcChannelProvider.GetChannel()); + } + + public override async Task Start(CancellationToken cancellationToken = default) + { + var stream = this.GrpcClient.Listen(); + + await stream.RequestStream.WriteAsync(new ClientMessage { RegistrationRequest = RegistrationRequest }); + + while (await stream.ResponseStream.MoveNext(cancellationToken)) + { + var req = stream.ResponseStream.Current; + + if (req.BlobEventRequest != null) + { + var ctx = BlobEventContext.FromRequest(req); + + try + { + ctx = await this.Middleware(ctx); + } + catch (Exception err) + { + Console.WriteLine("Unhandled application error: {0}", err.ToString()); + ctx.Res.Success = false; + } + + await stream.RequestStream.WriteAsync(ctx.ToResponse()); + } + + cancellationToken.ThrowIfCancellationRequested(); + } + + await stream.RequestStream.CompleteAsync(); + } + } +} + diff --git a/src/Nitric.Sdk/Worker/FileEventWorker.cs b/src/Nitric.Sdk/Worker/FileEventWorker.cs new file mode 100644 index 0000000..723016f --- /dev/null +++ b/src/Nitric.Sdk/Worker/FileEventWorker.cs @@ -0,0 +1,80 @@ +// Copyright 2021, Nitric Technologies Pty Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System.Threading; +using System.Threading.Tasks; +using Nitric.Sdk.Common; +using Nitric.Proto.Storage.v1; +using GrpcClient = Nitric.Proto.Storage.v1.StorageListener.StorageListenerClient; +using Nitric.Sdk.Service; +using Nitric.Sdk.Storage; +using System; + +namespace Nitric.Sdk.Worker +{ + public class FileEventWorker : AbstractWorker + { + readonly private RegistrationRequest RegistrationRequest; + readonly private Bucket bucket; + public GrpcClient GrpcClient { private get; set; } + + public FileEventWorker(RegistrationRequest request, Bucket bucket, Func> middleware) : base(middleware) + { + this.RegistrationRequest = request; + this.bucket = bucket; + this.GrpcClient = new GrpcClient(GrpcChannelProvider.GetChannel()); + } + + public FileEventWorker(RegistrationRequest request, Bucket bucket, params Middleware[] middlewares) : base(middlewares) + { + this.RegistrationRequest = request; + this.bucket = bucket; + this.GrpcClient = new GrpcClient(GrpcChannelProvider.GetChannel()); + } + + public override async Task Start(CancellationToken cancellationToken = default) + { + var stream = this.GrpcClient.Listen(); + + await stream.RequestStream.WriteAsync(new ClientMessage { RegistrationRequest = RegistrationRequest }); + + while (await stream.ResponseStream.MoveNext(cancellationToken)) + { + var req = stream.ResponseStream.Current; + + if (req.BlobEventRequest != null) + { + var ctx = FileEventContext.FromRequest(req, this.bucket); + + try + { + ctx = await this.Middleware(ctx); + } + catch (Exception err) + { + Console.WriteLine("Unhandled application error: {0}", err.ToString()); + ctx.Res.Success = false; + } + + await stream.RequestStream.WriteAsync(ctx.ToResponse()); + } + + cancellationToken.ThrowIfCancellationRequested(); + } + + await stream.RequestStream.CompleteAsync(); + } + } +} + diff --git a/src/Nitric.Sdk/Worker/JobWorker.cs b/src/Nitric.Sdk/Worker/JobWorker.cs new file mode 100644 index 0000000..5ce31c4 --- /dev/null +++ b/src/Nitric.Sdk/Worker/JobWorker.cs @@ -0,0 +1,75 @@ +// Copyright 2021, Nitric Technologies Pty Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System.Threading; +using System.Threading.Tasks; +using Nitric.Sdk.Common; +using Nitric.Proto.Batch.v1; +using GrpcClient = Nitric.Proto.Batch.v1.Job.JobClient; +using Nitric.Sdk.Service; +using System; + +namespace Nitric.Sdk.Worker +{ + public class JobWorker : AbstractWorker> + { + readonly private RegistrationRequest RegistrationRequest; + public GrpcClient GrpcClient { private get; set; } + + public JobWorker(RegistrationRequest request, Func, Task>> middleware) : base(middleware) + { + this.RegistrationRequest = request; + this.GrpcClient = new GrpcClient(GrpcChannelProvider.GetChannel()); + } + + public JobWorker(RegistrationRequest request, params Middleware>[] middlewares) : base(middlewares) + { + this.RegistrationRequest = request; + this.GrpcClient = new GrpcClient(GrpcChannelProvider.GetChannel()); + } + + public override async Task Start(CancellationToken cancellationToken = default) + { + var stream = this.GrpcClient.HandleJob(); + + await stream.RequestStream.WriteAsync(new ClientMessage { RegistrationRequest = RegistrationRequest }); + + while (await stream.ResponseStream.MoveNext(cancellationToken)) + { + var req = stream.ResponseStream.Current; + + if (req.JobRequest != null) + { + var ctx = JobContext.FromRequest(req); + + try + { + ctx = await this.Middleware(ctx); + } + catch (Exception) + { + ctx.Res.Success = false; + } + + await stream.RequestStream.WriteAsync(ctx.ToResponse()); + } + + cancellationToken.ThrowIfCancellationRequested(); + } + + await stream.RequestStream.CompleteAsync(); + } + } +} + diff --git a/src/Nitric.Sdk/Worker/ScheduleWorker.cs b/src/Nitric.Sdk/Worker/ScheduleWorker.cs new file mode 100644 index 0000000..ff1df24 --- /dev/null +++ b/src/Nitric.Sdk/Worker/ScheduleWorker.cs @@ -0,0 +1,75 @@ +// Copyright 2021, Nitric Technologies Pty Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System.Threading; +using System.Threading.Tasks; +using Nitric.Sdk.Common; +using Nitric.Proto.Schedules.v1; +using GrpcClient = Nitric.Proto.Schedules.v1.Schedules.SchedulesClient; +using Nitric.Sdk.Service; +using System; + +namespace Nitric.Sdk.Worker +{ + public class ScheduleWorker : AbstractWorker + { + readonly private RegistrationRequest RegistrationRequest; + public GrpcClient GrpcClient { private get; set; } + + public ScheduleWorker(RegistrationRequest request, Func> middleware) : base(middleware) + { + this.RegistrationRequest = request; + this.GrpcClient = new GrpcClient(GrpcChannelProvider.GetChannel()); + } + + public ScheduleWorker(RegistrationRequest request, params Middleware[] middlewares) : base(middlewares) + { + this.RegistrationRequest = request; + this.GrpcClient = new GrpcClient(GrpcChannelProvider.GetChannel()); + } + + public override async Task Start(CancellationToken cancellationToken = default) + { + var stream = this.GrpcClient.Schedule(); + + await stream.RequestStream.WriteAsync(new ClientMessage { RegistrationRequest = RegistrationRequest }); + + while (await stream.ResponseStream.MoveNext(cancellationToken)) + { + var req = stream.ResponseStream.Current; + + if (req.IntervalRequest != null) + { + var ctx = IntervalContext.FromRequest(req); + + try + { + ctx = await this.Middleware(ctx); + } + catch (Exception err) + { + Console.WriteLine("Unhandled application error: {0}", err.ToString()); + } + + await stream.RequestStream.WriteAsync(ctx.ToResponse()); + } + + cancellationToken.ThrowIfCancellationRequested(); + } + + await stream.RequestStream.CompleteAsync(); + } + } +} + diff --git a/src/Nitric.Sdk/Worker/SubscriptionWorker.cs b/src/Nitric.Sdk/Worker/SubscriptionWorker.cs new file mode 100644 index 0000000..3850896 --- /dev/null +++ b/src/Nitric.Sdk/Worker/SubscriptionWorker.cs @@ -0,0 +1,76 @@ +// Copyright 2021, Nitric Technologies Pty Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System.Threading; +using System.Threading.Tasks; +using Nitric.Sdk.Common; +using Nitric.Proto.Topics.v1; +using GrpcClient = Nitric.Proto.Topics.v1.Subscriber.SubscriberClient; +using Nitric.Sdk.Service; +using System; + +namespace Nitric.Sdk.Worker +{ + public class SubscriptionWorker : AbstractWorker> + { + readonly private RegistrationRequest RegistrationRequest; + public GrpcClient GrpcClient { private get; set; } + + public SubscriptionWorker(RegistrationRequest request, Func, Task>> middleware) : base(middleware) + { + this.RegistrationRequest = request; + this.GrpcClient = new GrpcClient(GrpcChannelProvider.GetChannel()); + } + + public SubscriptionWorker(RegistrationRequest request, params Middleware>[] middlewares) : base(middlewares) + { + this.RegistrationRequest = request; + this.GrpcClient = new GrpcClient(GrpcChannelProvider.GetChannel()); + } + + public override async Task Start(CancellationToken cancellationToken = default) + { + var stream = this.GrpcClient.Subscribe(); + + await stream.RequestStream.WriteAsync(new ClientMessage { RegistrationRequest = RegistrationRequest }); + + while (await stream.ResponseStream.MoveNext(cancellationToken)) + { + var req = stream.ResponseStream.Current; + + if (req.MessageRequest != null) + { + var ctx = MessageContext.FromRequest(req); + + try + { + ctx = await this.Middleware(ctx); + } + catch (Exception err) + { + Console.WriteLine("Unhandled application error: {0}", err.ToString()); + ctx.Res.Success = false; + } + + await stream.RequestStream.WriteAsync(ctx.ToResponse()); + } + + cancellationToken.ThrowIfCancellationRequested(); + } + + await stream.RequestStream.CompleteAsync(); + } + } +} + diff --git a/src/Nitric.Sdk/Worker/WebsocketWorker.cs b/src/Nitric.Sdk/Worker/WebsocketWorker.cs new file mode 100644 index 0000000..5d3662b --- /dev/null +++ b/src/Nitric.Sdk/Worker/WebsocketWorker.cs @@ -0,0 +1,76 @@ +// Copyright 2021, Nitric Technologies Pty Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System.Threading; +using System.Threading.Tasks; +using Nitric.Sdk.Common; +using Nitric.Proto.Websockets.v1; +using GrpcClient = Nitric.Proto.Websockets.v1.WebsocketHandler.WebsocketHandlerClient; +using Nitric.Sdk.Service; +using System; + +namespace Nitric.Sdk.Worker +{ + public class WebsocketWorker : AbstractWorker + { + readonly private RegistrationRequest RegistrationRequest; + public GrpcClient GrpcClient { private get; set; } + + public WebsocketWorker(RegistrationRequest request, Func> middleware) : base(middleware) + { + this.RegistrationRequest = request; + this.GrpcClient = new GrpcClient(GrpcChannelProvider.GetChannel()); + } + + public WebsocketWorker(RegistrationRequest request, params Middleware[] middlewares) : base(middlewares) + { + this.RegistrationRequest = request; + this.GrpcClient = new GrpcClient(GrpcChannelProvider.GetChannel()); + } + + public override async Task Start(CancellationToken cancellationToken = default) + { + var stream = this.GrpcClient.HandleEvents(); + + await stream.RequestStream.WriteAsync(new ClientMessage { RegistrationRequest = RegistrationRequest }); + + while (await stream.ResponseStream.MoveNext(cancellationToken)) + { + var req = stream.ResponseStream.Current; + + if (req.WebsocketEventRequest != null) + { + var ctx = WebsocketContext.FromRequest(req); + + try + { + ctx = await this.Middleware(ctx); + } + catch (Exception err) + { + Console.WriteLine("Unhandled application error: {0}", err.ToString()); + ctx.Res.Success = false; + } + + await stream.RequestStream.WriteAsync(ctx.ToResponse()); + } + + cancellationToken.ThrowIfCancellationRequested(); + } + + await stream.RequestStream.CompleteAsync(); + } + } +} + diff --git a/src/Nitric.Sdk/Worker/Worker.cs b/src/Nitric.Sdk/Worker/Worker.cs new file mode 100644 index 0000000..b1d6778 --- /dev/null +++ b/src/Nitric.Sdk/Worker/Worker.cs @@ -0,0 +1,68 @@ +// Copyright 2021, Nitric Technologies Pty Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System; +using System.Threading.Tasks; +using System.Collections.Generic; +using Nitric.Sdk.Service; +using System.Linq; +using System.Threading; + +namespace Nitric.Sdk.Worker +{ + interface IWorker + { + public Task Start(CancellationToken cancellationToken = default); + } + + public abstract class AbstractWorker : IWorker + { + protected Func> Middleware; + + public AbstractWorker(params Middleware[] middlewares) + { + if (middlewares.Count() == 0) + { + throw new ArgumentException("cannot create worker with no handlers"); + } + + // Convert the middleware array into a list + var middlewareList = new List>(); + + middlewareList.AddRange(middlewares); + + Func> lastCall = (context) => + { + return Task.FromResult(context); + }; + + middlewares.Reverse(); + + this.Middleware = middlewares.Aggregate(lastCall, (next, handler) => + { + Func> nextFunc = async (context) => await handler(context, next) ?? context; + + return nextFunc; + }); + } + + public AbstractWorker(Func> middleware) + { + this.Middleware = middleware; + } + + public abstract Task Start(CancellationToken cancellationToken = default); + } +} + diff --git a/test/Nitric.Sdk.Test/Api/Document/DocumentToGenericTest.cs b/test/Nitric.Sdk.Test/Api/Document/DocumentToGenericTest.cs deleted file mode 100644 index 3bf2d06..0000000 --- a/test/Nitric.Sdk.Test/Api/Document/DocumentToGenericTest.cs +++ /dev/null @@ -1,151 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -using System; -using System.Collections.Generic; -using System.Linq; -using Google.Protobuf.WellKnownTypes; -using Newtonsoft.Json; -using Nitric.Sdk.Document; -using Xunit; -using Xunit.Abstractions; - -namespace Nitric.Sdk.Test.Api.Document -{ - public class TestProfile - { - public string Name { get; set; } - public float Age { get; set; } - public bool Employed { get; set; } - public List Hobbies { get; set; } - public float[][] Numbers { get; set; } - public TestAddress Address { get; set; } - } - - public class TestAddress - { - public string Street { get; set; } - } - - public class DocumentToGenericTest : DocumentRef - { - private readonly ITestOutputHelper _testOutputHelper; - - public DocumentToGenericTest(ITestOutputHelper testOutputHelper) - { - _testOutputHelper = testOutputHelper; - } - - public string ToAssertableString(IDictionary dictionary) - { - var pairStrings = dictionary.OrderBy(p => p.Key) - .Select(p => p.Key + ": " + string.Join(", ", p.Value)); - return string.Join("; ", pairStrings); - } - - [Fact] - public void TestStructWithScalars() - { - var genericStruct = new Struct(); - genericStruct.Fields.Add("name", Value.ForString("John Smith")); - genericStruct.Fields.Add("age", Value.ForNumber(21.0)); - genericStruct.Fields.Add("employed", Value.ForBool(true)); - - var actual = DocumentToGeneric(genericStruct); - - var expected = new TestProfile { - Name = "John Smith", - Age = 21, - Employed = true, - }; - - Assert.Equivalent(expected, actual); - } - - [Fact] - public void TestStructWithList() - { - var genericList = new List { Value.ForString("Reading"), Value.ForString("Writing"), Value.ForString("Deleting") }; - - var genericStruct = new Struct(); - genericStruct.Fields.Add("name", Value.ForString("John Smith")); - genericStruct.Fields.Add("age", Value.ForNumber(21)); - genericStruct.Fields.Add("employed", Value.ForBool(true)); - genericStruct.Fields.Add("hobbies", Value.ForList(genericList.ToArray())); - - var expectedList = new List { "Reading", "Writing", "Deleting" }; - - var expected = new TestProfile { - Name = "John Smith", - Age = 21, - Employed = true, - Hobbies = expectedList, - }; - - var actual = DocumentToGeneric(genericStruct); - - Assert.Equivalent(expected, actual); - } - - [Fact] - public void TestStructWithNestedLists() - { - var genericStruct = new Struct(); - genericStruct.Fields.Add("name", Value.ForString("John Smith")); - genericStruct.Fields.Add("age", Value.ForNumber(21)); - genericStruct.Fields.Add("employed", Value.ForBool(true)); - genericStruct.Fields.Add("numbers", Value.ForList(new[] { - Value.ForList(Value.ForNumber(0), Value.ForNumber(1)), - Value.ForList(Value.ForNumber(2), Value.ForNumber(3)), - })); - - var expected = new TestProfile { - Name = "John Smith", - Age = 21, - Employed = true, - Numbers = new float[][] { new float[] { 0, 1}, new float[] { 2, 3 }} - }; - - var actual = DocumentToGeneric(genericStruct); - - Assert.Equivalent(expected, actual); - } - - [Fact] - public void TestStructWithNestedStruct() - { - var nestedStruct = new Struct(); - nestedStruct.Fields.Add("street", Value.ForString("123 street st")); - - var genericStruct = new Struct(); - genericStruct.Fields.Add("name", Value.ForString("John Smith")); - genericStruct.Fields.Add("age", Value.ForNumber(21)); - genericStruct.Fields.Add("employed", Value.ForBool(true)); - genericStruct.Fields.Add("address", Value.ForStruct(nestedStruct)); - - var expected = new TestProfile { - Name = "John Smith", - Age = 21, - Employed = true, - Address = new TestAddress { - Street = "123 street st" - }, - }; - - var actual = DocumentToGeneric(genericStruct); - - Assert.Equivalent(expected, actual); - } - } -} diff --git a/test/Nitric.Sdk.Test/Api/Document/DocumentsTest.cs b/test/Nitric.Sdk.Test/Api/Document/DocumentsTest.cs deleted file mode 100644 index 9d40a62..0000000 --- a/test/Nitric.Sdk.Test/Api/Document/DocumentsTest.cs +++ /dev/null @@ -1,832 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -using System; -using System.Collections.Generic; -using Google.Protobuf.WellKnownTypes; -using Grpc.Core; -using Moq; -using Nitric.Proto.Document.v1; -using Nitric.Sdk.Document; -using Xunit; -using Key = Nitric.Proto.Document.v1.Key; - -namespace Nitric.Sdk.Test.Api.Document -{ - class TestDocument - { - public String name { get; set; } - public float age { get; set; } - public List addresses { get; set; } - } - - class TestSubDocument - { - public String name { get; set; } - public float age { get; set; } - public List addresses { get; set; } - } - public class DocumentsTest - { - [Fact] - public void TestBuildDocuments() - { - var documents = new DocumentsClient(); - Assert.NotNull(documents); - } - - /* - * TESTING COLLECTIONS - */ - [Fact] - public void TestCollectionsMethodWithName() - { - var collection = new DocumentsClient().Collection("test-collection"); - Assert.NotNull(collection); - } - - [Fact] - public void TestCollectionsMethodWithoutName() - { - var documents = new DocumentsClient(); - Assert.Throws( - () => documents.Collection(null)); - Assert.Throws( - () => documents.Collection("")); - } - - [Fact] - public void TestCollectionSubCollectionWithName() - { - var collection = new DocumentsClient().Collection("test-collection"); - var subcollection = collection.Collection("test-subcollection"); - Assert.NotNull(subcollection); - Assert.Equal(collection.Name, subcollection.ParentKey.Collection.Name); - Assert.Null(subcollection.ParentKey.Id); - } - - [Fact] - public void TestCollectionSubCollectionWithoutName() - { - var collection = new DocumentsClient().Collection("test-collection"); - Assert.Throws( - () => collection.Collection(null)); - Assert.Throws( - () => collection.Collection("")); - } - - /* - * TESTING DOCS - */ - [Fact] - public void TestBuildDocsWithDocumentId() - { - var collection = new DocumentsClient().Collection("test-collection"); - var docs = collection.Doc("test-document"); - Assert.NotNull(docs); - } - - [Fact] - public void TestBuildDocWithoutDocumentId() - { - var collection = new DocumentsClient().Collection("test-collection"); - Assert.Throws( - () => collection.Doc("")); - Assert.Throws( - () => collection.Doc(null)); - } - - [Fact] - public void TestBuildQuery() - { - var collection = new DocumentsClient().Collection("test-collection"); - var query = collection.Query(); - Assert.NotNull(query); - } - - /* - * TESTING GET (DOCS) - */ - [Fact] - public void TestGet() - { - var content = new Struct(); - content.Fields.Add("name", Value.ForString("John Smith")); - content.Fields.Add("age", Value.ForNumber(21)); - content.Fields.Add("addresses", Value.ForList(Value.ForString("123 street st"))); - - var document = new Proto.Document.v1.Document - { - Content = content, - }; - var documentGetResponse = new DocumentGetResponse - { - Document = document, - }; - - Mock dc = new Mock(); - dc.Setup(e => e.Get(It.IsAny(), null, null, - It.IsAny())) - .Returns(documentGetResponse) - .Verifiable(); - - var documentRef = new DocumentsClient(dc.Object) - .Collection("test-collection") - .Doc("test-document"); - var response = documentRef.Get(); - - Assert.Equal("John Smith", response.Content.name); - Assert.Equal(21, response.Content.age); - Assert.Equal(new List { "123 street st" }, response.Content.addresses); - Assert.Equal(response.Ref, documentRef); - - dc.Verify( - t => t.Get(It.IsAny(), null, null, It.IsAny()), - Times.Once); - } - - [Fact] - public void TestGetWithSortedDictionary() - { - var value = new Value - { - StringValue = "document" - }; - - var content = new Struct(); - content.Fields.Add("test", value); - - var document = new Proto.Document.v1.Document - { - Content = content, - }; - var documentGetResponse = new DocumentGetResponse - { - Document = document, - }; - - Mock dc = new Mock(); - dc.Setup(e => e.Get(It.IsAny(), null, null, - It.IsAny())) - .Returns(documentGetResponse) - .Verifiable(); - - var documentRef = new DocumentsClient(dc.Object) - .Collection>("test-collection") - .Doc("test-document"); - var response = documentRef.Get(); - Assert.Equal("document", response.Content["test"]); - Assert.Equal(response.Ref, documentRef); - - dc.Verify( - t => t.Get(It.IsAny(), null, null, It.IsAny()), - Times.Once); - } - - [Fact] - public void TestGetToNonExistentDocument() - { - Mock dc = new Mock(); - dc.Setup(e => e.Get(It.IsAny(), null, null, - It.IsAny())) - .Throws(new RpcException(new Status(StatusCode.NotFound, "The specified document does not exist"))) - .Verifiable(); - - var documentRef = new DocumentsClient(dc.Object) - .Collection>("test-collection") - .Doc("test-document"); - try - { - var response = documentRef.Get(); - } - catch (Common.NitricException ne) - { - Assert.Equal("Status(StatusCode=\"NotFound\", Detail=\"The specified document does not exist\")", - ne.Message); - } - - dc.Verify( - t => t.Get(It.IsAny(), null, null, It.IsAny()), - Times.Once); - } - - /* - * TESTING SET (DOCS) - */ - [Fact] - public void TestSetWithSingleEntryDictionary() - { - var document = new TestDocument { name = "document", age = 21, addresses = new List { "123 street st" } }; - - Mock dc = new Mock(); - dc.Setup(e => e.Set(It.IsAny(), null, null, - It.IsAny())) - .Returns(new DocumentSetResponse()) - .Verifiable(); - - var documentRef = new DocumentsClient(dc.Object) - .Collection("test-collection") - .Doc("test-document"); - - documentRef.Set(document); - - dc.Verify( - t => t.Set(It.IsAny(), null, null, It.IsAny()), - Times.Once); - } - - [Fact] - public void TestSetWithMultipleEntryDictionary() - { - var document = new Dictionary(); - for (int i = 0; i < 100; i++) - { - document.Add(i.ToString(), "document"); - } - - Mock dc = new Mock(); - dc.Setup(e => e.Set(It.IsAny(), null, null, - It.IsAny())) - .Returns(new DocumentSetResponse()) - .Verifiable(); - - var documentRef = new DocumentsClient(dc.Object) - .Collection>("test-collection") - .Doc("test-document"); - - documentRef.Set(document); - - dc.Verify( - t => t.Set(It.IsAny(), null, null, It.IsAny()), - Times.Once); - } - - [Fact] - public void TestSetWithEmptyDictionary() - { - var document = new Dictionary(); - - Mock dc = new Mock(); - dc.Setup(e => e.Set(It.IsAny(), null, null, - It.IsAny())) - .Returns(new DocumentSetResponse()) - .Verifiable(); - - var documentRef = new DocumentsClient(dc.Object) - .Collection>("test-collection") - .Doc("test-document"); - - documentRef.Set(document); - - dc.Verify( - t => t.Set(It.IsAny(), null, null, It.IsAny()), - Times.Once); - } - - [Fact] - public void TestSetWithNullDocumentThrows() - { - Mock dc = new Mock(); - dc.Setup(e => e.Set(It.IsAny(), null, null, - It.IsAny())) - .Returns(new DocumentSetResponse()) - .Verifiable(); - - var documentRef = new DocumentsClient(dc.Object) - .Collection("test-collection") - .Doc("test-document"); - - Assert.Throws( - () => documentRef.Set(null)); - - dc.Verify( - t => t.Set(It.IsAny(), null, null, It.IsAny()), - Times.Never); - } - - [Fact] - public void TestSetToDocumentWithoutPermissions() - { - Mock dc = new Mock(); - dc.Setup(e => e.Set(It.IsAny(), null, null, - It.IsAny())) - .Throws(new RpcException(new Status(StatusCode.PermissionDenied, - "You do not have permission to modify this document"))) - .Verifiable(); - - var document = new TestDocument { name = "document" }; - - var documentRef = new DocumentsClient(dc.Object) - .Collection("test-collection") - .Doc("test-document"); - try - { - documentRef.Set(document); - } - catch (Common.NitricException ne) - { - Assert.Equal( - "Status(StatusCode=\"PermissionDenied\", Detail=\"You do not have permission to modify this document\")", - ne.Message); - } - - dc.Verify( - t => t.Set(It.IsAny(), null, null, It.IsAny()), - Times.Once); - } - - /* - * TESTING DELETE (DOCS) - */ - [Fact] - public void TestDelete() - { - Mock dc = new Mock(); - dc.Setup(e => e.Delete(It.IsAny(), null, null, - It.IsAny())) - .Returns(new DocumentDeleteResponse()) - .Verifiable(); - - var documentRef = new DocumentsClient(dc.Object) - .Collection("test-collection") - .Doc("test-document"); - - documentRef.Delete(); - - dc.Verify( - t => t.Delete(It.IsAny(), null, null, - It.IsAny()), Times.Once); - } - - /* - * TESTING DOC COLLECTION (DOCS) - */ - [Fact] - public void TestDocCollectionWithName() - { - var docCollection = new DocumentsClient() - .Collection("test-collection") - .Doc("test-document") - .Collection("test-collection-2"); - - Assert.NotNull(docCollection); - } - - [Fact] - public void TestDocCollectionWithoutName() - { - var document = new DocumentsClient() - .Collection("test-collection") - .Doc("test-document"); - - Assert.Throws( - () => document.Collection(null)); - Assert.Throws( - () => document.Collection("")); - } - - [Fact] - public void TestMultipleDocCollectionsThrows() - { - var doc = new DocumentsClient().Collection("test-collection") - .Doc("test-document") - .Collection("test-collection-2") - .Doc("test-document-2"); - - Assert.Throws( - () => - doc.Collection("this-collection-throws-error") - ); - } - - /* - * TEST COLLECTION GROUP - */ - [Fact] - public void TestCollectionGroupBuildWithName() - { - var collection = new DocumentsClient() - .Collection("test-collection"); - var collectionGroup = collection.Collection("test-subcollection"); - Assert.NotNull(collectionGroup); - Assert.Equal("test-subcollection", collectionGroup.Name); - Assert.Null(collectionGroup.ParentKey.Id); - } - - [Fact] - public void TestCollectionGroupBuildWithoutName() - { - var collection = new DocumentsClient() - .Collection("test-collection"); - - Assert.Throws( - () => collection.Collection(null)); - Assert.Throws( - () => collection.Collection("")); - } - - /* - * TEST QUERY - */ - [Fact] - public void TestWhereExpression() - { - var query = new DocumentsClient() - .Collection("test-collection") - .Query(); - - try - { - query - .Where("first_name", "==", "john") - .Where("last_name", ">=", "smith") - .Where("postcode", "<=", "1234") - .Where("address", "startsWith", "B") - .Where("id", ">", "0") - .Where("id", "<", "5"); - Assert.True(true); - } - catch (Exception) - { - Assert.False(false); - } - } - - [Fact] - public void TestChangingLimit() - { - var query = new DocumentsClient() - .Collection("test-collection") - .Query(); - - try - { - query.Limit(100); - Assert.True(true); - } - catch (Exception) - { - Assert.False(false); - } - } - - [Fact] - public void TestHandlingNegativeLimits() - { - var query = new DocumentsClient() - .Collection>("test-collection") - .Query(); - - try - { - query.Limit(-100); - Assert.True(true); - } - catch (Exception) - { - Assert.False(false); - } - } - - [Fact] - public void TestChangingPagingToken() - { - var query = new DocumentsClient() - .Collection("test-collection") - .Query(); - - var pagingToken = new Dictionary(); - pagingToken.Add("test", "entry"); - - try - { - query.PagingFrom(pagingToken); - Assert.True(true); - } - catch (Exception) - { - Assert.False(false); - } - } - - [Fact] - public void TestChangingWithNullPagingToken() - { - var query = new DocumentsClient() - .Collection("test-collection") - .Query(); - - try - { - query.PagingFrom(null); - Assert.True(true); - } - catch (Exception) - { - Assert.False(false); - } - } - - [Fact] - public void TestChangingWithEmptyPagingToken() - { - var query = new DocumentsClient() - .Collection("test-collection") - .Query(); - - try - { - query.PagingFrom(new Dictionary()); - Assert.True(true); - } - catch (Exception) - { - Assert.False(false); - } - } - - [Fact] - public void TestFetch() - { - var pagingToken = new Dictionary { { "page-from", "line 10" } }; - - var content = new Struct(); - content.Fields.Add("name", Value.ForString("document")); - content.Fields.Add("age", Value.ForNumber(21)); - content.Fields.Add("addresses", Value.ForList(new [] { Value.ForString("123 street st")})); - var testDocument = new Proto.Document.v1.Document - { - Content = content, - }; - var documents = new Google.Protobuf.Collections.RepeatedField { testDocument }; - - var queryResponse = new DocumentQueryResponse(); - queryResponse.Documents.Add(documents); - queryResponse.PagingToken.Add(pagingToken); - - Mock dc = new Mock(); - dc.Setup(e => e.Query(It.IsAny(), null, null, - It.IsAny())) - .Returns(queryResponse) - .Verifiable(); - - var query = new DocumentsClient(dc.Object) - .Collection("test-collection") - .Query(); - - try - { - var response = query.Fetch(); - Assert.Single(response.Documents); - Assert.Equal("document", response.Documents[0].Content.name); - Assert.Equal(21, response.Documents[0].Content.age); - Assert.Equal(new List { "123 street st" }, response.Documents[0].Content.addresses); - Assert.Equal(response.PagingToken, pagingToken); - } - catch (Exception) - { - Assert.False(false); - } - - dc.Verify( - t => t.Query(It.IsAny(), null, null, - It.IsAny()), Times.Once); - } - - [Fact] - public void TestFetchConformsToLimitOfOne() - { - var pagingToken = new Dictionary { { "page-from", "line 10" } }; - - var content = new Struct(); - content.Fields.Add("name", Value.ForString("document")); - content.Fields.Add("age", Value.ForNumber(21)); - content.Fields.Add("addresses", Value.ForList(new [] { Value.ForString("123 street st")})); - var testDocument = new Proto.Document.v1.Document - { - Content = content, - }; - var documents = new Google.Protobuf.Collections.RepeatedField { testDocument }; - - var queryResponse = new DocumentQueryResponse(); - queryResponse.Documents.Add(documents); - queryResponse.PagingToken.Add(pagingToken); - - Mock dc = new Mock(); - dc.Setup(e => e.Query(It.IsAny(), null, null, - It.IsAny())) - .Returns(queryResponse) - .Verifiable(); - - var query = new DocumentsClient(dc.Object) - .Collection("test-collection") - .Query(); - - try - { - var response = query - .Limit(1) - .Fetch(); - Assert.Single(response.Documents); - Assert.Equal("document", response.Documents[0].Content.name); - Assert.Equal(21, response.Documents[0].Content.age); - Assert.Equal(new List { "123 street st" }, response.Documents[0].Content.addresses); - Assert.Equal(response.PagingToken, pagingToken); - } - catch (Exception) - { - Assert.False(false); - } - - dc.Verify( - t => t.Query(It.IsAny(), null, null, - It.IsAny()), Times.Once); - } - - [Fact] - public void TestFetchWithExpressions() - { - var pagingToken = new Dictionary { { "page-from", "line 10" } }; - - var content = new Struct(); - content.Fields.Add("name", Value.ForString("John Smith")); - content.Fields.Add("age", Value.ForNumber(21)); - content.Fields.Add("addresses", Value.ForList(new []{ Value.ForString("123 street st")})); - var testDocument = new Proto.Document.v1.Document - { - Content = content, - }; - var documents = new Google.Protobuf.Collections.RepeatedField { testDocument }; - - var queryResponse = new DocumentQueryResponse(); - queryResponse.Documents.Add(documents); - queryResponse.PagingToken.Add(pagingToken); - - Mock dc = new Mock(); - dc.Setup(e => e.Query(It.IsAny(), null, null, - It.IsAny())) - .Returns(queryResponse) - .Verifiable(); - - var query = new DocumentsClient(dc.Object) - .Collection("test-collection") - .Query(); - - try - { - var response = query - .Where("name", "startsWith", "John") - .Where("name", "!=", "John Baker") - .Fetch(); - Assert.Single(response.Documents); - Assert.Equal("John Smith", response.Documents[0].Content.name); - Assert.Equal(21, response.Documents[0].Content.age); - Assert.Equal(new List { "123 street st"}, response.Documents[0].Content.addresses); - Assert.Equal(response.PagingToken, pagingToken); - } - catch (Exception) - { - Assert.False(false); - } - - dc.Verify( - t => t.Query(It.IsAny(), null, null, - It.IsAny()), Times.Once); - } - - [Fact] - public void TestFetchWithPagingToken() - { - var pagingToken = new Dictionary { { "page-from", "line 10" } }; - - var updatedPagingToken = new Dictionary { { "page-from", "line 11" } }; - - var content = new Struct(); - content.Fields.Add("name", Value.ForString("John Smith")); - content.Fields.Add("age", Value.ForNumber(21)); - content.Fields.Add("addresses", Value.ForList(new []{ Value.ForString("123 street st")})); - - var testDocument = new Proto.Document.v1.Document - { - Content = content, - }; - var documents = new Google.Protobuf.Collections.RepeatedField { testDocument }; - - var queryResponse = new DocumentQueryResponse(); - queryResponse.Documents.Add(documents); - queryResponse.PagingToken.Add(updatedPagingToken); - - Mock dc = new Mock(); - dc.Setup(e => e.Query(It.IsAny(), null, null, - It.IsAny())) - .Returns(queryResponse) - .Verifiable(); - - var query = new DocumentsClient(dc.Object) - .Collection("test-collection") - .Query(); - - try - { - var response = query - .PagingFrom(pagingToken) - .Fetch(); - Assert.Single(response.Documents); - Assert.Equal("John Smith", response.Documents[0].Content.name); - Assert.Equal(21, response.Documents[0].Content.age); - Assert.Equal(new List { "123 street st"}, response.Documents[0].Content.addresses); - Assert.Equal(response.PagingToken, updatedPagingToken); - } - catch (Exception) - { - Assert.False(false); - } - - dc.Verify( - t => t.Query(It.IsAny(), null, null, - It.IsAny()), Times.Once); - } - - [Fact] - public void TestFetchNonExistentDocument() - { - Mock dc = new Mock(); - dc.Setup(e => e.Query(It.IsAny(), null, null, - It.IsAny())) - .Throws(new RpcException(new Status(StatusCode.NotFound, "The specified document does not exist"))) - .Verifiable(); - - var query = new DocumentsClient(dc.Object) - .Collection("test-collection") - .Query(); - try - { - var response = query.Fetch(); - } - catch (global::Nitric.Sdk.Common.NitricException ne) - { - Assert.Equal("Status(StatusCode=\"NotFound\", Detail=\"The specified document does not exist\")", - ne.Message); - } - - dc.Verify( - t => t.Query(It.IsAny(), null, null, - It.IsAny()), Times.Once); - } - - [Fact] - public void TestFetchFromSubcollection() - { - var pagingToken = new Dictionary { { "page-from", "line 10" } }; - - var content = new Struct(); - content.Fields.Add("name", Value.ForString("John Smith")); - content.Fields.Add("age", Value.ForNumber(21)); - content.Fields.Add("addresses", Value.ForList(new []{ Value.ForString("123 street st")})); - var testDocument = new Proto.Document.v1.Document - { - Key = new Key { Id = "1234" }, - Content = content, - }; - var documents = new Google.Protobuf.Collections.RepeatedField { testDocument }; - - var queryResponse = new DocumentQueryResponse(); - queryResponse.Documents.Add(documents); - queryResponse.PagingToken.Add(pagingToken); - - Mock dc = new Mock(); - dc.Setup(e => e.Query(It.IsAny(), null, null, - It.IsAny())) - .Returns(queryResponse) - .Verifiable(); - - var query = new DocumentsClient(dc.Object) - .Collection("test-collection") - .Collection("test-subcollection") - .Query(); - - var response = query.Fetch(); - Assert.Single(response.Documents); - Assert.Equal("John Smith", response.Documents[0].Content.name); - Assert.Equal(21, response.Documents[0].Content.age); - Assert.Equal(new List { "123 street st"}, response.Documents[0].Content.addresses); - Assert.Equal(response.PagingToken, pagingToken); - - - dc.Verify( - t => t.Query(It.IsAny(), null, null, - It.IsAny()), Times.Once); - } - } -} diff --git a/test/Nitric.Sdk.Test/Api/Event/EventClientTest.cs b/test/Nitric.Sdk.Test/Api/Event/EventClientTest.cs deleted file mode 100644 index 2228fd9..0000000 --- a/test/Nitric.Sdk.Test/Api/Event/EventClientTest.cs +++ /dev/null @@ -1,132 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -using System; -using System.Collections.Generic; -using Google.Protobuf.WellKnownTypes; -using Grpc.Core; -using Moq; -using Nitric.Proto.Event.v1; -using Nitric.Sdk.Event; -using Xunit; - -namespace Nitric.Sdk.Test.Api.Event -{ - public class TestProfile - { - public string Name; - public double Age; - public List Addresses; - } - - public class EventClientTest - { - [Fact] - public void TestBuildEvents() - { - var evt = new EventsClient(); - Assert.NotNull(evt); - } - [Fact] - public void TestBuildTopicWithName() - { - var topic = new EventsClient().Topic("test-topic"); - Assert.NotNull(topic); - Assert.Equal("test-topic", topic.Name); - } - - [Fact] - public void TestBuildTopicWithoutName() - { - Assert.Throws( - () => new EventsClient().Topic("") - ); - Assert.Throws( - () => new EventsClient().Topic(null) - ); - } - - [Fact] - public void TestPublish() - { - Mock ec = new Mock(); - - ec.Setup(e => e.Publish(It.IsAny(), null, null, It.IsAny())) - .Returns(new EventPublishResponse { Id = "1234" }) - .Verifiable(); - - var topic = new EventsClient(ec.Object).Topic("test-topic"); - - var payload = new TestProfile - { Name = "John Smith", Age = 30, Addresses = new List { "123 street st" } }; - - var evtToSend = new Sdk.Event.Event { Id = "1234", Payload = payload, PayloadType = "payloadType"}; - - var response = topic.Publish(evtToSend); - - Assert.Equal("1234", response); - - ec.Verify(t => t.Publish(It.IsAny(), null, null, It.IsAny()), Times.Once); - } - - [Fact] - public void TestPublishOnlyPayload() - { - Mock ec = new Mock(); - - ec.Setup(e => e.Publish(It.IsAny(), null, null, It.IsAny())) - .Returns(new EventPublishResponse { Id = "1234" }) - .Verifiable(); - - var topic = new EventsClient(ec.Object).Topic("test-topic"); - - var payload = new TestProfile - { Name = "John Smith", Age = 30, Addresses = new List { "123 street st" } }; - - var response = topic.Publish(payload); - - Assert.Equal("1234", response); - - ec.Verify(t => t.Publish(It.IsAny(), null, null, It.IsAny()), Times.Once); - } - - [Fact] - public void TestPublishToNonExistentTopic() - { - Mock ec = new Mock(); - - ec.Setup(e => e.Publish(It.IsAny(), null, null, It.IsAny())) - .Throws(new RpcException(new Status(StatusCode.NotFound, "The specified topic does not exist"))) - .Verifiable(); - - var topic = new EventsClient(ec.Object).Topic("test-topic"); - - var payload = new TestProfile - { Name = "John Smith", Age = 30, Addresses = new List { "123 street st" } }; - - var evtToSend = new Sdk.Event.Event { Id = "1", Payload = payload, PayloadType = "payloadType"}; - - try - { - var response = topic.Publish(evtToSend); - } - catch (global::Nitric.Sdk.Common.NitricException ne) - { - Assert.Equal("Status(StatusCode=\"NotFound\", Detail=\"The specified topic does not exist\")", ne.Message); - } - - ec.Verify(t => t.Publish(It.IsAny(), null, null, It.IsAny()), Times.Once); - } - }; -} diff --git a/test/Nitric.Sdk.Test/Api/Event/EventTest.cs b/test/Nitric.Sdk.Test/Api/Event/EventTest.cs deleted file mode 100644 index 05a9bb8..0000000 --- a/test/Nitric.Sdk.Test/Api/Event/EventTest.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -using System.Collections.Generic; -using Xunit; - - -namespace Nitric.Sdk.Test.Api.Event -{ - public class EventTest - { - [Fact] - public void TestBuild() - { - var payload = new TestProfile - { Name = "John Smith", Age = 30, Addresses = new List { "123 street st" } }; - - var eventTest = new global::Nitric.Sdk.Event.Event - { Id = "id", Payload = payload, PayloadType = "payloadType" }; - - Assert.NotNull(eventTest); - Assert.Equal("id", eventTest.Id); - Assert.Equal("payloadType", eventTest.PayloadType); - Assert.Equal(payload, eventTest.Payload); - } - - [Fact] - public void TestToString() - { - var payload = new TestProfile - { Name = "John Smith", Age = 30, Addresses = new List { "123 street st" } }; - - var eventTest = new global::Nitric.Sdk.Event.Event - { Id = "id", Payload = payload, PayloadType = "payloadType" }; - - Assert.Equal("Event[id=id, payloadType=payloadType, payload={\"Name\":\"John Smith\",\"Age\":30.0,\"Addresses\":[\"123 street st\"]}]", - eventTest.ToString()); - } - } -} diff --git a/test/Nitric.Sdk.Test/Api/Queue/FailedTaskTest.cs b/test/Nitric.Sdk.Test/Api/Queue/FailedTaskTest.cs deleted file mode 100644 index 5eb055b..0000000 --- a/test/Nitric.Sdk.Test/Api/Queue/FailedTaskTest.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -using System.Collections.Generic; -using Google.Protobuf.WellKnownTypes; -using Nitric.Sdk.Queue; -using Xunit; - -namespace Nitric.Sdk.Test.Api.Queue -{ - public class TestProfile - { - public string Name; - public double Age; - public List Addresses; - } - - public class FailedTaskTest - { - [Fact] - public void TestBuild() - { - var payload = new TestProfile - { Name = "John Smith", Age = 30, Addresses = new List { "123 street st " } }; - var failedTask = new global::Nitric.Sdk.Queue.FailedTask - { - Message = "message", - Task = new Task - { - Id = "1", - PayloadType = "payload type", - Payload = payload - } - }; - - Assert.NotNull(failedTask); - Assert.Equal("1", failedTask.Task.Id); - Assert.Equal("payload type", failedTask.Task.PayloadType); - Assert.Equal(payload, failedTask.Task.Payload); - Assert.Equal("message", failedTask.Message); - } - } -} diff --git a/test/Nitric.Sdk.Test/Api/Queue/QueueClientTest.cs b/test/Nitric.Sdk.Test/Api/Queue/QueueClientTest.cs deleted file mode 100644 index 6dd9173..0000000 --- a/test/Nitric.Sdk.Test/Api/Queue/QueueClientTest.cs +++ /dev/null @@ -1,258 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -using System; -using System.Collections.Generic; -using System.Linq; -using Google.Protobuf.Collections; -using Google.Protobuf.WellKnownTypes; -using Grpc.Core; -using Moq; -using Nitric.Proto.Queue.v1; -using Nitric.Sdk.Queue; -using Xunit; - -namespace Nitric.Sdk.Test.Api.Queue -{ - public class QueueClientTest - { - [Fact] - public void TestBuildQueues() - { - var queues = new QueuesClient(); - Assert.NotNull(queues); - } - - [Fact] - public void TestBuildQueueWithName() - { - var queue = new QueuesClient().Queue("test-queue"); - Assert.NotNull(queue); - Assert.Equal("test-queue", queue.Name); - } - - [Fact] - public void TestBuildQueueWithoutName() - { - Assert.Throws( - () => new QueuesClient().Queue("") - ); - Assert.Throws( - () => new QueuesClient().Queue(null) - ); - } - - [Fact] - public void TestSendToNonExistentQueue() - { - Mock qc = new Mock(); - qc.Setup(e => - e.Send(It.IsAny(), null, null, It.IsAny())) - .Throws(new RpcException(new Status(StatusCode.NotFound, "The specified queue does not exist"))) - .Verifiable(); - - var queue = new QueuesClient(qc.Object).Queue("test-queue"); - - try - { - queue.Send(new Task()); - } - catch (global::Nitric.Sdk.Common.NitricException ne) - { - Assert.Equal("Status(StatusCode=\"NotFound\", Detail=\"The specified queue does not exist\")", - ne.Message); - } - - qc.Verify( - t => t.Send(It.IsAny(), null, null, It.IsAny()), - Times.Once); - } - - [Fact] - public void TestSendBatchWithFailedTasks() - { - //Setting up failed tasks to then return later - NitricTask failedTaskTask = new NitricTask(); - failedTaskTask.Id = "0"; - failedTaskTask.LeaseId = "1"; - failedTaskTask.Payload = new Struct(); - failedTaskTask.PayloadType = "Dictionary"; - - Proto.Queue.v1.FailedTask failedTask = new Proto.Queue.v1.FailedTask(); - failedTask.Message = "I am a failed task... I failed my task"; - failedTask.Task = failedTaskTask; - - List failedTasks = new List(); - failedTasks.Add(failedTask); - - var queueBatchResponse = new QueueSendBatchResponse(); - queueBatchResponse.FailedTasks.AddRange(failedTasks); - - Mock qc = new Mock(); - qc.Setup(e => e.SendBatch(It.IsAny(), null, null, - It.IsAny())) - .Returns(queueBatchResponse) - .Verifiable(); - - var queue = new QueuesClient(qc.Object).Queue("test-queue"); - - var failedTasksResp = queue.Send(new TestProfile {}, new TestProfile {}); - - Assert.Equal("I am a failed task... I failed my task", failedTasksResp[0].Message); - - qc.Verify( - t => t.SendBatch(It.IsAny(), null, null, - It.IsAny()), Times.Once); - } - - [Fact] - public void TestSendBatchWithNoFailedTasks() - { - Mock qc = new Mock(); - qc.Setup(e => e.SendBatch(It.IsAny(), null, null, - It.IsAny())) - .Returns(new QueueSendBatchResponse()) - .Verifiable(); - - var queue = new QueuesClient(qc.Object).Queue("test-queue"); - - var failedTasks = queue.Send(new TestProfile {}, new TestProfile {}); - - Assert.Empty(failedTasks); - - qc.Verify( - t => t.SendBatch(It.IsAny(), null, null, - It.IsAny()), Times.Once); - } - - [Fact] - public void TestReceiveTasks() - { - NitricTask taskToReturn = new NitricTask(); - taskToReturn.Id = "32"; - taskToReturn.LeaseId = "1"; - taskToReturn.Payload = new Struct(); - taskToReturn.PayloadType = "Dictionary"; - - RepeatedField tasks = new RepeatedField(); - tasks.Add(taskToReturn); - - var queueReceieveResponse = new QueueReceiveResponse(); - queueReceieveResponse.Tasks.AddRange(tasks); - - Mock qc = new Mock(); - qc.Setup(e => e.Receive(It.IsAny(), null, null, - It.IsAny())) - .Returns(queueReceieveResponse) - .Verifiable(); - - var queue = new QueuesClient(qc.Object).Queue("test-queue"); - - var response = queue.Receive(3); - - Assert.Equal("32", response.ToList()[0].Id); - - qc.Verify( - t => t.Receive(It.IsAny(), null, null, - It.IsAny()), Times.Once); - } - - [Fact] - public void TestReceiveNoTasks() - { - Mock qc = new Mock(); - qc.Setup(e => e.Receive(It.IsAny(), null, null, - It.IsAny())) - .Returns(new QueueReceiveResponse()) - .Verifiable(); - - var queue = new QueuesClient(qc.Object).Queue("test-queue"); - - var response = queue.Receive(3); - - Assert.Empty(response); - - qc.Verify( - t => t.Receive(It.IsAny(), null, null, - It.IsAny()), Times.Once); - } - - [Fact] - public void TestSend() - { - Mock qc = new Mock(); - qc.Setup(e => - e.Send(It.IsAny(), null, null, It.IsAny())) - .Verifiable(); - - var queue = new QueuesClient(qc.Object).Queue("test-queue"); - - queue.Send(new Task { Id = "0", Payload = new TestProfile { Name = "John Smith", Age = 30, Addresses = new List { "123 street st" }}, PayloadType = "JSON" }); - - qc.Verify( - t => t.Send(It.IsAny(), null, null, It.IsAny()), - Times.Once); - } - - [Fact] - public void TestComplete() - { - var receivedTask = new ReceivedTask - { - Id = "32", - LeaseId = "1", - PayloadType = "profile", - Payload = new TestProfile { Name = "John Smith", Age = 30, Addresses = new List { "123 street st" }} - }; - - var payload = new Struct(); - payload.Fields.Add("Name", Value.ForString("John Smith")); - payload.Fields.Add("Age", Value.ForNumber(30.0)); - payload.Fields.Add("Addresses", Value.ForList(new []{ Value.ForString("123 street st") })); - - NitricTask taskToReturn = new NitricTask(); - taskToReturn.Id = "32"; - taskToReturn.LeaseId = "1"; - taskToReturn.Payload = payload; - taskToReturn.PayloadType = "profile"; - - RepeatedField tasks = new RepeatedField(); - tasks.Add(taskToReturn); - - var queueReceieveResponse = new QueueReceiveResponse(); - queueReceieveResponse.Tasks.AddRange(tasks); - - Mock qc = new Mock(); - qc.Setup(e => e.Receive(It.IsAny(), null, null, - It.IsAny())) - .Returns(queueReceieveResponse) - .Verifiable(); - - Mock qcr = new Mock(); - qc.Setup(e => e.Complete(It.IsAny(), null, null, - It.IsAny())) - .Verifiable(); - - var queue = new QueuesClient(qc.Object).Queue("test-queue"); - - var response = queue.Receive(3); - - response.ToList()[0].Complete(); - - qc.Verify( - t => t.Complete(It.IsAny(), null, null, - It.IsAny()), Times.Once); - } - } -} diff --git a/test/Nitric.Sdk.Test/Api/Queue/TaskTest.cs b/test/Nitric.Sdk.Test/Api/Queue/TaskTest.cs deleted file mode 100644 index 7f5abd4..0000000 --- a/test/Nitric.Sdk.Test/Api/Queue/TaskTest.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -using System.Collections.Generic; -using Xunit; - -namespace Nitric.Sdk.Test.Api.Queue -{ - public class QueueItemTest - { - [Fact] - public void TestBuild() - { - var payload = new TestProfile { Name = "John Smith", Age = 30, Addresses = new List { "123 street st" }}; - var queueItem = new global::Nitric.Sdk.Queue.Task - { - Id = "2", - PayloadType = "payload type", - Payload = payload - }; - - Assert.NotNull(queueItem); - Assert.Equal("2", queueItem.Id); - Assert.Equal("payload type", queueItem.PayloadType); - Assert.Equal(payload, queueItem.Payload); - } - } -} diff --git a/test/Nitric.Sdk.Test/Api/Storage/StorageClientTest.cs b/test/Nitric.Sdk.Test/Api/Storage/StorageClientTest.cs deleted file mode 100644 index 4a87995..0000000 --- a/test/Nitric.Sdk.Test/Api/Storage/StorageClientTest.cs +++ /dev/null @@ -1,191 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -using System; -using Grpc.Core; -using Moq; -using Nitric.Proto.Storage.v1; -using Xunit; - -namespace Nitric.Sdk.Test.Api.Storage -{ - public class StorageClientTest - { - [Fact] - public void TestBuildStorage() - { - var storage = new Sdk.Storage.Storage(); - Assert.NotNull(storage); - } - - [Fact] - public void TestBuildBucketWithName() - { - var bucket = new Sdk.Storage.Storage().Bucket("test-bucket"); - Assert.NotNull(bucket); - Assert.Equal("test-bucket", bucket.Name); - } - - [Fact] - public void TestBuildBucketWithoutName() - { - Assert.Throws( - () => new Sdk.Storage.Storage().Bucket("") - ); - Assert.Throws( - () => new Sdk.Storage.Storage().Bucket(null) - ); - } - - [Fact] - public void TestBuildFileWithName() - { - var file = new Sdk.Storage.Storage().Bucket("test-bucket").File("test-file"); - Assert.NotNull(file); - Assert.Equal("test-file", file.Name); - } - - [Fact] - public void TestBuildFileWithoutName() - { - Assert.Throws( - () => new Sdk.Storage.Storage().Bucket("test-bucket").File("") - ); - Assert.Throws( - () => new Sdk.Storage.Storage().Bucket("test-bucket").File(null) - ); - } - - [Fact] - public void TestWrite() - { - var request = new StorageWriteRequest - { - BucketName = "test-bucket", - Key = "test-file", - Body = Google.Protobuf.ByteString.CopyFrom( - System.Text.Encoding.UTF8.GetBytes("Body")) - }; - - Mock bc = new Mock(); - bc.Setup(e => e.Write(It.IsAny(), null, null, - It.IsAny())) - .Returns(new StorageWriteResponse()) - .Verifiable(); - - var file = new Sdk.Storage.Storage(bc.Object).Bucket("test-bucket").File("test-file"); - - file.Write(System.Text.Encoding.UTF8.GetBytes("Hello World")); - - bc.Verify( - t => t.Write(It.IsAny(), null, null, - It.IsAny()), Times.Once); - } - - [Fact] - public void TestWriteString() - { - var request = new StorageWriteRequest - { - BucketName = "test-bucket", - Key = "test-file", - Body = Google.Protobuf.ByteString.CopyFrom( - System.Text.Encoding.UTF8.GetBytes("Body")) - }; - - Mock bc = new Mock(); - bc.Setup(e => e.Write(It.IsAny(), null, null, - It.IsAny())) - .Returns(new StorageWriteResponse()) - .Verifiable(); - - var file = new Sdk.Storage.Storage(bc.Object).Bucket("test-bucket").File("test-file"); - - file.Write("Hello World"); - - bc.Verify( - t => t.Write(It.IsAny(), null, null, - It.IsAny()), Times.Once); - } - - [Fact] - public void TestReadExistingKey() - { - var storageResponse = new StorageReadResponse(); - storageResponse.Body = - Google.Protobuf.ByteString.CopyFrom(System.Text.Encoding.UTF8.GetBytes("Hello World")); - - Mock bc = new Mock(); - bc.Setup(e => e.Read(It.IsAny(), null, null, - It.IsAny())) - .Returns(storageResponse) - .Verifiable(); - - var file = new Sdk.Storage.Storage(bc.Object).Bucket("test-bucket").File("test-file"); - - var response = file.Read(); - - Assert.Equal("Hello World", System.Text.Encoding.UTF8.GetString(response)); - - bc.Verify( - t => t.Read(It.IsAny(), null, null, It.IsAny()), - Times.Once); - } - - [Fact] - public void TestReadNonExistingKey() - { - Mock bc = new Mock(); - bc.Setup(e => e.Read(It.IsAny(), null, null, - It.IsAny())) - .Throws(new RpcException(new Status(StatusCode.NotFound, "The specified key does not exist"))) - .Verifiable(); - - var file = new Sdk.Storage.Storage(bc.Object).Bucket("test-bucket").File("test-file"); - - try - { - file.Read(); - Assert.True(false); - } - catch (global::Nitric.Sdk.Common.NitricException ne) - { - Assert.Equal("Status(StatusCode=\"NotFound\", Detail=\"The specified key does not exist\")", - ne.Message); - } - - bc.Verify( - t => t.Read(It.IsAny(), null, null, It.IsAny()), - Times.Once); - } - - [Fact] - public void TestDeleteExistingKey() - { - Mock bc = new Mock(); - bc.Setup(e => e.Delete(It.IsAny(), null, null, - It.IsAny())) - .Returns(new StorageDeleteResponse()) - .Verifiable(); - - var file = new Sdk.Storage.Storage(bc.Object).Bucket("test-bucket").File("test-file"); - - file.Delete(); - - bc.Verify( - t => t.Delete(It.IsAny(), null, null, - It.IsAny()), Times.Once); - } - } -} diff --git a/test/Nitric.Sdk.Test/Api/Websocket/WebsocketTest.cs b/test/Nitric.Sdk.Test/Api/Websocket/WebsocketTest.cs deleted file mode 100644 index b918486..0000000 --- a/test/Nitric.Sdk.Test/Api/Websocket/WebsocketTest.cs +++ /dev/null @@ -1,143 +0,0 @@ -using System; -using System.Text; -using Google.Protobuf; -using Grpc.Core; -using Moq; -using Nitric.Proto.Secret.v1; -using Nitric.Proto.Websocket.v1; -using Nitric.Sdk.Common; -using Nitric.Sdk.Resource; -using Nitric.Sdk.Secret; -using Nitric.Sdk.Websocket; -using Xunit; - -namespace Nitric.Sdk.Test.Api.Websocket; - -public class WebsocketTest { - [Fact] - public void TestWebsocketBuild() - { - var websocket = new WebsocketClient(); - Assert.NotNull(websocket); - } - - [Fact] - public void TestBuildSecretsWithNullClient() - { - var websocket = new WebsocketClient(null); - Assert.NotNull(websocket); - } - - [Fact] - public void TestBuildWebsocketWithIdAndSocket() - { - var connection = new WebsocketClient().Connection("socket-name", "connection-id"); - Assert.NotNull(connection); - Assert.Equal("connection-id", connection.Id); - Assert.Equal("socket-name", connection.Socket); - } - - [Fact] - public void TestBuildWebsocketWithoutIdOrSocket() - { - Assert.Throws( - () => new WebsocketClient().Connection("", "connection-id")); - Assert.Throws( - () => new WebsocketClient().Connection(null, "connection-id")); - Assert.Throws( - () => new WebsocketClient().Connection("socket-name", "")); - Assert.Throws( - () => new WebsocketClient().Connection("socket-name", null)); - } - - //Testing Websocket Methods - [Fact] - public void TestWebsocketSend() - { - var websocketSendRequest = new WebsocketSendRequest - { - Socket = "socket-name", - ConnectionId = "connection-id", - Data = ByteString.CopyFromUtf8("websocket-data") - }; - Mock wc = new Mock(); - wc.Setup(e => - e.Send(websocketSendRequest, null, null, It.IsAny())) - .Verifiable(); - - var connection = new WebsocketClient(wc.Object) - .Connection("socket-name", "connection-id"); - - connection.Send("websocket-data"); - - wc.Verify( - t => t.Send(websocketSendRequest, null, null, It.IsAny()), - Times.Once); - } - - [Fact] - public void TestWebsocketSendWithError() - { - var websocketSendRequest = new WebsocketSendRequest - { - Socket = "socket-name", - ConnectionId = "connection-id", - Data = ByteString.CopyFromUtf8("websocket-data") - }; - Mock wc = new Mock(); - wc.Setup(e => - e.Send(websocketSendRequest, null, null, It.IsAny())) - .Throws(new RpcException(Status.DefaultCancelled, "succeeded in failing")); - - var connection = new WebsocketClient(wc.Object) - .Connection("socket-name", "connection-id"); - - Assert.Throws(() => - connection.Send("websocket-data") - ); - } - - [Fact] - public void TestWebsocketClose() - { - var websocketCloseRequest = new WebsocketCloseRequest - { - Socket = "socket-name", - ConnectionId = "connection-id", - }; - Mock wc = new Mock(); - wc.Setup(e => - e.Close(websocketCloseRequest, null, null, It.IsAny())) - .Verifiable(); - - var connection = new WebsocketClient(wc.Object) - .Connection("socket-name", "connection-id"); - - connection.Close(); - - wc.Verify( - t => t.Close(websocketCloseRequest, null, null, It.IsAny()), - Times.Once); - } - - [Fact] - public void TestWebsocketCloseWithError() - { - var websocketCloseRequest = new WebsocketCloseRequest - { - Socket = "socket-name", - ConnectionId = "connection-id", - }; - Mock wc = new Mock(); - wc.Setup(e => - e.Close(websocketCloseRequest, null, null, It.IsAny())) - .Throws(new RpcException(Status.DefaultCancelled, "succeeded in failing")); - - var connection = new WebsocketClient(wc.Object) - .Connection("socket-name", "connection-id"); - - Assert.Throws(() => - connection.Close() - ); - } -} diff --git a/test/Nitric.Sdk.Test/Batch/JobTest.cs b/test/Nitric.Sdk.Test/Batch/JobTest.cs new file mode 100644 index 0000000..b10c6d5 --- /dev/null +++ b/test/Nitric.Sdk.Test/Batch/JobTest.cs @@ -0,0 +1,152 @@ +using System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Grpc.Core; +using Moq; +using Nitric.Proto.Batch.v1; +using Nitric.Sdk.Common; +using Xunit; +using GrpcClient = Nitric.Proto.Batch.v1.Batch.BatchClient; + + +namespace Nitric.Sdk.Test.Job +{ + public class TestSubmission + { + public int Id { get; set; } + public string Message { get; set; } + public List Tags { get; set; } + } + public class JobTest + { + [Fact] + public void TestBuildJobWithName() + { + var job = new Sdk.Job.Job("job-name"); + + Assert.NotNull(job); + Assert.Equal("job-name", job.Name); + } + + [Fact] + public void TestBuildJobWithoutName() + { + Assert.Throws( + () => new Sdk.Job.Job("") + ); + Assert.Throws( + () => new Sdk.Job.Job(null) + ); + } + + [Fact] + public void TestJobToString() + { + var job = new Sdk.Job.Job("job-name"); + + Assert.Equal("Job`1[name=job-name]", job.ToString()); + } + + [Fact] + public async Task TestSubmitJob() + { + var testSubmission = new TestSubmission + { + Id = 1234, + Message = "This seems like a good test string?", + Tags = new List { "message", "test" } + }; + + var payload = Sdk.Common.Struct.FromJsonSerializable(testSubmission); + + var request = new JobSubmitRequest + { + JobName = "job-name", + Data = new JobData + { + Struct = payload + } + }; + + Mock gc = new Mock(); + gc.Setup(e => + e.SubmitJobAsync(It.IsAny(), null, null, It.IsAny())) + .Returns(new AsyncUnaryCall(Task.FromResult(new JobSubmitResponse()), null, null, null, null, null)) + .Verifiable(); + + var job = new Sdk.Job.Job("job-name", gc.Object); + + await job.Submit(testSubmission); + + gc.Verify( + t => t.SubmitJobAsync(request, null, null, It.IsAny()), Times.Once); + } + + [Fact] + public async Task TestSubmitJobWithNullPayload() + { + var request = new JobSubmitRequest + { + JobName = "job-name", + }; + + Mock gc = new Mock(); + gc.Setup(e => + e.SubmitJobAsync(It.IsAny(), null, null, It.IsAny())) + .Returns(new AsyncUnaryCall(Task.FromResult(new JobSubmitResponse()), null, null, null, null, null)) + .Verifiable(); + + var kv = new Sdk.Job.Job("job-name", gc.Object); + + await kv.Submit(null); + + gc.Verify( + t => t.SubmitJobAsync(request, null, null, It.IsAny()), Times.Once); + } + + [Fact] + public async Task TestSubmitJobWithError() + { + var testSubmission = new TestSubmission + { + Id = 1234, + Message = "This seems like a good test string?", + Tags = new List { "message", "test" } + }; + + var payload = Sdk.Common.Struct.FromJsonSerializable(testSubmission); + + var request = new JobSubmitRequest + { + JobName = "job-name", + Data = new JobData + { + Struct = payload + } + }; + + Mock gc = new Mock(); + gc.Setup(e => + e.SubmitJobAsync(It.IsAny(), null, null, It.IsAny())) + .Throws(new RpcException(new Status(StatusCode.NotFound, "The specified job does not exist"))) + .Verifiable(); + + var job = new Sdk.Job.Job("job-name", gc.Object); + + try + { + await job.Submit(testSubmission); + Assert.Fail(); + } + catch (RpcException e) + { + Assert.Equal("Status(StatusCode=\"NotFound\", Detail=\"The specified job does not exist\")", + e.Message); + } + + gc.Verify( + t => t.SubmitJobAsync(request, null, null, It.IsAny()), Times.Once); + } + } +} diff --git a/test/Nitric.Sdk.Test/Common/ExceptionsTest.cs b/test/Nitric.Sdk.Test/Common/ExceptionsTest.cs new file mode 100644 index 0000000..c30f7a8 --- /dev/null +++ b/test/Nitric.Sdk.Test/Common/ExceptionsTest.cs @@ -0,0 +1,186 @@ +using Nitric.Sdk.Common; +using Grpc.Core; +using Xunit; + +namespace Nitric.Sdk.Test.Common +{ + public class ExceptionsTest + { + [Fact] + public void BuildUnknownException() + { + var rpcException = new RpcException(new Status(StatusCode.Unknown, "an error occurred")); + + var exception = NitricException.FromRpcException(rpcException); + + Assert.Equal("Status(StatusCode=\"Unknown\", Detail=\"an error occurred\")", + exception.Message); + } + + [Fact] + public void BuildCancelledException() + { + var rpcException = new RpcException(new Status(StatusCode.Cancelled, "an error occurred")); + + var exception = NitricException.FromRpcException(rpcException); + + Assert.Equal("Status(StatusCode=\"Cancelled\", Detail=\"an error occurred\")", + exception.Message); + } + + [Fact] + public void BuildInvalidArgumentException() + { + var rpcException = new RpcException(new Status(StatusCode.InvalidArgument, "an error occurred")); + + var exception = NitricException.FromRpcException(rpcException); + + Assert.Equal("Status(StatusCode=\"InvalidArgument\", Detail=\"an error occurred\")", + exception.Message); + } + + [Fact] + public void BuildDeadlineExceededException() + { + var rpcException = new RpcException(new Status(StatusCode.DeadlineExceeded, "an error occurred")); + + var exception = NitricException.FromRpcException(rpcException); + + Assert.Equal("Status(StatusCode=\"DeadlineExceeded\", Detail=\"an error occurred\")", + exception.Message); + } + + [Fact] + public void BuildNotFoundException() + { + var rpcException = new RpcException(new Status(StatusCode.NotFound, "an error occurred")); + + var exception = NitricException.FromRpcException(rpcException); + + Assert.Equal("Status(StatusCode=\"NotFound\", Detail=\"an error occurred\")", + exception.Message); + } + + [Fact] + public void BuildAlreadyExistsException() + { + var rpcException = new RpcException(new Status(StatusCode.AlreadyExists, "an error occurred")); + + var exception = NitricException.FromRpcException(rpcException); + + Assert.Equal("Status(StatusCode=\"AlreadyExists\", Detail=\"an error occurred\")", + exception.Message); + } + + [Fact] + public void BuildPermissionDeniedException() + { + var rpcException = new RpcException(new Status(StatusCode.PermissionDenied, "an error occurred")); + + var exception = NitricException.FromRpcException(rpcException); + + Assert.Equal("Status(StatusCode=\"PermissionDenied\", Detail=\"an error occurred\")", + exception.Message); + } + + [Fact] + public void BuildResourceExhaustedException() + { + var rpcException = new RpcException(new Status(StatusCode.ResourceExhausted, "an error occurred")); + + var exception = NitricException.FromRpcException(rpcException); + + Assert.Equal("Status(StatusCode=\"ResourceExhausted\", Detail=\"an error occurred\")", + exception.Message); + } + + [Fact] + public void BuildFailedPreconditionException() + { + var rpcException = new RpcException(new Status(StatusCode.FailedPrecondition, "an error occurred")); + + var exception = NitricException.FromRpcException(rpcException); + + Assert.Equal("Status(StatusCode=\"FailedPrecondition\", Detail=\"an error occurred\")", + exception.Message); + } + + [Fact] + public void BuildAbortedException() + { + var rpcException = new RpcException(new Status(StatusCode.Aborted, "an error occurred")); + + var exception = NitricException.FromRpcException(rpcException); + + Assert.Equal("Status(StatusCode=\"Aborted\", Detail=\"an error occurred\")", + exception.Message); + } + + [Fact] + public void BuildOutOfRangeException() + { + var rpcException = new RpcException(new Status(StatusCode.OutOfRange, "an error occurred")); + + var exception = NitricException.FromRpcException(rpcException); + + Assert.Equal("Status(StatusCode=\"OutOfRange\", Detail=\"an error occurred\")", + exception.Message); + } + + [Fact] + public void BuildUnimplementedException() + { + var rpcException = new RpcException(new Status(StatusCode.Unimplemented, "an error occurred")); + + var exception = NitricException.FromRpcException(rpcException); + + Assert.Equal("Status(StatusCode=\"Unimplemented\", Detail=\"an error occurred\")", + exception.Message); + } + + [Fact] + public void BuildInternalException() + { + var rpcException = new RpcException(new Status(StatusCode.Internal, "an error occurred")); + + var exception = NitricException.FromRpcException(rpcException); + + Assert.Equal("Status(StatusCode=\"Internal\", Detail=\"an error occurred\")", + exception.Message); + } + + [Fact] + public void BuildUnavailableException() + { + var rpcException = new RpcException(new Status(StatusCode.Unavailable, "an error occurred")); + + var exception = NitricException.FromRpcException(rpcException); + + Assert.Equal("Status(StatusCode=\"Unavailable\", Detail=\"an error occurred\")", + exception.Message); + } + + [Fact] + public void BuildDataLossException() + { + var rpcException = new RpcException(new Status(StatusCode.DataLoss, "an error occurred")); + + var exception = NitricException.FromRpcException(rpcException); + + Assert.Equal("Status(StatusCode=\"DataLoss\", Detail=\"an error occurred\")", + exception.Message); + } + + [Fact] + public void BuildUnauthenticatedException() + { + var rpcException = new RpcException(new Status(StatusCode.Unauthenticated, "an error occurred")); + + var exception = NitricException.FromRpcException(rpcException); + + Assert.Equal("Status(StatusCode=\"Unauthenticated\", Detail=\"an error occurred\")", + exception.Message); + } + } +} + diff --git a/test/Nitric.Sdk.Test/Faas/FaasTest.cs b/test/Nitric.Sdk.Test/Faas/FaasTest.cs deleted file mode 100644 index 9c1911d..0000000 --- a/test/Nitric.Sdk.Test/Faas/FaasTest.cs +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -namespace Nitric.Sdk.Test.Faas -{ - // //[TestClass] - // public class FaasTest - // { - // //[Fact] - // public async void TestDoubleStart() - // { - // Sdk.Function.Faas faas = Sdk.Function.Faas.NewBuilder() - // .Function(new HelloWorld()) - // .Build(); - // Thread faasThread = new Thread(() => faas.Start()); - // faasThread.Start(); - // await Assert.ThrowsAsync(() => faas.Start()); - // } - // //[Fact] - // public void TestCall() - // { - // Sdk.Function.Faas faas = new Sdk.Function.Faas { HttpHandler = new HelloWorld() }; - // Thread faasThread = new Thread(() => faas.Start()); - // faasThread.Start(); - // var client = new HttpClient(); - // var result = client.GetAsync(string.Format("http://{0}:{1}/", "127.0.0.1", 8080)); - // Assert.Equal("Hello World", result.Result.ToString()); - // } - // } - // public class HelloWorld : INitricFunction - // { - // public int requestNum = 0; - // public Response Handle(Trigger request) - // { - // return request.DefaultResponse(Encoding.UTF8.GetBytes("Hello World")); - // } - // } -} diff --git a/test/Nitric.Sdk.Test/Faas/ResponseTest.cs b/test/Nitric.Sdk.Test/Faas/ResponseTest.cs deleted file mode 100644 index b0c8f06..0000000 --- a/test/Nitric.Sdk.Test/Faas/ResponseTest.cs +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -namespace Nitric.Sdk.Test.Faas -{ - // public class ResponseTest - // { - // [Fact] - // public void TestHttpToGrpc() - // { - // var ctx = new HttpResponseContext() - // .SetStatus(200) - // .AddHeader("x-nitric-testing", "test"); - // - // var response = new Response( - // Encoding.UTF8.GetBytes("Hello World"), - // ctx - // ); - // - // var triggerResponse = response.ToGrpcTriggerResponse(); - // - // Assert.Equal("Hello World", triggerResponse.Data.ToStringUtf8()); - // Assert.NotNull(triggerResponse.Http); - // Assert.Equal(200, triggerResponse.Http.Status); - // Assert.Equal("test", triggerResponse.Http.Headers["x-nitric-testing"].Value[0]); - // } - // - // public void TestTopicToGrpc() - // { - // var ctx = new EventResponse() - // .SetSuccess(true); - // - // var response = new Response( - // Encoding.UTF8.GetBytes("Hello World"), - // ctx - // ); - // - // var triggerResponse = response.ToGrpcTriggerResponse(); - // - // Assert.Equal("Hello World", triggerResponse.Data.ToStringUtf8()); - // Assert.NotNull(triggerResponse.Topic); - // Assert.Equal(true, triggerResponse.Topic.Success); - // } - // } -} diff --git a/test/Nitric.Sdk.Test/Faas/TriggerTest.cs b/test/Nitric.Sdk.Test/Faas/TriggerTest.cs deleted file mode 100644 index d9560fc..0000000 --- a/test/Nitric.Sdk.Test/Faas/TriggerTest.cs +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -namespace Nitric.Sdk.Test.Faas -{ - // public class TriggerTest - // { - // [Fact] - // public void TestFromGrpcTriggerRequestHttp() - // { - // var triggerRequest = new TriggerRequest(); - // triggerRequest.Data = Google.Protobuf.ByteString.CopyFrom(Encoding.UTF8.GetBytes("Hello World")); - // triggerRequest.Http = new HttpTriggerContext(); - // triggerRequest.Http.Method = "GET"; - // var testHeader = new HeaderValue(); - // testHeader.Value.Add("test"); - // triggerRequest.Http.Headers.Add("x-nitric-test", testHeader); - // triggerRequest.MimeType = "text/plain"; - // triggerRequest.Http.Path = "/test/"; - // - // var trigger = Trigger.FromGrpcTriggerRequest(triggerRequest); - // - // - // Assert.True(trigger.Context.IsHttp()); - // Assert.Equal("Hello World", Encoding.UTF8.GetString(trigger.Data)); - // Assert.Equal("text/plain", trigger.MimeType); - // Assert.Equal("GET", trigger.Context.AsHttp().Method); - // Assert.Equal("/test/", trigger.Context.AsHttp().Path); - // Assert.Equal("test", trigger.Context.AsHttp().Headers["x-nitric-test"][0]); - // } - // - // [Fact] - // public void TestFromGrpcTriggerTopic() - // { - // var triggerRequest = new TriggerRequest(); - // triggerRequest.Data = Google.Protobuf.ByteString.CopyFrom(Encoding.UTF8.GetBytes("Hello World")); - // triggerRequest.MimeType = "text/plain"; - // triggerRequest.Topic = new Nitric.Proto.Faas.v1.TopicTriggerContext(); - // triggerRequest.Topic.Topic = "Test"; - // - // var trigger = Trigger.FromGrpcTriggerRequest(triggerRequest); - // - // Assert.True(trigger.Context.IsTopic()); - // Assert.Equal("Hello World", Encoding.UTF8.GetString(trigger.Data)); - // Assert.Equal("text/plain", trigger.MimeType); - // Assert.Equal("Test", trigger.Context.AsTopic().Topic); - // } - // } -} diff --git a/test/Nitric.Sdk.Test/KeyValueStore/KeyValueStoreTest.cs b/test/Nitric.Sdk.Test/KeyValueStore/KeyValueStoreTest.cs new file mode 100644 index 0000000..1de614a --- /dev/null +++ b/test/Nitric.Sdk.Test/KeyValueStore/KeyValueStoreTest.cs @@ -0,0 +1,454 @@ +// Copyright 2021, Nitric Technologies Pty Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System; +using System.Collections.Generic; +using Grpc.Core; +using Moq; +using Xunit; +using GrpcClient = Nitric.Proto.KvStore.v1.KvStore.KvStoreClient; +using Nitric.Sdk.KeyValueStore; +using Nitric.Proto.KvStore.v1; +using System.Threading; +using System.Threading.Tasks; +using Nitric.Sdk.Common; + +namespace Nitric.Sdk.Test.KeyValueStore +{ + public class TestProfile + { + public string Name { get; set; } + public int Age { get; set; } + public List Addresses { get; set; } + } + + public class KeyValueStoreClientTest + { + [Fact] + public void TestBuildKeyValueStoreWithName() + { + var store = new KeyValueStore("test-store"); + Assert.NotNull(store); + Assert.Equal("test-store", store.Name); + } + + [Fact] + public void TestBuildKeyValueStoreWithoutName() + { + Assert.Throws( + () => new KeyValueStore("") + ); + Assert.Throws( + () => new KeyValueStore(null) + ); + } + + [Fact] + public void TestKeyValueStoreToString() + { + var job = new KeyValueStore("test-store"); + + Assert.Equal("KeyValueStore`1[name=test-store]", job.ToString()); + } + + [Fact] + public async void TestSetToKeyValueStore() + { + var testProfile = new TestProfile + { + Name = "John Smith", + Age = 21, + Addresses = new List { "123 address street" } + }; + + var payload = Sdk.Common.Struct.FromJsonSerializable(testProfile); + + var request = new KvStoreSetValueRequest + { + Content = payload, + Ref = new ValueRef + { + Key = "test-key", + Store = "test-store" + } + }; + + var resp = new KvStoreSetValueResponse(); + + Mock gc = new Mock(); + gc.Setup(e => + e.SetValueAsync(It.IsAny(), null, null, It.IsAny())) + .Returns(new AsyncUnaryCall(Task.FromResult(resp), null, null, null, null, null)) + .Verifiable(); + + var kv = new KeyValueStore("test-store", gc.Object); + + await kv.Set("test-key", testProfile); + + gc.Verify( + t => t.SetValueAsync(request, null, null, It.IsAny()), Times.Once); + } + + [Fact] + public async void TestSetNullToKeyValueStore() + { + var request = new KvStoreSetValueRequest + { + Content = null, + Ref = new ValueRef + { + Key = "test-key", + Store = "test-store" + } + }; + + var resp = new KvStoreSetValueResponse(); + + Mock gc = new Mock(); + gc.Setup(e => + e.SetValueAsync(It.IsAny(), null, null, It.IsAny())) + .Returns(new AsyncUnaryCall(Task.FromResult(resp), null, null, null, null, null)) + .Verifiable(); + + var kv = new KeyValueStore("test-store", gc.Object); + + await kv.Set("test-key", null); + + gc.Verify( + t => t.SetValueAsync(request, null, null, It.IsAny()), Times.Once); + } + + [Fact] + public async void TestSetNullToKeyValueStoreWithError() + { + var request = new KvStoreSetValueRequest + { + Content = null, + Ref = new ValueRef + { + Key = "test-key", + Store = "test-store" + } + }; + + Mock gc = new Mock(); + gc.Setup(e => + e.SetValueAsync(It.IsAny(), null, null, It.IsAny())) + .Throws(new RpcException(new Status(StatusCode.NotFound, "The specified key value store does not exist"))) + .Verifiable(); + + var kv = new KeyValueStore("test-store", gc.Object); + + try + { + await kv.Set("test-key", null); + Assert.Fail(); + } + catch (NitricException e) + { + Assert.Equal("Status(StatusCode=\"NotFound\", Detail=\"The specified key value store does not exist\")", + e.Message); + } + + gc.Verify( + t => t.SetValueAsync(request, null, null, It.IsAny()), Times.Once); + } + + [Fact] + public async void TestGetToKeyValueStore() + { + var testProfile = new TestProfile + { + Name = "John Smith", + Age = 21, + Addresses = new List { "123 address street" } + }; + + var payload = Sdk.Common.Struct.FromJsonSerializable(testProfile); + + var request = new KvStoreGetValueRequest + { + Ref = new ValueRef + { + Key = "test-key", + Store = "test-store" + } + }; + + var resp = new KvStoreGetValueResponse + { + Value = new Value + { + Content = payload, + Ref = new ValueRef + { + Key = "test-key", + Store = "test-store" + } + } + }; + + Mock gc = new Mock(); + gc.Setup(e => + e.GetValueAsync(It.IsAny(), null, null, It.IsAny())) + .Returns(new AsyncUnaryCall(Task.FromResult(resp), null, null, null, null, null)) + .Verifiable(); + + var kv = new KeyValueStore("test-store", gc.Object); + + var profile = await kv.Get("test-key"); + + Assert.Equal("John Smith", profile.Name); + Assert.Equal(21, profile.Age); + Assert.Equal("123 address street", profile.Addresses[0]); + + gc.Verify( + t => t.GetValueAsync(request, null, null, It.IsAny()), Times.Once); + } + + [Fact] + public async void TestGetToKeyValueStoreWithError() + { + var testProfile = new TestProfile + { + Name = "John Smith", + Age = 21, + Addresses = new List { "123 address street" } + }; + + var payload = Sdk.Common.Struct.FromJsonSerializable(testProfile); + + var request = new KvStoreGetValueRequest + { + Ref = new ValueRef + { + Key = "test-key", + Store = "test-store" + } + }; + + Mock gc = new Mock(); + gc.Setup(e => + e.GetValueAsync(It.IsAny(), null, null, It.IsAny())) + .Throws(new RpcException(new Status(StatusCode.NotFound, "The specified key value store does not exist"))) + .Verifiable(); + + var kv = new KeyValueStore("test-store", gc.Object); + + try + { + await kv.Get("test-key"); + Assert.Fail(); + } + catch (NitricException e) + { + Assert.Equal("Status(StatusCode=\"NotFound\", Detail=\"The specified key value store does not exist\")", + e.Message); + } + + gc.Verify( + t => t.GetValueAsync(request, null, null, It.IsAny()), Times.Once); + } + + [Fact] + public async void TestDeleteKeyValuePair() + { + var request = new KvStoreDeleteKeyRequest + { + Ref = new ValueRef + { + Key = "test-key", + Store = "test-store" + } + }; + + var resp = new KvStoreDeleteKeyResponse(); + + Mock gc = new Mock(); + gc.Setup(e => + e.DeleteKeyAsync(It.IsAny(), null, null, It.IsAny())) + .Returns(new AsyncUnaryCall(Task.FromResult(resp), null, null, null, null, null)) + .Verifiable(); + + var kv = new KeyValueStore("test-store", gc.Object); + + await kv.Delete("test-key"); + + gc.Verify( + t => t.DeleteKeyAsync(request, null, null, It.IsAny()), Times.Once); + } + + [Fact] + public async void TestDeleteKeyValuePairWithError() + { + var request = new KvStoreDeleteKeyRequest + { + Ref = new ValueRef + { + Key = "test-key", + Store = "test-store" + } + }; + + Mock gc = new Mock(); + gc.Setup(e => + e.DeleteKeyAsync(It.IsAny(), null, null, It.IsAny())) + .Throws(new RpcException(new Status(StatusCode.NotFound, "The specified key value store does not exist"))) + .Verifiable(); + + var kv = new KeyValueStore("test-store", gc.Object); + + try + { + await kv.Delete("test-key"); + Assert.Fail(); + } + catch (NitricException e) + { + Assert.Equal("Status(StatusCode=\"NotFound\", Detail=\"The specified key value store does not exist\")", + e.Message); + } + + + gc.Verify( + t => t.DeleteKeyAsync(request, null, null, It.IsAny()), Times.Once); + } + + [Fact] + public async void TestGetListOfKeysWithNoPrefix() + { + var request = new KvStoreScanKeysRequest + { + Prefix = "", + Store = new Store + { + Name = "test-store", + }, + }; + + var responseStream = new FakeAsyncStreamReader( + new List + { + new KvStoreScanKeysResponse { Key = "key-1" }, + new KvStoreScanKeysResponse { Key = "key-2" }, + new KvStoreScanKeysResponse { Key = "key-3" }, + } + ); + + var resp = new AsyncServerStreamingCall(responseStream, null, null, null, null); + + Mock gc = new Mock(); + gc.Setup(e => + e.ScanKeys(It.IsAny(), null, null, It.IsAny())) + .Returns(resp) + .Verifiable(); + + var kv = new KeyValueStore("test-store", gc.Object); + + var keys = kv.Keys(); + + gc.Verify( + t => t.ScanKeys(request, null, null, It.IsAny()), Times.Once); + + Assert.Equal("key-1", keys.Current); + await keys.MoveNext(); + Assert.Equal("key-2", keys.Current); + await keys.MoveNext(CancellationToken.None); + Assert.Equal("key-3", keys.Current); + var movedForward = await keys.MoveNext(); + Assert.False(movedForward); + } + + [Fact] + public async void TestGetListOfKeysWithPrefix() + { + var request = new KvStoreScanKeysRequest + { + Prefix = "key-", + Store = new Store + { + Name = "test-store", + }, + }; + + var responseStream = new FakeAsyncStreamReader( + new List + { + new KvStoreScanKeysResponse { Key = "key-1" }, + new KvStoreScanKeysResponse { Key = "key-2" }, + new KvStoreScanKeysResponse { Key = "key-3" }, + } + ); + + var resp = new AsyncServerStreamingCall(responseStream, null, null, null, null); + + Mock gc = new Mock(); + gc.Setup(e => + e.ScanKeys(It.IsAny(), null, null, It.IsAny())) + .Returns(resp) + .Verifiable(); + + var kv = new KeyValueStore("test-store", gc.Object); + + var keys = kv.Keys("key-"); + + gc.Verify( + t => t.ScanKeys(request, null, null, It.IsAny()), Times.Once); + + Assert.Equal("key-1", keys.Current); + await keys.MoveNext(); + Assert.Equal("key-2", keys.Current); + await keys.MoveNext(CancellationToken.None); + Assert.Equal("key-3", keys.Current); + var movedForward = await keys.MoveNext(); + Assert.False(movedForward); + } + + [Fact] + public void TestGetListOfKeysWithError() + { + var request = new KvStoreScanKeysRequest + { + Prefix = "", + Store = new Store + { + Name = "test-store", + }, + }; + + Mock gc = new Mock(); + gc.Setup(e => + e.ScanKeys(It.IsAny(), null, null, It.IsAny())) + .Throws(new RpcException(new Status(StatusCode.NotFound, "The specified key value store does not exist"))) + .Verifiable(); + + var kv = new KeyValueStore("test-store", gc.Object); + + try + { + kv.Keys(); + Assert.Fail(); + } + catch (NitricException e) + { + Assert.Equal("Status(StatusCode=\"NotFound\", Detail=\"The specified key value store does not exist\")", + e.Message); + } + + gc.Verify( + t => t.ScanKeys(request, null, null, It.IsAny()), Times.Once); + } + } +} + diff --git a/test/Nitric.Sdk.Test/Mocks.cs b/test/Nitric.Sdk.Test/Mocks.cs new file mode 100644 index 0000000..9924b15 --- /dev/null +++ b/test/Nitric.Sdk.Test/Mocks.cs @@ -0,0 +1,48 @@ +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Grpc.Core; + +namespace Nitric.Sdk.Test +{ + internal class FakeAsyncStreamReader : IAsyncStreamReader + { + private readonly List results; + private int index; + + public FakeAsyncStreamReader(List results) + { + index = 0; + this.results = results; + } + + public T Current => results[index]; + + public Task MoveNext(CancellationToken cancellationToken) + { + if (index == results.Count - 1) + { + return Task.FromResult(false); + } + + index += 1; + + return Task.FromResult(true); + } + } + + internal class FakeClientStreamWriter : IClientStreamWriter + { + WriteOptions IAsyncStreamWriter.WriteOptions { get => WriteOptions.Default; set { } } + + public Task CompleteAsync() + { + return Task.FromResult(true); + } + + public Task WriteAsync(T message) + { + return Task.FromResult(true); + } + } +} \ No newline at end of file diff --git a/test/Nitric.Sdk.Test/Nitric.Sdk.Test.csproj b/test/Nitric.Sdk.Test/Nitric.Sdk.Test.csproj index 3ef2bda..89e9006 100644 --- a/test/Nitric.Sdk.Test/Nitric.Sdk.Test.csproj +++ b/test/Nitric.Sdk.Test/Nitric.Sdk.Test.csproj @@ -1,7 +1,7 @@ - .net6.0 + .net7.0 false @@ -25,13 +25,13 @@ - - - - - - - + + + + + + + @@ -41,5 +41,15 @@ + + + + + + + + + + diff --git a/test/Nitric.Sdk.Test/Queue/QueueTest.cs b/test/Nitric.Sdk.Test/Queue/QueueTest.cs new file mode 100644 index 0000000..cbb6457 --- /dev/null +++ b/test/Nitric.Sdk.Test/Queue/QueueTest.cs @@ -0,0 +1,357 @@ +// Copyright 2021, Nitric Technologies Pty Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System; +using System.Collections.Generic; +using System.Linq; +using Google.Protobuf.WellKnownTypes; +using Grpc.Core; +using Moq; +using Nitric.Proto.Queues.v1; +using GrpcClient = Nitric.Proto.Queues.v1.Queues.QueuesClient; +using Xunit; +using System.Threading.Tasks; +using Nitric.Sdk.Common; + +namespace Nitric.Sdk.Test.Queue +{ + public class TestProfile + { + public string Name; + public double Age; + public List Addresses; + } + + public class QueueClientTest + { + [Fact] + public void TestBuildQueueWithName() + { + var queue = new Sdk.Queue.Queue("test-queue"); + Assert.NotNull(queue); + Assert.Equal("test-queue", queue.Name); + } + + [Fact] + public void TestBuildQueueWithoutName() + { + Assert.Throws( + () => new Sdk.Queue.Queue("") + ); + Assert.Throws( + () => new Sdk.Queue.Queue(null) + ); + } + + [Fact] + public void TestQueueToString() + { + var queue = new Sdk.Queue.Queue("test-queue"); + Assert.Equal("Queue`1[name=test-queue]", queue.ToString()); + } + + [Fact] + public async void TestEnqueue() + { + Mock qc = new Mock(); + qc.Setup(e => + e.EnqueueAsync(It.IsAny(), null, null, It.IsAny())) + .Returns(new AsyncUnaryCall(Task.FromResult(new QueueEnqueueResponse()), null, null, null, null)) + .Verifiable(); + + var queue = new Sdk.Queue.Queue("test-queue", qc.Object); + + await queue.Enqueue(new TestProfile { Name = "John Smith", Age = 30, Addresses = new List { "123 street st" } }); + + qc.Verify( + t => t.EnqueueAsync(It.IsAny(), null, null, It.IsAny()), + Times.Once); + } + + [Fact] + public void TestEnqueueNullMessage() + { + var queue = new Sdk.Queue.Queue("test-queue"); + + Assert.ThrowsAsync(async () => await queue.Enqueue(null)); + } + + [Fact] + public async void TestEnqueueMultipleMessagesWithFailedMessages() + { + FailedEnqueueMessage failedMessage = new FailedEnqueueMessage(); + failedMessage.Details = "I am a failed message... I failed my message"; + failedMessage.Message = new QueueMessage(); + + List failedMessages = new List + { + failedMessage, + }; + + var queueBatchResponse = new QueueEnqueueResponse(); + queueBatchResponse.FailedMessages.AddRange(failedMessages); + + Mock qc = new Mock(); + qc.Setup(e => e.EnqueueAsync(It.IsAny(), null, null, + It.IsAny())) + .Returns(new AsyncUnaryCall(Task.FromResult(queueBatchResponse), null, null, null, null)) + .Verifiable(); + + var queue = new Sdk.Queue.Queue("test-queue", qc.Object); + + var failedMessagesResp = await queue.Enqueue(new TestProfile { }, new TestProfile { }); + + Assert.Equal("I am a failed message... I failed my message", failedMessagesResp[0].Details); + + qc.Verify( + t => t.EnqueueAsync(It.IsAny(), null, null, + It.IsAny()), Times.Once); + } + + [Fact] + public async void TestEnqueueMultipleMessagesWithNoFailedMessages() + { + Mock qc = new Mock(); + qc.Setup(e => e.EnqueueAsync(It.IsAny(), null, null, + It.IsAny())) + .Returns(new AsyncUnaryCall(Task.FromResult(new QueueEnqueueResponse()), null, null, null, null)) + .Verifiable(); + + var queue = new Sdk.Queue.Queue("test-queue", qc.Object); + + var failedMessages = await queue.Enqueue(new TestProfile { }, new TestProfile { }); + + Assert.Empty(failedMessages); + + qc.Verify( + t => t.EnqueueAsync(It.IsAny(), null, null, + It.IsAny()), Times.Once); + } + + [Fact] + public async void TestEnqueueToNonExistentQueue() + { + Mock qc = new Mock(); + qc.Setup(e => + e.EnqueueAsync(It.IsAny(), null, null, It.IsAny())) + .Throws(new RpcException(new Status(StatusCode.NotFound, "The specified queue does not exist"))) + .Verifiable(); + + var queue = new Sdk.Queue.Queue("test-queue", qc.Object); + + try + { + await queue.Enqueue(new TestProfile()); + } + catch (NitricException ne) + { + Assert.Equal("Status(StatusCode=\"NotFound\", Detail=\"The specified queue does not exist\")", + ne.Message); + } + + qc.Verify( + t => t.EnqueueAsync(It.IsAny(), null, null, It.IsAny()), + Times.Once); + } + + [Fact] + public async void TestDequeueMessages() + { + var payload = new Google.Protobuf.WellKnownTypes.Struct(); + payload.Fields.Add("Name", Value.ForString("John Smith")); + payload.Fields.Add("Age", Value.ForNumber(30.0)); + payload.Fields.Add("Addresses", Value.ForList(new[] { Value.ForString("123 street st") })); + + var messages = new List() + { + new DequeuedMessage + { + Message = new QueueMessage + { + StructPayload = payload + }, + LeaseId = "1" + } + }; + + var queueReceieveResponse = new QueueDequeueResponse(); + queueReceieveResponse.Messages.AddRange(messages); + + Mock qc = new Mock(); + qc.Setup(e => e.DequeueAsync(It.IsAny(), null, null, + It.IsAny())) + .Returns(new AsyncUnaryCall(Task.FromResult(queueReceieveResponse), null, null, null, null)) + .Verifiable(); + + var queue = new Sdk.Queue.Queue("test-queue", qc.Object); + + var response = await queue.Dequeue(3); + + Assert.Equal("John Smith", response[0].Message.Name); + Assert.Equal(30.0, response[0].Message.Age); + Assert.Equal("123 street st", response[0].Message.Addresses[0]); + + qc.Verify( + t => t.DequeueAsync(It.IsAny(), null, null, + It.IsAny()), Times.Once); + } + + [Fact] + public async void TestDequeueNoMessages() + { + Mock qc = new Mock(); + qc.Setup(e => e.DequeueAsync(It.IsAny(), null, null, + It.IsAny())) + .Returns(new AsyncUnaryCall(Task.FromResult(new QueueDequeueResponse()), null, null, null, null)) + .Verifiable(); + + var queue = new Sdk.Queue.Queue("test-queue", qc.Object); + + var response = await queue.Dequeue(3); + + Assert.Empty(response); + + qc.Verify( + t => t.DequeueAsync(It.IsAny(), null, null, + It.IsAny()), Times.Once); + } + + [Fact] + public async void TestDequeueToNonExistentQueue() + { + Mock qc = new Mock(); + qc.Setup(e => e.DequeueAsync(It.IsAny(), null, null, + It.IsAny())) + .Throws(new RpcException(new Status(StatusCode.NotFound, "The specified queue does not exist"))) + .Verifiable(); + + var queue = new Sdk.Queue.Queue("test-queue", qc.Object); + + try + { + await queue.Dequeue(3); + Assert.Fail(); + } + catch (NitricException e) + { + Assert.Equal("Status(StatusCode=\"NotFound\", Detail=\"The specified queue does not exist\")", + e.Message); + } + + qc.Verify( + t => t.DequeueAsync(It.IsAny(), null, null, + It.IsAny()), Times.Once); + } + + [Fact] + public async void TestComplete() + { + var payload = new Google.Protobuf.WellKnownTypes.Struct(); + payload.Fields.Add("Name", Value.ForString("John Smith")); + payload.Fields.Add("Age", Value.ForNumber(30.0)); + payload.Fields.Add("Addresses", Value.ForList(new[] { Value.ForString("123 street st") })); + + var messages = new List() + { + new DequeuedMessage + { + Message = new QueueMessage + { + StructPayload = payload + }, + LeaseId = "1" + } + }; + + var queueReceieveResponse = new QueueDequeueResponse(); + queueReceieveResponse.Messages.AddRange(messages); + + Mock qc = new Mock(); + qc.Setup(e => e.DequeueAsync(It.IsAny(), null, null, + It.IsAny())) + .Returns(new AsyncUnaryCall(Task.FromResult(queueReceieveResponse), null, null, null, null)) + .Verifiable(); + + qc.Setup(e => e.CompleteAsync(It.IsAny(), null, null, + It.IsAny())) + .Returns(new AsyncUnaryCall(Task.FromResult(new QueueCompleteResponse()), null, null, null, null)) + .Verifiable(); + + var queue = new Sdk.Queue.Queue("test-queue", qc.Object); + + var response = await queue.Dequeue(3); + + await response.ToList()[0].Complete(); + + qc.Verify( + t => t.CompleteAsync(It.IsAny(), null, null, + It.IsAny()), Times.Once); + } + + [Fact] + public async void TestCompleteToNonExistentQueue() + { + var payload = new Google.Protobuf.WellKnownTypes.Struct(); + payload.Fields.Add("Name", Value.ForString("John Smith")); + payload.Fields.Add("Age", Value.ForNumber(30.0)); + payload.Fields.Add("Addresses", Value.ForList(new[] { Value.ForString("123 street st") })); + + var messages = new List() + { + new DequeuedMessage + { + Message = new QueueMessage + { + StructPayload = payload + }, + LeaseId = "1" + } + }; + + var queueReceieveResponse = new QueueDequeueResponse(); + queueReceieveResponse.Messages.AddRange(messages); + + Mock qc = new Mock(); + qc.Setup(e => e.DequeueAsync(It.IsAny(), null, null, + It.IsAny())) + .Returns(new AsyncUnaryCall(Task.FromResult(queueReceieveResponse), null, null, null, null)) + .Verifiable(); + + Mock qcr = new Mock(); + qc.Setup(e => e.CompleteAsync(It.IsAny(), null, null, + It.IsAny())) + .Throws(new RpcException(new Status(StatusCode.NotFound, "The specified queue does not exist"))) + .Verifiable(); + + var queue = new Sdk.Queue.Queue("test-queue", qc.Object); + + var response = await queue.Dequeue(3); + + try + { + await response.ToList()[0].Complete(); + Assert.Fail(); + } + catch (NitricException e) + { + Assert.Equal("Status(StatusCode=\"NotFound\", Detail=\"The specified queue does not exist\")", + e.Message); + } + + qc.Verify( + t => t.CompleteAsync(It.IsAny(), null, null, + It.IsAny()), Times.Once); + } + } +} diff --git a/test/Nitric.Sdk.Test/Queue/ReceivedMessageTest.cs b/test/Nitric.Sdk.Test/Queue/ReceivedMessageTest.cs new file mode 100644 index 0000000..1aaf99c --- /dev/null +++ b/test/Nitric.Sdk.Test/Queue/ReceivedMessageTest.cs @@ -0,0 +1,77 @@ +// Copyright 2021, Nitric Technologies Pty Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System.Collections.Generic; +using Xunit; +using Nitric.Sdk.Queue; + +namespace Nitric.Sdk.Test.Queue +{ + public class ReceivedMessageTest + { + [Fact] + public void TestBuildReceivedMessage() + { + var payload = new TestProfile { Name = "John Smith", Age = 30, Addresses = new List { "123 street st" } }; + var queueItem = new ReceivedMessage + { + LeaseId = "1", + Message = payload, + }; + + Assert.NotNull(queueItem); + Assert.Equal("1", queueItem.LeaseId); + Assert.Equal(payload, queueItem.Message); + } + + [Fact] + public void TestReceivedMessageToString() + { + var queueItem = new ReceivedMessage + { + LeaseId = "1", + Message = null, + }; + + Assert.Equal("ReceivedMessage`1[leaseId=1]", queueItem.ToString()); + } + + [Fact] + public void TestBuildFailedMessage() + { + var payload = new TestProfile { Name = "John Smith", Age = 30, Addresses = new List { "123 street st" } }; + var failedMessage = new FailedMessage + { + Details = "The failed task failed successfully", + Message = payload, + }; + + Assert.NotNull(failedMessage); + Assert.Equal("The failed task failed successfully", failedMessage.Details); + Assert.Equal(payload, failedMessage.Message); + } + + [Fact] + public void TestFailedMessageToString() + { + var failedMessage = new FailedMessage + { + Details = "The failed task failed successfully", + Message = null, + }; + + Assert.Equal("FailedMessage`1[details=The failed task failed successfully]", failedMessage.ToString()); + } + } +} diff --git a/test/Nitric.Sdk.Test/Api/Secret/SecretTest.cs b/test/Nitric.Sdk.Test/Secret/SecretTest.cs similarity index 50% rename from test/Nitric.Sdk.Test/Api/Secret/SecretTest.cs rename to test/Nitric.Sdk.Test/Secret/SecretTest.cs index de43963..1f1e92c 100644 --- a/test/Nitric.Sdk.Test/Api/Secret/SecretTest.cs +++ b/test/Nitric.Sdk.Test/Secret/SecretTest.cs @@ -16,33 +16,22 @@ using System.Text; using Grpc.Core; using Moq; -using Nitric.Proto.Secret.v1; +using Nitric.Proto.Secrets.v1; +using GrpcClient = Nitric.Proto.Secrets.v1.SecretManager.SecretManagerClient; using Nitric.Sdk.Secret; using Xunit; +using System.Threading.Tasks; +using Nitric.Sdk.Common; - -namespace Nitric.Sdk.Test.Api.Secret +namespace Nitric.Sdk.Test.Secret { public class SecretTest { - [Fact] - public void TestBuildSecrets() - { - var secrets = new SecretsClient(); - Assert.NotNull(secrets); - } - - [Fact] - public void TestBuildSecretsWithNullClient() - { - var secrets = new SecretsClient(null); - Assert.NotNull(secrets); - } [Fact] public void TestBuildSecretWithName() { - var secret = new SecretsClient().Secret("test-secret"); + var secret = new Sdk.Secret.Secret("test-secret"); Assert.NotNull(secret); Assert.Equal("test-secret", secret.Name); } @@ -51,127 +40,109 @@ public void TestBuildSecretWithName() public void TestBuildSecretWithoutName() { Assert.Throws( - () => new SecretsClient().Secret("")); + () => new Sdk.Secret.Secret("")); Assert.Throws( - () => new SecretsClient().Secret(null)); + () => new Sdk.Secret.Secret(null)); } //Testing Secret Methods [Fact] - public void TestPutSecretBytes() + public async void TestPutSecretBytes() { var secretPutResponse = new SecretPutResponse { - SecretVersion = new Proto.Secret.v1.SecretVersion + SecretVersion = new Proto.Secrets.v1.SecretVersion { - Secret = new Proto.Secret.v1.Secret + Secret = new Proto.Secrets.v1.Secret { Name = "test-secret", }, Version = "test-version", } }; - Mock sc = new Mock(); + Mock sc = new Mock(); sc.Setup(e => - e.Put(It.IsAny(), null, null, It.IsAny())) - .Returns(secretPutResponse) + e.PutAsync(It.IsAny(), null, null, It.IsAny())) + .Returns(new AsyncUnaryCall(Task.FromResult(secretPutResponse), null, null, null, null)) .Verifiable(); - var testBytes = Encoding.UTF8.GetBytes("Super secret message"); - var secret = new SecretsClient(sc.Object) - .Secret("test-secret"); - var response = secret.Put(testBytes); + var secret = new Sdk.Secret.Secret("test-secret", sc.Object); + + var response = await secret.Put("Super secret message"); Assert.Equal("test-version", response.Id); Assert.Equal(secret.Name, response.Secret.Name); sc.Verify( - t => t.Put(It.IsAny(), null, null, It.IsAny()), + t => t.PutAsync(It.IsAny(), null, null, It.IsAny()), Times.Once); } [Fact] - public void TestPutSecretString() + public async void TestPutSecretString() { var secretPutResponse = new SecretPutResponse { - SecretVersion = new Proto.Secret.v1.SecretVersion + SecretVersion = new Proto.Secrets.v1.SecretVersion { - Secret = new Proto.Secret.v1.Secret + Secret = new Proto.Secrets.v1.Secret { Name = "test-secret", }, Version = "test-version", } }; - Mock sc = new Mock(); + Mock sc = new Mock(); sc.Setup(e => - e.Put(It.IsAny(), null, null, It.IsAny())) - .Returns(secretPutResponse) + e.PutAsync(It.IsAny(), null, null, It.IsAny())) + .Returns(new AsyncUnaryCall(Task.FromResult(secretPutResponse), null, null, null, null)) .Verifiable(); var testString = "Super secret message"; - var secret = new SecretsClient(sc.Object) - .Secret("test-secret"); - var response = secret.Put(testString); + var secret = new Sdk.Secret.Secret("test-secret", sc.Object); + var response = await secret.Put(testString); Assert.Equal("test-version", response.Id); Assert.Equal(secret.Name, response.Secret.Name); sc.Verify( - t => t.Put(It.IsAny(), null, null, It.IsAny()), + t => t.PutAsync(It.IsAny(), null, null, It.IsAny()), Times.Once); } - [Fact] - public void TestPutEmptySecretBytes() - { - var secret = new SecretsClient().Secret("test-secret"); - Assert.Throws( - () => secret.Put(new byte[] { })); - } - - [Fact] - public void TestPutNullSecretBytes() - { - var secret = new SecretsClient().Secret("test-secret"); - Assert.Throws( - () => secret.Put((byte[])null)); - } - [Fact] public void TestPutEmptySecretString() { - var secret = new SecretsClient().Secret("test-secret"); - Assert.Throws( - () => secret.Put("")); + var secret = new Sdk.Secret.Secret("test-secret"); + Assert.ThrowsAsync( + async () => await secret.Put("")); } [Fact] - public void TestPutNullSecretString() + public void TestPutNullSecretBytes() { - var secret = new SecretsClient().Secret("test-secret"); - Assert.Throws( - () => secret.Put((string)null)); + var secret = new Sdk.Secret.Secret("test-secret"); + Assert.ThrowsAsync( + async () => await secret.Put(null)); } [Fact] - public void TestPutNonExistentSecret() + public async void TestPutNonExistentSecret() { - Mock sc = new Mock(); + Mock sc = new Mock(); sc.Setup(e => - e.Put(It.IsAny(), null, null, It.IsAny())) + e.PutAsync(It.IsAny(), null, null, It.IsAny())) .Throws(new RpcException(new Status(StatusCode.NotFound, "The specified secret does not exist"))) .Verifiable(); var testString = "Super secret message"; - var secret = new SecretsClient(sc.Object) - .Secret("test-secret"); + var secret = new Sdk.Secret.Secret("test-secret", sc.Object); try { - var response = secret.Put(testString); + var response = await secret.Put(testString); + Assert.Fail(); } - catch (global::Nitric.Sdk.Common.NitricException ne) + catch (NitricException ne) { Assert.Equal("Status(StatusCode=\"NotFound\", Detail=\"The specified secret does not exist\")", ne.Message); @@ -179,14 +150,14 @@ public void TestPutNonExistentSecret() sc.Verify( - t => t.Put(It.IsAny(), null, null, It.IsAny()), + t => t.PutAsync(It.IsAny(), null, null, It.IsAny()), Times.Once); } [Fact] public void TestGetSecretVersion() { - var secret = new SecretsClient().Secret("test-secret"); + var secret = new Sdk.Secret.Secret("test-secret"); var secretVersion = secret.Version("test-version"); Assert.NotNull(secretVersion); Assert.Equal("test-version", secretVersion.Id); @@ -197,67 +168,33 @@ public void TestGetSecretVersion() public void TestGetSecretVersionWithoutName() { Assert.Throws( - () => new SecretsClient().Secret("test-secret").Version("")); + () => new Sdk.Secret.Secret("test-secret").Version("")); Assert.Throws( - () => new SecretsClient().Secret("test-secret").Version(null)); - } - - [Fact] - public void TestAccessSecretWithoutPermission() - { - Mock sc = new Mock(); - sc.Setup(e => e.Access(It.IsAny(), null, null, - It.IsAny())) - .Throws(new RpcException(new Status(StatusCode.PermissionDenied, - "You do not have permission to access this secret"))) - .Verifiable(); - - var secret = new SecretsClient(sc.Object) - .Secret("test-secret"); - try - { - var response = secret.Version("test-secret").Access(); - } - catch (global::Nitric.Sdk.Common.NitricException ne) - { - Assert.Equal( - "Status(StatusCode=\"PermissionDenied\", Detail=\"You do not have permission to access this secret\")", - ne.Message); - } - - - sc.Verify( - t => t.Access(It.IsAny(), null, null, - It.IsAny()), Times.Once); + () => new Sdk.Secret.Secret("test-secret").Version(null)); } [Fact] public void TestGetLatestSecretVersion() { - var secretVersion = new SecretsClient() - .Secret("test-secret") - .Latest(); + var secretVersion = new Sdk.Secret.Secret("test-secret").Latest(); Assert.Equal("latest", secretVersion.Id); } [Fact] public void TestSecretToString() { - var secretString = new SecretsClient() - .Secret("test-secret") - .ToString(); - Assert.Equal("[name=test-secret]", secretString); + var secretString = new Sdk.Secret.Secret("test-secret").ToString(); + Assert.Equal("Secret[name=test-secret]", secretString); } - //Testing Secret Version Methods [Fact] - public void TestAccess() + public async void TestAccess() { var secretPutResponse = new SecretAccessResponse { - SecretVersion = new Proto.Secret.v1.SecretVersion + SecretVersion = new Proto.Secrets.v1.SecretVersion { - Secret = new Proto.Secret.v1.Secret + Secret = new Proto.Secrets.v1.Secret { Name = "test-secret", }, @@ -265,16 +202,15 @@ public void TestAccess() }, Value = Google.Protobuf.ByteString.CopyFromUtf8("Super secret message"), }; - Mock sc = new Mock(); - sc.Setup(e => e.Access(It.IsAny(), null, null, + Mock sc = new Mock(); + sc.Setup(e => e.AccessAsync(It.IsAny(), null, null, It.IsAny())) - .Returns(secretPutResponse) + .Returns(new AsyncUnaryCall(Task.FromResult(secretPutResponse), null, null, null, null)) .Verifiable(); - var version = new SecretsClient(sc.Object) - .Secret("test-secret") + var version = new Sdk.Secret.Secret("test-secret", sc.Object) .Version("test-version"); - var response = version.Access(); + var response = await version.Access(); Assert.Equal("test-version", response.SecretVersion.Id); Assert.Equal("test-secret", response.SecretVersion.Secret.Name); @@ -282,28 +218,56 @@ public void TestAccess() Assert.Equal("Super secret message", response.Value); sc.Verify( - t => t.Access(It.IsAny(), null, null, + t => t.AccessAsync(It.IsAny(), null, null, It.IsAny()), Times.Once); } + [Fact] + public async void TestAccessSecretWithoutPermission() + { + Mock sc = new Mock(); + sc.Setup(e => e.AccessAsync(It.IsAny(), null, null, + It.IsAny())) + .Throws(new RpcException(new Status(StatusCode.PermissionDenied, + "You do not have permission to access this secret"))) + .Verifiable(); + + var secret = new Sdk.Secret.Secret("test-secret", sc.Object); + try + { + var response = await secret.Version("test-secret").Access(); + } + catch (NitricException ne) + { + Assert.Equal( + "Status(StatusCode=\"PermissionDenied\", Detail=\"You do not have permission to access this secret\")", + ne.Message); + } + + + sc.Verify( + t => t.AccessAsync(It.IsAny(), null, null, + It.IsAny()), Times.Once); + } + + [Fact] public void TestSecretVersionToString() { - var secretVersionString = new SecretsClient() - .Secret("test-secret") + var secretVersionString = new Sdk.Secret.Secret("test-secret") .Version("test-version") .ToString(); - Assert.Equal("SecretVersion[secret=[name=test-secret], version=test-version]", secretVersionString); + Assert.Equal("SecretVersion[secret=Secret[name=test-secret], version=test-version]", secretVersionString); } [Fact] - public void TestSecretValueToString() + public async Task TestSecretValueToString() { var secretPutResponse = new SecretAccessResponse { - SecretVersion = new Proto.Secret.v1.SecretVersion + SecretVersion = new Proto.Secrets.v1.SecretVersion { - Secret = new Proto.Secret.v1.Secret + Secret = new Proto.Secrets.v1.Secret { Name = "test-secret", }, @@ -311,24 +275,23 @@ public void TestSecretValueToString() }, Value = Google.Protobuf.ByteString.CopyFromUtf8("Super secret message"), }; - Mock sc = new Mock(); - sc.Setup(e => e.Access(It.IsAny(), null, null, + Mock sc = new Mock(); + sc.Setup(e => e.AccessAsync(It.IsAny(), null, null, It.IsAny())) - .Returns(secretPutResponse) + .Returns(new AsyncUnaryCall(Task.FromResult(secretPutResponse), null, null, null, null)) .Verifiable(); - var version = new SecretsClient(sc.Object) - .Secret("test-secret") + var version = new Sdk.Secret.Secret("test-secret", sc.Object) .Version("test-version"); - var response = version.Access(); + var response = await version.Access(); Assert.Equal( - "SecretValue[secretVersion=SecretVersion[secret=[name=test-secret], version=test-version], value.length=20]", + "SecretValue[secretVersion=SecretVersion[secret=Secret[name=test-secret], version=test-version], value.length=20]", response.ToString()); sc.Verify( - t => t.Access(It.IsAny(), null, null, + t => t.AccessAsync(It.IsAny(), null, null, It.IsAny()), Times.Once); } } diff --git a/test/Nitric.Sdk.Test/Storage/BucketTest.cs b/test/Nitric.Sdk.Test/Storage/BucketTest.cs new file mode 100644 index 0000000..dd38801 --- /dev/null +++ b/test/Nitric.Sdk.Test/Storage/BucketTest.cs @@ -0,0 +1,657 @@ +// Copyright 2021, Nitric Technologies Pty Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Grpc.Core; +using Moq; +using Nitric.Proto.Storage.v1; +using Nitric.Sdk.Common; +using Nitric.Sdk.Service; +using Xunit; +using GrpcClient = Nitric.Proto.Storage.v1.Storage.StorageClient; + +namespace Nitric.Sdk.Test.Storage +{ + + public class StorageClientTest + { + [Fact] + public void TestBuildBucketWithName() + { + var bucket = new Sdk.Storage.Bucket("test-bucket"); + Assert.NotNull(bucket); + Assert.Equal("test-bucket", bucket.Name); + } + + [Fact] + public void TestBuildBucketWithoutName() + { + Assert.Throws( + () => new Sdk.Storage.Bucket("") + ); + Assert.Throws( + () => new Sdk.Storage.Bucket(null) + ); + } + + [Fact] + public void TestBuildFileWithName() + { + var file = new Sdk.Storage.Bucket("test-bucket").File("test-file"); + Assert.NotNull(file); + Assert.Equal("test-file", file.Name); + } + + [Fact] + public void TestBuildFileWithoutName() + { + Assert.Throws( + () => new Sdk.Storage.Bucket("test-bucket").File("") + ); + Assert.Throws( + () => new Sdk.Storage.Bucket("test-bucket").File(null) + ); + } + + [Fact] + public void TestBucketToString() + { + var bucket = new Sdk.Storage.Bucket("test-bucket"); + Assert.Equal("Bucket[name=test-bucket]", bucket.ToString()); + } + + [Fact] + public void TestFileToString() + { + var file = new Sdk.Storage.Bucket("test-bucket").File("test-file"); + Assert.Equal("File[name=test-file\nbucket=test-bucket]", file.ToString()); + } + + [Fact] + public async void TestListBlobsWithNoPrefix() + { + var request = new StorageListBlobsRequest + { + BucketName = "test-bucket", + Prefix = "", + }; + + var blobs = new List + { + new Blob { Key = "key-1" }, + new Blob { Key = "key-2" }, + new Blob { Key = "key-3" }, + }; + var response = new StorageListBlobsResponse(); + response.Blobs.AddRange(blobs); + + Mock bc = new Mock(); + bc.Setup(e => e.ListBlobsAsync(It.IsAny(), null, null, + It.IsAny())) + .Returns(new AsyncUnaryCall(Task.FromResult(response), null, null, null, null)) + .Verifiable(); + + var files = await new Sdk.Storage.Bucket("test-bucket", bc.Object).Files(); + + bc.Verify( + t => t.ListBlobsAsync(request, null, null, + It.IsAny()), Times.Once); + + Assert.Equal("key-1", files[0].Name); + Assert.Equal("key-2", files[1].Name); + Assert.Equal("key-3", files[2].Name); + } + + [Fact] + public async void TestListBlobsWithPrefix() + { + var request = new StorageListBlobsRequest + { + BucketName = "test-bucket", + Prefix = "key-", + }; + + var blobs = new List + { + new Blob { Key = "key-1" }, + new Blob { Key = "key-2" }, + new Blob { Key = "key-3" }, + }; + var response = new StorageListBlobsResponse(); + response.Blobs.AddRange(blobs); + + Mock bc = new Mock(); + bc.Setup(e => e.ListBlobsAsync(It.IsAny(), null, null, + It.IsAny())) + .Returns(new AsyncUnaryCall(Task.FromResult(response), null, null, null, null)) + .Verifiable(); + + var files = await new Sdk.Storage.Bucket("test-bucket", bc.Object).Files("key-"); + + bc.Verify( + t => t.ListBlobsAsync(request, null, null, + It.IsAny()), Times.Once); + + Assert.Equal("key-1", files[0].Name); + Assert.Equal("key-2", files[1].Name); + Assert.Equal("key-3", files[2].Name); + } + + [Fact] + public async void TestListBlobsToNonExistentBucket() + { + Mock bc = new Mock(); + bc.Setup(e => e.ListBlobsAsync(It.IsAny(), null, null, + It.IsAny())) + .Throws(new RpcException(new Status(StatusCode.NotFound, "The specified bucket does not exist"))) + .Verifiable(); + + try + { + await new Sdk.Storage.Bucket("test-bucket", bc.Object).Files(); + Assert.Fail(); + } + catch (NitricException e) + { + Assert.Equal("Status(StatusCode=\"NotFound\", Detail=\"The specified bucket does not exist\")", + e.Message); + } + + bc.Verify( + t => t.ListBlobsAsync(It.IsAny(), null, null, + It.IsAny()), Times.Once); + } + + [Fact] + public async void TestWrite() + { + var request = new StorageWriteRequest + { + BucketName = "test-bucket", + Key = "test-file", + Body = Google.Protobuf.ByteString.CopyFrom( + System.Text.Encoding.UTF8.GetBytes("Body")) + }; + + Mock bc = new Mock(); + bc.Setup(e => e.WriteAsync(It.IsAny(), null, null, + It.IsAny())) + .Returns(new AsyncUnaryCall(Task.FromResult(new StorageWriteResponse()), null, null, null, null)) + .Verifiable(); + + var file = new Sdk.Storage.Bucket("test-bucket", bc.Object).File("test-file"); + + await file.Write(System.Text.Encoding.UTF8.GetBytes("Hello World")); + + bc.Verify( + t => t.WriteAsync(It.IsAny(), null, null, + It.IsAny()), Times.Once); + } + + [Fact] + public async void TestWriteBytesToNonExistentBucket() + { + var request = new StorageWriteRequest + { + BucketName = "test-bucket", + Key = "test-file", + Body = Google.Protobuf.ByteString.CopyFrom( + System.Text.Encoding.UTF8.GetBytes("Body")) + }; + + Mock bc = new Mock(); + bc.Setup(e => e.WriteAsync(It.IsAny(), null, null, + It.IsAny())) + .Throws(new RpcException(new Status(StatusCode.NotFound, "The specified bucket does not exist"))) + .Verifiable(); + + var file = new Sdk.Storage.Bucket("test-bucket", bc.Object).File("test-file"); + + try + { + await file.Write(System.Text.Encoding.UTF8.GetBytes("Hello World")); + Assert.Fail(); + } + catch (NitricException e) + { + Assert.Equal("Status(StatusCode=\"NotFound\", Detail=\"The specified bucket does not exist\")", + e.Message); + } + + bc.Verify( + t => t.WriteAsync(It.IsAny(), null, null, + It.IsAny()), Times.Once); + } + + [Fact] + public async void TestWriteToNonExistentBucket() + { + Mock bc = new Mock(); + bc.Setup(e => e.WriteAsync(It.IsAny(), null, null, + It.IsAny())) + .Throws(new RpcException(new Status(StatusCode.NotFound, "The specified bucket does not exist"))) + .Verifiable(); + + var file = new Sdk.Storage.Bucket("test-bucket", bc.Object).File("test-file"); + + try + { + await file.Write("Hello World"); + Assert.Fail(); + } + catch (NitricException e) + { + Assert.Equal("Status(StatusCode=\"NotFound\", Detail=\"The specified bucket does not exist\")", + e.Message); + } + + bc.Verify( + t => t.WriteAsync(It.IsAny(), null, null, + It.IsAny()), Times.Once); + } + + [Fact] + public async void TestWriteString() + { + var request = new StorageWriteRequest + { + BucketName = "test-bucket", + Key = "test-file", + Body = Google.Protobuf.ByteString.CopyFrom( + System.Text.Encoding.UTF8.GetBytes("Body")) + }; + + Mock bc = new Mock(); + bc.Setup(e => e.WriteAsync(It.IsAny(), null, null, + It.IsAny())) + .Returns(new AsyncUnaryCall(Task.FromResult(new StorageWriteResponse()), null, null, null, null)) + .Verifiable(); + + var file = new Sdk.Storage.Bucket("test-bucket", bc.Object).File("test-file"); + + await file.Write("Hello World"); + + bc.Verify( + t => t.WriteAsync(It.IsAny(), null, null, + It.IsAny()), Times.Once); + } + + [Fact] + public async void TestWriteStringToNonExistentBucket() + { + var request = new StorageWriteRequest + { + BucketName = "test-bucket", + Key = "test-file", + Body = Google.Protobuf.ByteString.CopyFrom( + System.Text.Encoding.UTF8.GetBytes("Body")) + }; + + Mock bc = new Mock(); + bc.Setup(e => e.WriteAsync(It.IsAny(), null, null, + It.IsAny())) + .Throws(new RpcException(new Status(StatusCode.NotFound, "The specified bucket does not exist"))) + .Verifiable(); + + var file = new Sdk.Storage.Bucket("test-bucket", bc.Object).File("test-file"); + + try + { + await file.Write("Hello World"); + Assert.Fail(); + } + catch (NitricException e) + { + Assert.Equal("Status(StatusCode=\"NotFound\", Detail=\"The specified bucket does not exist\")", + e.Message); + } + + bc.Verify( + t => t.WriteAsync(It.IsAny(), null, null, + It.IsAny()), Times.Once); + } + + [Fact] + public async void TestReadExistingKey() + { + var storageResponse = new StorageReadResponse(); + storageResponse.Body = + Google.Protobuf.ByteString.CopyFrom(System.Text.Encoding.UTF8.GetBytes("Hello World")); + + Mock bc = new Mock(); + bc.Setup(e => e.ReadAsync(It.IsAny(), null, null, + It.IsAny())) + .Returns(new AsyncUnaryCall(Task.FromResult(storageResponse), null, null, null, null)) + .Verifiable(); + + var file = new Sdk.Storage.Bucket("test-bucket", bc.Object).File("test-file"); + + var response = await file.Read(); + + Assert.Equal("Hello World", System.Text.Encoding.UTF8.GetString(response)); + + bc.Verify( + t => t.ReadAsync(It.IsAny(), null, null, It.IsAny()), + Times.Once); + } + + [Fact] + public async void TestReadNonExistingKey() + { + Mock bc = new Mock(); + bc.Setup(e => e.ReadAsync(It.IsAny(), null, null, + It.IsAny())) + .Throws(new RpcException(new Status(StatusCode.NotFound, "The specified key does not exist"))) + .Verifiable(); + + var file = new Sdk.Storage.Bucket("test-bucket", bc.Object).File("test-file"); + + try + { + await file.Read(); + Assert.Fail(); + } + catch (NitricException ne) + { + Assert.Equal("Status(StatusCode=\"NotFound\", Detail=\"The specified key does not exist\")", + ne.Message); + } + + bc.Verify( + t => t.ReadAsync(It.IsAny(), null, null, It.IsAny()), + Times.Once); + } + + [Fact] + public async void TestDeleteExistingKey() + { + Mock bc = new Mock(); + bc.Setup(e => e.DeleteAsync(It.IsAny(), null, null, + It.IsAny())) + .Returns(new AsyncUnaryCall(Task.FromResult(new StorageDeleteResponse()), null, null, null, null)) + .Verifiable(); + + var file = new Sdk.Storage.Bucket("test-bucket", bc.Object).File("test-file"); + + await file.Delete(); + + bc.Verify( + t => t.DeleteAsync(It.IsAny(), null, null, + It.IsAny()), Times.Once); + } + + [Fact] + public async void TestDeleteNonExistingKey() + { + Mock bc = new Mock(); + bc.Setup(e => e.DeleteAsync(It.IsAny(), null, null, + It.IsAny())) + .Throws(new RpcException(new Status(StatusCode.NotFound, "The specified key does not exist"))) + .Verifiable(); + + var file = new Sdk.Storage.Bucket("test-bucket", bc.Object).File("test-file"); + + try + { + await file.Delete(); + Assert.Fail(); + } + catch (NitricException ne) + { + Assert.Equal("Status(StatusCode=\"NotFound\", Detail=\"The specified key does not exist\")", + ne.Message); + } + + bc.Verify( + t => t.DeleteAsync(It.IsAny(), null, null, It.IsAny()), + Times.Once); + } + + [Fact] + public async void TestGetUploadUrlWithDefaultExpiry() + { + var request = new StoragePreSignUrlRequest + { + BucketName = "test-bucket", + Key = "test-file", + Operation = StoragePreSignUrlRequest.Types.Operation.Write, + Expiry = new Google.Protobuf.WellKnownTypes.Duration { Seconds = 600 }, + }; + + Mock bc = new Mock(); + bc.Setup(e => e.PreSignUrlAsync(It.IsAny(), null, null, + It.IsAny())) + .Returns(new AsyncUnaryCall(Task.FromResult(new StoragePreSignUrlResponse { Url = "https://example.com" }), null, null, null, null)) + .Verifiable(); + + var file = new Sdk.Storage.Bucket("test-bucket", bc.Object).File("test-file"); + + var url = await file.GetUploadUrl(); + + bc.Verify( + t => t.PreSignUrlAsync(request, null, null, + It.IsAny()), Times.Once); + + Assert.Equal("https://example.com", url); + } + + [Fact] + public async void TestGetUploadUrlWithSpecificExpiry() + { + var request = new StoragePreSignUrlRequest + { + BucketName = "test-bucket", + Key = "test-file", + Operation = StoragePreSignUrlRequest.Types.Operation.Write, + Expiry = new Google.Protobuf.WellKnownTypes.Duration { Seconds = 300 }, + }; + + Mock bc = new Mock(); + bc.Setup(e => e.PreSignUrlAsync(It.IsAny(), null, null, + It.IsAny())) + .Returns(new AsyncUnaryCall(Task.FromResult(new StoragePreSignUrlResponse { Url = "https://example.com" }), null, null, null, null)) + .Verifiable(); + + var file = new Sdk.Storage.Bucket("test-bucket", bc.Object).File("test-file"); + + var url = await file.GetUploadUrl(300); + + bc.Verify( + t => t.PreSignUrlAsync(request, null, null, + It.IsAny()), Times.Once); + + Assert.Equal("https://example.com", url); + } + + [Fact] + public async void TestGetUploadUrlNonExistingKey() + { + var request = new StoragePreSignUrlRequest + { + BucketName = "test-bucket", + Key = "test-file", + Operation = StoragePreSignUrlRequest.Types.Operation.Write, + Expiry = new Google.Protobuf.WellKnownTypes.Duration { Seconds = 600 }, + }; + + Mock bc = new Mock(); + bc.Setup(e => e.PreSignUrlAsync(It.IsAny(), null, null, + It.IsAny())) + .Throws(new RpcException(new Status(StatusCode.NotFound, "The specified key does not exist"))) + .Verifiable(); + + var file = new Sdk.Storage.Bucket("test-bucket", bc.Object).File("test-file"); + + try + { + await file.GetUploadUrl(); + Assert.Fail(); + } + catch (NitricException ne) + { + Assert.Equal("Status(StatusCode=\"NotFound\", Detail=\"The specified key does not exist\")", + ne.Message); + } + + bc.Verify( + t => t.PreSignUrlAsync(It.IsAny(), null, null, + It.IsAny()), Times.Once); + } + + [Fact] + public async void TestGetDownloadUrlWithDefaultExpiry() + { + var request = new StoragePreSignUrlRequest + { + BucketName = "test-bucket", + Key = "test-file", + Operation = StoragePreSignUrlRequest.Types.Operation.Read, + Expiry = new Google.Protobuf.WellKnownTypes.Duration { Seconds = 600 }, + }; + + Mock bc = new Mock(); + bc.Setup(e => e.PreSignUrlAsync(It.IsAny(), null, null, + It.IsAny())) + .Returns(new AsyncUnaryCall(Task.FromResult(new StoragePreSignUrlResponse { Url = "https://example.com" }), null, null, null, null)) + .Verifiable(); + + var file = new Sdk.Storage.Bucket("test-bucket", bc.Object).File("test-file"); + + var url = await file.GetDownloadUrl(); + + bc.Verify( + t => t.PreSignUrlAsync(request, null, null, + It.IsAny()), Times.Once); + + Assert.Equal("https://example.com", url); + } + + [Fact] + public async void TestGetDownloadUrlWithSpecificExpiry() + { + var request = new StoragePreSignUrlRequest + { + BucketName = "test-bucket", + Key = "test-file", + Operation = StoragePreSignUrlRequest.Types.Operation.Read, + Expiry = new Google.Protobuf.WellKnownTypes.Duration { Seconds = 300 }, + }; + + Mock bc = new Mock(); + bc.Setup(e => e.PreSignUrlAsync(It.IsAny(), null, null, + It.IsAny())) + .Returns(new AsyncUnaryCall(Task.FromResult(new StoragePreSignUrlResponse { Url = "https://example.com" }), null, null, null, null)) + .Verifiable(); + + var file = new Sdk.Storage.Bucket("test-bucket", bc.Object).File("test-file"); + + var url = await file.GetDownloadUrl(300); + + bc.Verify( + t => t.PreSignUrlAsync(request, null, null, + It.IsAny()), Times.Once); + + Assert.Equal("https://example.com", url); + } + + [Fact] + public async void TestGetDownloadUrlNonExistingKey() + { + var request = new StoragePreSignUrlRequest + { + BucketName = "test-bucket", + Key = "test-file", + Operation = StoragePreSignUrlRequest.Types.Operation.Read, + Expiry = new Google.Protobuf.WellKnownTypes.Duration { Seconds = 600 }, + }; + + Mock bc = new Mock(); + bc.Setup(e => e.PreSignUrlAsync(It.IsAny(), null, null, + It.IsAny())) + .Throws(new RpcException(new Status(StatusCode.NotFound, "The specified key does not exist"))) + .Verifiable(); + + var file = new Sdk.Storage.Bucket("test-bucket", bc.Object).File("test-file"); + + try + { + await file.GetDownloadUrl(); + Assert.Fail(); + } + catch (NitricException ne) + { + Assert.Equal("Status(StatusCode=\"NotFound\", Detail=\"The specified key does not exist\")", + ne.Message); + } + + bc.Verify( + t => t.PreSignUrlAsync(It.IsAny(), null, null, + It.IsAny()), Times.Once); + } + + [Fact] + public void TestRegisterBlobEventWorkerOnWrite() + { + Func> middleware = async (ctx) => + { + return await Task.FromResult(ctx); + }; + + var bucket = new Sdk.Storage.Bucket("test-bucket"); + + bucket.On(Service.BlobEventType.Write, "*", middleware); + } + + [Fact] + public void TestRegisterBlobEventWorkerOnDelete() + { + Func> middleware = async (ctx) => + { + return await Task.FromResult(ctx); + }; + + var bucket = new Sdk.Storage.Bucket("test-bucket"); + + bucket.On(Service.BlobEventType.Delete, "*", middleware); + } + + [Fact] + public void TestRegisterBlobEventWorkerOnWriteWithMultipleMiddleware() + { + Middleware middleware = async (ctx, next) => + { + return await next(ctx); + }; + + var bucket = new Sdk.Storage.Bucket("test-bucket"); + + bucket.On(Service.BlobEventType.Write, "*", middleware, middleware); + } + + [Fact] + public void TestRegisterBlobEventWorkerOnDeleteWithMultipleMiddleware() + { + Middleware middleware = async (ctx, next) => + { + return await next(ctx); + }; + + var bucket = new Sdk.Storage.Bucket("test-bucket"); + + bucket.On(Service.BlobEventType.Delete, "*", middleware, middleware); + } + } +} \ No newline at end of file diff --git a/test/Nitric.Sdk.Test/Topics/TopicTest.cs b/test/Nitric.Sdk.Test/Topics/TopicTest.cs new file mode 100644 index 0000000..1434680 --- /dev/null +++ b/test/Nitric.Sdk.Test/Topics/TopicTest.cs @@ -0,0 +1,109 @@ +// Copyright 2021, Nitric Technologies Pty Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System; +using System.Collections.Generic; +using Grpc.Core; +using Moq; +using GrpcClient = Nitric.Proto.Topics.v1.Topics.TopicsClient; +using Nitric.Proto.Topics.v1; +using Nitric.Sdk.Topics; +using Xunit; +using System.Threading.Tasks; +using Nitric.Sdk.Common; + +namespace Nitric.Sdk.Test.Event +{ + public class TestProfile + { + public string Name; + public double Age; + public List Addresses; + } + + public class EventClientTest + { + [Fact] + public void TestBuildTopicWithName() + { + var topic = new Topic("test-topic"); + Assert.NotNull(topic); + Assert.Equal("test-topic", topic.Name); + } + + [Fact] + public void TestBuildTopicWithoutName() + { + Assert.Throws( + () => new Topic("") + ); + Assert.Throws( + () => new Topic(null) + ); + } + + [Fact] + public void TestTopicToString() + { + var topic = new Topic("test-topic"); + + Assert.Equal("Topic`1[name=test-topic]", topic.ToString()); + } + + [Fact] + public async void TestPublish() + { + Mock ec = new Mock(); + + ec.Setup(e => e.PublishAsync(It.IsAny(), null, null, It.IsAny())) + .Returns(new AsyncUnaryCall(Task.FromResult(new TopicPublishResponse()), null, null, null, null)) + .Verifiable(); + + var topic = new Topic("test-topic", ec.Object); + + var profile = new TestProfile + { Name = "John Smith", Age = 30, Addresses = new List { "123 street st" } }; + + await topic.Publish(profile); + + ec.Verify(t => t.PublishAsync(It.IsAny(), null, null, It.IsAny()), Times.Once); + } + + [Fact] + public async void TestPublishToNonExistentTopic() + { + Mock ec = new Mock(); + + ec.Setup(e => e.PublishAsync(It.IsAny(), null, null, It.IsAny())) + .Throws(new RpcException(new Status(StatusCode.NotFound, "The specified topic does not exist"))) + .Verifiable(); + + var topic = new Topic("test-topic", ec.Object); + + var profile = new TestProfile + { Name = "John Smith", Age = 30, Addresses = new List { "123 street st" } }; + + try + { + await topic.Publish(profile); + } + catch (NitricException ne) + { + Assert.Equal("Status(StatusCode=\"NotFound\", Detail=\"The specified topic does not exist\")", ne.Message); + } + + ec.Verify(t => t.PublishAsync(It.IsAny(), null, null, It.IsAny()), Times.Once); + } + }; +} diff --git a/test/Nitric.Sdk.Test/Websocket/ConnectionTest.cs b/test/Nitric.Sdk.Test/Websocket/ConnectionTest.cs new file mode 100644 index 0000000..a9e101c --- /dev/null +++ b/test/Nitric.Sdk.Test/Websocket/ConnectionTest.cs @@ -0,0 +1,147 @@ +// Copyright 2021, Nitric Technologies Pty Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System; +using System.Threading.Tasks; +using Google.Protobuf; +using Grpc.Core; +using Moq; +using Nitric.Proto.Websockets.v1; +using Nitric.Sdk.Common; +using Nitric.Sdk.Websocket; +using Xunit; +using GrpcClient = Nitric.Proto.Websockets.v1.Websocket.WebsocketClient; + +namespace Nitric.Sdk.Test.Websocket +{ + + public class WebsocketTest + { + [Fact] + public void TestBuildConnectionWithIdAndSocket() + { + var connection = new Connection("connection-id", "socket-name"); + Assert.NotNull(connection); + Assert.Equal("connection-id", connection.Id); + Assert.Equal("socket-name", connection.SocketName); + } + + [Fact] + public void TestBuildConnectionWithoutIdOrSocket() + { + Assert.Throws( + () => new Connection("", "connection-id")); + Assert.Throws( + () => new Connection(null, "connection-id")); + Assert.Throws( + () => new Connection("socket-name", "")); + Assert.Throws( + () => new Connection("socket-name", null)); + } + + [Fact] + public void TestConnectionToString() + { + var connection = new Connection("connection-id", "socket-name"); + + Assert.Equal("Connection[socketName=socket-name,connectionId=connection-id]", connection.ToString()); + } + + [Fact] + public async void TestWebsocketSend() + { + var websocketSendRequest = new WebsocketSendRequest + { + SocketName = "socket-name", + ConnectionId = "connection-id", + Data = ByteString.CopyFromUtf8("websocket-data") + }; + Mock wc = new Mock(); + wc.Setup(e => + e.SendMessageAsync(websocketSendRequest, null, null, It.IsAny())) + .Returns(new AsyncUnaryCall(Task.FromResult(new WebsocketSendResponse()), null, null, null, null)) + .Verifiable(); + + var connection = new Connection("connection-id", "socket-name", wc.Object); + + await connection.SendMessage("websocket-data"); + + wc.Verify( + t => t.SendMessageAsync(websocketSendRequest, null, null, It.IsAny()), + Times.Once); + } + + [Fact] + public void TestWebsocketSendWithError() + { + var websocketSendRequest = new WebsocketSendRequest + { + SocketName = "socket-name", + ConnectionId = "connection-id", + Data = ByteString.CopyFromUtf8("websocket-data") + }; + Mock wc = new Mock(); + wc.Setup(e => + e.SendMessageAsync(websocketSendRequest, null, null, It.IsAny())) + .Throws(new RpcException(Status.DefaultCancelled, "succeeded in failing")); + + var connection = new Connection("connection-id", "socket-name", wc.Object); + + Assert.ThrowsAsync(async () => + await connection.SendMessage("websocket-data") + ); + } + + [Fact] + public async void TestWebsocketClose() + { + var websocketCloseRequest = new WebsocketCloseConnectionRequest + { + SocketName = "socket-name", + ConnectionId = "connection-id", + }; + Mock wc = new Mock(); + wc.Setup(e => + e.CloseConnectionAsync(websocketCloseRequest, null, null, It.IsAny())) + .Returns(new AsyncUnaryCall(Task.FromResult(new WebsocketCloseConnectionResponse()), null, null, null, null)) + .Verifiable(); + + var connection = new Connection("connection-id", "socket-name", wc.Object); + + await connection.CloseConnection(); + + wc.Verify( + t => t.CloseConnectionAsync(websocketCloseRequest, null, null, It.IsAny()), + Times.Once); + } + + [Fact] + public void TestWebsocketCloseWithError() + { + var websocketCloseRequest = new WebsocketCloseConnectionRequest + { + SocketName = "socket-name", + ConnectionId = "connection-id", + }; + Mock wc = new Mock(); + wc.Setup(e => + e.CloseConnectionAsync(websocketCloseRequest, null, null, It.IsAny())) + .Throws(new RpcException(Status.DefaultCancelled, "succeeded in failing")); + + var connection = new Connection("connection-id", "socket-name", wc.Object); + + Assert.ThrowsAsync(connection.CloseConnection); + } + } +} \ No newline at end of file diff --git a/test/Nitric.Sdk.Test/Worker/ApiWorkerTest.cs b/test/Nitric.Sdk.Test/Worker/ApiWorkerTest.cs new file mode 100644 index 0000000..9ca1369 --- /dev/null +++ b/test/Nitric.Sdk.Test/Worker/ApiWorkerTest.cs @@ -0,0 +1,169 @@ +using System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Google.Protobuf; +using Grpc.Core; +using Moq; +using Nitric.Proto.Apis.v1; +using Nitric.Sdk.Service; +using Nitric.Sdk.Worker; +using Xunit; + +using GrpcClient = Nitric.Proto.Apis.v1.Api.ApiClient; + +namespace Nitric.Sdk.Test.Worker +{ + public class ApiWorkerTest + { + [Fact] + public void TestApiWorkerBuildWithMiddleware() + { + Func> middleware = async (ctx) => + { + return await Task.FromResult(ctx); + }; + + var registration = new RegistrationRequest + { + Api = "api-name", + Path = "/", + }; + + var worker = new ApiWorker(registration, middleware); + + Assert.NotNull(worker); + } + + [Fact] + public void TestApiWorkerBuildWithMultipleMiddleware() + { + Middleware middleware = async (ctx, next) => + { + return await next(ctx); + }; + + var registration = new RegistrationRequest + { + Api = "api-name", + Path = "/", + }; + + var worker = new ApiWorker(registration, middleware, middleware); + + Assert.NotNull(worker); + } + + [Fact] + public void TestApiWorkerBuildWithNoMiddleware() + { + Middleware middleware = async (ctx, next) => + { + return await next(ctx); + }; + + var registration = new RegistrationRequest + { + Api = "api-name", + Path = "/", + }; + + Assert.Throws(() => + { + var worker = new ApiWorker(registration); + }); + } + + [Fact] + public async void TestApiWorkerStart() + { + Middleware middleware = async (ctx, next) => + { + var profile = ctx.Req.Json(); + Assert.Equal("John Smith", profile.Name); + Assert.Equal(21, profile.Age); + Assert.Equal("john.smith@email.com", profile.Contacts[0]); + return await next(ctx); + }; + + var registration = new RegistrationRequest + { + Api = "api-name", + Path = "/", + }; + + var mockClientMessage = new FakeClientStreamWriter(); + + var body = ByteString.CopyFromUtf8("{\"name\":\"John Smith\",\"age\":21,\"contacts\":[\"john.smith@email.com\"]}"); + + var responseStream = new FakeAsyncStreamReader( + new List + { + new ServerMessage { Id = "id-1", RegistrationResponse = new RegistrationResponse { }}, + new ServerMessage { Id = "id-2", HttpRequest = new Proto.Apis.v1.HttpRequest { Body = body} }, + } + ); + + var resp = new AsyncDuplexStreamingCall(mockClientMessage, responseStream, null, null, null, null); + + Mock wc = new Mock(); + wc.Setup(e => + e.Serve(null, null, It.IsAny())) + .Returns(resp); + + var worker = new ApiWorker(registration, middleware) + { + GrpcClient = wc.Object + }; + + await worker.Start(); + + wc.Verify( + t => t.Serve(null, null, It.IsAny()), Times.Once); + } + + [Fact] + public async void TestScheduleWorkerStartsWithErrors() + { + Middleware middleware = (ctx, next) => + { + throw new ApplicationException("Expected test exception!"); + }; + + var registration = new RegistrationRequest + { + Api = "api-name", + Path = "/", + }; + + var mockClientMessage = new FakeClientStreamWriter(); + + var body = ByteString.CopyFromUtf8("{\"name\":\"John Smith\",\"age\":21,\"contacts\":[\"john.smith@email.com\"]}"); + + var responseStream = new FakeAsyncStreamReader( + new List + { + new ServerMessage { Id = "id-1", RegistrationResponse = new RegistrationResponse { }}, + new ServerMessage { Id = "id-2", HttpRequest = new Proto.Apis.v1.HttpRequest { Body = body} }, + } + ); + + var resp = new AsyncDuplexStreamingCall(mockClientMessage, responseStream, null, null, null, null); + + Mock wc = new Mock(); + wc.Setup(e => + e.Serve(null, null, It.IsAny())) + .Returns(resp); + + var worker = new ApiWorker(registration, middleware) + { + GrpcClient = wc.Object + }; + + await worker.Start(); + + wc.Verify( + t => t.Serve(null, null, It.IsAny()), Times.Once); + } + } +} \ No newline at end of file diff --git a/test/Nitric.Sdk.Test/Worker/BlobEventWorker.cs b/test/Nitric.Sdk.Test/Worker/BlobEventWorker.cs new file mode 100644 index 0000000..f48f3c0 --- /dev/null +++ b/test/Nitric.Sdk.Test/Worker/BlobEventWorker.cs @@ -0,0 +1,203 @@ +using System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Grpc.Core; +using Moq; +using Nitric.Proto.Storage.v1; +using Nitric.Sdk.Service; +using Nitric.Sdk.Worker; +using Xunit; + +using GrpcClient = Nitric.Proto.Storage.v1.StorageListener.StorageListenerClient; + +namespace Nitric.Sdk.Test.Worker +{ + public class BlobEventWorkerTest + { + [Fact] + public void TestBlobEventWorkerBuildWithMiddleware() + { + Func> middleware = async (ctx) => + { + return await Task.FromResult(ctx); + }; + + var registration = new RegistrationRequest + { + BucketName = "bucket-name", + BlobEventType = Proto.Storage.v1.BlobEventType.Created, + }; + + var worker = new BlobEventWorker(registration, middleware); + + Assert.NotNull(worker); + } + + [Fact] + public void TestBlobEventWorkerBuildWithMultipleMiddleware() + { + Middleware middleware = async (ctx, next) => + { + return await next(ctx); + }; + + var registration = new RegistrationRequest + { + BucketName = "bucket-name", + BlobEventType = Proto.Storage.v1.BlobEventType.Created, + }; + + var worker = new BlobEventWorker(registration, middleware, middleware); + + Assert.NotNull(worker); + } + + [Fact] + public void TestBlobEventWorkerBuildWithNoMiddleware() + { + Middleware middleware = async (ctx, next) => + { + return await next(ctx); + }; + + var registration = new RegistrationRequest + { + BucketName = "bucket-name", + BlobEventType = Proto.Storage.v1.BlobEventType.Created, + }; + + Assert.Throws(() => + { + var worker = new BlobEventWorker(registration); + }); + } + + [Fact] + public async void TestBlobEventWorkerStartCreated() + { + Middleware middleware = async (ctx, next) => + { + Assert.Equal("test-file", ctx.Req.Key); + Assert.Equal(Service.BlobEventType.Write, ctx.Req.NotificationType); + return await next(ctx); + }; + + var registration = new RegistrationRequest + { + BucketName = "BlobEvent-name", + BlobEventType = Proto.Storage.v1.BlobEventType.Created, + }; + + var mockClientMessage = new FakeClientStreamWriter(); + + var responseStream = new FakeAsyncStreamReader( + new List + { + new ServerMessage { Id = "id-1", RegistrationResponse = new RegistrationResponse { }}, + new ServerMessage { Id = "id-2", BlobEventRequest = new Proto.Storage.v1.BlobEventRequest { BucketName = "bucket-name", BlobEvent = new BlobEvent { Key="test-file", Type=Proto.Storage.v1.BlobEventType.Created} } }, } + ); + + var resp = new AsyncDuplexStreamingCall(mockClientMessage, responseStream, null, null, null, null); + + Mock wc = new Mock(); + wc.Setup(e => + e.Listen(null, null, It.IsAny())) + .Returns(resp); + + var worker = new BlobEventWorker(registration, middleware) + { + GrpcClient = wc.Object + }; + + await worker.Start(); + + wc.Verify( + t => t.Listen(null, null, It.IsAny()), Times.Once); + } + + [Fact] + public async void TestBlobEventWorkerStartDeleted() + { + Middleware middleware = async (ctx, next) => + { + Assert.Equal("test-file", ctx.Req.Key); + Assert.Equal(Service.BlobEventType.Delete, ctx.Req.NotificationType); + return await next(ctx); + }; + + var registration = new RegistrationRequest + { + BucketName = "BlobEvent-name", + BlobEventType = Proto.Storage.v1.BlobEventType.Created, + }; + + var mockClientMessage = new FakeClientStreamWriter(); + + var responseStream = new FakeAsyncStreamReader( + new List + { + new ServerMessage { Id = "id-1", RegistrationResponse = new RegistrationResponse { }}, + new ServerMessage { Id = "id-2", BlobEventRequest = new Proto.Storage.v1.BlobEventRequest { BucketName = "bucket-name", BlobEvent = new BlobEvent { Key="test-file", Type=Proto.Storage.v1.BlobEventType.Deleted} } }, } + ); + + var resp = new AsyncDuplexStreamingCall(mockClientMessage, responseStream, null, null, null, null); + + Mock wc = new Mock(); + wc.Setup(e => + e.Listen(null, null, It.IsAny())) + .Returns(resp); + + var worker = new BlobEventWorker(registration, middleware) + { + GrpcClient = wc.Object + }; + + await worker.Start(); + + wc.Verify( + t => t.Listen(null, null, It.IsAny()), Times.Once); + } + + [Fact] + public async void TestBlobEventWorkerStartsWithErrors() + { + Middleware middleware = (ctx, next) => + { + throw new ApplicationException("Expected test exception!"); + }; + + var registration = new RegistrationRequest + { + BucketName = "BlobEvent-name", + BlobEventType = Proto.Storage.v1.BlobEventType.Created, + }; + + var mockClientMessage = new FakeClientStreamWriter(); + + var responseStream = new FakeAsyncStreamReader( + new List + { + new ServerMessage { Id = "id-1", RegistrationResponse = new RegistrationResponse { }}, + new ServerMessage { Id = "id-2", BlobEventRequest = new Proto.Storage.v1.BlobEventRequest { BucketName = "bucket-name", BlobEvent = new BlobEvent { Key="test-file", Type=Proto.Storage.v1.BlobEventType.Created} } }, } + ); + + var resp = new AsyncDuplexStreamingCall(mockClientMessage, responseStream, null, null, null, null); + + Mock wc = new Mock(); + wc.Setup(e => + e.Listen(null, null, It.IsAny())) + .Returns(resp); + + var worker = new BlobEventWorker(registration, middleware) + { + GrpcClient = wc.Object + }; + + await worker.Start(); + + wc.Verify( + t => t.Listen(null, null, It.IsAny()), Times.Once); + } + } +} \ No newline at end of file diff --git a/test/Nitric.Sdk.Test/Worker/FileEventWorker.cs b/test/Nitric.Sdk.Test/Worker/FileEventWorker.cs new file mode 100644 index 0000000..cefd925 --- /dev/null +++ b/test/Nitric.Sdk.Test/Worker/FileEventWorker.cs @@ -0,0 +1,216 @@ +using System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Grpc.Core; +using Moq; +using Nitric.Proto.Storage.v1; +using Nitric.Sdk.Service; +using Nitric.Sdk.Storage; +using Nitric.Sdk.Worker; +using Xunit; + +using GrpcClient = Nitric.Proto.Storage.v1.StorageListener.StorageListenerClient; + +namespace Nitric.Sdk.Test.Worker +{ + public class FileEventWorkerTest + { + [Fact] + public void TestFileEventWorkerBuildWithMiddleware() + { + Func> middleware = async (ctx) => + { + return await Task.FromResult(ctx); + }; + + var registration = new RegistrationRequest + { + BucketName = "bucket-name", + BlobEventType = Proto.Storage.v1.BlobEventType.Created, + }; + + var bucket = new Bucket("bucket-name"); + + var worker = new FileEventWorker(registration, bucket, middleware); + + Assert.NotNull(worker); + } + + [Fact] + public void TestFileEventWorkerBuildWithMultipleMiddleware() + { + Middleware middleware = async (ctx, next) => + { + return await next(ctx); + }; + + var registration = new RegistrationRequest + { + BucketName = "bucket-name", + BlobEventType = Proto.Storage.v1.BlobEventType.Created, + }; + + var bucket = new Bucket("bucket-name"); + + var worker = new FileEventWorker(registration, bucket, middleware, middleware); + + Assert.NotNull(worker); + } + + [Fact] + public void TestFileEventWorkerBuildWithNoMiddleware() + { + Middleware middleware = async (ctx, next) => + { + return await next(ctx); + }; + + var registration = new RegistrationRequest + { + BucketName = "bucket-name", + BlobEventType = Proto.Storage.v1.BlobEventType.Created, + }; + + var bucket = new Bucket("bucket-name"); + + Assert.Throws(() => + { + var worker = new FileEventWorker(registration, bucket); + }); + } + + [Fact] + public async void TestFileEventWorkerStartCreated() + { + Middleware middleware = async (ctx, next) => + { + Assert.Equal("test-file", ctx.Req.File.Name); + Assert.Equal(Service.BlobEventType.Write, ctx.Req.NotificationType); + return await next(ctx); + }; + + var registration = new RegistrationRequest + { + BucketName = "BlobEvent-name", + BlobEventType = Proto.Storage.v1.BlobEventType.Created, + }; + + var mockClientMessage = new FakeClientStreamWriter(); + + var responseStream = new FakeAsyncStreamReader( + new List + { + new ServerMessage { Id = "id-1", RegistrationResponse = new RegistrationResponse { }}, + new ServerMessage { Id = "id-2", BlobEventRequest = new Proto.Storage.v1.BlobEventRequest { BucketName = "bucket-name", BlobEvent = new BlobEvent { Key="test-file", Type=Proto.Storage.v1.BlobEventType.Created} } }, } + ); + + var resp = new AsyncDuplexStreamingCall(mockClientMessage, responseStream, null, null, null, null); + + Mock wc = new Mock(); + wc.Setup(e => + e.Listen(null, null, It.IsAny())) + .Returns(resp); + + var bucket = new Bucket("bucket-name"); + + var worker = new FileEventWorker(registration, bucket, middleware) + { + GrpcClient = wc.Object + }; + + await worker.Start(); + + wc.Verify( + t => t.Listen(null, null, It.IsAny()), Times.Once); + } + + [Fact] + public async void TestFileEventWorkerStartDeleted() + { + Middleware middleware = async (ctx, next) => + { + Assert.Equal("test-file", ctx.Req.File.Name); + Assert.Equal(Service.BlobEventType.Delete, ctx.Req.NotificationType); + return await next(ctx); + }; + + var registration = new RegistrationRequest + { + BucketName = "BlobEvent-name", + BlobEventType = Proto.Storage.v1.BlobEventType.Created, + }; + + var mockClientMessage = new FakeClientStreamWriter(); + + var responseStream = new FakeAsyncStreamReader( + new List + { + new ServerMessage { Id = "id-1", RegistrationResponse = new RegistrationResponse { }}, + new ServerMessage { Id = "id-2", BlobEventRequest = new Proto.Storage.v1.BlobEventRequest { BucketName = "bucket-name", BlobEvent = new BlobEvent { Key="test-file", Type=Proto.Storage.v1.BlobEventType.Deleted} } }, } + ); + + var resp = new AsyncDuplexStreamingCall(mockClientMessage, responseStream, null, null, null, null); + + Mock wc = new Mock(); + wc.Setup(e => + e.Listen(null, null, It.IsAny())) + .Returns(resp); + + var bucket = new Bucket("bucket-name"); + + var worker = new FileEventWorker(registration, bucket, middleware) + { + GrpcClient = wc.Object + }; + + await worker.Start(); + + wc.Verify( + t => t.Listen(null, null, It.IsAny()), Times.Once); + } + + [Fact] + public async void TestFileEventWorkerStartsWithErrors() + { + Middleware middleware = (ctx, next) => + { + throw new ApplicationException("Expected test exception!"); + }; + + var registration = new RegistrationRequest + { + BucketName = "BlobEvent-name", + BlobEventType = Proto.Storage.v1.BlobEventType.Created, + }; + + var mockClientMessage = new FakeClientStreamWriter(); + + var responseStream = new FakeAsyncStreamReader( + new List + { + new ServerMessage { Id = "id-1", RegistrationResponse = new RegistrationResponse { }}, + new ServerMessage { Id = "id-2", BlobEventRequest = new Proto.Storage.v1.BlobEventRequest { BucketName = "bucket-name", BlobEvent = new BlobEvent { Key="test-file", Type=Proto.Storage.v1.BlobEventType.Created} } }, } + ); + + var resp = new AsyncDuplexStreamingCall(mockClientMessage, responseStream, null, null, null, null); + + Mock wc = new Mock(); + wc.Setup(e => + e.Listen(null, null, It.IsAny())) + .Returns(resp); + + var bucket = new Bucket("bucket-name"); + + var worker = new FileEventWorker(registration, bucket, middleware) + { + GrpcClient = wc.Object + }; + + await worker.Start(); + + wc.Verify( + t => t.Listen(null, null, It.IsAny()), Times.Once); + } + } +} \ No newline at end of file diff --git a/test/Nitric.Sdk.Test/Worker/JobWorkerTest.cs b/test/Nitric.Sdk.Test/Worker/JobWorkerTest.cs new file mode 100644 index 0000000..25add62 --- /dev/null +++ b/test/Nitric.Sdk.Test/Worker/JobWorkerTest.cs @@ -0,0 +1,199 @@ +using System; +using System.Collections.Generic; +using System.Threading; +using Grpc.Core; +using Moq; +using Nitric.Sdk.Service; +using Nitric.Sdk.Worker; +using Nitric.Proto.Batch.v1; +using Xunit; + +using GrpcClient = Nitric.Proto.Batch.v1.Job.JobClient; +using Nitric.Sdk.Common; +using System.Threading.Tasks; + +namespace Nitric.Sdk.Test.Worker +{ + public class TestSubmission + { + public int Id { get; set; } + public string Message { get; set; } + public List Tags { get; set; } + } + + public class JobWorkerTest + { + [Fact] + public void TestJobWorkerBuildWithMiddleware() + { + Func, Task>> middleware = async (ctx) => + { + return await Task.FromResult(ctx); + }; + + var registration = new RegistrationRequest + { + JobName = "job-name", + }; + + var worker = new JobWorker(registration, middleware); + + Assert.NotNull(worker); + } + + [Fact] + public void TestJobWorkerBuildWithMultipleMiddleware() + { + Middleware> middleware = async (ctx, next) => + { + return await next(ctx); + }; + + var registration = new RegistrationRequest + { + JobName = "job-name" + }; + + var worker = new JobWorker(registration, middleware, middleware); + + Assert.NotNull(worker); + } + + [Fact] + public void TestJobWorkerBuildWithNoMiddleware() + { + Middleware> middleware = async (ctx, next) => + { + return await next(ctx); + }; + + var registration = new RegistrationRequest + { + JobName = "job-name", + }; + + Assert.Throws(() => + { + var worker = new JobWorker(registration); + }); + } + + [Fact] + public async void TestJobWorkerStart() + { + var testSubmission = new TestSubmission + { + Id = 1234, + Message = "this seems like a good test message", + Tags = new List { "message", "test" } + }; + + var jobRequest = new JobRequest + { + JobName = "schedule-name", + Data = new JobData + { + Struct = Struct.FromJsonSerializable(testSubmission), + } + }; + + Middleware> middleware = (ctx, next) => + { + Assert.Equal("job-name", ctx.Req.JobName); + Assert.Equal(1234, ctx.Req.Data.Id); + Assert.Equal("this seems like a good test message", ctx.Req.Data.Message); + Assert.Equal(new List { "message", "test" }, ctx.Req.Data.Tags); + return next(ctx); + }; + + var registration = new RegistrationRequest + { + JobName = "job-name", + }; + + var mockClientMessage = new FakeClientStreamWriter(); + + var responseStream = new FakeAsyncStreamReader( + new List + { + new ServerMessage { Id = "id-1", RegistrationResponse = new RegistrationResponse { }}, + new ServerMessage { Id = "id-2", JobRequest = jobRequest }, + } + ); + + var resp = new AsyncDuplexStreamingCall(mockClientMessage, responseStream, null, null, null, null); + + Mock wc = new Mock(); + wc.Setup(e => + e.HandleJob(null, null, It.IsAny())) + .Returns(resp); + + var worker = new JobWorker(registration, middleware) + { + GrpcClient = wc.Object + }; + + await worker.Start(); + + wc.Verify( + t => t.HandleJob(null, null, It.IsAny()), Times.Once); + } + + [Fact] + public async void TestJobWorkerStartsWithErrors() + { + var testSubmission = new TestSubmission + { + Id = 1234, + Message = "this seems like a good test message", + Tags = new List { "message", "test" } + }; + + var jobRequest = new JobRequest + { + JobName = "schedule-name", + Data = new JobData + { + Struct = Struct.FromJsonSerializable(testSubmission), + } + }; + + Middleware> middleware = (ctx, next) => + { + throw new ApplicationException("Expected test exception!"); + }; + + var registration = new RegistrationRequest + { + JobName = "job-name", + }; + + var mockClientMessage = new FakeClientStreamWriter(); + + var responseStream = new FakeAsyncStreamReader( + new List + { + new ServerMessage { Id = "id-1", RegistrationResponse = new RegistrationResponse { }}, + new ServerMessage { Id = "id-2", JobRequest = jobRequest }, + } + ); + + var resp = new AsyncDuplexStreamingCall(mockClientMessage, responseStream, null, null, null, null); + + Mock wc = new Mock(); + wc.Setup(e => + e.HandleJob(null, null, It.IsAny())) + .Returns(resp); + + var worker = new JobWorker(registration, middleware) + { + GrpcClient = wc.Object + }; + + await worker.Start(); + + wc.Verify( + t => t.HandleJob(null, null, It.IsAny()), Times.Once); + } + } +} \ No newline at end of file diff --git a/test/Nitric.Sdk.Test/Worker/ScheduleWorkerTest.cs b/test/Nitric.Sdk.Test/Worker/ScheduleWorkerTest.cs new file mode 100644 index 0000000..ec6195c --- /dev/null +++ b/test/Nitric.Sdk.Test/Worker/ScheduleWorkerTest.cs @@ -0,0 +1,161 @@ +using System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Grpc.Core; +using Moq; +using Nitric.Proto.Schedules.v1; +using Nitric.Sdk.Service; +using Nitric.Sdk.Worker; +using Xunit; + +using GrpcClient = Nitric.Proto.Schedules.v1.Schedules.SchedulesClient; + +namespace Nitric.Sdk.Test.Worker +{ + public class ScheduleWorkerTest + { + [Fact] + public void TestScheduleWorkerBuildWithMiddleware() + { + Func> middleware = async (ctx) => + { + return await Task.FromResult(ctx); + }; + + var registration = new RegistrationRequest + { + ScheduleName = "schedule-name", + Cron = new ScheduleCron { Expression = "* * * * *" } + }; + + var worker = new ScheduleWorker(registration, middleware); + + Assert.NotNull(worker); + } + + [Fact] + public void TestScheduleWorkerBuildWithMultipleMiddleware() + { + Middleware middleware = async (ctx, next) => + { + return await next(ctx); + }; + + var registration = new RegistrationRequest + { + ScheduleName = "schedule-name", + Cron = new ScheduleCron { Expression = "* * * * *" } + }; + + var worker = new ScheduleWorker(registration, middleware, middleware); + + Assert.NotNull(worker); + } + + [Fact] + public void TestScheduleWorkerBuildWithNoMiddleware() + { + Middleware middleware = async (ctx, next) => + { + return await next(ctx); + }; + + var registration = new RegistrationRequest + { + ScheduleName = "schedule-name", + Cron = new ScheduleCron { Expression = "* * * * *" } + }; + + Assert.Throws(() => + { + var worker = new ScheduleWorker(registration); + }); + } + + [Fact] + public async void TestScheduleWorkerStart() + { + Middleware middleware = async (ctx, next) => + { + Assert.Equal("schedule-name", ctx.Req.ScheduleName); + return await next(ctx); + }; + + var registration = new RegistrationRequest + { + ScheduleName = "schedule-name", + Cron = new ScheduleCron { Expression = "* * * * *" } + }; + + var mockClientMessage = new FakeClientStreamWriter(); + + var responseStream = new FakeAsyncStreamReader( + new List + { + new ServerMessage { Id = "id-1", RegistrationResponse = new RegistrationResponse { }}, + new ServerMessage { Id = "id-2", IntervalRequest = new Proto.Schedules.v1.IntervalRequest { ScheduleName = "schedule-name" } }, + } + ); + + var resp = new AsyncDuplexStreamingCall(mockClientMessage, responseStream, null, null, null, null); + + Mock wc = new Mock(); + wc.Setup(e => + e.Schedule(null, null, It.IsAny())) + .Returns(resp); + + var worker = new ScheduleWorker(registration, middleware) + { + GrpcClient = wc.Object + }; + + await worker.Start(); + + wc.Verify( + t => t.Schedule(null, null, It.IsAny()), Times.Once); + } + + [Fact] + public async void TestScheduleWorkerStartsWithErrors() + { + Middleware middleware = (ctx, next) => + { + throw new ApplicationException("Expected test exception!"); + }; + + var registration = new RegistrationRequest + { + ScheduleName = "schedule-name", + Cron = new ScheduleCron { Expression = "* * * * *" } + }; + + var mockClientMessage = new FakeClientStreamWriter(); + + var responseStream = new FakeAsyncStreamReader( + new List + { + new ServerMessage { Id = "id-1", RegistrationResponse = new RegistrationResponse { }}, + new ServerMessage { Id = "id-2", IntervalRequest = new Proto.Schedules.v1.IntervalRequest { ScheduleName = "schedule-name" } }, + } + ); + + var resp = new AsyncDuplexStreamingCall(mockClientMessage, responseStream, null, null, null, null); + + Mock wc = new Mock(); + wc.Setup(e => + e.Schedule(null, null, It.IsAny())) + .Returns(resp); + + var worker = new ScheduleWorker(registration, middleware) + { + GrpcClient = wc.Object + }; + + await worker.Start(); + + wc.Verify( + t => t.Schedule(null, null, It.IsAny()), Times.Once); + } + } +} \ No newline at end of file diff --git a/test/Nitric.Sdk.Test/Worker/SubscriptionWorkerTest.cs b/test/Nitric.Sdk.Test/Worker/SubscriptionWorkerTest.cs new file mode 100644 index 0000000..69c625f --- /dev/null +++ b/test/Nitric.Sdk.Test/Worker/SubscriptionWorkerTest.cs @@ -0,0 +1,193 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Threading; +using System.Threading.Tasks; +using Grpc.Core; +using Moq; +using Nitric.Proto.Topics.v1; +using Nitric.Sdk.Common; +using Nitric.Sdk.Service; +using Nitric.Sdk.Worker; +using Xunit; + +using GrpcClient = Nitric.Proto.Topics.v1.Subscriber.SubscriberClient; + +namespace Nitric.Sdk.Test.Worker +{ + public class TestProfile + { + public string Name { get; set; } + public int Age { get; set; } + public List Contacts { get; set; } + + } + public class SubscriptionWorkerTest + { + [Fact] + public void TestSubscriptionWorkerBuildWithMiddleware() + { + Func, Task>> middleware = async (ctx) => + { + return await Task.FromResult(ctx); + }; + + var registration = new RegistrationRequest + { + TopicName = "topic-name", + }; + + var worker = new SubscriptionWorker(registration, middleware); + + Assert.NotNull(worker); + } + + [Fact] + public void TestSubscriptionWorkerBuildWithMultipleMiddleware() + { + Middleware> middleware = async (ctx, next) => + { + return await next(ctx); + }; + + var registration = new RegistrationRequest + { + TopicName = "topic-name", + }; + + var worker = new SubscriptionWorker(registration, middleware, middleware); + + Assert.NotNull(worker); + } + + [Fact] + public void TestSubscriptionWorkerBuildWithNoMiddleware() + { + var registration = new RegistrationRequest + { + TopicName = "topic-name", + }; + + Assert.Throws(() => + { + var worker = new SubscriptionWorker(registration); + }); + } + + [Fact] + public async void TestSubscriptionWorkerStart() + { + Middleware> middleware = async (ctx, next) => + { + Assert.Equal("topic-name", ctx.Req.TopicName); + Assert.Equal("John Smith", ctx.Req.Message.Name); + Assert.Equal(21, ctx.Req.Message.Age); + Assert.Equal("john.smith@email.com", ctx.Req.Message.Contacts[0]); + return await next(ctx); + }; + + var registration = new RegistrationRequest + { + TopicName = "topic-name", + }; + + var mockClientMessage = new FakeClientStreamWriter(); + + var responseStream = new FakeAsyncStreamReader( + new List + { + new ServerMessage { Id = "id-1", RegistrationResponse = new RegistrationResponse() }, + new ServerMessage + { + Id = "id-2", MessageRequest = new MessageRequest + { + TopicName = "topic-name", + Message = new TopicMessage + { + StructPayload = Struct.FromJsonSerializable(new TestProfile + { + Name = "John Smith", + Age = 21, + Contacts = new List { "john.smith@email.com" }, + }) + }, + }, + }, + } + ); + + var resp = new AsyncDuplexStreamingCall(mockClientMessage, responseStream, null, null, null, null); + + Mock wc = new Mock(); + wc.Setup(e => + e.Subscribe(null, null, It.IsAny())) + .Returns(resp); + + var worker = new SubscriptionWorker(registration, middleware) + { + GrpcClient = wc.Object + }; + + await worker.Start(); + + wc.Verify( + t => t.Subscribe(null, null, It.IsAny()), Times.Once); + } + + [Fact] + public async void TestSubscriptionWorkerStartsWithErrors() + { + Middleware> middleware = (ctx, next) => + { + throw new ApplicationException("Expected test exception!"); + }; + + var registration = new RegistrationRequest + { + TopicName = "topic-name", + }; + + var mockClientMessage = new FakeClientStreamWriter(); + + var responseStream = new FakeAsyncStreamReader( + new List + { + new ServerMessage { Id = "id-1", RegistrationResponse = new RegistrationResponse { }}, + new ServerMessage + { + Id = "id-2", MessageRequest = new MessageRequest + { + TopicName = "schedule-name", + Message = new TopicMessage + { + StructPayload = Struct.FromJsonSerializable(new TestProfile + { + Name = "John Smith", + Age = 21, + Contacts = new List { "john.smith@email.com" }, + }) + }, + }, + }, + } + ); + + var resp = new AsyncDuplexStreamingCall(mockClientMessage, responseStream, null, null, null, null); + + Mock wc = new Mock(); + wc.Setup(e => + e.Subscribe(null, null, It.IsAny())) + .Returns(resp); + + var worker = new SubscriptionWorker(registration, middleware) + { + GrpcClient = wc.Object + }; + + await worker.Start(); + + wc.Verify( + t => t.Subscribe(null, null, It.IsAny()), Times.Once); + } + } +} \ No newline at end of file diff --git a/test/Nitric.Sdk.Test/Worker/WebsocketWorkerTest.cs b/test/Nitric.Sdk.Test/Worker/WebsocketWorkerTest.cs new file mode 100644 index 0000000..7b16014 --- /dev/null +++ b/test/Nitric.Sdk.Test/Worker/WebsocketWorkerTest.cs @@ -0,0 +1,175 @@ +using System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Grpc.Core; +using Moq; +using Nitric.Proto.Websockets.v1; +using Nitric.Sdk.Service; +using Nitric.Sdk.Worker; +using Xunit; + +using GrpcClient = Nitric.Proto.Websockets.v1.WebsocketHandler.WebsocketHandlerClient; + +namespace Nitric.Sdk.Test.Worker +{ + public class WebsocketWorkerTest + { + [Fact] + public void TestWebsocketWorkerBuildWithMiddleware() + { + Func> middleware = async (ctx) => + { + return await Task.FromResult(ctx); + }; + + var registration = new RegistrationRequest + { + SocketName = "websocket-name", + }; + + var worker = new WebsocketWorker(registration, middleware); + + Assert.NotNull(worker); + } + + [Fact] + public void TestWebsocketWorkerBuildWithMultipleMiddleware() + { + Middleware middleware = async (ctx, next) => + { + return await next(ctx); + }; + + var registration = new RegistrationRequest + { + SocketName = "websocket-name", + }; + + var worker = new WebsocketWorker(registration, middleware, middleware); + + Assert.NotNull(worker); + } + + [Fact] + public void TestWebsocketWorkerBuildWithNoMiddleware() + { + Middleware middleware = async (ctx, next) => + { + return await next(ctx); + }; + + var registration = new RegistrationRequest + { + SocketName = "websocket-name", + }; + + Assert.Throws(() => + { + var worker = new WebsocketWorker(registration); + }); + } + + [Fact] + public async void TestWebsocketWorkerStart() + { + Middleware middleware = async (ctx, next) => + { + Assert.Equal("websocket-name", ctx.Req.SocketName); + Assert.Equal("connection-1234", ctx.Req.ConnectionId); + return await next(ctx); + }; + + var registration = new RegistrationRequest + { + SocketName = "websocket-name", + }; + + var mockClientMessage = new FakeClientStreamWriter(); + + var responseStream = new FakeAsyncStreamReader( + new List + { + new ServerMessage { Id = "id-1", RegistrationResponse = new RegistrationResponse { }}, + new ServerMessage + { + Id = "id-2", + WebsocketEventRequest = new WebsocketEventRequest + { + SocketName = "websocket-name", + ConnectionId = "connection-1234", + Connection = new WebsocketConnectionEvent() + }, + }, + } + ); + + var resp = new AsyncDuplexStreamingCall(mockClientMessage, responseStream, null, null, null, null); + + Mock wc = new Mock(); + wc.Setup(e => + e.HandleEvents(null, null, It.IsAny())) + .Returns(resp); + + var worker = new WebsocketWorker(registration, middleware) + { + GrpcClient = wc.Object + }; + + await worker.Start(); + + wc.Verify( + t => t.HandleEvents(null, null, It.IsAny()), Times.Once); + } + + [Fact] + public async void TestWebsocketWorkerStartsWithErrors() + { + Middleware middleware = (ctx, next) => + { + throw new ApplicationException("Expected test exception!"); + }; + + var registration = new RegistrationRequest + { + SocketName = "websocket-name", + }; + + var mockClientMessage = new FakeClientStreamWriter(); + + var responseStream = new FakeAsyncStreamReader( + new List + { + new ServerMessage { Id = "id-1", RegistrationResponse = new RegistrationResponse { }}, + new ServerMessage + { + Id = "id-2", + WebsocketEventRequest = new WebsocketEventRequest + { + SocketName = "websocket-name", + ConnectionId = "connection-1234", + Connection = new WebsocketConnectionEvent() + }, + }, + } + ); + + var resp = new AsyncDuplexStreamingCall(mockClientMessage, responseStream, null, null, null, null); + + Mock wc = new Mock(); + wc.Setup(e => + e.HandleEvents(null, null, It.IsAny())) + .Returns(resp); + + var worker = new WebsocketWorker(registration, middleware) + { + GrpcClient = wc.Object + }; + + await worker.Start(); + + wc.Verify( + t => t.HandleEvents(null, null, It.IsAny()), Times.Once); + } + } +} \ No newline at end of file diff --git a/test/Nitric.Sdk.Test/examples/ExamplesTest.cs b/test/Nitric.Sdk.Test/examples/ExamplesTest.cs deleted file mode 100644 index 411eccd..0000000 --- a/test/Nitric.Sdk.Test/examples/ExamplesTest.cs +++ /dev/null @@ -1,330 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -using Moq; -using Examples; -using Nitric.Proto.Document.v1; -using Nitric.Proto.Event.v1; -using Nitric.Proto.Queue.v1; -using Nitric.Proto.Secret.v1; -using Nitric.Proto.Storage.v1; -using Grpc.Core; -using Google.Protobuf.WellKnownTypes; -using Xunit; -using System.Collections.Generic; -using Google.Protobuf.Collections; -using System; -using Nitric.Sdk.Common.Util; -using Environment = System.Environment; - -[assembly: CollectionBehavior(DisableTestParallelization = true)] - -namespace Nitric.Test.Examples -{ - [Collection("Examples")] - public class DocumentsExamplesTest : IDisposable - { - private readonly Server server; - private readonly Mock mockServer; - - public DocumentsExamplesTest() - { - var value = new Value - { - StringValue = "document" - }; - - var content = new Struct(); - content.Fields.Add("test", value); - - var document = new Document - { - Content = content, - }; - var documentGetResponse = new DocumentGetResponse - { - Document = document, - }; - - //Setup a mock server for the snippets to hit - mockServer = new Mock(); - mockServer.Setup(e => e.Delete(It.IsAny(), It.IsAny())) - .ReturnsAsync(new DocumentDeleteResponse()) - .Verifiable(); - mockServer.Setup(e => e.Get(It.IsAny(), It.IsAny())) - .ReturnsAsync(documentGetResponse) - .Verifiable(); - mockServer.Setup(e => e.Set(It.IsAny(), It.IsAny())) - .ReturnsAsync(new DocumentSetResponse()) - .Verifiable(); - mockServer.Setup(e => e.Query(It.IsAny(), It.IsAny())) - .ReturnsAsync(new DocumentQueryResponse()) - .Verifiable(); - this.server = new Server - { - Services = { DocumentService.BindService(mockServer.Object) }, - Ports = { new ServerPort("localhost", 50051, ServerCredentials.Insecure) } - }; - server.Start(); - } - - [Fact] - public void TestDocumentExamples() - { - //Call functions - DeleteExample.DeleteFile(); - GetExample.GetFile(); - SetExample.SetFile(); - PagedResultsExample.PagedResults(); - QueryExample.Query(); - QueryFilterExample.QueryFilter(); - QueryLimitsExample.QueryLimits(); - SubDocQueryExample.QueryDocCol(); - } - - public void Dispose() - { - //Verify all the functions were called - mockServer.Verify(e => e.Delete(It.IsAny(), It.IsAny()), - Times.Once); - mockServer.Verify(e => e.Get(It.IsAny(), It.IsAny()), Times.Once); - mockServer.Verify(e => e.Set(It.IsAny(), It.IsAny()), Times.Once); - mockServer.Verify(e => e.Query(It.IsAny(), It.IsAny()), - Times.Exactly(6)); - - this.server.KillAsync().Wait(); - } - } - - [Collection("Examples")] - public class EventsExamplesTest : IDisposable - { - private Server server; - private Mock mockServer; - - public EventsExamplesTest() - { - //Setup a mock server for the snippets to hit - Environment.SetEnvironmentVariable("SERVICE_ADDRESS", "127.0.0.1:50052"); - mockServer = new Mock(); - mockServer.Setup(e => e.Publish(It.IsAny(), It.IsAny())) - .ReturnsAsync(new EventPublishResponse()) - .Verifiable(); - this.server = new Server - { - Services = { EventService.BindService(mockServer.Object) }, - Ports = { new ServerPort("localhost", 50052, ServerCredentials.Insecure) } - }; - server.Start(); - } - - [Fact] - public void TestEventsExample() - { - //Call functions - EventIdsExample.EventIdsTopic(); - PublishExample.PublishTopic(); - - //Verify all the functions were called - mockServer.Verify(e => e.Publish(It.IsAny(), It.IsAny()), - Times.Exactly(2)); - } - - public void Dispose() - { - //Verify all the functions were called - mockServer.Verify(e => e.Publish(It.IsAny(), It.IsAny()), - Times.Exactly(2)); - - this.server.KillAsync().Wait(); - } - } - - [Collection("Examples")] - public class QueuesExamplesTest : IDisposable - { - private readonly Server server; - private readonly Mock mockServer = null; - - public QueuesExamplesTest() - { - var taskToReturn = new NitricTask - { - Id = "32", - LeaseId = "1", - Payload = Utils.ObjToStruct(new Dictionary()), - PayloadType = "Dictionary" - }; - - var tasks = new RepeatedField { taskToReturn }; - - var queueReceiveResponse = new QueueReceiveResponse(); - queueReceiveResponse.Tasks.AddRange(tasks); - - //Setup a mock server for the snippets to hit - mockServer = new Mock(); - mockServer.Setup(e => e.Send(It.IsAny(), It.IsAny())) - .ReturnsAsync(new QueueSendResponse()) - .Verifiable(); - mockServer.Setup(e => e.Receive(It.IsAny(), It.IsAny())) - .ReturnsAsync(queueReceiveResponse) - .Verifiable(); - mockServer.Setup(e => e.Complete(It.IsAny(), It.IsAny())) - .ReturnsAsync(new QueueCompleteResponse()) - .Verifiable(); - Environment.SetEnvironmentVariable("SERVICE_ADDRESS", "127.0.0.1:50053"); - this.server = new Server - { - Services = { QueueService.BindService(mockServer.Object) }, - Ports = { new ServerPort("localhost", 50053, ServerCredentials.Insecure) } - }; - server.Start(); - } - - [Fact] - public void TestQueuesExample() - { - //Call functions - ReceiveExample.ReceiveTask(); - SendExample.SendTask(); - } - - public void Dispose() - { - //Verify all the functions were called - mockServer.Verify(e => e.Send(It.IsAny(), It.IsAny()), Times.Once); - mockServer.Verify(e => e.Receive(It.IsAny(), It.IsAny()), - Times.Once); - mockServer.Verify(e => e.Complete(It.IsAny(), It.IsAny()), - Times.Once); - - this.server.KillAsync().Wait(); - } - } - - [Collection("Examples")] - public class SecretsExamplesTest : IDisposable - { - Server server = null; - Mock mockServer = null; - - public SecretsExamplesTest() - { - var secretPutResponse = new SecretPutResponse - { - SecretVersion = new Proto.Secret.v1.SecretVersion - { - Secret = new Proto.Secret.v1.Secret - { - Name = "test-secret", - }, - Version = "test-version", - } - }; - var secretAccessResponse = new SecretAccessResponse - { - SecretVersion = new Proto.Secret.v1.SecretVersion - { - Secret = new Proto.Secret.v1.Secret - { - Name = "test-secret", - }, - Version = "test-version", - } - }; - Environment.SetEnvironmentVariable("SERVICE_ADDRESS", "127.0.0.1:50054"); - //Setup a mock server for the snippets to hit - mockServer = new Mock(); - mockServer.Setup(e => e.Access(It.IsAny(), It.IsAny())) - .ReturnsAsync(secretAccessResponse) - .Verifiable(); - mockServer.Setup(e => e.Put(It.IsAny(), It.IsAny())) - .ReturnsAsync(secretPutResponse) - .Verifiable(); - this.server = new Server - { - Services = { SecretService.BindService(mockServer.Object) }, - Ports = { new ServerPort("localhost", 50054, ServerCredentials.Insecure) } - }; - server.Start(); - } - - [Fact] - public void TestSecretsExample() - { - //Call functions - AccessExample.AccessSecret(); - PutExample.PutSecret(); - } - - public void Dispose() - { - //Verify all the functions were called - mockServer.Verify(e => e.Access(It.IsAny(), It.IsAny()), - Times.Once); - mockServer.Verify(e => e.Put(It.IsAny(), It.IsAny()), Times.Once); - - this.server.KillAsync().Wait(); - } - } - - [Collection("Examples")] - public class StorageExamplesTest : IDisposable - { - Server server = null; - Mock mockServer = null; - - public StorageExamplesTest() - { - //Setup a mock server for the snippets to hit - mockServer = new Mock(); - mockServer.Setup(e => e.Write(It.IsAny(), It.IsAny())) - .ReturnsAsync(new StorageWriteResponse()) - .Verifiable(); - mockServer.Setup(e => e.Read(It.IsAny(), It.IsAny())) - .ReturnsAsync(new StorageReadResponse()) - .Verifiable(); - mockServer.Setup(e => e.Delete(It.IsAny(), It.IsAny())) - .ReturnsAsync(new StorageDeleteResponse()) - .Verifiable(); - Environment.SetEnvironmentVariable("SERVICE_ADDRESS", "127.0.0.1:50055"); - this.server = new Server - { - Services = { StorageService.BindService(mockServer.Object) }, - Ports = { new ServerPort("localhost", 50055, ServerCredentials.Insecure) } - }; - server.Start(); - } - - [Fact] - public void TestStorageExamples() - { - //Call functions - DeleteExamples.DeleteFile(); - ReadExample.ReadFile(); - WriteExample.WriteFile(); - } - - public void Dispose() - { - //Verify all the functions were called - mockServer.Verify(e => e.Write(It.IsAny(), It.IsAny()), Times.Once); - mockServer.Verify(e => e.Read(It.IsAny(), It.IsAny()), Times.Once); - mockServer.Verify(e => e.Delete(It.IsAny(), It.IsAny()), - Times.Once); - - this.server.KillAsync().Wait(); - } - } -} diff --git a/test/Nitric.Sdk.Test/examples/documents/Delete.cs b/test/Nitric.Sdk.Test/examples/documents/Delete.cs deleted file mode 100644 index fd34c79..0000000 --- a/test/Nitric.Sdk.Test/examples/documents/Delete.cs +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// [START import] -using System.Collections.Generic; -using Nitric.Sdk.Document; -// [END import] -namespace Examples -{ - class DeleteExample - { - public static void DeleteFile() - { - // [START snippet] - var docs = new DocumentsClient(); - - var document = docs.Collection>("products").Doc("nitric"); - - document.Delete(); - // [END snippet] - } - } -} diff --git a/test/Nitric.Sdk.Test/examples/documents/Get.cs b/test/Nitric.Sdk.Test/examples/documents/Get.cs deleted file mode 100644 index 25ec3f8..0000000 --- a/test/Nitric.Sdk.Test/examples/documents/Get.cs +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// [START import] -using System.Collections.Generic; -using Nitric.Sdk.Document; -// [END import] -namespace Examples -{ - class GetExample - { - public static void GetFile() - { - // [START snippet] - var docs = new DocumentsClient(); - - var document = docs.Collection>("products").Doc("nitric"); - - var product = document.Get(); - // [END snippet] - } - } -} diff --git a/test/Nitric.Sdk.Test/examples/documents/PagedResults.cs b/test/Nitric.Sdk.Test/examples/documents/PagedResults.cs deleted file mode 100644 index 9624509..0000000 --- a/test/Nitric.Sdk.Test/examples/documents/PagedResults.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// [START import] -using System.Collections.Generic; -using Nitric.Sdk.Document; -// [END import] -namespace Examples -{ - class PagedResultsExample - { - public static void PagedResults() - { - // [START snippet] - var docs = new DocumentsClient(); - - var query = docs.Collection>("Customers") - .Query() - .Where("active", "==", "true") - .Limit(100); - - // Fetch first page - var results = query.Fetch(); - - // Fetch next page - results = query.PagingFrom(results.PagingToken).Fetch(); - // [END snippet] - } - } -} diff --git a/test/Nitric.Sdk.Test/examples/documents/Query.cs b/test/Nitric.Sdk.Test/examples/documents/Query.cs deleted file mode 100644 index 4d7ad10..0000000 --- a/test/Nitric.Sdk.Test/examples/documents/Query.cs +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// [START import] -using System.Collections.Generic; -using Nitric.Sdk.Document; -// [END import] -namespace Examples -{ - class QueryExample - { - public static void Query() - { - // [START snippet] - var docs = new DocumentsClient(); - - var query = docs.Collection>("customers").Query(); - - var results = query.Fetch(); - // [END snippet] - } - } -} diff --git a/test/Nitric.Sdk.Test/examples/documents/QueryFilter.cs b/test/Nitric.Sdk.Test/examples/documents/QueryFilter.cs deleted file mode 100644 index d32dc61..0000000 --- a/test/Nitric.Sdk.Test/examples/documents/QueryFilter.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// [START import] -using System.Collections.Generic; -using Nitric.Sdk.Document; -// [END import] -namespace Examples -{ - class QueryFilterExample - { - public static void QueryFilter() - { - // [START snippet] - var docs = new DocumentsClient(); - - var query = docs.Collection>("Customers").Query() - .Where("country", "==", "US") - .Where("age", ">=", "21"); - - var results = query.Fetch(); - // [END snippet] - } - } -} diff --git a/test/Nitric.Sdk.Test/examples/documents/QueryLimits.cs b/test/Nitric.Sdk.Test/examples/documents/QueryLimits.cs deleted file mode 100644 index e90eaca..0000000 --- a/test/Nitric.Sdk.Test/examples/documents/QueryLimits.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// [START import] -using System.Collections.Generic; -using Nitric.Sdk.Document; -// [END import] -namespace Examples -{ - class QueryLimitsExample - { - public static void QueryLimits() - { - // [START snippet] - var docs = new DocumentsClient(); - - var query = docs.Collection>("Customers") - .Query() - .Limit(1000); - - var results = query.Fetch(); - // [END snippet] - } - } -} diff --git a/test/Nitric.Sdk.Test/examples/documents/Refs.cs b/test/Nitric.Sdk.Test/examples/documents/Refs.cs deleted file mode 100644 index 675dbd0..0000000 --- a/test/Nitric.Sdk.Test/examples/documents/Refs.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// [START import] -using System.Collections.Generic; -using Nitric.Sdk.Document; -// [END import] -namespace Examples -{ - class RefsExample - { - public static void RefDocs() - { - // [START snippet] - var docs = new DocumentsClient(); - - // create a reference to a collection named 'products' - var collection = docs.Collection>("products"); - - // create a reference to a document with the id 'nitric' - var nitric = collection.Doc("nitric"); - // [END snippet] - } - } -} diff --git a/test/Nitric.Sdk.Test/examples/documents/Set.cs b/test/Nitric.Sdk.Test/examples/documents/Set.cs deleted file mode 100644 index 63ad30f..0000000 --- a/test/Nitric.Sdk.Test/examples/documents/Set.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// [START import] -using System.Collections.Generic; -using Nitric.Sdk.Document; -// [END import] -namespace Examples -{ - class SetExample - { - public static void SetFile() - { - // [START snippet] - var docs = new DocumentsClient(); - - var document = docs.Collection>("products").Doc("nitric"); - - var product = new Dictionary(); - product.Add("id", "nitric"); - product.Add("name", "Nitric Framework"); - product.Add("description", "A development framework"); - - document.Set(product); - // [END snippet] - } - } -} diff --git a/test/Nitric.Sdk.Test/examples/documents/SubColQuery.cs b/test/Nitric.Sdk.Test/examples/documents/SubColQuery.cs deleted file mode 100644 index 99c84a6..0000000 --- a/test/Nitric.Sdk.Test/examples/documents/SubColQuery.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/* TEST CURRENTLY WON'T WORK WITHOUT SUBCOLLECTION QUERYS -// [START import] -using System.Collections.Generic; -using Nitric.Api.Document; -// [END import] -namespace DocumentsExamples -{ - class SubColQueryExample - { - public static void QuerySubCol() - { - // [START snippet] - var docs = new Documents(); - - var query = docs.Collection>("customers") - .Collection("Orders") - .Query(); - - var results = query.Fetch(); ; - // [END snippet] - } - } -} -*/ \ No newline at end of file diff --git a/test/Nitric.Sdk.Test/examples/documents/SubDocQuery.cs b/test/Nitric.Sdk.Test/examples/documents/SubDocQuery.cs deleted file mode 100644 index bbbcff1..0000000 --- a/test/Nitric.Sdk.Test/examples/documents/SubDocQuery.cs +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// [START import] -using System.Collections.Generic; -using Nitric.Sdk.Document; -// [END import] -namespace Examples -{ - class SubDocQueryExample - { - public static void QueryDocCol() - { - // [START snippet] - var docs = new DocumentsClient(); - - var query = docs.Collection>("customers") - .Doc("apple") - .Collection("Orders") - .Query(); - - var results = query.Fetch(); - // [END snippet] - } - } -} diff --git a/test/Nitric.Sdk.Test/examples/events/EventIDs.cs b/test/Nitric.Sdk.Test/examples/events/EventIDs.cs deleted file mode 100644 index b5a7364..0000000 --- a/test/Nitric.Sdk.Test/examples/events/EventIDs.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// [START import] - -using System.Collections.Generic; -using Nitric.Sdk.Event; - -// [END import] - -namespace Examples -{ - class EventIdsExample - { - public static void EventIdsTopic() - { - // [START snippet] - //Build the payload - var examplePayload = new Dictionary { { "Content", "of event" } }; - - var topic = new EventsClient().Topic("my-topic"); - - //Publish the topic - topic.Publish(new Event { Id = "1234", Payload = examplePayload }); - // [END snippet] - } - } -} diff --git a/test/Nitric.Sdk.Test/examples/events/Publish.cs b/test/Nitric.Sdk.Test/examples/events/Publish.cs deleted file mode 100644 index 3d38025..0000000 --- a/test/Nitric.Sdk.Test/examples/events/Publish.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// [START import] - -using System.Collections.Generic; -using Nitric.Sdk.Event; - -// [END import] - -namespace Examples -{ - class PublishExample - { - public static void PublishTopic() - { - // [START snippet] - //Build the payload - var examplePayload = new Dictionary(); - examplePayload.Add("Content", "of event"); - - var topic = new EventsClient().Topic("my-topic"); - - //Publish the topic - topic.Publish(new Event { Payload = examplePayload }); - // [END snippet] - } - } -} diff --git a/test/Nitric.Sdk.Test/examples/queues/Receive.cs b/test/Nitric.Sdk.Test/examples/queues/Receive.cs deleted file mode 100644 index 6ce038f..0000000 --- a/test/Nitric.Sdk.Test/examples/queues/Receive.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// [START import] -using Nitric.Sdk.Queue; -// [END import] - -namespace Examples -{ - class ReceiveExample - { - public static void ReceiveTask() - { - // [START snippet] - var queue = new QueuesClient().Queue("my-queue"); - - var tasks = queue.Receive(10); - - foreach (ReceivedTask task in tasks) - { - // Process tasks - - // Complete the task - task.Complete(); - } - // [END snippet] - } - } -} diff --git a/test/Nitric.Sdk.Test/examples/queues/Send.cs b/test/Nitric.Sdk.Test/examples/queues/Send.cs deleted file mode 100644 index 21d2e71..0000000 --- a/test/Nitric.Sdk.Test/examples/queues/Send.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// [START import] - -using Nitric.Sdk.Queue; - -// [END import] - -namespace Examples -{ - class SendExample - { - public static void SendTask() - { - // [START snippet] - var queue = new QueuesClient().Queue("my-queue"); - - var task = new Task { Id = "my-task" }; - - queue.Send(task); - // [END snippet] - } - } -} diff --git a/test/Nitric.Sdk.Test/examples/secrets/Access.cs b/test/Nitric.Sdk.Test/examples/secrets/Access.cs deleted file mode 100644 index 5bf6fba..0000000 --- a/test/Nitric.Sdk.Test/examples/secrets/Access.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// [START import] -using Nitric.Sdk.Secret; -// [END import] -namespace Examples -{ - class AccessExample - { - public static void AccessSecret() - { - // [START snippet] - var secrets = new SecretsClient(); - - var value = secrets.Secret("database.password") - .Latest() - .Access(); - - var password = value.ValueText; - // [END snippet] - } - } -} diff --git a/test/Nitric.Sdk.Test/examples/secrets/Latest.cs b/test/Nitric.Sdk.Test/examples/secrets/Latest.cs deleted file mode 100644 index 53de894..0000000 --- a/test/Nitric.Sdk.Test/examples/secrets/Latest.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// [START import] -using Nitric.Sdk.Secret; -// [END import] -namespace Examples -{ - class LatestExample - { - public static void LatestSecret() - { - // [START snippet] - var secrets = new SecretsClient(); - - var latest = secrets.Secret("database.password").Latest(); - // [END snippet] - } - } -} diff --git a/test/Nitric.Sdk.Test/examples/secrets/Put.cs b/test/Nitric.Sdk.Test/examples/secrets/Put.cs deleted file mode 100644 index bd5c0f1..0000000 --- a/test/Nitric.Sdk.Test/examples/secrets/Put.cs +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// [START import] -using Nitric.Sdk.Secret; -// [END import] -namespace Examples -{ - class PutExample - { - public static void PutSecret() - { - // [START snippet] - var secrets = new SecretsClient(); - - var newPassword = "qxGJp9rWMbYvPEsNFXzukQa!"; - - // Store the new password value, making it the latest version - secrets.Secret("database.password").Put(newPassword); - // [END snippet] - } - } -} diff --git a/test/Nitric.Sdk.Test/examples/storage/Delete.cs b/test/Nitric.Sdk.Test/examples/storage/Delete.cs deleted file mode 100644 index b36bf05..0000000 --- a/test/Nitric.Sdk.Test/examples/storage/Delete.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// [START import] -using Nitric.Sdk.Storage; -// [END import] - -namespace Examples -{ - class DeleteExamples - { - public static void DeleteFile() - { - // [START snippet] - var bucket = new Storage().Bucket("my-bucket"); - bucket.File("/path/to/file").Delete(); - // [END snipppet] - } - } -} diff --git a/test/Nitric.Sdk.Test/examples/storage/Read.cs b/test/Nitric.Sdk.Test/examples/storage/Read.cs deleted file mode 100644 index 8c4cb42..0000000 --- a/test/Nitric.Sdk.Test/examples/storage/Read.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// [START import] -using Nitric.Sdk.Storage; -// [END import] - -namespace Examples -{ - class ReadExample - { - public static void ReadFile() - { - // [START snippet] - var bucket = new Storage().Bucket("my-bucket"); - var file = bucket.File("/path/to/file").Read(); - // [END snipppet] - } - } -} diff --git a/test/Nitric.Sdk.Test/examples/storage/Write.cs b/test/Nitric.Sdk.Test/examples/storage/Write.cs deleted file mode 100644 index b363c5c..0000000 --- a/test/Nitric.Sdk.Test/examples/storage/Write.cs +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// [START import] -using System.Text; -using Nitric.Sdk.Storage; -// [END import] - -namespace Examples -{ - class WriteExample - { - public static void WriteFile() - { - // [START snippet] - var data = Encoding.UTF8.GetBytes("Hello World"); - - var bucket = new Storage().Bucket("my-bucket"); - bucket.File("/path/to/file").Write(data); - // [END snippet] - } - } -} diff --git a/tools/license/licenseconfig.json b/tools/license/licenseconfig.json index 5bc3c34..4580abe 100644 --- a/tools/license/licenseconfig.json +++ b/tools/license/licenseconfig.json @@ -6,6 +6,7 @@ ".github/", "properties/**/*", "Scripts/", + "nitric/proto/**/*", "src/Nitric.Sdk/Proto/**/*", "test/**/*", "tools/",