From fd89bfe3d480028838d2263187107b10dcb83c13 Mon Sep 17 00:00:00 2001 From: Greg Fichtenholtz <74032303+gfichtenholt@users.noreply.github.com> Date: Tue, 22 Mar 2022 00:02:59 -0700 Subject: [PATCH] 2nd step toward Investigate and propose package repositories API with similar core interface to packages API. #3496 (#4476) * attempt #2 * checkpoint #1 * 2nd checkpoint * Michael's feedback --- .../core/packages/v1alpha1/repositories.go | 38 +- .../packages/v1alpha1/repositories_test.go | 115 +- .../docs/kubeapps-apis.swagger.json | 686 +++-- cmd/kubeapps-apis/gen/apidocs.pb.go | 2 +- .../gen/core/packages/v1alpha1/packages.pb.go | 2 +- .../packages/v1alpha1/packages_grpc.pb.go | 4 - .../core/packages/v1alpha1/repositories.pb.go | 710 ++++- .../packages/v1alpha1/repositories.pb.gw.go | 197 ++ .../packages/v1alpha1/repositories_grpc.pb.go | 40 +- .../gen/core/plugins/v1alpha1/plugins.pb.go | 2 +- .../core/plugins/v1alpha1/plugins_grpc.pb.go | 4 - .../fluxv2/packages/v1alpha1/fluxv2.pb.go | 91 +- .../fluxv2/packages/v1alpha1/fluxv2.pb.gw.go | 239 +- .../packages/v1alpha1/fluxv2_grpc.pb.go | 40 +- .../plugins/helm/packages/v1alpha1/helm.pb.go | 2 +- .../helm/packages/v1alpha1/helm.pb.gw.go | 38 +- .../helm/packages/v1alpha1/helm_grpc.pb.go | 4 - .../packages/v1alpha1/kapp_controller.pb.go | 2 +- .../v1alpha1/kapp_controller_grpc.pb.go | 4 - .../resources/v1alpha1/resources.pb.go | 2 +- .../resources/v1alpha1/resources_grpc.pb.go | 4 - cmd/kubeapps-apis/plugin_test/mock_plugin.go | 22 +- cmd/kubeapps-apis/plugin_test/utils.go | 27 + .../plugins/fluxv2/packages/v1alpha1/chart.go | 37 +- .../packages/v1alpha1/global_vars_test.go | 341 +++ .../v1alpha1/integration_utils_test.go | 4 +- .../plugins/fluxv2/packages/v1alpha1/repo.go | 102 + .../v1alpha1/repo_integration_test.go | 174 ++ .../fluxv2/packages/v1alpha1/repo_test.go | 210 +- .../fluxv2/packages/v1alpha1/server.go | 56 +- .../core/packages/v1alpha1/repositories.proto | 99 + .../fluxv2/packages/v1alpha1/fluxv2.proto | 7 + dashboard/src/gen/google/api/http.ts | 250 +- dashboard/src/gen/google/protobuf/any.ts | 48 +- .../src/gen/google/protobuf/descriptor.ts | 2447 ++++++++++------ dashboard/src/gen/google/protobuf/struct.ts | 331 ++- .../core/packages/v1alpha1/packages.ts | 2418 ++++++++++------ .../core/packages/v1alpha1/repositories.ts | 1342 +++++++-- .../core/plugins/v1alpha1/plugins.ts | 108 +- .../fluxv2/packages/v1alpha1/fluxv2.ts | 41 +- .../plugins/helm/packages/v1alpha1/helm.ts | 144 +- .../packages/v1alpha1/kapp_controller.ts | 151 +- .../plugins/resources/v1alpha1/resources.ts | 666 +++-- .../protoc-gen-openapiv2/options/openapiv2.ts | 2460 +++++++++++------ 44 files changed, 9753 insertions(+), 3958 deletions(-) diff --git a/cmd/kubeapps-apis/core/packages/v1alpha1/repositories.go b/cmd/kubeapps-apis/core/packages/v1alpha1/repositories.go index cc97cdc6c30..7eec6dc7fba 100644 --- a/cmd/kubeapps-apis/core/packages/v1alpha1/repositories.go +++ b/cmd/kubeapps-apis/core/packages/v1alpha1/repositories.go @@ -71,15 +71,45 @@ func (s repositoriesServer) AddPackageRepository(ctx context.Context, request *p return nil, status.Errorf(status.Convert(err).Code(), "Unable to add package repository %q using the plugin %q: %v", request.Name, request.Plugin.Name, err) } - // TODO (gfichtenholt) // Validate the plugin response - //if response.InstalledPackageRef == nil { - // return nil, status.Errorf(codes.Internal, "Invalid CreateInstalledPackage response from the plugin %v: %v", pluginWithServer.plugin.Name, err) - //} + if response.PackageRepoRef == nil { + return nil, status.Errorf(codes.Internal, "Invalid AddPackageRepository response from the plugin %v: %v", pluginWithServer.plugin.Name, err) + } return response, nil } +func (s repositoriesServer) GetPackageRepositoryDetail(ctx context.Context, request *packages.GetPackageRepositoryDetailRequest) (*packages.GetPackageRepositoryDetailResponse, error) { + contextMsg := fmt.Sprintf("(identifier=%q, cluster=%q, namespace=%q)", request.GetPackageRepoRef().GetIdentifier(), request.GetPackageRepoRef().GetContext().GetCluster(), request.GetPackageRepoRef().GetContext().GetNamespace()) + log.Infof("+core GetPackageRepositoryDetail %s", contextMsg) + + if request.GetPackageRepoRef().GetPlugin() == nil { + return nil, status.Errorf(codes.InvalidArgument, "Unable to retrieve the plugin (missing PackageRepoRef.Plugin)") + } + + // Retrieve the plugin with server matching the requested plugin name + pluginWithServer := s.getPluginWithServer(request.PackageRepoRef.Plugin) + if pluginWithServer == nil { + return nil, status.Errorf(codes.Internal, "Unable to get the plugin %v", request.PackageRepoRef.Plugin) + } + + // Get the response from the requested plugin + response, err := pluginWithServer.server.GetPackageRepositoryDetail(ctx, request) + if err != nil { + return nil, status.Errorf(status.Convert(err).Code(), "Unable to get the package repository detail for the repository %q using the plugin %q: %v", request.PackageRepoRef.Identifier, request.PackageRepoRef.Plugin.Name, err) + } + + // Validate the plugin response + if response.GetDetail().GetPackageRepoRef() == nil { + return nil, status.Errorf(codes.Internal, "Invalid package reposirtory detail response from the plugin %v: %v", pluginWithServer.plugin.Name, err) + } + + // Build the response + return &packages.GetPackageRepositoryDetailResponse{ + Detail: response.Detail, + }, nil +} + // getPluginWithServer returns the *pkgPluginsWithServer from a given packagesServer // matching the plugin name func (s repositoriesServer) getPluginWithServer(plugin *v1alpha1.Plugin) *repoPluginsWithServer { diff --git a/cmd/kubeapps-apis/core/packages/v1alpha1/repositories_test.go b/cmd/kubeapps-apis/core/packages/v1alpha1/repositories_test.go index 05260ab094d..00d23ee2aa2 100644 --- a/cmd/kubeapps-apis/core/packages/v1alpha1/repositories_test.go +++ b/cmd/kubeapps-apis/core/packages/v1alpha1/repositories_test.go @@ -17,13 +17,47 @@ import ( "google.golang.org/grpc/status" ) +var mockedRepoPlugin1 = makeDefaultTestRepositoriesPlugin("mock1") +var mockedRepoPlugin2 = makeDefaultTestRepositoriesPlugin("mock2") +var mockedNotFoundRepoPlugin = makeOnlyStatusTestRepositoriesPlugin("bad-plugin", codes.NotFound) + var ignoreUnexportedRepoOpts = cmpopts.IgnoreUnexported( corev1.AddPackageRepositoryRequest{}, corev1.AddPackageRepositoryResponse{}, corev1.Context{}, plugins.Plugin{}, + corev1.PackageRepositoryReference{}, + corev1.GetPackageRepositoryDetailRequest{}, + corev1.GetPackageRepositoryDetailResponse{}, + corev1.PackageRepositoryDetail{}, + corev1.PackageRepositoryStatus{}, ) +func makeDefaultTestRepositoriesPlugin(pluginName string) repoPluginsWithServer { + pluginDetails := &plugins.Plugin{Name: pluginName, Version: "v1alpha1"} + repositoriesPluginServer := &plugin_test.TestRepositoriesPluginServer{Plugin: pluginDetails} + + repositoriesPluginServer.PackageRepositoryDetail = + plugin_test.MakePackageRepositoryDetail("repo-1", pluginDetails) + + return repoPluginsWithServer{ + plugin: pluginDetails, + server: repositoriesPluginServer, + } +} + +func makeOnlyStatusTestRepositoriesPlugin(pluginName string, statusCode codes.Code) repoPluginsWithServer { + pluginDetails := &plugins.Plugin{Name: pluginName, Version: "v1alpha1"} + repositoriesPluginServer := &plugin_test.TestRepositoriesPluginServer{Plugin: pluginDetails} + + repositoriesPluginServer.Status = statusCode + + return repoPluginsWithServer{ + plugin: pluginDetails, + server: repositoriesPluginServer, + } +} + func TestAddPackageRepository(t *testing.T) { testCases := []struct { name string @@ -47,7 +81,16 @@ func TestAddPackageRepository(t *testing.T) { }, Name: "repo-1", }, - expectedResponse: &corev1.AddPackageRepositoryResponse{}, + expectedResponse: &corev1.AddPackageRepositoryResponse{ + PackageRepoRef: &corev1.PackageRepositoryReference{ + Context: &corev1.Context{ + Cluster: "default", + Namespace: "my-ns", + }, + Identifier: "repo-1", + Plugin: &plugins.Plugin{Name: "plugin-1", Version: "v1alpha1"}, + }, + }, }, { name: "returns invalid argument if plugin not specified in request", @@ -102,3 +145,73 @@ func TestAddPackageRepository(t *testing.T) { }) } } + +func TestGetPackageRepositoryDetail(t *testing.T) { + testCases := []struct { + name string + configuredPlugins []repoPluginsWithServer + statusCode codes.Code + request *corev1.GetPackageRepositoryDetailRequest + expectedResponse *corev1.GetPackageRepositoryDetailResponse + }{ + { + name: "it should successfully call the core GetPackageRepositoryDetail operation", + configuredPlugins: []repoPluginsWithServer{ + mockedRepoPlugin1, + mockedRepoPlugin2, + }, + request: &corev1.GetPackageRepositoryDetailRequest{ + PackageRepoRef: &corev1.PackageRepositoryReference{ + Context: &corev1.Context{ + Cluster: plugin_test.GlobalPackagingCluster, + Namespace: plugin_test.DefaultNamespace, + }, + Identifier: "repo-1", + Plugin: mockedPackagingPlugin1.plugin, + }, + }, + expectedResponse: &corev1.GetPackageRepositoryDetailResponse{ + Detail: plugin_test.MakePackageRepositoryDetail("repo-1", mockedRepoPlugin1.plugin), + }, + statusCode: codes.OK, + }, + { + name: "it should fail when calling the core GetPackageRepositoryDetail operation when the package is not present in a plugin", + configuredPlugins: []repoPluginsWithServer{ + mockedRepoPlugin1, + mockedNotFoundRepoPlugin, + }, + request: &corev1.GetPackageRepositoryDetailRequest{ + PackageRepoRef: &corev1.PackageRepositoryReference{ + Context: &corev1.Context{ + Cluster: plugin_test.GlobalPackagingCluster, + Namespace: plugin_test.DefaultNamespace, + }, + Identifier: "repo-1", + Plugin: mockedNotFoundPackagingPlugin.plugin, + }, + }, + statusCode: codes.NotFound, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + server := &repositoriesServer{ + pluginsWithServers: tc.configuredPlugins, + } + packageRepoDetail, err := server.GetPackageRepositoryDetail( + context.Background(), tc.request) + + if got, want := status.Code(err), tc.statusCode; got != want { + t.Fatalf("got: %+v, want: %+v, err: %+v", got, want, err) + } + + if tc.statusCode == codes.OK { + if got, want := packageRepoDetail, tc.expectedResponse; !cmp.Equal(got, want, ignoreUnexportedRepoOpts) { + t.Errorf("mismatch (-want +got):\n%s", cmp.Diff(want, got, ignoreUnexportedRepoOpts)) + } + } + }) + } +} diff --git a/cmd/kubeapps-apis/docs/kubeapps-apis.swagger.json b/cmd/kubeapps-apis/docs/kubeapps-apis.swagger.json index 01b45eceee3..4814f22c855 100644 --- a/cmd/kubeapps-apis/docs/kubeapps-apis.swagger.json +++ b/cmd/kubeapps-apis/docs/kubeapps-apis.swagger.json @@ -73,28 +73,28 @@ "parameters": [ { "name": "context.cluster", - "description": "Cluster\n\nA cluster name can be provided to target a specific cluster if multiple\nclusters are configured, otherwise all clusters will be assumed.", + "description": "Cluster. A cluster name can be provided to target a specific cluster if multiple\nclusters are configured, otherwise all clusters will be assumed.", "in": "query", "required": false, "type": "string" }, { "name": "context.namespace", - "description": "Namespace\n\nA namespace must be provided if the context of the operation is for a resource\nor resources in a particular namespace.\nFor requests to list items, not including a namespace here implies that the context\nfor the request is everything the requesting user can read, though the result can\nbe filtered by any filtering options of the request. Plugins may choose to return\nUnimplemented for some queries for which we do not yet have a need.", + "description": "Namespace. A namespace must be provided if the context of the operation is for a resource\nor resources in a particular namespace.\nFor requests to list items, not including a namespace here implies that the context\nfor the request is everything the requesting user can read, though the result can\nbe filtered by any filtering options of the request. Plugins may choose to return\nUnimplemented for some queries for which we do not yet have a need.", "in": "query", "required": false, "type": "string" }, { "name": "filterOptions.query", - "description": "Text query\n\nText query for the request", + "description": "Text query. Text query for the request", "in": "query", "required": false, "type": "string" }, { "name": "filterOptions.categories", - "description": "Categories\n\nCollection of categories for the request", + "description": "Categories. Collection of categories for the request", "in": "query", "required": false, "type": "array", @@ -105,7 +105,7 @@ }, { "name": "filterOptions.repositories", - "description": "Repositories\n\nCollection of repositories where the packages belong to", + "description": "Repositories. Collection of repositories where the packages belong to", "in": "query", "required": false, "type": "array", @@ -116,28 +116,28 @@ }, { "name": "filterOptions.pkgVersion", - "description": "Package version\n\nPackage version for the request", + "description": "Package version. Package version for the request", "in": "query", "required": false, "type": "string" }, { "name": "filterOptions.appVersion", - "description": "App version\n\nPackaged app version for the request", + "description": "App version. Packaged app version for the request", "in": "query", "required": false, "type": "string" }, { "name": "paginationOptions.pageToken", - "description": "Page token\n\nThe client uses this field to request a specific page of the list results.", + "description": "Page token. The client uses this field to request a specific page of the list results.", "in": "query", "required": false, "type": "string" }, { "name": "paginationOptions.pageSize", - "description": "Page size\n\nClients use this field to specify the maximum number of results to be\nreturned by the server. The server may further constrain the maximum number\nof results returned in a single page. If the page_size is 0, the server\nwill decide the number of results to be returned.", + "description": "Page size. Clients use this field to specify the maximum number of results to be\nreturned by the server. The server may further constrain the maximum number\nof results returned in a single page. If the page_size is 0, the server\nwill decide the number of results to be returned.", "in": "query", "required": false, "type": "integer", @@ -204,8 +204,7 @@ "description": "Available package identifier\n\nThe fully qualified identifier for the available package\n(ie. a unique name for the context). For some packaging systems\n(particularly those where an available package is backed by a CR) this\nwill just be the name, but for others such as those where an available\npackage is not backed by a CR (eg. standard helm) it may be necessary\nto include the repository in the name or even the repo namespace\nto ensure this is unique.\nFor example two helm repositories can define\nan \"apache\" chart that is available globally, the names would need to\nencode that to be unique (ie. \"repoA:apache\" and \"repoB:apache\").", "in": "path", "required": true, - "type": "string", - "pattern": ".+" + "type": "string" }, { "name": "pkgVersion", @@ -275,8 +274,7 @@ "description": "Available package identifier\n\nThe fully qualified identifier for the available package\n(ie. a unique name for the context). For some packaging systems\n(particularly those where an available package is backed by a CR) this\nwill just be the name, but for others such as those where an available\npackage is not backed by a CR (eg. standard helm) it may be necessary\nto include the repository in the name or even the repo namespace\nto ensure this is unique.\nFor example two helm repositories can define\nan \"apache\" chart that is available globally, the names would need to\nencode that to be unique (ie. \"repoA:apache\" and \"repoB:apache\").", "in": "path", "required": true, - "type": "string", - "pattern": ".+" + "type": "string" }, { "name": "pkgVersion", @@ -315,28 +313,28 @@ "parameters": [ { "name": "context.cluster", - "description": "Cluster\n\nA cluster name can be provided to target a specific cluster if multiple\nclusters are configured, otherwise all clusters will be assumed.", + "description": "Cluster. A cluster name can be provided to target a specific cluster if multiple\nclusters are configured, otherwise all clusters will be assumed.", "in": "query", "required": false, "type": "string" }, { "name": "context.namespace", - "description": "Namespace\n\nA namespace must be provided if the context of the operation is for a resource\nor resources in a particular namespace.\nFor requests to list items, not including a namespace here implies that the context\nfor the request is everything the requesting user can read, though the result can\nbe filtered by any filtering options of the request. Plugins may choose to return\nUnimplemented for some queries for which we do not yet have a need.", + "description": "Namespace. A namespace must be provided if the context of the operation is for a resource\nor resources in a particular namespace.\nFor requests to list items, not including a namespace here implies that the context\nfor the request is everything the requesting user can read, though the result can\nbe filtered by any filtering options of the request. Plugins may choose to return\nUnimplemented for some queries for which we do not yet have a need.", "in": "query", "required": false, "type": "string" }, { "name": "paginationOptions.pageToken", - "description": "Page token\n\nThe client uses this field to request a specific page of the list results.", + "description": "Page token. The client uses this field to request a specific page of the list results.", "in": "query", "required": false, "type": "string" }, { "name": "paginationOptions.pageSize", - "description": "Page size\n\nClients use this field to specify the maximum number of results to be\nreturned by the server. The server may further constrain the maximum number\nof results returned in a single page. If the page_size is 0, the server\nwill decide the number of results to be returned.", + "description": "Page size. Clients use this field to specify the maximum number of results to be\nreturned by the server. The server may further constrain the maximum number\nof results returned in a single page. If the page_size is 0, the server\nwill decide the number of results to be returned.", "in": "query", "required": false, "type": "integer", @@ -566,43 +564,7 @@ "in": "body", "required": true, "schema": { - "type": "object", - "properties": { - "installedPackageRef": { - "type": "object", - "properties": { - "context": { - "type": "object", - "description": "The context (cluster/namespace) for the package.", - "title": "Installed package context" - }, - "plugin": { - "type": "object", - "example": { - "name": "kapp_controller.packages", - "version": "v1alpha1" - }, - "description": "The plugin used to identify and interact with the installed package.\nThis field can be omitted when the request is in the context of a specific plugin.", - "title": "The plugin used to identify and interact with the installed package.\nThis field can be omitted when the request is in the context of a specific plugin." - } - }, - "title": "A reference uniquely identifying the installed package being updated.\nRequired" - }, - "pkgVersionReference": { - "$ref": "#/definitions/v1alpha1VersionReference", - "title": "For helm this will be the exact version in VersionReference.version\nFor fluxv2 this could be any semver constraint expression\nFor other plugins we can extend the VersionReference as needed. Optional" - }, - "values": { - "type": "string", - "description": "An optional serialized values string to be included when templating a\npackage in the format expected by the plugin. Included when the backend\nformat doesn't use secrets or configmaps for values or supports both.\nThese values are layered on top of any values refs above, when\nrelevant." - }, - "reconciliationOptions": { - "$ref": "#/definitions/v1alpha1ReconciliationOptions", - "description": "An optional field for specifying data common to systems that reconcile\nthe package on the cluster." - } - }, - "description": "Request for UpdateInstalledPackage. The intent is to reach the desired state specified\nby the fields in the request, while leaving other fields intact. This is a whole\nobject \"Update\" semantics rather than \"Patch\" semantics. The caller will provide the\nvalues for the fields below, which will replace, or be overlayed onto, the\ncorresponding fields in the existing resource. For example, with the\nUpdateInstalledPackageRequest, it is not possible to change just the 'package version\nreference' without also specifying 'values' field. As a side effect, not specifying the\n'values' field in the request means there are no values specified in the desired state.\nSo the meaning of each field value is describing the desired state of the corresponding\nfield in the resource after the update operation has completed the renconciliation.", - "title": "UpdateInstalledPackageRequest" + "$ref": "#/definitions/v1alpha1UpdateInstalledPackageRequest" } } ], @@ -710,6 +672,69 @@ ] } }, + "/core/packages/v1alpha1/repositories/plugin/{packageRepoRef.plugin.name}/{packageRepoRef.plugin.version}/c/{packageRepoRef.context.cluster}/ns/{packageRepoRef.context.namespace}/{packageRepoRef.identifier}": { + "get": { + "operationId": "RepositoriesService_GetPackageRepositoryDetail", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1alpha1GetPackageRepositoryDetailResponse" + } + }, + "401": { + "description": "Returned when the user does not have permission to access the resource.", + "schema": {} + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "packageRepoRef.plugin.name", + "description": "Plugin name\n\nThe name of the plugin, such as `fluxv2.packages` or `kapp_controller.packages`.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "packageRepoRef.plugin.version", + "description": "Plugin version\n\nThe version of the plugin, such as v1alpha1", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "packageRepoRef.context.cluster", + "description": "Cluster\n\nA cluster name can be provided to target a specific cluster if multiple\nclusters are configured, otherwise all clusters will be assumed.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "packageRepoRef.context.namespace", + "description": "Namespace\n\nA namespace must be provided if the context of the operation is for a resource\nor resources in a particular namespace.\nFor requests to list items, not including a namespace here implies that the context\nfor the request is everything the requesting user can read, though the result can\nbe filtered by any filtering options of the request. Plugins may choose to return\nUnimplemented for some queries for which we do not yet have a need.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "packageRepoRef.identifier", + "description": "The fully qualified identifier for the repository\n(i.e. a unique name for the context).", + "in": "path", + "required": true, + "type": "string" + } + ], + "tags": [ + "RepositoriesService" + ] + } + }, "/core/plugins/v1alpha1/configured-plugins": { "get": { "summary": "GetConfiguredPlugins returns a map of short and longnames for the configured plugins.", @@ -762,28 +787,28 @@ "parameters": [ { "name": "context.cluster", - "description": "Cluster\n\nA cluster name can be provided to target a specific cluster if multiple\nclusters are configured, otherwise all clusters will be assumed.", + "description": "Cluster. A cluster name can be provided to target a specific cluster if multiple\nclusters are configured, otherwise all clusters will be assumed.", "in": "query", "required": false, "type": "string" }, { "name": "context.namespace", - "description": "Namespace\n\nA namespace must be provided if the context of the operation is for a resource\nor resources in a particular namespace.\nFor requests to list items, not including a namespace here implies that the context\nfor the request is everything the requesting user can read, though the result can\nbe filtered by any filtering options of the request. Plugins may choose to return\nUnimplemented for some queries for which we do not yet have a need.", + "description": "Namespace. A namespace must be provided if the context of the operation is for a resource\nor resources in a particular namespace.\nFor requests to list items, not including a namespace here implies that the context\nfor the request is everything the requesting user can read, though the result can\nbe filtered by any filtering options of the request. Plugins may choose to return\nUnimplemented for some queries for which we do not yet have a need.", "in": "query", "required": false, "type": "string" }, { "name": "filterOptions.query", - "description": "Text query\n\nText query for the request", + "description": "Text query. Text query for the request", "in": "query", "required": false, "type": "string" }, { "name": "filterOptions.categories", - "description": "Categories\n\nCollection of categories for the request", + "description": "Categories. Collection of categories for the request", "in": "query", "required": false, "type": "array", @@ -794,7 +819,7 @@ }, { "name": "filterOptions.repositories", - "description": "Repositories\n\nCollection of repositories where the packages belong to", + "description": "Repositories. Collection of repositories where the packages belong to", "in": "query", "required": false, "type": "array", @@ -805,28 +830,28 @@ }, { "name": "filterOptions.pkgVersion", - "description": "Package version\n\nPackage version for the request", + "description": "Package version. Package version for the request", "in": "query", "required": false, "type": "string" }, { "name": "filterOptions.appVersion", - "description": "App version\n\nPackaged app version for the request", + "description": "App version. Packaged app version for the request", "in": "query", "required": false, "type": "string" }, { "name": "paginationOptions.pageToken", - "description": "Page token\n\nThe client uses this field to request a specific page of the list results.", + "description": "Page token. The client uses this field to request a specific page of the list results.", "in": "query", "required": false, "type": "string" }, { "name": "paginationOptions.pageSize", - "description": "Page size\n\nClients use this field to specify the maximum number of results to be\nreturned by the server. The server may further constrain the maximum number\nof results returned in a single page. If the page_size is 0, the server\nwill decide the number of results to be returned.", + "description": "Page size. Clients use this field to specify the maximum number of results to be\nreturned by the server. The server may further constrain the maximum number\nof results returned in a single page. If the page_size is 0, the server\nwill decide the number of results to be returned.", "in": "query", "required": false, "type": "integer", @@ -880,19 +905,18 @@ "description": "Available package identifier\n\nThe fully qualified identifier for the available package\n(ie. a unique name for the context). For some packaging systems\n(particularly those where an available package is backed by a CR) this\nwill just be the name, but for others such as those where an available\npackage is not backed by a CR (eg. standard helm) it may be necessary\nto include the repository in the name or even the repo namespace\nto ensure this is unique.\nFor example two helm repositories can define\nan \"apache\" chart that is available globally, the names would need to\nencode that to be unique (ie. \"repoA:apache\" and \"repoB:apache\").", "in": "path", "required": true, - "type": "string", - "pattern": ".+" + "type": "string" }, { "name": "availablePackageRef.plugin.name", - "description": "Plugin name\n\nThe name of the plugin, such as `fluxv2.packages` or `kapp_controller.packages`.", + "description": "Plugin name. The name of the plugin, such as `fluxv2.packages` or `kapp_controller.packages`.", "in": "query", "required": false, "type": "string" }, { "name": "availablePackageRef.plugin.version", - "description": "Plugin version\n\nThe version of the plugin, such as v1alpha1", + "description": "Plugin version. The version of the plugin, such as v1alpha1", "in": "query", "required": false, "type": "string" @@ -952,19 +976,18 @@ "description": "Available package identifier\n\nThe fully qualified identifier for the available package\n(ie. a unique name for the context). For some packaging systems\n(particularly those where an available package is backed by a CR) this\nwill just be the name, but for others such as those where an available\npackage is not backed by a CR (eg. standard helm) it may be necessary\nto include the repository in the name or even the repo namespace\nto ensure this is unique.\nFor example two helm repositories can define\nan \"apache\" chart that is available globally, the names would need to\nencode that to be unique (ie. \"repoA:apache\" and \"repoB:apache\").", "in": "path", "required": true, - "type": "string", - "pattern": ".+" + "type": "string" }, { "name": "availablePackageRef.plugin.name", - "description": "Plugin name\n\nThe name of the plugin, such as `fluxv2.packages` or `kapp_controller.packages`.", + "description": "Plugin name. The name of the plugin, such as `fluxv2.packages` or `kapp_controller.packages`.", "in": "query", "required": false, "type": "string" }, { "name": "availablePackageRef.plugin.version", - "description": "Plugin version\n\nThe version of the plugin, such as v1alpha1", + "description": "Plugin version. The version of the plugin, such as v1alpha1", "in": "query", "required": false, "type": "string" @@ -1007,28 +1030,28 @@ "parameters": [ { "name": "context.cluster", - "description": "Cluster\n\nA cluster name can be provided to target a specific cluster if multiple\nclusters are configured, otherwise all clusters will be assumed.", + "description": "Cluster. A cluster name can be provided to target a specific cluster if multiple\nclusters are configured, otherwise all clusters will be assumed.", "in": "query", "required": false, "type": "string" }, { "name": "context.namespace", - "description": "Namespace\n\nA namespace must be provided if the context of the operation is for a resource\nor resources in a particular namespace.\nFor requests to list items, not including a namespace here implies that the context\nfor the request is everything the requesting user can read, though the result can\nbe filtered by any filtering options of the request. Plugins may choose to return\nUnimplemented for some queries for which we do not yet have a need.", + "description": "Namespace. A namespace must be provided if the context of the operation is for a resource\nor resources in a particular namespace.\nFor requests to list items, not including a namespace here implies that the context\nfor the request is everything the requesting user can read, though the result can\nbe filtered by any filtering options of the request. Plugins may choose to return\nUnimplemented for some queries for which we do not yet have a need.", "in": "query", "required": false, "type": "string" }, { "name": "paginationOptions.pageToken", - "description": "Page token\n\nThe client uses this field to request a specific page of the list results.", + "description": "Page token. The client uses this field to request a specific page of the list results.", "in": "query", "required": false, "type": "string" }, { "name": "paginationOptions.pageSize", - "description": "Page size\n\nClients use this field to specify the maximum number of results to be\nreturned by the server. The server may further constrain the maximum number\nof results returned in a single page. If the page_size is 0, the server\nwill decide the number of results to be returned.", + "description": "Page size. Clients use this field to specify the maximum number of results to be\nreturned by the server. The server may further constrain the maximum number\nof results returned in a single page. If the page_size is 0, the server\nwill decide the number of results to be returned.", "in": "query", "required": false, "type": "integer", @@ -1121,14 +1144,14 @@ }, { "name": "installedPackageRef.plugin.name", - "description": "Plugin name\n\nThe name of the plugin, such as `fluxv2.packages` or `kapp_controller.packages`.", + "description": "Plugin name. The name of the plugin, such as `fluxv2.packages` or `kapp_controller.packages`.", "in": "query", "required": false, "type": "string" }, { "name": "installedPackageRef.plugin.version", - "description": "Plugin version\n\nThe version of the plugin, such as v1alpha1", + "description": "Plugin version. The version of the plugin, such as v1alpha1", "in": "query", "required": false, "type": "string" @@ -1183,14 +1206,14 @@ }, { "name": "installedPackageRef.plugin.name", - "description": "Plugin name\n\nThe name of the plugin, such as `fluxv2.packages` or `kapp_controller.packages`.", + "description": "Plugin name. The name of the plugin, such as `fluxv2.packages` or `kapp_controller.packages`.", "in": "query", "required": false, "type": "string" }, { "name": "installedPackageRef.plugin.version", - "description": "Plugin version\n\nThe version of the plugin, such as v1alpha1", + "description": "Plugin version. The version of the plugin, such as v1alpha1", "in": "query", "required": false, "type": "string" @@ -1248,38 +1271,7 @@ "in": "body", "required": true, "schema": { - "type": "object", - "properties": { - "installedPackageRef": { - "type": "object", - "properties": { - "context": { - "type": "object", - "description": "The context (cluster/namespace) for the package.", - "title": "Installed package context" - }, - "plugin": { - "$ref": "#/definitions/v1alpha1Plugin", - "description": "The plugin used to identify and interact with the installed package.\nThis field can be omitted when the request is in the context of a specific plugin." - } - }, - "title": "A reference uniquely identifying the installed package being updated.\nRequired" - }, - "pkgVersionReference": { - "$ref": "#/definitions/v1alpha1VersionReference", - "title": "For helm this will be the exact version in VersionReference.version\nFor fluxv2 this could be any semver constraint expression\nFor other plugins we can extend the VersionReference as needed. Optional" - }, - "values": { - "type": "string", - "description": "An optional serialized values string to be included when templating a\npackage in the format expected by the plugin. Included when the backend\nformat doesn't use secrets or configmaps for values or supports both.\nThese values are layered on top of any values refs above, when\nrelevant." - }, - "reconciliationOptions": { - "$ref": "#/definitions/v1alpha1ReconciliationOptions", - "description": "An optional field for specifying data common to systems that reconcile\nthe package on the cluster." - } - }, - "description": "Request for UpdateInstalledPackage. The intent is to reach the desired state specified\nby the fields in the request, while leaving other fields intact. This is a whole\nobject \"Update\" semantics rather than \"Patch\" semantics. The caller will provide the\nvalues for the fields below, which will replace, or be overlayed onto, the\ncorresponding fields in the existing resource. For example, with the\nUpdateInstalledPackageRequest, it is not possible to change just the 'package version\nreference' without also specifying 'values' field. As a side effect, not specifying the\n'values' field in the request means there are no values specified in the desired state.\nSo the meaning of each field value is describing the desired state of the corresponding\nfield in the resource after the update operation has completed the renconciliation.", - "title": "UpdateInstalledPackageRequest" + "$ref": "#/definitions/v1alpha1UpdateInstalledPackageRequest" } } ], @@ -1334,14 +1326,14 @@ }, { "name": "installedPackageRef.plugin.name", - "description": "Plugin name\n\nThe name of the plugin, such as `fluxv2.packages` or `kapp_controller.packages`.", + "description": "Plugin name. The name of the plugin, such as `fluxv2.packages` or `kapp_controller.packages`.", "in": "query", "required": false, "type": "string" }, { "name": "installedPackageRef.plugin.version", - "description": "Plugin version\n\nThe version of the plugin, such as v1alpha1", + "description": "Plugin version. The version of the plugin, such as v1alpha1", "in": "query", "required": false, "type": "string" @@ -1389,6 +1381,69 @@ ] } }, + "/plugins/fluxv2/packages/v1alpha1/repositories/plugin/{packageRepoRef.plugin.name}/{packageRepoRef.plugin.version}/c/{packageRepoRef.context.cluster}/ns/{packageRepoRef.context.namespace}/{packageRepoRef.identifier}": { + "get": { + "operationId": "FluxV2RepositoriesService_GetPackageRepositoryDetail", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1alpha1GetPackageRepositoryDetailResponse" + } + }, + "401": { + "description": "Returned when the user does not have permission to access the resource.", + "schema": {} + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "packageRepoRef.plugin.name", + "description": "Plugin name\n\nThe name of the plugin, such as `fluxv2.packages` or `kapp_controller.packages`.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "packageRepoRef.plugin.version", + "description": "Plugin version\n\nThe version of the plugin, such as v1alpha1", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "packageRepoRef.context.cluster", + "description": "Cluster\n\nA cluster name can be provided to target a specific cluster if multiple\nclusters are configured, otherwise all clusters will be assumed.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "packageRepoRef.context.namespace", + "description": "Namespace\n\nA namespace must be provided if the context of the operation is for a resource\nor resources in a particular namespace.\nFor requests to list items, not including a namespace here implies that the context\nfor the request is everything the requesting user can read, though the result can\nbe filtered by any filtering options of the request. Plugins may choose to return\nUnimplemented for some queries for which we do not yet have a need.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "packageRepoRef.identifier", + "description": "The fully qualified identifier for the repository\n(i.e. a unique name for the context).", + "in": "path", + "required": true, + "type": "string" + } + ], + "tags": [ + "FluxV2RepositoriesService" + ] + } + }, "/plugins/helm/packages/v1alpha1/availablepackages": { "get": { "summary": "GetAvailablePackageSummaries returns the available packages managed by the 'helm' plugin", @@ -1414,28 +1469,28 @@ "parameters": [ { "name": "context.cluster", - "description": "Cluster\n\nA cluster name can be provided to target a specific cluster if multiple\nclusters are configured, otherwise all clusters will be assumed.", + "description": "Cluster. A cluster name can be provided to target a specific cluster if multiple\nclusters are configured, otherwise all clusters will be assumed.", "in": "query", "required": false, "type": "string" }, { "name": "context.namespace", - "description": "Namespace\n\nA namespace must be provided if the context of the operation is for a resource\nor resources in a particular namespace.\nFor requests to list items, not including a namespace here implies that the context\nfor the request is everything the requesting user can read, though the result can\nbe filtered by any filtering options of the request. Plugins may choose to return\nUnimplemented for some queries for which we do not yet have a need.", + "description": "Namespace. A namespace must be provided if the context of the operation is for a resource\nor resources in a particular namespace.\nFor requests to list items, not including a namespace here implies that the context\nfor the request is everything the requesting user can read, though the result can\nbe filtered by any filtering options of the request. Plugins may choose to return\nUnimplemented for some queries for which we do not yet have a need.", "in": "query", "required": false, "type": "string" }, { "name": "filterOptions.query", - "description": "Text query\n\nText query for the request", + "description": "Text query. Text query for the request", "in": "query", "required": false, "type": "string" }, { "name": "filterOptions.categories", - "description": "Categories\n\nCollection of categories for the request", + "description": "Categories. Collection of categories for the request", "in": "query", "required": false, "type": "array", @@ -1446,7 +1501,7 @@ }, { "name": "filterOptions.repositories", - "description": "Repositories\n\nCollection of repositories where the packages belong to", + "description": "Repositories. Collection of repositories where the packages belong to", "in": "query", "required": false, "type": "array", @@ -1457,28 +1512,28 @@ }, { "name": "filterOptions.pkgVersion", - "description": "Package version\n\nPackage version for the request", + "description": "Package version. Package version for the request", "in": "query", "required": false, "type": "string" }, { "name": "filterOptions.appVersion", - "description": "App version\n\nPackaged app version for the request", + "description": "App version. Packaged app version for the request", "in": "query", "required": false, "type": "string" }, { "name": "paginationOptions.pageToken", - "description": "Page token\n\nThe client uses this field to request a specific page of the list results.", + "description": "Page token. The client uses this field to request a specific page of the list results.", "in": "query", "required": false, "type": "string" }, { "name": "paginationOptions.pageSize", - "description": "Page size\n\nClients use this field to specify the maximum number of results to be\nreturned by the server. The server may further constrain the maximum number\nof results returned in a single page. If the page_size is 0, the server\nwill decide the number of results to be returned.", + "description": "Page size. Clients use this field to specify the maximum number of results to be\nreturned by the server. The server may further constrain the maximum number\nof results returned in a single page. If the page_size is 0, the server\nwill decide the number of results to be returned.", "in": "query", "required": false, "type": "integer", @@ -1532,19 +1587,18 @@ "description": "Available package identifier\n\nThe fully qualified identifier for the available package\n(ie. a unique name for the context). For some packaging systems\n(particularly those where an available package is backed by a CR) this\nwill just be the name, but for others such as those where an available\npackage is not backed by a CR (eg. standard helm) it may be necessary\nto include the repository in the name or even the repo namespace\nto ensure this is unique.\nFor example two helm repositories can define\nan \"apache\" chart that is available globally, the names would need to\nencode that to be unique (ie. \"repoA:apache\" and \"repoB:apache\").", "in": "path", "required": true, - "type": "string", - "pattern": ".+" + "type": "string" }, { "name": "availablePackageRef.plugin.name", - "description": "Plugin name\n\nThe name of the plugin, such as `fluxv2.packages` or `kapp_controller.packages`.", + "description": "Plugin name. The name of the plugin, such as `fluxv2.packages` or `kapp_controller.packages`.", "in": "query", "required": false, "type": "string" }, { "name": "availablePackageRef.plugin.version", - "description": "Plugin version\n\nThe version of the plugin, such as v1alpha1", + "description": "Plugin version. The version of the plugin, such as v1alpha1", "in": "query", "required": false, "type": "string" @@ -1604,19 +1658,18 @@ "description": "Available package identifier\n\nThe fully qualified identifier for the available package\n(ie. a unique name for the context). For some packaging systems\n(particularly those where an available package is backed by a CR) this\nwill just be the name, but for others such as those where an available\npackage is not backed by a CR (eg. standard helm) it may be necessary\nto include the repository in the name or even the repo namespace\nto ensure this is unique.\nFor example two helm repositories can define\nan \"apache\" chart that is available globally, the names would need to\nencode that to be unique (ie. \"repoA:apache\" and \"repoB:apache\").", "in": "path", "required": true, - "type": "string", - "pattern": ".+" + "type": "string" }, { "name": "availablePackageRef.plugin.name", - "description": "Plugin name\n\nThe name of the plugin, such as `fluxv2.packages` or `kapp_controller.packages`.", + "description": "Plugin name. The name of the plugin, such as `fluxv2.packages` or `kapp_controller.packages`.", "in": "query", "required": false, "type": "string" }, { "name": "availablePackageRef.plugin.version", - "description": "Plugin version\n\nThe version of the plugin, such as v1alpha1", + "description": "Plugin version. The version of the plugin, such as v1alpha1", "in": "query", "required": false, "type": "string" @@ -1659,28 +1712,28 @@ "parameters": [ { "name": "context.cluster", - "description": "Cluster\n\nA cluster name can be provided to target a specific cluster if multiple\nclusters are configured, otherwise all clusters will be assumed.", + "description": "Cluster. A cluster name can be provided to target a specific cluster if multiple\nclusters are configured, otherwise all clusters will be assumed.", "in": "query", "required": false, "type": "string" }, { "name": "context.namespace", - "description": "Namespace\n\nA namespace must be provided if the context of the operation is for a resource\nor resources in a particular namespace.\nFor requests to list items, not including a namespace here implies that the context\nfor the request is everything the requesting user can read, though the result can\nbe filtered by any filtering options of the request. Plugins may choose to return\nUnimplemented for some queries for which we do not yet have a need.", + "description": "Namespace. A namespace must be provided if the context of the operation is for a resource\nor resources in a particular namespace.\nFor requests to list items, not including a namespace here implies that the context\nfor the request is everything the requesting user can read, though the result can\nbe filtered by any filtering options of the request. Plugins may choose to return\nUnimplemented for some queries for which we do not yet have a need.", "in": "query", "required": false, "type": "string" }, { "name": "paginationOptions.pageToken", - "description": "Page token\n\nThe client uses this field to request a specific page of the list results.", + "description": "Page token. The client uses this field to request a specific page of the list results.", "in": "query", "required": false, "type": "string" }, { "name": "paginationOptions.pageSize", - "description": "Page size\n\nClients use this field to specify the maximum number of results to be\nreturned by the server. The server may further constrain the maximum number\nof results returned in a single page. If the page_size is 0, the server\nwill decide the number of results to be returned.", + "description": "Page size. Clients use this field to specify the maximum number of results to be\nreturned by the server. The server may further constrain the maximum number\nof results returned in a single page. If the page_size is 0, the server\nwill decide the number of results to be returned.", "in": "query", "required": false, "type": "integer", @@ -1773,14 +1826,14 @@ }, { "name": "installedPackageRef.plugin.name", - "description": "Plugin name\n\nThe name of the plugin, such as `fluxv2.packages` or `kapp_controller.packages`.", + "description": "Plugin name. The name of the plugin, such as `fluxv2.packages` or `kapp_controller.packages`.", "in": "query", "required": false, "type": "string" }, { "name": "installedPackageRef.plugin.version", - "description": "Plugin version\n\nThe version of the plugin, such as v1alpha1", + "description": "Plugin version. The version of the plugin, such as v1alpha1", "in": "query", "required": false, "type": "string" @@ -1835,14 +1888,14 @@ }, { "name": "installedPackageRef.plugin.name", - "description": "Plugin name\n\nThe name of the plugin, such as `fluxv2.packages` or `kapp_controller.packages`.", + "description": "Plugin name. The name of the plugin, such as `fluxv2.packages` or `kapp_controller.packages`.", "in": "query", "required": false, "type": "string" }, { "name": "installedPackageRef.plugin.version", - "description": "Plugin version\n\nThe version of the plugin, such as v1alpha1", + "description": "Plugin version. The version of the plugin, such as v1alpha1", "in": "query", "required": false, "type": "string" @@ -1900,38 +1953,7 @@ "in": "body", "required": true, "schema": { - "type": "object", - "properties": { - "installedPackageRef": { - "type": "object", - "properties": { - "context": { - "type": "object", - "description": "The context (cluster/namespace) for the package.", - "title": "Installed package context" - }, - "plugin": { - "$ref": "#/definitions/v1alpha1Plugin", - "description": "The plugin used to identify and interact with the installed package.\nThis field can be omitted when the request is in the context of a specific plugin." - } - }, - "title": "A reference uniquely identifying the installed package being updated.\nRequired" - }, - "pkgVersionReference": { - "$ref": "#/definitions/v1alpha1VersionReference", - "title": "For helm this will be the exact version in VersionReference.version\nFor fluxv2 this could be any semver constraint expression\nFor other plugins we can extend the VersionReference as needed. Optional" - }, - "values": { - "type": "string", - "description": "An optional serialized values string to be included when templating a\npackage in the format expected by the plugin. Included when the backend\nformat doesn't use secrets or configmaps for values or supports both.\nThese values are layered on top of any values refs above, when\nrelevant." - }, - "reconciliationOptions": { - "$ref": "#/definitions/v1alpha1ReconciliationOptions", - "description": "An optional field for specifying data common to systems that reconcile\nthe package on the cluster." - } - }, - "description": "Request for UpdateInstalledPackage. The intent is to reach the desired state specified\nby the fields in the request, while leaving other fields intact. This is a whole\nobject \"Update\" semantics rather than \"Patch\" semantics. The caller will provide the\nvalues for the fields below, which will replace, or be overlayed onto, the\ncorresponding fields in the existing resource. For example, with the\nUpdateInstalledPackageRequest, it is not possible to change just the 'package version\nreference' without also specifying 'values' field. As a side effect, not specifying the\n'values' field in the request means there are no values specified in the desired state.\nSo the meaning of each field value is describing the desired state of the corresponding\nfield in the resource after the update operation has completed the renconciliation.", - "title": "UpdateInstalledPackageRequest" + "$ref": "#/definitions/v1alpha1UpdateInstalledPackageRequest" } } ], @@ -1986,14 +2008,14 @@ }, { "name": "installedPackageRef.plugin.name", - "description": "Plugin name\n\nThe name of the plugin, such as `fluxv2.packages` or `kapp_controller.packages`.", + "description": "Plugin name. The name of the plugin, such as `fluxv2.packages` or `kapp_controller.packages`.", "in": "query", "required": false, "type": "string" }, { "name": "installedPackageRef.plugin.version", - "description": "Plugin version\n\nThe version of the plugin, such as v1alpha1", + "description": "Plugin version. The version of the plugin, such as v1alpha1", "in": "query", "required": false, "type": "string" @@ -2053,31 +2075,7 @@ "in": "body", "required": true, "schema": { - "type": "object", - "properties": { - "installedPackageRef": { - "type": "object", - "properties": { - "context": { - "type": "object", - "description": "The context (cluster/namespace) for the package.", - "title": "Installed package context" - }, - "plugin": { - "$ref": "#/definitions/v1alpha1Plugin", - "description": "The plugin used to identify and interact with the installed package.\nThis field can be omitted when the request is in the context of a specific plugin." - } - }, - "description": "A reference uniquely identifying the installed package.", - "title": "Installed package reference" - }, - "releaseRevision": { - "type": "integer", - "format": "int32", - "description": "A number identifying the Helm revision to which to rollback.", - "title": "ReleaseRevision" - } - } + "$ref": "#/definitions/v1alpha1RollbackInstalledPackageRequest" } } ], @@ -2111,28 +2109,28 @@ "parameters": [ { "name": "context.cluster", - "description": "Cluster\n\nA cluster name can be provided to target a specific cluster if multiple\nclusters are configured, otherwise all clusters will be assumed.", + "description": "Cluster. A cluster name can be provided to target a specific cluster if multiple\nclusters are configured, otherwise all clusters will be assumed.", "in": "query", "required": false, "type": "string" }, { "name": "context.namespace", - "description": "Namespace\n\nA namespace must be provided if the context of the operation is for a resource\nor resources in a particular namespace.\nFor requests to list items, not including a namespace here implies that the context\nfor the request is everything the requesting user can read, though the result can\nbe filtered by any filtering options of the request. Plugins may choose to return\nUnimplemented for some queries for which we do not yet have a need.", + "description": "Namespace. A namespace must be provided if the context of the operation is for a resource\nor resources in a particular namespace.\nFor requests to list items, not including a namespace here implies that the context\nfor the request is everything the requesting user can read, though the result can\nbe filtered by any filtering options of the request. Plugins may choose to return\nUnimplemented for some queries for which we do not yet have a need.", "in": "query", "required": false, "type": "string" }, { "name": "filterOptions.query", - "description": "Text query\n\nText query for the request", + "description": "Text query. Text query for the request", "in": "query", "required": false, "type": "string" }, { "name": "filterOptions.categories", - "description": "Categories\n\nCollection of categories for the request", + "description": "Categories. Collection of categories for the request", "in": "query", "required": false, "type": "array", @@ -2143,7 +2141,7 @@ }, { "name": "filterOptions.repositories", - "description": "Repositories\n\nCollection of repositories where the packages belong to", + "description": "Repositories. Collection of repositories where the packages belong to", "in": "query", "required": false, "type": "array", @@ -2154,28 +2152,28 @@ }, { "name": "filterOptions.pkgVersion", - "description": "Package version\n\nPackage version for the request", + "description": "Package version. Package version for the request", "in": "query", "required": false, "type": "string" }, { "name": "filterOptions.appVersion", - "description": "App version\n\nPackaged app version for the request", + "description": "App version. Packaged app version for the request", "in": "query", "required": false, "type": "string" }, { "name": "paginationOptions.pageToken", - "description": "Page token\n\nThe client uses this field to request a specific page of the list results.", + "description": "Page token. The client uses this field to request a specific page of the list results.", "in": "query", "required": false, "type": "string" }, { "name": "paginationOptions.pageSize", - "description": "Page size\n\nClients use this field to specify the maximum number of results to be\nreturned by the server. The server may further constrain the maximum number\nof results returned in a single page. If the page_size is 0, the server\nwill decide the number of results to be returned.", + "description": "Page size. Clients use this field to specify the maximum number of results to be\nreturned by the server. The server may further constrain the maximum number\nof results returned in a single page. If the page_size is 0, the server\nwill decide the number of results to be returned.", "in": "query", "required": false, "type": "integer", @@ -2229,19 +2227,18 @@ "description": "Available package identifier\n\nThe fully qualified identifier for the available package\n(ie. a unique name for the context). For some packaging systems\n(particularly those where an available package is backed by a CR) this\nwill just be the name, but for others such as those where an available\npackage is not backed by a CR (eg. standard helm) it may be necessary\nto include the repository in the name or even the repo namespace\nto ensure this is unique.\nFor example two helm repositories can define\nan \"apache\" chart that is available globally, the names would need to\nencode that to be unique (ie. \"repoA:apache\" and \"repoB:apache\").", "in": "path", "required": true, - "type": "string", - "pattern": ".+" + "type": "string" }, { "name": "availablePackageRef.plugin.name", - "description": "Plugin name\n\nThe name of the plugin, such as `fluxv2.packages` or `kapp_controller.packages`.", + "description": "Plugin name. The name of the plugin, such as `fluxv2.packages` or `kapp_controller.packages`.", "in": "query", "required": false, "type": "string" }, { "name": "availablePackageRef.plugin.version", - "description": "Plugin version\n\nThe version of the plugin, such as v1alpha1", + "description": "Plugin version. The version of the plugin, such as v1alpha1", "in": "query", "required": false, "type": "string" @@ -2301,19 +2298,18 @@ "description": "Available package identifier\n\nThe fully qualified identifier for the available package\n(ie. a unique name for the context). For some packaging systems\n(particularly those where an available package is backed by a CR) this\nwill just be the name, but for others such as those where an available\npackage is not backed by a CR (eg. standard helm) it may be necessary\nto include the repository in the name or even the repo namespace\nto ensure this is unique.\nFor example two helm repositories can define\nan \"apache\" chart that is available globally, the names would need to\nencode that to be unique (ie. \"repoA:apache\" and \"repoB:apache\").", "in": "path", "required": true, - "type": "string", - "pattern": ".+" + "type": "string" }, { "name": "availablePackageRef.plugin.name", - "description": "Plugin name\n\nThe name of the plugin, such as `fluxv2.packages` or `kapp_controller.packages`.", + "description": "Plugin name. The name of the plugin, such as `fluxv2.packages` or `kapp_controller.packages`.", "in": "query", "required": false, "type": "string" }, { "name": "availablePackageRef.plugin.version", - "description": "Plugin version\n\nThe version of the plugin, such as v1alpha1", + "description": "Plugin version. The version of the plugin, such as v1alpha1", "in": "query", "required": false, "type": "string" @@ -2356,28 +2352,28 @@ "parameters": [ { "name": "context.cluster", - "description": "Cluster\n\nA cluster name can be provided to target a specific cluster if multiple\nclusters are configured, otherwise all clusters will be assumed.", + "description": "Cluster. A cluster name can be provided to target a specific cluster if multiple\nclusters are configured, otherwise all clusters will be assumed.", "in": "query", "required": false, "type": "string" }, { "name": "context.namespace", - "description": "Namespace\n\nA namespace must be provided if the context of the operation is for a resource\nor resources in a particular namespace.\nFor requests to list items, not including a namespace here implies that the context\nfor the request is everything the requesting user can read, though the result can\nbe filtered by any filtering options of the request. Plugins may choose to return\nUnimplemented for some queries for which we do not yet have a need.", + "description": "Namespace. A namespace must be provided if the context of the operation is for a resource\nor resources in a particular namespace.\nFor requests to list items, not including a namespace here implies that the context\nfor the request is everything the requesting user can read, though the result can\nbe filtered by any filtering options of the request. Plugins may choose to return\nUnimplemented for some queries for which we do not yet have a need.", "in": "query", "required": false, "type": "string" }, { "name": "paginationOptions.pageToken", - "description": "Page token\n\nThe client uses this field to request a specific page of the list results.", + "description": "Page token. The client uses this field to request a specific page of the list results.", "in": "query", "required": false, "type": "string" }, { "name": "paginationOptions.pageSize", - "description": "Page size\n\nClients use this field to specify the maximum number of results to be\nreturned by the server. The server may further constrain the maximum number\nof results returned in a single page. If the page_size is 0, the server\nwill decide the number of results to be returned.", + "description": "Page size. Clients use this field to specify the maximum number of results to be\nreturned by the server. The server may further constrain the maximum number\nof results returned in a single page. If the page_size is 0, the server\nwill decide the number of results to be returned.", "in": "query", "required": false, "type": "integer", @@ -2470,14 +2466,14 @@ }, { "name": "installedPackageRef.plugin.name", - "description": "Plugin name\n\nThe name of the plugin, such as `fluxv2.packages` or `kapp_controller.packages`.", + "description": "Plugin name. The name of the plugin, such as `fluxv2.packages` or `kapp_controller.packages`.", "in": "query", "required": false, "type": "string" }, { "name": "installedPackageRef.plugin.version", - "description": "Plugin version\n\nThe version of the plugin, such as v1alpha1", + "description": "Plugin version. The version of the plugin, such as v1alpha1", "in": "query", "required": false, "type": "string" @@ -2532,14 +2528,14 @@ }, { "name": "installedPackageRef.plugin.name", - "description": "Plugin name\n\nThe name of the plugin, such as `fluxv2.packages` or `kapp_controller.packages`.", + "description": "Plugin name. The name of the plugin, such as `fluxv2.packages` or `kapp_controller.packages`.", "in": "query", "required": false, "type": "string" }, { "name": "installedPackageRef.plugin.version", - "description": "Plugin version\n\nThe version of the plugin, such as v1alpha1", + "description": "Plugin version. The version of the plugin, such as v1alpha1", "in": "query", "required": false, "type": "string" @@ -2597,38 +2593,7 @@ "in": "body", "required": true, "schema": { - "type": "object", - "properties": { - "installedPackageRef": { - "type": "object", - "properties": { - "context": { - "type": "object", - "description": "The context (cluster/namespace) for the package.", - "title": "Installed package context" - }, - "plugin": { - "$ref": "#/definitions/v1alpha1Plugin", - "description": "The plugin used to identify and interact with the installed package.\nThis field can be omitted when the request is in the context of a specific plugin." - } - }, - "title": "A reference uniquely identifying the installed package being updated.\nRequired" - }, - "pkgVersionReference": { - "$ref": "#/definitions/v1alpha1VersionReference", - "title": "For helm this will be the exact version in VersionReference.version\nFor fluxv2 this could be any semver constraint expression\nFor other plugins we can extend the VersionReference as needed. Optional" - }, - "values": { - "type": "string", - "description": "An optional serialized values string to be included when templating a\npackage in the format expected by the plugin. Included when the backend\nformat doesn't use secrets or configmaps for values or supports both.\nThese values are layered on top of any values refs above, when\nrelevant." - }, - "reconciliationOptions": { - "$ref": "#/definitions/v1alpha1ReconciliationOptions", - "description": "An optional field for specifying data common to systems that reconcile\nthe package on the cluster." - } - }, - "description": "Request for UpdateInstalledPackage. The intent is to reach the desired state specified\nby the fields in the request, while leaving other fields intact. This is a whole\nobject \"Update\" semantics rather than \"Patch\" semantics. The caller will provide the\nvalues for the fields below, which will replace, or be overlayed onto, the\ncorresponding fields in the existing resource. For example, with the\nUpdateInstalledPackageRequest, it is not possible to change just the 'package version\nreference' without also specifying 'values' field. As a side effect, not specifying the\n'values' field in the request means there are no values specified in the desired state.\nSo the meaning of each field value is describing the desired state of the corresponding\nfield in the resource after the update operation has completed the renconciliation.", - "title": "UpdateInstalledPackageRequest" + "$ref": "#/definitions/v1alpha1UpdateInstalledPackageRequest" } } ], @@ -2683,14 +2648,14 @@ }, { "name": "installedPackageRef.plugin.name", - "description": "Plugin name\n\nThe name of the plugin, such as `fluxv2.packages` or `kapp_controller.packages`.", + "description": "Plugin name. The name of the plugin, such as `fluxv2.packages` or `kapp_controller.packages`.", "in": "query", "required": false, "type": "string" }, { "name": "installedPackageRef.plugin.version", - "description": "Plugin version\n\nThe version of the plugin, such as v1alpha1", + "description": "Plugin version. The version of the plugin, such as v1alpha1", "in": "query", "required": false, "type": "string" @@ -2726,14 +2691,14 @@ "parameters": [ { "name": "context.cluster", - "description": "Cluster\n\nA cluster name can be provided to target a specific cluster if multiple\nclusters are configured, otherwise all clusters will be assumed.", + "description": "Cluster. A cluster name can be provided to target a specific cluster if multiple\nclusters are configured, otherwise all clusters will be assumed.", "in": "query", "required": false, "type": "string" }, { "name": "context.namespace", - "description": "Namespace\n\nA namespace must be provided if the context of the operation is for a resource\nor resources in a particular namespace.\nFor requests to list items, not including a namespace here implies that the context\nfor the request is everything the requesting user can read, though the result can\nbe filtered by any filtering options of the request. Plugins may choose to return\nUnimplemented for some queries for which we do not yet have a need.", + "description": "Namespace. A namespace must be provided if the context of the operation is for a resource\nor resources in a particular namespace.\nFor requests to list items, not including a namespace here implies that the context\nfor the request is everything the requesting user can read, though the result can\nbe filtered by any filtering options of the request. Plugins may choose to return\nUnimplemented for some queries for which we do not yet have a need.", "in": "query", "required": false, "type": "string" @@ -2807,13 +2772,6 @@ "in": "path", "required": true, "type": "string" - }, - { - "name": "context.namespace", - "description": "Namespace\n\nA namespace must be provided if the context of the operation is for a resource\nor resources in a particular namespace.\nFor requests to list items, not including a namespace here implies that the context\nfor the request is everything the requesting user can read, though the result can\nbe filtered by any filtering options of the request. Plugins may choose to return\nUnimplemented for some queries for which we do not yet have a need.", - "in": "query", - "required": false, - "type": "string" } ], "tags": [ @@ -2940,31 +2898,6 @@ "in": "path", "required": true, "type": "string" - }, - { - "name": "type", - "description": "Type\n\nThe type of the secret. Valid values are defined by the Type enumeration.", - "in": "query", - "required": false, - "type": "string", - "enum": [ - "SECRET_TYPE_OPAQUE_UNSPECIFIED", - "SECRET_TYPE_SERVICE_ACCOUNT_TOKEN", - "SECRET_TYPE_DOCKER_CONFIG", - "SECRET_TYPE_DOCKER_CONFIG_JSON", - "SECRET_TYPE_BASIC_AUTH", - "SECRET_TYPE_SSH_AUTH", - "SECRET_TYPE_TLS", - "SECRET_TYPE_BOOTSTRAP_TOKEN" - ], - "default": "SECRET_TYPE_OPAQUE_UNSPECIFIED" - }, - { - "name": "name", - "description": "Name\n\nThe name of the secret.", - "in": "query", - "required": false, - "type": "string" } ], "tags": [ @@ -3082,7 +3015,7 @@ }, { "name": "watch", - "description": "Watch\n\nWhen true, this will cause the stream to remain open with updated\nresources being sent as events are received from the Kubernetes API\nserver.", + "description": "Watch. When true, this will cause the stream to remain open with updated\nresources being sent as events are received from the Kubernetes API\nserver.", "in": "query", "required": false, "type": "boolean" @@ -3095,19 +3028,6 @@ } }, "definitions": { - "InstalledPackageStatusStatusReason": { - "type": "string", - "enum": [ - "STATUS_REASON_UNSPECIFIED", - "STATUS_REASON_INSTALLED", - "STATUS_REASON_UNINSTALLED", - "STATUS_REASON_FAILED", - "STATUS_REASON_PENDING" - ], - "default": "STATUS_REASON_UNSPECIFIED", - "description": "Generic reasons why an installed package may be ready or not.\nThese should make sense across different packaging plugins.", - "title": "StatusReason" - }, "PackageRepositoryAuthPackageRepositoryAuthType": { "type": "string", "enum": [ @@ -3123,12 +3043,16 @@ "protobufAny": { "type": "object", "properties": { - "@type": { + "typeUrl": { "type": "string", "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." + }, + "value": { + "type": "string", + "format": "byte", + "description": "Must be a valid serialized protocol buffer of the above specified type." } }, - "additionalProperties": {}, "description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n\n Example 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\n Example 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n ...\n foo := \u0026pb.Foo{}\n if err := any.UnmarshalTo(foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\n\nJSON\n====\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }" }, "rpcStatus": { @@ -3678,6 +3602,17 @@ "description": "Response for GetPackageRepositories", "title": "GetPackageRepositories" }, + "v1alpha1GetPackageRepositoryDetailResponse": { + "type": "object", + "properties": { + "detail": { + "$ref": "#/definitions/v1alpha1PackageRepositoryDetail", + "title": "package repository detail" + } + }, + "description": "Response for GetPackageRepositoryDetail", + "title": "GetPackageRepositoryDetailResponse" + }, "v1alpha1GetResourcesResponse": { "type": "object", "properties": { @@ -3819,7 +3754,7 @@ "title": "Ready" }, "reason": { - "$ref": "#/definitions/InstalledPackageStatusStatusReason", + "$ref": "#/definitions/v1alpha1InstalledPackageStatusStatusReason", "description": "An enum indicating the reason for the current status.", "title": "Reason" }, @@ -3832,6 +3767,19 @@ "description": "An InstalledPackageStatus reports on the current status of the installation.", "title": "InstalledPackageStatus" }, + "v1alpha1InstalledPackageStatusStatusReason": { + "type": "string", + "enum": [ + "STATUS_REASON_UNSPECIFIED", + "STATUS_REASON_INSTALLED", + "STATUS_REASON_UNINSTALLED", + "STATUS_REASON_FAILED", + "STATUS_REASON_PENDING" + ], + "default": "STATUS_REASON_UNSPECIFIED", + "description": "Generic reasons why an installed package may be ready or not.\nThese should make sense across different packaging plugins.", + "title": "StatusReason" + }, "v1alpha1InstalledPackageSummary": { "type": "object", "properties": { @@ -3984,6 +3932,57 @@ "description": "Authentication/authorization to provide client’s identity when connecting\nto a package repository.\nThere are 6 total distinct use cases we may support:\n1) None (Public)\n2) Basic Auth\n3) Bearer Token \n4) Custom Authorization Header\n5) Docker Registry Credentials (for OCI only)\n6) TLS certificate and key\n\nNote that (1)-(4) may be done over HTTP or HTTPs without any custom \ncertificates or certificate authority \n(1) is handled by not not having PackageRepositoryAuth field on\n the parent object\na given plug-in may or may not support a given authentication type. \nFor example\n - direct-helm plug-in does not currently support (6), while flux does\n - flux plug-in does not support (3) or (4) while direct-helm does", "title": "PackageRepositoryAuth" }, + "v1alpha1PackageRepositoryDetail": { + "type": "object", + "properties": { + "packageRepoRef": { + "$ref": "#/definitions/v1alpha1PackageRepositoryReference", + "description": "A reference uniquely identifying the package repository." + }, + "name": { + "type": "string", + "title": "A user-provided name for the package repository (e.g. bitnami)" + }, + "description": { + "type": "string", + "description": "A user-provided description." + }, + "namespaceScoped": { + "type": "boolean", + "description": "Whether this repository is global or namespace-scoped." + }, + "type": { + "type": "string", + "title": "Package storage type" + }, + "url": { + "type": "string", + "description": "A URL identifying the package repository location." + }, + "interval": { + "type": "integer", + "format": "int64", + "title": "The interval at which to check the upstream for updates (in seconds)" + }, + "tlsConfig": { + "$ref": "#/definitions/v1alpha1PackageRepositoryTlsConfig", + "title": "TLS-specific parameters for connecting to a repository. \nIf the cert authority was configured for this repository, then in the context \nof GetPackageRepositoryDetail() operation, the PackageRepositoryTlsConfig will ALWAYS \ncontain an existing SecretKeyReference, rather that cert_authority field" + }, + "auth": { + "$ref": "#/definitions/v1alpha1PackageRepositoryAuth", + "title": "authentication parameters for connecting to a repository.\nIf Basic Auth or TLS or Docker Creds Auth was configured for this repository,\nthen in the context of GetPackageRepositoryDetail() operation, the \nPackageRepositoryAuth will ALWAYS contain an existing SecretKeyReference, \nrather that string values that may have been used when package repository was created\nfield" + }, + "customDetail": { + "$ref": "#/definitions/protobufAny", + "title": "Custom data added by the plugin" + }, + "status": { + "$ref": "#/definitions/v1alpha1PackageRepositoryStatus", + "description": "current status of the repository which can include reconciliation\nstatus, where relevant." + } + }, + "title": "PackageRepositoryDetail" + }, "v1alpha1PackageRepositoryReference": { "type": "object", "properties": { @@ -4003,6 +4002,40 @@ "description": "A PackageRepositoryReference has the minimum information required to\nuniquely identify a package repository.", "title": "PackageRepositoryReference" }, + "v1alpha1PackageRepositoryStatus": { + "type": "object", + "properties": { + "ready": { + "type": "boolean", + "description": "An indication of whether the repository is ready or not", + "title": "Ready" + }, + "reason": { + "$ref": "#/definitions/v1alpha1PackageRepositoryStatusStatusReason", + "description": "An enum indicating the reason for the current status.", + "title": "Reason" + }, + "userReason": { + "type": "string", + "description": "Optional text to return for user context, which may be plugin specific.", + "title": "UserReason" + } + }, + "description": "A PackageRepositoryStatus reports on the current status of the repository.", + "title": "PackageRepositoryStatus" + }, + "v1alpha1PackageRepositoryStatusStatusReason": { + "type": "string", + "enum": [ + "STATUS_REASON_UNSPECIFIED", + "STATUS_REASON_SUCCESS", + "STATUS_REASON_FAILED", + "STATUS_REASON_PENDING" + ], + "default": "STATUS_REASON_UNSPECIFIED", + "description": "Generic reasons why a package repository may be ready or not.\nThese should make sense across different packaging plugins.", + "title": "StatusReason" + }, "v1alpha1PackageRepositoryTlsConfig": { "type": "object", "properties": { @@ -4106,6 +4139,22 @@ "description": "A reference to a Kubernetes resource related to a specific installed package.\nThe context (cluster) for each resource is that of the related\ninstalled package.", "title": "Resource reference" }, + "v1alpha1RollbackInstalledPackageRequest": { + "type": "object", + "properties": { + "installedPackageRef": { + "$ref": "#/definitions/v1alpha1InstalledPackageReference", + "description": "A reference uniquely identifying the installed package.", + "title": "Installed package reference" + }, + "releaseRevision": { + "type": "integer", + "format": "int32", + "description": "A number identifying the Helm revision to which to rollback.", + "title": "ReleaseRevision" + } + } + }, "v1alpha1RollbackInstalledPackageResponse": { "type": "object", "properties": { @@ -4161,6 +4210,29 @@ }, "title": "TlsCertKey" }, + "v1alpha1UpdateInstalledPackageRequest": { + "type": "object", + "properties": { + "installedPackageRef": { + "$ref": "#/definitions/v1alpha1InstalledPackageReference", + "title": "A reference uniquely identifying the installed package being updated.\nRequired" + }, + "pkgVersionReference": { + "$ref": "#/definitions/v1alpha1VersionReference", + "title": "For helm this will be the exact version in VersionReference.version\nFor fluxv2 this could be any semver constraint expression\nFor other plugins we can extend the VersionReference as needed. Optional" + }, + "values": { + "type": "string", + "description": "An optional serialized values string to be included when templating a\npackage in the format expected by the plugin. Included when the backend\nformat doesn't use secrets or configmaps for values or supports both.\nThese values are layered on top of any values refs above, when\nrelevant." + }, + "reconciliationOptions": { + "$ref": "#/definitions/v1alpha1ReconciliationOptions", + "description": "An optional field for specifying data common to systems that reconcile\nthe package on the cluster." + } + }, + "description": "Request for UpdateInstalledPackage. The intent is to reach the desired state specified\nby the fields in the request, while leaving other fields intact. This is a whole\nobject \"Update\" semantics rather than \"Patch\" semantics. The caller will provide the\nvalues for the fields below, which will replace, or be overlayed onto, the\ncorresponding fields in the existing resource. For example, with the\nUpdateInstalledPackageRequest, it is not possible to change just the 'package version\nreference' without also specifying 'values' field. As a side effect, not specifying the\n'values' field in the request means there are no values specified in the desired state.\nSo the meaning of each field value is describing the desired state of the corresponding\nfield in the resource after the update operation has completed the renconciliation.", + "title": "UpdateInstalledPackageRequest" + }, "v1alpha1UpdateInstalledPackageResponse": { "type": "object", "properties": { diff --git a/cmd/kubeapps-apis/gen/apidocs.pb.go b/cmd/kubeapps-apis/gen/apidocs.pb.go index 56066d93197..deb74b7d9a6 100644 --- a/cmd/kubeapps-apis/gen/apidocs.pb.go +++ b/cmd/kubeapps-apis/gen/apidocs.pb.go @@ -4,7 +4,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.1 -// protoc (unknown) +// protoc v3.17.3 // source: kubeappsapis/apidocs/v1alpha1/apidocs.proto package gen diff --git a/cmd/kubeapps-apis/gen/core/packages/v1alpha1/packages.pb.go b/cmd/kubeapps-apis/gen/core/packages/v1alpha1/packages.pb.go index c15fdaddc66..c424699b382 100644 --- a/cmd/kubeapps-apis/gen/core/packages/v1alpha1/packages.pb.go +++ b/cmd/kubeapps-apis/gen/core/packages/v1alpha1/packages.pb.go @@ -4,7 +4,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.1 -// protoc (unknown) +// protoc v3.17.3 // source: kubeappsapis/core/packages/v1alpha1/packages.proto package v1alpha1 diff --git a/cmd/kubeapps-apis/gen/core/packages/v1alpha1/packages_grpc.pb.go b/cmd/kubeapps-apis/gen/core/packages/v1alpha1/packages_grpc.pb.go index f27e4b61ca2..f2e24a461b8 100644 --- a/cmd/kubeapps-apis/gen/core/packages/v1alpha1/packages_grpc.pb.go +++ b/cmd/kubeapps-apis/gen/core/packages/v1alpha1/packages_grpc.pb.go @@ -1,8 +1,4 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.2.0 -// - protoc (unknown) -// source: kubeappsapis/core/packages/v1alpha1/packages.proto package v1alpha1 diff --git a/cmd/kubeapps-apis/gen/core/packages/v1alpha1/repositories.pb.go b/cmd/kubeapps-apis/gen/core/packages/v1alpha1/repositories.pb.go index b7fcf717ace..d14d312cc0f 100644 --- a/cmd/kubeapps-apis/gen/core/packages/v1alpha1/repositories.pb.go +++ b/cmd/kubeapps-apis/gen/core/packages/v1alpha1/repositories.pb.go @@ -4,7 +4,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.1 -// protoc (unknown) +// protoc v3.17.3 // source: kubeappsapis/core/packages/v1alpha1/repositories.proto package v1alpha1 @@ -85,6 +85,62 @@ func (PackageRepositoryAuth_PackageRepositoryAuthType) EnumDescriptor() ([]byte, return file_kubeappsapis_core_packages_v1alpha1_repositories_proto_rawDescGZIP(), []int{2, 0} } +// StatusReason +// +// Generic reasons why a package repository may be ready or not. +// These should make sense across different packaging plugins. +type PackageRepositoryStatus_StatusReason int32 + +const ( + PackageRepositoryStatus_STATUS_REASON_UNSPECIFIED PackageRepositoryStatus_StatusReason = 0 + PackageRepositoryStatus_STATUS_REASON_SUCCESS PackageRepositoryStatus_StatusReason = 1 + PackageRepositoryStatus_STATUS_REASON_FAILED PackageRepositoryStatus_StatusReason = 2 + PackageRepositoryStatus_STATUS_REASON_PENDING PackageRepositoryStatus_StatusReason = 3 +) + +// Enum value maps for PackageRepositoryStatus_StatusReason. +var ( + PackageRepositoryStatus_StatusReason_name = map[int32]string{ + 0: "STATUS_REASON_UNSPECIFIED", + 1: "STATUS_REASON_SUCCESS", + 2: "STATUS_REASON_FAILED", + 3: "STATUS_REASON_PENDING", + } + PackageRepositoryStatus_StatusReason_value = map[string]int32{ + "STATUS_REASON_UNSPECIFIED": 0, + "STATUS_REASON_SUCCESS": 1, + "STATUS_REASON_FAILED": 2, + "STATUS_REASON_PENDING": 3, + } +) + +func (x PackageRepositoryStatus_StatusReason) Enum() *PackageRepositoryStatus_StatusReason { + p := new(PackageRepositoryStatus_StatusReason) + *p = x + return p +} + +func (x PackageRepositoryStatus_StatusReason) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (PackageRepositoryStatus_StatusReason) Descriptor() protoreflect.EnumDescriptor { + return file_kubeappsapis_core_packages_v1alpha1_repositories_proto_enumTypes[1].Descriptor() +} + +func (PackageRepositoryStatus_StatusReason) Type() protoreflect.EnumType { + return &file_kubeappsapis_core_packages_v1alpha1_repositories_proto_enumTypes[1] +} + +func (x PackageRepositoryStatus_StatusReason) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use PackageRepositoryStatus_StatusReason.Descriptor instead. +func (PackageRepositoryStatus_StatusReason) EnumDescriptor() ([]byte, []int) { + return file_kubeappsapis_core_packages_v1alpha1_repositories_proto_rawDescGZIP(), []int{10, 0} +} + // AddPackageRepositoryRequest // // Request for AddPackageRepository @@ -784,6 +840,56 @@ func (x *SecretKeyReference) GetKey() string { return "" } +// GetPackageRepositoryDetailRequest +// +// Request for GetPackageRepositoryDetail +type GetPackageRepositoryDetailRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PackageRepoRef *PackageRepositoryReference `protobuf:"bytes,1,opt,name=package_repo_ref,json=packageRepoRef,proto3" json:"package_repo_ref,omitempty"` +} + +func (x *GetPackageRepositoryDetailRequest) Reset() { + *x = GetPackageRepositoryDetailRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_kubeappsapis_core_packages_v1alpha1_repositories_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetPackageRepositoryDetailRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetPackageRepositoryDetailRequest) ProtoMessage() {} + +func (x *GetPackageRepositoryDetailRequest) ProtoReflect() protoreflect.Message { + mi := &file_kubeappsapis_core_packages_v1alpha1_repositories_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetPackageRepositoryDetailRequest.ProtoReflect.Descriptor instead. +func (*GetPackageRepositoryDetailRequest) Descriptor() ([]byte, []int) { + return file_kubeappsapis_core_packages_v1alpha1_repositories_proto_rawDescGZIP(), []int{7} +} + +func (x *GetPackageRepositoryDetailRequest) GetPackageRepoRef() *PackageRepositoryReference { + if x != nil { + return x.PackageRepoRef + } + return nil +} + // PackageRepositoryReference // // A PackageRepositoryReference has the minimum information required to @@ -807,7 +913,7 @@ type PackageRepositoryReference struct { func (x *PackageRepositoryReference) Reset() { *x = PackageRepositoryReference{} if protoimpl.UnsafeEnabled { - mi := &file_kubeappsapis_core_packages_v1alpha1_repositories_proto_msgTypes[7] + mi := &file_kubeappsapis_core_packages_v1alpha1_repositories_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -820,7 +926,7 @@ func (x *PackageRepositoryReference) String() string { func (*PackageRepositoryReference) ProtoMessage() {} func (x *PackageRepositoryReference) ProtoReflect() protoreflect.Message { - mi := &file_kubeappsapis_core_packages_v1alpha1_repositories_proto_msgTypes[7] + mi := &file_kubeappsapis_core_packages_v1alpha1_repositories_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -833,7 +939,7 @@ func (x *PackageRepositoryReference) ProtoReflect() protoreflect.Message { // Deprecated: Use PackageRepositoryReference.ProtoReflect.Descriptor instead. func (*PackageRepositoryReference) Descriptor() ([]byte, []int) { - return file_kubeappsapis_core_packages_v1alpha1_repositories_proto_rawDescGZIP(), []int{7} + return file_kubeappsapis_core_packages_v1alpha1_repositories_proto_rawDescGZIP(), []int{8} } func (x *PackageRepositoryReference) GetContext() *Context { @@ -875,7 +981,7 @@ type AddPackageRepositoryResponse struct { func (x *AddPackageRepositoryResponse) Reset() { *x = AddPackageRepositoryResponse{} if protoimpl.UnsafeEnabled { - mi := &file_kubeappsapis_core_packages_v1alpha1_repositories_proto_msgTypes[8] + mi := &file_kubeappsapis_core_packages_v1alpha1_repositories_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -888,7 +994,7 @@ func (x *AddPackageRepositoryResponse) String() string { func (*AddPackageRepositoryResponse) ProtoMessage() {} func (x *AddPackageRepositoryResponse) ProtoReflect() protoreflect.Message { - mi := &file_kubeappsapis_core_packages_v1alpha1_repositories_proto_msgTypes[8] + mi := &file_kubeappsapis_core_packages_v1alpha1_repositories_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -901,7 +1007,7 @@ func (x *AddPackageRepositoryResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use AddPackageRepositoryResponse.ProtoReflect.Descriptor instead. func (*AddPackageRepositoryResponse) Descriptor() ([]byte, []int) { - return file_kubeappsapis_core_packages_v1alpha1_repositories_proto_rawDescGZIP(), []int{8} + return file_kubeappsapis_core_packages_v1alpha1_repositories_proto_rawDescGZIP(), []int{9} } func (x *AddPackageRepositoryResponse) GetPackageRepoRef() *PackageRepositoryReference { @@ -911,6 +1017,281 @@ func (x *AddPackageRepositoryResponse) GetPackageRepoRef() *PackageRepositoryRef return nil } +// PackageRepositoryStatus +// +// A PackageRepositoryStatus reports on the current status of the repository. +type PackageRepositoryStatus struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Ready + // + // An indication of whether the repository is ready or not + Ready bool `protobuf:"varint,1,opt,name=ready,proto3" json:"ready,omitempty"` + // Reason + // + // An enum indicating the reason for the current status. + Reason PackageRepositoryStatus_StatusReason `protobuf:"varint,2,opt,name=reason,proto3,enum=kubeappsapis.core.packages.v1alpha1.PackageRepositoryStatus_StatusReason" json:"reason,omitempty"` + // UserReason + // + // Optional text to return for user context, which may be plugin specific. + UserReason string `protobuf:"bytes,3,opt,name=user_reason,json=userReason,proto3" json:"user_reason,omitempty"` +} + +func (x *PackageRepositoryStatus) Reset() { + *x = PackageRepositoryStatus{} + if protoimpl.UnsafeEnabled { + mi := &file_kubeappsapis_core_packages_v1alpha1_repositories_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PackageRepositoryStatus) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PackageRepositoryStatus) ProtoMessage() {} + +func (x *PackageRepositoryStatus) ProtoReflect() protoreflect.Message { + mi := &file_kubeappsapis_core_packages_v1alpha1_repositories_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PackageRepositoryStatus.ProtoReflect.Descriptor instead. +func (*PackageRepositoryStatus) Descriptor() ([]byte, []int) { + return file_kubeappsapis_core_packages_v1alpha1_repositories_proto_rawDescGZIP(), []int{10} +} + +func (x *PackageRepositoryStatus) GetReady() bool { + if x != nil { + return x.Ready + } + return false +} + +func (x *PackageRepositoryStatus) GetReason() PackageRepositoryStatus_StatusReason { + if x != nil { + return x.Reason + } + return PackageRepositoryStatus_STATUS_REASON_UNSPECIFIED +} + +func (x *PackageRepositoryStatus) GetUserReason() string { + if x != nil { + return x.UserReason + } + return "" +} + +// PackageRepositoryDetail +// +type PackageRepositoryDetail struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // A reference uniquely identifying the package repository. + PackageRepoRef *PackageRepositoryReference `protobuf:"bytes,1,opt,name=package_repo_ref,json=packageRepoRef,proto3" json:"package_repo_ref,omitempty"` + // A user-provided name for the package repository (e.g. bitnami) + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + // A user-provided description. + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + // Whether this repository is global or namespace-scoped. + NamespaceScoped bool `protobuf:"varint,4,opt,name=namespace_scoped,json=namespaceScoped,proto3" json:"namespace_scoped,omitempty"` + // Package storage type + Type string `protobuf:"bytes,5,opt,name=type,proto3" json:"type,omitempty"` + // A URL identifying the package repository location. + Url string `protobuf:"bytes,6,opt,name=url,proto3" json:"url,omitempty"` + // The interval at which to check the upstream for updates (in seconds) + Interval uint32 `protobuf:"varint,7,opt,name=interval,proto3" json:"interval,omitempty"` + // TLS-specific parameters for connecting to a repository. + // If the cert authority was configured for this repository, then in the context + // of GetPackageRepositoryDetail() operation, the PackageRepositoryTlsConfig will ALWAYS + // contain an existing SecretKeyReference, rather that cert_authority field + TlsConfig *PackageRepositoryTlsConfig `protobuf:"bytes,8,opt,name=tls_config,json=tlsConfig,proto3" json:"tls_config,omitempty"` + // authentication parameters for connecting to a repository. + // If Basic Auth or TLS or Docker Creds Auth was configured for this repository, + // then in the context of GetPackageRepositoryDetail() operation, the + // PackageRepositoryAuth will ALWAYS contain an existing SecretKeyReference, + // rather that string values that may have been used when package repository was created + // field + Auth *PackageRepositoryAuth `protobuf:"bytes,9,opt,name=auth,proto3" json:"auth,omitempty"` + // Custom data added by the plugin + CustomDetail *anypb.Any `protobuf:"bytes,10,opt,name=custom_detail,json=customDetail,proto3" json:"custom_detail,omitempty"` + // current status of the repository which can include reconciliation + // status, where relevant. + Status *PackageRepositoryStatus `protobuf:"bytes,11,opt,name=status,proto3" json:"status,omitempty"` +} + +func (x *PackageRepositoryDetail) Reset() { + *x = PackageRepositoryDetail{} + if protoimpl.UnsafeEnabled { + mi := &file_kubeappsapis_core_packages_v1alpha1_repositories_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PackageRepositoryDetail) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PackageRepositoryDetail) ProtoMessage() {} + +func (x *PackageRepositoryDetail) ProtoReflect() protoreflect.Message { + mi := &file_kubeappsapis_core_packages_v1alpha1_repositories_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PackageRepositoryDetail.ProtoReflect.Descriptor instead. +func (*PackageRepositoryDetail) Descriptor() ([]byte, []int) { + return file_kubeappsapis_core_packages_v1alpha1_repositories_proto_rawDescGZIP(), []int{11} +} + +func (x *PackageRepositoryDetail) GetPackageRepoRef() *PackageRepositoryReference { + if x != nil { + return x.PackageRepoRef + } + return nil +} + +func (x *PackageRepositoryDetail) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *PackageRepositoryDetail) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *PackageRepositoryDetail) GetNamespaceScoped() bool { + if x != nil { + return x.NamespaceScoped + } + return false +} + +func (x *PackageRepositoryDetail) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *PackageRepositoryDetail) GetUrl() string { + if x != nil { + return x.Url + } + return "" +} + +func (x *PackageRepositoryDetail) GetInterval() uint32 { + if x != nil { + return x.Interval + } + return 0 +} + +func (x *PackageRepositoryDetail) GetTlsConfig() *PackageRepositoryTlsConfig { + if x != nil { + return x.TlsConfig + } + return nil +} + +func (x *PackageRepositoryDetail) GetAuth() *PackageRepositoryAuth { + if x != nil { + return x.Auth + } + return nil +} + +func (x *PackageRepositoryDetail) GetCustomDetail() *anypb.Any { + if x != nil { + return x.CustomDetail + } + return nil +} + +func (x *PackageRepositoryDetail) GetStatus() *PackageRepositoryStatus { + if x != nil { + return x.Status + } + return nil +} + +// GetPackageRepositoryDetailResponse +// +// Response for GetPackageRepositoryDetail +type GetPackageRepositoryDetailResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // package repository detail + Detail *PackageRepositoryDetail `protobuf:"bytes,1,opt,name=detail,proto3" json:"detail,omitempty"` +} + +func (x *GetPackageRepositoryDetailResponse) Reset() { + *x = GetPackageRepositoryDetailResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_kubeappsapis_core_packages_v1alpha1_repositories_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetPackageRepositoryDetailResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetPackageRepositoryDetailResponse) ProtoMessage() {} + +func (x *GetPackageRepositoryDetailResponse) ProtoReflect() protoreflect.Message { + mi := &file_kubeappsapis_core_packages_v1alpha1_repositories_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetPackageRepositoryDetailResponse.ProtoReflect.Descriptor instead. +func (*GetPackageRepositoryDetailResponse) Descriptor() ([]byte, []int) { + return file_kubeappsapis_core_packages_v1alpha1_repositories_proto_rawDescGZIP(), []int{12} +} + +func (x *GetPackageRepositoryDetailResponse) GetDetail() *PackageRepositoryDetail { + if x != nil { + return x.Detail + } + return nil +} + var File_kubeappsapis_core_packages_v1alpha1_repositories_proto protoreflect.FileDescriptor var file_kubeappsapis_core_packages_v1alpha1_repositories_proto_rawDesc = []byte{ @@ -1059,48 +1440,148 @@ var file_kubeappsapis_core_packages_v1alpha1_repositories_proto_rawDesc = []byte 0x79, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, - 0x22, 0xc8, 0x01, 0x0a, 0x1a, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x52, 0x65, 0x70, 0x6f, - 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, - 0x46, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x2c, 0x2e, 0x6b, 0x75, 0x62, 0x65, 0x61, 0x70, 0x70, 0x73, 0x61, 0x70, 0x69, 0x73, 0x2e, + 0x22, 0x8e, 0x01, 0x0a, 0x21, 0x47, 0x65, 0x74, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x52, + 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x69, 0x0a, 0x10, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, + 0x65, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x72, 0x65, 0x66, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x3f, 0x2e, 0x6b, 0x75, 0x62, 0x65, 0x61, 0x70, 0x70, 0x73, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x52, 0x07, - 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, - 0x69, 0x66, 0x69, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x69, 0x64, 0x65, - 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x12, 0x42, 0x0a, 0x06, 0x70, 0x6c, 0x75, 0x67, 0x69, - 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x6b, 0x75, 0x62, 0x65, 0x61, 0x70, - 0x70, 0x73, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x6c, 0x75, 0x67, - 0x69, 0x6e, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x6c, 0x75, - 0x67, 0x69, 0x6e, 0x52, 0x06, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x22, 0x89, 0x01, 0x0a, 0x1c, - 0x41, 0x64, 0x64, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, - 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x69, 0x0a, 0x10, - 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x72, 0x65, 0x66, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x6b, 0x75, 0x62, 0x65, 0x61, 0x70, 0x70, - 0x73, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x61, 0x63, 0x6b, 0x61, - 0x67, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x63, - 0x6b, 0x61, 0x67, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, - 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x0e, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, - 0x52, 0x65, 0x70, 0x6f, 0x52, 0x65, 0x66, 0x32, 0xe4, 0x01, 0x0a, 0x13, 0x52, 0x65, 0x70, 0x6f, - 0x73, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, - 0xcc, 0x01, 0x0a, 0x14, 0x41, 0x64, 0x64, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x52, 0x65, - 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x40, 0x2e, 0x6b, 0x75, 0x62, 0x65, 0x61, - 0x70, 0x70, 0x73, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x61, 0x63, - 0x6b, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, - 0x64, 0x64, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, - 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x41, 0x2e, 0x6b, 0x75, 0x62, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x52, 0x65, + 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, + 0x65, 0x52, 0x0e, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x52, 0x65, + 0x66, 0x22, 0xc8, 0x01, 0x0a, 0x1a, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x52, 0x65, 0x70, + 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, + 0x12, 0x46, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x2c, 0x2e, 0x6b, 0x75, 0x62, 0x65, 0x61, 0x70, 0x70, 0x73, 0x61, 0x70, 0x69, 0x73, + 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x52, + 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x69, 0x64, 0x65, 0x6e, + 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x69, 0x64, + 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x12, 0x42, 0x0a, 0x06, 0x70, 0x6c, 0x75, 0x67, + 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x6b, 0x75, 0x62, 0x65, 0x61, + 0x70, 0x70, 0x73, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x6c, 0x75, + 0x67, 0x69, 0x6e, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x6c, + 0x75, 0x67, 0x69, 0x6e, 0x52, 0x06, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x22, 0x89, 0x01, 0x0a, + 0x1c, 0x41, 0x64, 0x64, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, + 0x69, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x69, 0x0a, + 0x10, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x72, 0x65, + 0x66, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x6b, 0x75, 0x62, 0x65, 0x61, 0x70, + 0x70, 0x73, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x61, 0x63, 0x6b, + 0x61, 0x67, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x61, + 0x63, 0x6b, 0x61, 0x67, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x52, + 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x0e, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, + 0x65, 0x52, 0x65, 0x70, 0x6f, 0x52, 0x65, 0x66, 0x22, 0xb2, 0x02, 0x0a, 0x17, 0x50, 0x61, 0x63, + 0x6b, 0x61, 0x67, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x65, 0x61, 0x64, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x05, 0x72, 0x65, 0x61, 0x64, 0x79, 0x12, 0x61, 0x0a, 0x06, 0x72, 0x65, + 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x49, 0x2e, 0x6b, 0x75, 0x62, 0x65, 0x61, 0x70, 0x70, 0x73, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x41, 0x64, 0x64, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, - 0x69, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2f, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x22, 0x24, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x70, 0x61, 0x63, - 0x6b, 0x61, 0x67, 0x65, 0x73, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x72, - 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x3a, 0x01, 0x2a, 0x42, 0x4b, - 0x5a, 0x49, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6b, 0x75, 0x62, - 0x65, 0x61, 0x70, 0x70, 0x73, 0x2f, 0x6b, 0x75, 0x62, 0x65, 0x61, 0x70, 0x70, 0x73, 0x2f, 0x63, - 0x6d, 0x64, 0x2f, 0x6b, 0x75, 0x62, 0x65, 0x61, 0x70, 0x70, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x73, - 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, - 0x65, 0x73, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, + 0x2e, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, + 0x72, 0x79, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, + 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x52, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x1f, 0x0a, + 0x0b, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0a, 0x75, 0x73, 0x65, 0x72, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x22, 0x7d, + 0x0a, 0x0c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x1d, + 0x0a, 0x19, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, + 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x19, 0x0a, + 0x15, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x53, + 0x55, 0x43, 0x43, 0x45, 0x53, 0x53, 0x10, 0x01, 0x12, 0x18, 0x0a, 0x14, 0x53, 0x54, 0x41, 0x54, + 0x55, 0x53, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, + 0x10, 0x02, 0x12, 0x19, 0x0a, 0x15, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x52, 0x45, 0x41, + 0x53, 0x4f, 0x4e, 0x5f, 0x50, 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x10, 0x03, 0x22, 0xe8, 0x04, + 0x0a, 0x17, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, + 0x6f, 0x72, 0x79, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x69, 0x0a, 0x10, 0x70, 0x61, 0x63, + 0x6b, 0x61, 0x67, 0x65, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x72, 0x65, 0x66, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x6b, 0x75, 0x62, 0x65, 0x61, 0x70, 0x70, 0x73, 0x61, 0x70, + 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, + 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x66, 0x65, 0x72, + 0x65, 0x6e, 0x63, 0x65, 0x52, 0x0e, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x52, 0x65, 0x70, + 0x6f, 0x52, 0x65, 0x66, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, + 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x29, 0x0a, 0x10, 0x6e, 0x61, + 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x64, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, + 0x63, 0x6f, 0x70, 0x65, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x69, + 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x69, + 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x12, 0x5e, 0x0a, 0x0a, 0x74, 0x6c, 0x73, 0x5f, 0x63, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x6b, 0x75, + 0x62, 0x65, 0x61, 0x70, 0x70, 0x73, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, + 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x2e, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, + 0x6f, 0x72, 0x79, 0x54, 0x6c, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x09, 0x74, 0x6c, + 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x4e, 0x0a, 0x04, 0x61, 0x75, 0x74, 0x68, 0x18, + 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x6b, 0x75, 0x62, 0x65, 0x61, 0x70, 0x70, 0x73, + 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, + 0x65, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x63, 0x6b, + 0x61, 0x67, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x41, 0x75, 0x74, + 0x68, 0x52, 0x04, 0x61, 0x75, 0x74, 0x68, 0x12, 0x39, 0x0a, 0x0d, 0x63, 0x75, 0x73, 0x74, 0x6f, + 0x6d, 0x5f, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x0c, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x44, 0x65, 0x74, 0x61, + 0x69, 0x6c, 0x12, 0x54, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x0b, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x3c, 0x2e, 0x6b, 0x75, 0x62, 0x65, 0x61, 0x70, 0x70, 0x73, 0x61, 0x70, 0x69, + 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x2e, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, + 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x7a, 0x0a, 0x22, 0x47, 0x65, 0x74, 0x50, + 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, + 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x54, + 0x0a, 0x06, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3c, + 0x2e, 0x6b, 0x75, 0x62, 0x65, 0x61, 0x70, 0x70, 0x73, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, + 0x72, 0x65, 0x2e, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x52, 0x65, 0x70, 0x6f, + 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x06, 0x64, 0x65, + 0x74, 0x61, 0x69, 0x6c, 0x32, 0xfb, 0x04, 0x0a, 0x13, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, + 0x6f, 0x72, 0x69, 0x65, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0xcc, 0x01, 0x0a, + 0x14, 0x41, 0x64, 0x64, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, + 0x69, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x40, 0x2e, 0x6b, 0x75, 0x62, 0x65, 0x61, 0x70, 0x70, 0x73, + 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, + 0x65, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x50, + 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x41, 0x2e, 0x6b, 0x75, 0x62, 0x65, 0x61, 0x70, + 0x70, 0x73, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x61, 0x63, 0x6b, + 0x61, 0x67, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x64, + 0x64, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, + 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2f, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x29, 0x22, 0x24, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, + 0x65, 0x73, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x72, 0x65, 0x70, 0x6f, + 0x73, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x3a, 0x01, 0x2a, 0x12, 0x94, 0x03, 0x0a, 0x1a, + 0x47, 0x65, 0x74, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, + 0x74, 0x6f, 0x72, 0x79, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x46, 0x2e, 0x6b, 0x75, 0x62, + 0x65, 0x61, 0x70, 0x70, 0x73, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x70, + 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2e, 0x47, 0x65, 0x74, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, + 0x69, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x47, 0x2e, 0x6b, 0x75, 0x62, 0x65, 0x61, 0x70, 0x70, 0x73, 0x61, 0x70, 0x69, + 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x2e, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x61, 0x63, 0x6b, + 0x61, 0x67, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x65, 0x74, + 0x61, 0x69, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xe4, 0x01, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0xdd, 0x01, 0x12, 0xda, 0x01, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x70, 0x61, + 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, + 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x2f, 0x70, 0x6c, 0x75, + 0x67, 0x69, 0x6e, 0x2f, 0x7b, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x5f, 0x72, 0x65, 0x70, + 0x6f, 0x5f, 0x72, 0x65, 0x66, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x6e, 0x61, 0x6d, + 0x65, 0x7d, 0x2f, 0x7b, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x5f, 0x72, 0x65, 0x70, 0x6f, + 0x5f, 0x72, 0x65, 0x66, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x65, 0x72, 0x73, + 0x69, 0x6f, 0x6e, 0x7d, 0x2f, 0x63, 0x2f, 0x7b, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x5f, + 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x72, 0x65, 0x66, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, + 0x2e, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x7d, 0x2f, 0x6e, 0x73, 0x2f, 0x7b, 0x70, 0x61, + 0x63, 0x6b, 0x61, 0x67, 0x65, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x72, 0x65, 0x66, 0x2e, 0x63, + 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, + 0x7d, 0x2f, 0x7b, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x5f, + 0x72, 0x65, 0x66, 0x2e, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x3d, 0x2a, + 0x2a, 0x7d, 0x42, 0x4b, 0x5a, 0x49, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x6b, 0x75, 0x62, 0x65, 0x61, 0x70, 0x70, 0x73, 0x2f, 0x6b, 0x75, 0x62, 0x65, 0x61, 0x70, + 0x70, 0x73, 0x2f, 0x63, 0x6d, 0x64, 0x2f, 0x6b, 0x75, 0x62, 0x65, 0x61, 0x70, 0x70, 0x73, 0x2d, + 0x61, 0x70, 0x69, 0x73, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x70, 0x61, + 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1115,45 +1596,60 @@ func file_kubeappsapis_core_packages_v1alpha1_repositories_proto_rawDescGZIP() [ return file_kubeappsapis_core_packages_v1alpha1_repositories_proto_rawDescData } -var file_kubeappsapis_core_packages_v1alpha1_repositories_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_kubeappsapis_core_packages_v1alpha1_repositories_proto_msgTypes = make([]protoimpl.MessageInfo, 9) +var file_kubeappsapis_core_packages_v1alpha1_repositories_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_kubeappsapis_core_packages_v1alpha1_repositories_proto_msgTypes = make([]protoimpl.MessageInfo, 13) var file_kubeappsapis_core_packages_v1alpha1_repositories_proto_goTypes = []interface{}{ (PackageRepositoryAuth_PackageRepositoryAuthType)(0), // 0: kubeappsapis.core.packages.v1alpha1.PackageRepositoryAuth.PackageRepositoryAuthType - (*AddPackageRepositoryRequest)(nil), // 1: kubeappsapis.core.packages.v1alpha1.AddPackageRepositoryRequest - (*PackageRepositoryTlsConfig)(nil), // 2: kubeappsapis.core.packages.v1alpha1.PackageRepositoryTlsConfig - (*PackageRepositoryAuth)(nil), // 3: kubeappsapis.core.packages.v1alpha1.PackageRepositoryAuth - (*UsernamePassword)(nil), // 4: kubeappsapis.core.packages.v1alpha1.UsernamePassword - (*TlsCertKey)(nil), // 5: kubeappsapis.core.packages.v1alpha1.TlsCertKey - (*DockerCredentials)(nil), // 6: kubeappsapis.core.packages.v1alpha1.DockerCredentials - (*SecretKeyReference)(nil), // 7: kubeappsapis.core.packages.v1alpha1.SecretKeyReference - (*PackageRepositoryReference)(nil), // 8: kubeappsapis.core.packages.v1alpha1.PackageRepositoryReference - (*AddPackageRepositoryResponse)(nil), // 9: kubeappsapis.core.packages.v1alpha1.AddPackageRepositoryResponse - (*Context)(nil), // 10: kubeappsapis.core.packages.v1alpha1.Context - (*v1alpha1.Plugin)(nil), // 11: kubeappsapis.core.plugins.v1alpha1.Plugin - (*anypb.Any)(nil), // 12: google.protobuf.Any + (PackageRepositoryStatus_StatusReason)(0), // 1: kubeappsapis.core.packages.v1alpha1.PackageRepositoryStatus.StatusReason + (*AddPackageRepositoryRequest)(nil), // 2: kubeappsapis.core.packages.v1alpha1.AddPackageRepositoryRequest + (*PackageRepositoryTlsConfig)(nil), // 3: kubeappsapis.core.packages.v1alpha1.PackageRepositoryTlsConfig + (*PackageRepositoryAuth)(nil), // 4: kubeappsapis.core.packages.v1alpha1.PackageRepositoryAuth + (*UsernamePassword)(nil), // 5: kubeappsapis.core.packages.v1alpha1.UsernamePassword + (*TlsCertKey)(nil), // 6: kubeappsapis.core.packages.v1alpha1.TlsCertKey + (*DockerCredentials)(nil), // 7: kubeappsapis.core.packages.v1alpha1.DockerCredentials + (*SecretKeyReference)(nil), // 8: kubeappsapis.core.packages.v1alpha1.SecretKeyReference + (*GetPackageRepositoryDetailRequest)(nil), // 9: kubeappsapis.core.packages.v1alpha1.GetPackageRepositoryDetailRequest + (*PackageRepositoryReference)(nil), // 10: kubeappsapis.core.packages.v1alpha1.PackageRepositoryReference + (*AddPackageRepositoryResponse)(nil), // 11: kubeappsapis.core.packages.v1alpha1.AddPackageRepositoryResponse + (*PackageRepositoryStatus)(nil), // 12: kubeappsapis.core.packages.v1alpha1.PackageRepositoryStatus + (*PackageRepositoryDetail)(nil), // 13: kubeappsapis.core.packages.v1alpha1.PackageRepositoryDetail + (*GetPackageRepositoryDetailResponse)(nil), // 14: kubeappsapis.core.packages.v1alpha1.GetPackageRepositoryDetailResponse + (*Context)(nil), // 15: kubeappsapis.core.packages.v1alpha1.Context + (*v1alpha1.Plugin)(nil), // 16: kubeappsapis.core.plugins.v1alpha1.Plugin + (*anypb.Any)(nil), // 17: google.protobuf.Any } var file_kubeappsapis_core_packages_v1alpha1_repositories_proto_depIdxs = []int32{ - 10, // 0: kubeappsapis.core.packages.v1alpha1.AddPackageRepositoryRequest.context:type_name -> kubeappsapis.core.packages.v1alpha1.Context - 2, // 1: kubeappsapis.core.packages.v1alpha1.AddPackageRepositoryRequest.tls_config:type_name -> kubeappsapis.core.packages.v1alpha1.PackageRepositoryTlsConfig - 3, // 2: kubeappsapis.core.packages.v1alpha1.AddPackageRepositoryRequest.auth:type_name -> kubeappsapis.core.packages.v1alpha1.PackageRepositoryAuth - 11, // 3: kubeappsapis.core.packages.v1alpha1.AddPackageRepositoryRequest.plugin:type_name -> kubeappsapis.core.plugins.v1alpha1.Plugin - 12, // 4: kubeappsapis.core.packages.v1alpha1.AddPackageRepositoryRequest.custom_detail:type_name -> google.protobuf.Any - 7, // 5: kubeappsapis.core.packages.v1alpha1.PackageRepositoryTlsConfig.secret_ref:type_name -> kubeappsapis.core.packages.v1alpha1.SecretKeyReference + 15, // 0: kubeappsapis.core.packages.v1alpha1.AddPackageRepositoryRequest.context:type_name -> kubeappsapis.core.packages.v1alpha1.Context + 3, // 1: kubeappsapis.core.packages.v1alpha1.AddPackageRepositoryRequest.tls_config:type_name -> kubeappsapis.core.packages.v1alpha1.PackageRepositoryTlsConfig + 4, // 2: kubeappsapis.core.packages.v1alpha1.AddPackageRepositoryRequest.auth:type_name -> kubeappsapis.core.packages.v1alpha1.PackageRepositoryAuth + 16, // 3: kubeappsapis.core.packages.v1alpha1.AddPackageRepositoryRequest.plugin:type_name -> kubeappsapis.core.plugins.v1alpha1.Plugin + 17, // 4: kubeappsapis.core.packages.v1alpha1.AddPackageRepositoryRequest.custom_detail:type_name -> google.protobuf.Any + 8, // 5: kubeappsapis.core.packages.v1alpha1.PackageRepositoryTlsConfig.secret_ref:type_name -> kubeappsapis.core.packages.v1alpha1.SecretKeyReference 0, // 6: kubeappsapis.core.packages.v1alpha1.PackageRepositoryAuth.type:type_name -> kubeappsapis.core.packages.v1alpha1.PackageRepositoryAuth.PackageRepositoryAuthType - 4, // 7: kubeappsapis.core.packages.v1alpha1.PackageRepositoryAuth.username_password:type_name -> kubeappsapis.core.packages.v1alpha1.UsernamePassword - 5, // 8: kubeappsapis.core.packages.v1alpha1.PackageRepositoryAuth.tls_cert_key:type_name -> kubeappsapis.core.packages.v1alpha1.TlsCertKey - 6, // 9: kubeappsapis.core.packages.v1alpha1.PackageRepositoryAuth.docker_creds:type_name -> kubeappsapis.core.packages.v1alpha1.DockerCredentials - 7, // 10: kubeappsapis.core.packages.v1alpha1.PackageRepositoryAuth.secret_ref:type_name -> kubeappsapis.core.packages.v1alpha1.SecretKeyReference - 10, // 11: kubeappsapis.core.packages.v1alpha1.PackageRepositoryReference.context:type_name -> kubeappsapis.core.packages.v1alpha1.Context - 11, // 12: kubeappsapis.core.packages.v1alpha1.PackageRepositoryReference.plugin:type_name -> kubeappsapis.core.plugins.v1alpha1.Plugin - 8, // 13: kubeappsapis.core.packages.v1alpha1.AddPackageRepositoryResponse.package_repo_ref:type_name -> kubeappsapis.core.packages.v1alpha1.PackageRepositoryReference - 1, // 14: kubeappsapis.core.packages.v1alpha1.RepositoriesService.AddPackageRepository:input_type -> kubeappsapis.core.packages.v1alpha1.AddPackageRepositoryRequest - 9, // 15: kubeappsapis.core.packages.v1alpha1.RepositoriesService.AddPackageRepository:output_type -> kubeappsapis.core.packages.v1alpha1.AddPackageRepositoryResponse - 15, // [15:16] is the sub-list for method output_type - 14, // [14:15] is the sub-list for method input_type - 14, // [14:14] is the sub-list for extension type_name - 14, // [14:14] is the sub-list for extension extendee - 0, // [0:14] is the sub-list for field type_name + 5, // 7: kubeappsapis.core.packages.v1alpha1.PackageRepositoryAuth.username_password:type_name -> kubeappsapis.core.packages.v1alpha1.UsernamePassword + 6, // 8: kubeappsapis.core.packages.v1alpha1.PackageRepositoryAuth.tls_cert_key:type_name -> kubeappsapis.core.packages.v1alpha1.TlsCertKey + 7, // 9: kubeappsapis.core.packages.v1alpha1.PackageRepositoryAuth.docker_creds:type_name -> kubeappsapis.core.packages.v1alpha1.DockerCredentials + 8, // 10: kubeappsapis.core.packages.v1alpha1.PackageRepositoryAuth.secret_ref:type_name -> kubeappsapis.core.packages.v1alpha1.SecretKeyReference + 10, // 11: kubeappsapis.core.packages.v1alpha1.GetPackageRepositoryDetailRequest.package_repo_ref:type_name -> kubeappsapis.core.packages.v1alpha1.PackageRepositoryReference + 15, // 12: kubeappsapis.core.packages.v1alpha1.PackageRepositoryReference.context:type_name -> kubeappsapis.core.packages.v1alpha1.Context + 16, // 13: kubeappsapis.core.packages.v1alpha1.PackageRepositoryReference.plugin:type_name -> kubeappsapis.core.plugins.v1alpha1.Plugin + 10, // 14: kubeappsapis.core.packages.v1alpha1.AddPackageRepositoryResponse.package_repo_ref:type_name -> kubeappsapis.core.packages.v1alpha1.PackageRepositoryReference + 1, // 15: kubeappsapis.core.packages.v1alpha1.PackageRepositoryStatus.reason:type_name -> kubeappsapis.core.packages.v1alpha1.PackageRepositoryStatus.StatusReason + 10, // 16: kubeappsapis.core.packages.v1alpha1.PackageRepositoryDetail.package_repo_ref:type_name -> kubeappsapis.core.packages.v1alpha1.PackageRepositoryReference + 3, // 17: kubeappsapis.core.packages.v1alpha1.PackageRepositoryDetail.tls_config:type_name -> kubeappsapis.core.packages.v1alpha1.PackageRepositoryTlsConfig + 4, // 18: kubeappsapis.core.packages.v1alpha1.PackageRepositoryDetail.auth:type_name -> kubeappsapis.core.packages.v1alpha1.PackageRepositoryAuth + 17, // 19: kubeappsapis.core.packages.v1alpha1.PackageRepositoryDetail.custom_detail:type_name -> google.protobuf.Any + 12, // 20: kubeappsapis.core.packages.v1alpha1.PackageRepositoryDetail.status:type_name -> kubeappsapis.core.packages.v1alpha1.PackageRepositoryStatus + 13, // 21: kubeappsapis.core.packages.v1alpha1.GetPackageRepositoryDetailResponse.detail:type_name -> kubeappsapis.core.packages.v1alpha1.PackageRepositoryDetail + 2, // 22: kubeappsapis.core.packages.v1alpha1.RepositoriesService.AddPackageRepository:input_type -> kubeappsapis.core.packages.v1alpha1.AddPackageRepositoryRequest + 9, // 23: kubeappsapis.core.packages.v1alpha1.RepositoriesService.GetPackageRepositoryDetail:input_type -> kubeappsapis.core.packages.v1alpha1.GetPackageRepositoryDetailRequest + 11, // 24: kubeappsapis.core.packages.v1alpha1.RepositoriesService.AddPackageRepository:output_type -> kubeappsapis.core.packages.v1alpha1.AddPackageRepositoryResponse + 14, // 25: kubeappsapis.core.packages.v1alpha1.RepositoriesService.GetPackageRepositoryDetail:output_type -> kubeappsapis.core.packages.v1alpha1.GetPackageRepositoryDetailResponse + 24, // [24:26] is the sub-list for method output_type + 22, // [22:24] is the sub-list for method input_type + 22, // [22:22] is the sub-list for extension type_name + 22, // [22:22] is the sub-list for extension extendee + 0, // [0:22] is the sub-list for field type_name } func init() { file_kubeappsapis_core_packages_v1alpha1_repositories_proto_init() } @@ -1248,7 +1744,7 @@ func file_kubeappsapis_core_packages_v1alpha1_repositories_proto_init() { } } file_kubeappsapis_core_packages_v1alpha1_repositories_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PackageRepositoryReference); i { + switch v := v.(*GetPackageRepositoryDetailRequest); i { case 0: return &v.state case 1: @@ -1260,6 +1756,18 @@ func file_kubeappsapis_core_packages_v1alpha1_repositories_proto_init() { } } file_kubeappsapis_core_packages_v1alpha1_repositories_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PackageRepositoryReference); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_kubeappsapis_core_packages_v1alpha1_repositories_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AddPackageRepositoryResponse); i { case 0: return &v.state @@ -1271,6 +1779,42 @@ func file_kubeappsapis_core_packages_v1alpha1_repositories_proto_init() { return nil } } + file_kubeappsapis_core_packages_v1alpha1_repositories_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PackageRepositoryStatus); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_kubeappsapis_core_packages_v1alpha1_repositories_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PackageRepositoryDetail); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_kubeappsapis_core_packages_v1alpha1_repositories_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetPackageRepositoryDetailResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } file_kubeappsapis_core_packages_v1alpha1_repositories_proto_msgTypes[1].OneofWrappers = []interface{}{ (*PackageRepositoryTlsConfig_CertAuthority)(nil), @@ -1288,8 +1832,8 @@ func file_kubeappsapis_core_packages_v1alpha1_repositories_proto_init() { File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_kubeappsapis_core_packages_v1alpha1_repositories_proto_rawDesc, - NumEnums: 1, - NumMessages: 9, + NumEnums: 2, + NumMessages: 13, NumExtensions: 0, NumServices: 1, }, diff --git a/cmd/kubeapps-apis/gen/core/packages/v1alpha1/repositories.pb.gw.go b/cmd/kubeapps-apis/gen/core/packages/v1alpha1/repositories.pb.gw.go index 72148f64ee7..8a0fcdd051d 100644 --- a/cmd/kubeapps-apis/gen/core/packages/v1alpha1/repositories.pb.gw.go +++ b/cmd/kubeapps-apis/gen/core/packages/v1alpha1/repositories.pb.gw.go @@ -65,6 +65,156 @@ func local_request_RepositoriesService_AddPackageRepository_0(ctx context.Contex } +var ( + filter_RepositoriesService_GetPackageRepositoryDetail_0 = &utilities.DoubleArray{Encoding: map[string]int{"package_repo_ref": 0, "plugin": 1, "name": 2, "version": 3, "context": 4, "cluster": 5, "namespace": 6, "identifier": 7}, Base: []int{1, 7, 1, 1, 2, 2, 2, 3, 6, 0, 0, 0, 5, 0, 7, 0}, Check: []int{0, 1, 2, 3, 2, 5, 2, 7, 2, 4, 6, 8, 9, 13, 2, 15}} +) + +func request_RepositoriesService_GetPackageRepositoryDetail_0(ctx context.Context, marshaler runtime.Marshaler, client RepositoriesServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetPackageRepositoryDetailRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["package_repo_ref.plugin.name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "package_repo_ref.plugin.name") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "package_repo_ref.plugin.name", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "package_repo_ref.plugin.name", err) + } + + val, ok = pathParams["package_repo_ref.plugin.version"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "package_repo_ref.plugin.version") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "package_repo_ref.plugin.version", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "package_repo_ref.plugin.version", err) + } + + val, ok = pathParams["package_repo_ref.context.cluster"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "package_repo_ref.context.cluster") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "package_repo_ref.context.cluster", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "package_repo_ref.context.cluster", err) + } + + val, ok = pathParams["package_repo_ref.context.namespace"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "package_repo_ref.context.namespace") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "package_repo_ref.context.namespace", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "package_repo_ref.context.namespace", err) + } + + val, ok = pathParams["package_repo_ref.identifier"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "package_repo_ref.identifier") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "package_repo_ref.identifier", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "package_repo_ref.identifier", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_RepositoriesService_GetPackageRepositoryDetail_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetPackageRepositoryDetail(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_RepositoriesService_GetPackageRepositoryDetail_0(ctx context.Context, marshaler runtime.Marshaler, server RepositoriesServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetPackageRepositoryDetailRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["package_repo_ref.plugin.name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "package_repo_ref.plugin.name") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "package_repo_ref.plugin.name", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "package_repo_ref.plugin.name", err) + } + + val, ok = pathParams["package_repo_ref.plugin.version"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "package_repo_ref.plugin.version") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "package_repo_ref.plugin.version", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "package_repo_ref.plugin.version", err) + } + + val, ok = pathParams["package_repo_ref.context.cluster"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "package_repo_ref.context.cluster") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "package_repo_ref.context.cluster", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "package_repo_ref.context.cluster", err) + } + + val, ok = pathParams["package_repo_ref.context.namespace"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "package_repo_ref.context.namespace") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "package_repo_ref.context.namespace", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "package_repo_ref.context.namespace", err) + } + + val, ok = pathParams["package_repo_ref.identifier"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "package_repo_ref.identifier") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "package_repo_ref.identifier", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "package_repo_ref.identifier", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_RepositoriesService_GetPackageRepositoryDetail_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetPackageRepositoryDetail(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterRepositoriesServiceHandlerServer registers the http handlers for service RepositoriesService to "mux". // UnaryRPC :call RepositoriesServiceServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -94,6 +244,29 @@ func RegisterRepositoriesServiceHandlerServer(ctx context.Context, mux *runtime. }) + mux.Handle("GET", pattern_RepositoriesService_GetPackageRepositoryDetail_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/kubeappsapis.core.packages.v1alpha1.RepositoriesService/GetPackageRepositoryDetail", runtime.WithHTTPPathPattern("/core/packages/v1alpha1/repositories/plugin/{package_repo_ref.plugin.name}/{package_repo_ref.plugin.version}/c/{package_repo_ref.context.cluster}/ns/{package_repo_ref.context.namespace}/{package_repo_ref.identifier=**}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_RepositoriesService_GetPackageRepositoryDetail_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_RepositoriesService_GetPackageRepositoryDetail_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -155,13 +328,37 @@ func RegisterRepositoriesServiceHandlerClient(ctx context.Context, mux *runtime. }) + mux.Handle("GET", pattern_RepositoriesService_GetPackageRepositoryDetail_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/kubeappsapis.core.packages.v1alpha1.RepositoriesService/GetPackageRepositoryDetail", runtime.WithHTTPPathPattern("/core/packages/v1alpha1/repositories/plugin/{package_repo_ref.plugin.name}/{package_repo_ref.plugin.version}/c/{package_repo_ref.context.cluster}/ns/{package_repo_ref.context.namespace}/{package_repo_ref.identifier=**}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_RepositoriesService_GetPackageRepositoryDetail_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_RepositoriesService_GetPackageRepositoryDetail_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } var ( pattern_RepositoriesService_AddPackageRepository_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"core", "packages", "v1alpha1", "repositories"}, "")) + + pattern_RepositoriesService_GetPackageRepositoryDetail_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5, 1, 0, 4, 1, 5, 6, 2, 7, 1, 0, 4, 1, 5, 8, 2, 9, 1, 0, 4, 1, 5, 10, 3, 0, 4, 1, 5, 11}, []string{"core", "packages", "v1alpha1", "repositories", "plugin", "package_repo_ref.plugin.name", "package_repo_ref.plugin.version", "c", "package_repo_ref.context.cluster", "ns", "package_repo_ref.context.namespace", "package_repo_ref.identifier"}, "")) ) var ( forward_RepositoriesService_AddPackageRepository_0 = runtime.ForwardResponseMessage + + forward_RepositoriesService_GetPackageRepositoryDetail_0 = runtime.ForwardResponseMessage ) diff --git a/cmd/kubeapps-apis/gen/core/packages/v1alpha1/repositories_grpc.pb.go b/cmd/kubeapps-apis/gen/core/packages/v1alpha1/repositories_grpc.pb.go index 04022f8cf56..f56a1384e6e 100644 --- a/cmd/kubeapps-apis/gen/core/packages/v1alpha1/repositories_grpc.pb.go +++ b/cmd/kubeapps-apis/gen/core/packages/v1alpha1/repositories_grpc.pb.go @@ -1,8 +1,4 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.2.0 -// - protoc (unknown) -// source: kubeappsapis/core/packages/v1alpha1/repositories.proto package v1alpha1 @@ -23,6 +19,7 @@ const _ = grpc.SupportPackageIsVersion7 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type RepositoriesServiceClient interface { AddPackageRepository(ctx context.Context, in *AddPackageRepositoryRequest, opts ...grpc.CallOption) (*AddPackageRepositoryResponse, error) + GetPackageRepositoryDetail(ctx context.Context, in *GetPackageRepositoryDetailRequest, opts ...grpc.CallOption) (*GetPackageRepositoryDetailResponse, error) } type repositoriesServiceClient struct { @@ -42,11 +39,21 @@ func (c *repositoriesServiceClient) AddPackageRepository(ctx context.Context, in return out, nil } +func (c *repositoriesServiceClient) GetPackageRepositoryDetail(ctx context.Context, in *GetPackageRepositoryDetailRequest, opts ...grpc.CallOption) (*GetPackageRepositoryDetailResponse, error) { + out := new(GetPackageRepositoryDetailResponse) + err := c.cc.Invoke(ctx, "/kubeappsapis.core.packages.v1alpha1.RepositoriesService/GetPackageRepositoryDetail", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // RepositoriesServiceServer is the server API for RepositoriesService service. // All implementations should embed UnimplementedRepositoriesServiceServer // for forward compatibility type RepositoriesServiceServer interface { AddPackageRepository(context.Context, *AddPackageRepositoryRequest) (*AddPackageRepositoryResponse, error) + GetPackageRepositoryDetail(context.Context, *GetPackageRepositoryDetailRequest) (*GetPackageRepositoryDetailResponse, error) } // UnimplementedRepositoriesServiceServer should be embedded to have forward compatible implementations. @@ -56,6 +63,9 @@ type UnimplementedRepositoriesServiceServer struct { func (UnimplementedRepositoriesServiceServer) AddPackageRepository(context.Context, *AddPackageRepositoryRequest) (*AddPackageRepositoryResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method AddPackageRepository not implemented") } +func (UnimplementedRepositoriesServiceServer) GetPackageRepositoryDetail(context.Context, *GetPackageRepositoryDetailRequest) (*GetPackageRepositoryDetailResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetPackageRepositoryDetail not implemented") +} // UnsafeRepositoriesServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to RepositoriesServiceServer will @@ -86,6 +96,24 @@ func _RepositoriesService_AddPackageRepository_Handler(srv interface{}, ctx cont return interceptor(ctx, in, info, handler) } +func _RepositoriesService_GetPackageRepositoryDetail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetPackageRepositoryDetailRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RepositoriesServiceServer).GetPackageRepositoryDetail(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/kubeappsapis.core.packages.v1alpha1.RepositoriesService/GetPackageRepositoryDetail", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RepositoriesServiceServer).GetPackageRepositoryDetail(ctx, req.(*GetPackageRepositoryDetailRequest)) + } + return interceptor(ctx, in, info, handler) +} + // RepositoriesService_ServiceDesc is the grpc.ServiceDesc for RepositoriesService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -97,6 +125,10 @@ var RepositoriesService_ServiceDesc = grpc.ServiceDesc{ MethodName: "AddPackageRepository", Handler: _RepositoriesService_AddPackageRepository_Handler, }, + { + MethodName: "GetPackageRepositoryDetail", + Handler: _RepositoriesService_GetPackageRepositoryDetail_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "kubeappsapis/core/packages/v1alpha1/repositories.proto", diff --git a/cmd/kubeapps-apis/gen/core/plugins/v1alpha1/plugins.pb.go b/cmd/kubeapps-apis/gen/core/plugins/v1alpha1/plugins.pb.go index dd0180ec6d6..6b47597990f 100644 --- a/cmd/kubeapps-apis/gen/core/plugins/v1alpha1/plugins.pb.go +++ b/cmd/kubeapps-apis/gen/core/plugins/v1alpha1/plugins.pb.go @@ -4,7 +4,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.1 -// protoc (unknown) +// protoc v3.17.3 // source: kubeappsapis/core/plugins/v1alpha1/plugins.proto package v1alpha1 diff --git a/cmd/kubeapps-apis/gen/core/plugins/v1alpha1/plugins_grpc.pb.go b/cmd/kubeapps-apis/gen/core/plugins/v1alpha1/plugins_grpc.pb.go index c9f75647c0d..ed468e46510 100644 --- a/cmd/kubeapps-apis/gen/core/plugins/v1alpha1/plugins_grpc.pb.go +++ b/cmd/kubeapps-apis/gen/core/plugins/v1alpha1/plugins_grpc.pb.go @@ -1,8 +1,4 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.2.0 -// - protoc (unknown) -// source: kubeappsapis/core/plugins/v1alpha1/plugins.proto package v1alpha1 diff --git a/cmd/kubeapps-apis/gen/plugins/fluxv2/packages/v1alpha1/fluxv2.pb.go b/cmd/kubeapps-apis/gen/plugins/fluxv2/packages/v1alpha1/fluxv2.pb.go index e9ef1cb203a..5b6d535bd08 100644 --- a/cmd/kubeapps-apis/gen/plugins/fluxv2/packages/v1alpha1/fluxv2.pb.go +++ b/cmd/kubeapps-apis/gen/plugins/fluxv2/packages/v1alpha1/fluxv2.pb.go @@ -4,7 +4,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.1 -// protoc (unknown) +// protoc v3.17.3 // source: kubeappsapis/plugins/fluxv2/packages/v1alpha1/fluxv2.proto package v1alpha1 @@ -233,7 +233,7 @@ var file_kubeappsapis_plugins_fluxv2_packages_v1alpha1_fluxv2_proto_rawDesc = [] 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x7d, 0x2f, 0x7b, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x5f, 0x72, 0x65, 0x66, 0x2e, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x7d, 0x2f, 0x72, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x72, 0x65, 0x66, 0x73, 0x32, 0xf4, 0x01, 0x0a, 0x19, 0x46, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x72, 0x65, 0x66, 0x73, 0x32, 0x95, 0x05, 0x0a, 0x19, 0x46, 0x6c, 0x75, 0x78, 0x56, 0x32, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0xd6, 0x01, 0x0a, 0x14, 0x41, 0x64, 0x64, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, @@ -249,12 +249,39 @@ var file_kubeappsapis_plugins_fluxv2_packages_v1alpha1_fluxv2_proto_rawDesc = [] 0x2f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x2f, 0x66, 0x6c, 0x75, 0x78, 0x76, 0x32, 0x2f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x3a, 0x01, - 0x2a, 0x42, 0x55, 0x5a, 0x53, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x6b, 0x75, 0x62, 0x65, 0x61, 0x70, 0x70, 0x73, 0x2f, 0x6b, 0x75, 0x62, 0x65, 0x61, 0x70, 0x70, - 0x73, 0x2f, 0x63, 0x6d, 0x64, 0x2f, 0x6b, 0x75, 0x62, 0x65, 0x61, 0x70, 0x70, 0x73, 0x2d, 0x61, - 0x70, 0x69, 0x73, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x2f, - 0x66, 0x6c, 0x75, 0x78, 0x76, 0x32, 0x2f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x2f, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x2a, 0x12, 0x9e, 0x03, 0x0a, 0x1a, 0x47, 0x65, 0x74, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, + 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, + 0x12, 0x46, 0x2e, 0x6b, 0x75, 0x62, 0x65, 0x61, 0x70, 0x70, 0x73, 0x61, 0x70, 0x69, 0x73, 0x2e, + 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x76, 0x31, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, + 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x65, 0x74, 0x61, 0x69, + 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x47, 0x2e, 0x6b, 0x75, 0x62, 0x65, 0x61, + 0x70, 0x70, 0x73, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x61, 0x63, + 0x6b, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, + 0x65, 0x74, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, + 0x6f, 0x72, 0x79, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0xee, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0xe7, 0x01, 0x12, 0xe4, 0x01, 0x2f, 0x70, + 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x2f, 0x66, 0x6c, 0x75, 0x78, 0x76, 0x32, 0x2f, 0x70, 0x61, + 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, + 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x2f, 0x70, 0x6c, 0x75, + 0x67, 0x69, 0x6e, 0x2f, 0x7b, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x5f, 0x72, 0x65, 0x70, + 0x6f, 0x5f, 0x72, 0x65, 0x66, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x6e, 0x61, 0x6d, + 0x65, 0x7d, 0x2f, 0x7b, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x5f, 0x72, 0x65, 0x70, 0x6f, + 0x5f, 0x72, 0x65, 0x66, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x65, 0x72, 0x73, + 0x69, 0x6f, 0x6e, 0x7d, 0x2f, 0x63, 0x2f, 0x7b, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x5f, + 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x72, 0x65, 0x66, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, + 0x2e, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x7d, 0x2f, 0x6e, 0x73, 0x2f, 0x7b, 0x70, 0x61, + 0x63, 0x6b, 0x61, 0x67, 0x65, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x72, 0x65, 0x66, 0x2e, 0x63, + 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, + 0x7d, 0x2f, 0x7b, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x5f, + 0x72, 0x65, 0x66, 0x2e, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x3d, 0x2a, + 0x2a, 0x7d, 0x42, 0x55, 0x5a, 0x53, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x6b, 0x75, 0x62, 0x65, 0x61, 0x70, 0x70, 0x73, 0x2f, 0x6b, 0x75, 0x62, 0x65, 0x61, 0x70, + 0x70, 0x73, 0x2f, 0x63, 0x6d, 0x64, 0x2f, 0x6b, 0x75, 0x62, 0x65, 0x61, 0x70, 0x70, 0x73, 0x2d, + 0x61, 0x70, 0x69, 0x73, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, + 0x2f, 0x66, 0x6c, 0x75, 0x78, 0x76, 0x32, 0x2f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, + 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var file_kubeappsapis_plugins_fluxv2_packages_v1alpha1_fluxv2_proto_goTypes = []interface{}{ @@ -268,16 +295,18 @@ var file_kubeappsapis_plugins_fluxv2_packages_v1alpha1_fluxv2_proto_goTypes = [] (*v1alpha1.DeleteInstalledPackageRequest)(nil), // 7: kubeappsapis.core.packages.v1alpha1.DeleteInstalledPackageRequest (*v1alpha1.GetInstalledPackageResourceRefsRequest)(nil), // 8: kubeappsapis.core.packages.v1alpha1.GetInstalledPackageResourceRefsRequest (*v1alpha1.AddPackageRepositoryRequest)(nil), // 9: kubeappsapis.core.packages.v1alpha1.AddPackageRepositoryRequest - (*v1alpha1.GetAvailablePackageSummariesResponse)(nil), // 10: kubeappsapis.core.packages.v1alpha1.GetAvailablePackageSummariesResponse - (*v1alpha1.GetAvailablePackageDetailResponse)(nil), // 11: kubeappsapis.core.packages.v1alpha1.GetAvailablePackageDetailResponse - (*v1alpha1.GetAvailablePackageVersionsResponse)(nil), // 12: kubeappsapis.core.packages.v1alpha1.GetAvailablePackageVersionsResponse - (*v1alpha1.GetInstalledPackageSummariesResponse)(nil), // 13: kubeappsapis.core.packages.v1alpha1.GetInstalledPackageSummariesResponse - (*v1alpha1.GetInstalledPackageDetailResponse)(nil), // 14: kubeappsapis.core.packages.v1alpha1.GetInstalledPackageDetailResponse - (*v1alpha1.CreateInstalledPackageResponse)(nil), // 15: kubeappsapis.core.packages.v1alpha1.CreateInstalledPackageResponse - (*v1alpha1.UpdateInstalledPackageResponse)(nil), // 16: kubeappsapis.core.packages.v1alpha1.UpdateInstalledPackageResponse - (*v1alpha1.DeleteInstalledPackageResponse)(nil), // 17: kubeappsapis.core.packages.v1alpha1.DeleteInstalledPackageResponse - (*v1alpha1.GetInstalledPackageResourceRefsResponse)(nil), // 18: kubeappsapis.core.packages.v1alpha1.GetInstalledPackageResourceRefsResponse - (*v1alpha1.AddPackageRepositoryResponse)(nil), // 19: kubeappsapis.core.packages.v1alpha1.AddPackageRepositoryResponse + (*v1alpha1.GetPackageRepositoryDetailRequest)(nil), // 10: kubeappsapis.core.packages.v1alpha1.GetPackageRepositoryDetailRequest + (*v1alpha1.GetAvailablePackageSummariesResponse)(nil), // 11: kubeappsapis.core.packages.v1alpha1.GetAvailablePackageSummariesResponse + (*v1alpha1.GetAvailablePackageDetailResponse)(nil), // 12: kubeappsapis.core.packages.v1alpha1.GetAvailablePackageDetailResponse + (*v1alpha1.GetAvailablePackageVersionsResponse)(nil), // 13: kubeappsapis.core.packages.v1alpha1.GetAvailablePackageVersionsResponse + (*v1alpha1.GetInstalledPackageSummariesResponse)(nil), // 14: kubeappsapis.core.packages.v1alpha1.GetInstalledPackageSummariesResponse + (*v1alpha1.GetInstalledPackageDetailResponse)(nil), // 15: kubeappsapis.core.packages.v1alpha1.GetInstalledPackageDetailResponse + (*v1alpha1.CreateInstalledPackageResponse)(nil), // 16: kubeappsapis.core.packages.v1alpha1.CreateInstalledPackageResponse + (*v1alpha1.UpdateInstalledPackageResponse)(nil), // 17: kubeappsapis.core.packages.v1alpha1.UpdateInstalledPackageResponse + (*v1alpha1.DeleteInstalledPackageResponse)(nil), // 18: kubeappsapis.core.packages.v1alpha1.DeleteInstalledPackageResponse + (*v1alpha1.GetInstalledPackageResourceRefsResponse)(nil), // 19: kubeappsapis.core.packages.v1alpha1.GetInstalledPackageResourceRefsResponse + (*v1alpha1.AddPackageRepositoryResponse)(nil), // 20: kubeappsapis.core.packages.v1alpha1.AddPackageRepositoryResponse + (*v1alpha1.GetPackageRepositoryDetailResponse)(nil), // 21: kubeappsapis.core.packages.v1alpha1.GetPackageRepositoryDetailResponse } var file_kubeappsapis_plugins_fluxv2_packages_v1alpha1_fluxv2_proto_depIdxs = []int32{ 0, // 0: kubeappsapis.plugins.fluxv2.packages.v1alpha1.FluxV2PackagesService.GetAvailablePackageSummaries:input_type -> kubeappsapis.core.packages.v1alpha1.GetAvailablePackageSummariesRequest @@ -290,18 +319,20 @@ var file_kubeappsapis_plugins_fluxv2_packages_v1alpha1_fluxv2_proto_depIdxs = [] 7, // 7: kubeappsapis.plugins.fluxv2.packages.v1alpha1.FluxV2PackagesService.DeleteInstalledPackage:input_type -> kubeappsapis.core.packages.v1alpha1.DeleteInstalledPackageRequest 8, // 8: kubeappsapis.plugins.fluxv2.packages.v1alpha1.FluxV2PackagesService.GetInstalledPackageResourceRefs:input_type -> kubeappsapis.core.packages.v1alpha1.GetInstalledPackageResourceRefsRequest 9, // 9: kubeappsapis.plugins.fluxv2.packages.v1alpha1.FluxV2RepositoriesService.AddPackageRepository:input_type -> kubeappsapis.core.packages.v1alpha1.AddPackageRepositoryRequest - 10, // 10: kubeappsapis.plugins.fluxv2.packages.v1alpha1.FluxV2PackagesService.GetAvailablePackageSummaries:output_type -> kubeappsapis.core.packages.v1alpha1.GetAvailablePackageSummariesResponse - 11, // 11: kubeappsapis.plugins.fluxv2.packages.v1alpha1.FluxV2PackagesService.GetAvailablePackageDetail:output_type -> kubeappsapis.core.packages.v1alpha1.GetAvailablePackageDetailResponse - 12, // 12: kubeappsapis.plugins.fluxv2.packages.v1alpha1.FluxV2PackagesService.GetAvailablePackageVersions:output_type -> kubeappsapis.core.packages.v1alpha1.GetAvailablePackageVersionsResponse - 13, // 13: kubeappsapis.plugins.fluxv2.packages.v1alpha1.FluxV2PackagesService.GetInstalledPackageSummaries:output_type -> kubeappsapis.core.packages.v1alpha1.GetInstalledPackageSummariesResponse - 14, // 14: kubeappsapis.plugins.fluxv2.packages.v1alpha1.FluxV2PackagesService.GetInstalledPackageDetail:output_type -> kubeappsapis.core.packages.v1alpha1.GetInstalledPackageDetailResponse - 15, // 15: kubeappsapis.plugins.fluxv2.packages.v1alpha1.FluxV2PackagesService.CreateInstalledPackage:output_type -> kubeappsapis.core.packages.v1alpha1.CreateInstalledPackageResponse - 16, // 16: kubeappsapis.plugins.fluxv2.packages.v1alpha1.FluxV2PackagesService.UpdateInstalledPackage:output_type -> kubeappsapis.core.packages.v1alpha1.UpdateInstalledPackageResponse - 17, // 17: kubeappsapis.plugins.fluxv2.packages.v1alpha1.FluxV2PackagesService.DeleteInstalledPackage:output_type -> kubeappsapis.core.packages.v1alpha1.DeleteInstalledPackageResponse - 18, // 18: kubeappsapis.plugins.fluxv2.packages.v1alpha1.FluxV2PackagesService.GetInstalledPackageResourceRefs:output_type -> kubeappsapis.core.packages.v1alpha1.GetInstalledPackageResourceRefsResponse - 19, // 19: kubeappsapis.plugins.fluxv2.packages.v1alpha1.FluxV2RepositoriesService.AddPackageRepository:output_type -> kubeappsapis.core.packages.v1alpha1.AddPackageRepositoryResponse - 10, // [10:20] is the sub-list for method output_type - 0, // [0:10] is the sub-list for method input_type + 10, // 10: kubeappsapis.plugins.fluxv2.packages.v1alpha1.FluxV2RepositoriesService.GetPackageRepositoryDetail:input_type -> kubeappsapis.core.packages.v1alpha1.GetPackageRepositoryDetailRequest + 11, // 11: kubeappsapis.plugins.fluxv2.packages.v1alpha1.FluxV2PackagesService.GetAvailablePackageSummaries:output_type -> kubeappsapis.core.packages.v1alpha1.GetAvailablePackageSummariesResponse + 12, // 12: kubeappsapis.plugins.fluxv2.packages.v1alpha1.FluxV2PackagesService.GetAvailablePackageDetail:output_type -> kubeappsapis.core.packages.v1alpha1.GetAvailablePackageDetailResponse + 13, // 13: kubeappsapis.plugins.fluxv2.packages.v1alpha1.FluxV2PackagesService.GetAvailablePackageVersions:output_type -> kubeappsapis.core.packages.v1alpha1.GetAvailablePackageVersionsResponse + 14, // 14: kubeappsapis.plugins.fluxv2.packages.v1alpha1.FluxV2PackagesService.GetInstalledPackageSummaries:output_type -> kubeappsapis.core.packages.v1alpha1.GetInstalledPackageSummariesResponse + 15, // 15: kubeappsapis.plugins.fluxv2.packages.v1alpha1.FluxV2PackagesService.GetInstalledPackageDetail:output_type -> kubeappsapis.core.packages.v1alpha1.GetInstalledPackageDetailResponse + 16, // 16: kubeappsapis.plugins.fluxv2.packages.v1alpha1.FluxV2PackagesService.CreateInstalledPackage:output_type -> kubeappsapis.core.packages.v1alpha1.CreateInstalledPackageResponse + 17, // 17: kubeappsapis.plugins.fluxv2.packages.v1alpha1.FluxV2PackagesService.UpdateInstalledPackage:output_type -> kubeappsapis.core.packages.v1alpha1.UpdateInstalledPackageResponse + 18, // 18: kubeappsapis.plugins.fluxv2.packages.v1alpha1.FluxV2PackagesService.DeleteInstalledPackage:output_type -> kubeappsapis.core.packages.v1alpha1.DeleteInstalledPackageResponse + 19, // 19: kubeappsapis.plugins.fluxv2.packages.v1alpha1.FluxV2PackagesService.GetInstalledPackageResourceRefs:output_type -> kubeappsapis.core.packages.v1alpha1.GetInstalledPackageResourceRefsResponse + 20, // 20: kubeappsapis.plugins.fluxv2.packages.v1alpha1.FluxV2RepositoriesService.AddPackageRepository:output_type -> kubeappsapis.core.packages.v1alpha1.AddPackageRepositoryResponse + 21, // 21: kubeappsapis.plugins.fluxv2.packages.v1alpha1.FluxV2RepositoriesService.GetPackageRepositoryDetail:output_type -> kubeappsapis.core.packages.v1alpha1.GetPackageRepositoryDetailResponse + 11, // [11:22] is the sub-list for method output_type + 0, // [0:11] is the sub-list for method input_type 0, // [0:0] is the sub-list for extension type_name 0, // [0:0] is the sub-list for extension extendee 0, // [0:0] is the sub-list for field type_name diff --git a/cmd/kubeapps-apis/gen/plugins/fluxv2/packages/v1alpha1/fluxv2.pb.gw.go b/cmd/kubeapps-apis/gen/plugins/fluxv2/packages/v1alpha1/fluxv2.pb.gw.go index 434fe7255ae..68ad79ea514 100644 --- a/cmd/kubeapps-apis/gen/plugins/fluxv2/packages/v1alpha1/fluxv2.pb.gw.go +++ b/cmd/kubeapps-apis/gen/plugins/fluxv2/packages/v1alpha1/fluxv2.pb.gw.go @@ -15,7 +15,7 @@ import ( "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" - "github.com/kubeapps/kubeapps/cmd/kubeapps-apis/gen/core/packages/v1alpha1" + v1alpha1_0 "github.com/kubeapps/kubeapps/cmd/kubeapps-apis/gen/core/packages/v1alpha1" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" @@ -37,7 +37,7 @@ var ( ) func request_FluxV2PackagesService_GetAvailablePackageSummaries_0(ctx context.Context, marshaler runtime.Marshaler, client FluxV2PackagesServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1alpha1.GetAvailablePackageSummariesRequest + var protoReq v1alpha1_0.GetAvailablePackageSummariesRequest var metadata runtime.ServerMetadata if err := req.ParseForm(); err != nil { @@ -53,7 +53,7 @@ func request_FluxV2PackagesService_GetAvailablePackageSummaries_0(ctx context.Co } func local_request_FluxV2PackagesService_GetAvailablePackageSummaries_0(ctx context.Context, marshaler runtime.Marshaler, server FluxV2PackagesServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1alpha1.GetAvailablePackageSummariesRequest + var protoReq v1alpha1_0.GetAvailablePackageSummariesRequest var metadata runtime.ServerMetadata if err := req.ParseForm(); err != nil { @@ -73,7 +73,7 @@ var ( ) func request_FluxV2PackagesService_GetAvailablePackageDetail_0(ctx context.Context, marshaler runtime.Marshaler, client FluxV2PackagesServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1alpha1.GetAvailablePackageDetailRequest + var protoReq v1alpha1_0.GetAvailablePackageDetailRequest var metadata runtime.ServerMetadata var ( @@ -126,7 +126,7 @@ func request_FluxV2PackagesService_GetAvailablePackageDetail_0(ctx context.Conte } func local_request_FluxV2PackagesService_GetAvailablePackageDetail_0(ctx context.Context, marshaler runtime.Marshaler, server FluxV2PackagesServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1alpha1.GetAvailablePackageDetailRequest + var protoReq v1alpha1_0.GetAvailablePackageDetailRequest var metadata runtime.ServerMetadata var ( @@ -183,7 +183,7 @@ var ( ) func request_FluxV2PackagesService_GetAvailablePackageVersions_0(ctx context.Context, marshaler runtime.Marshaler, client FluxV2PackagesServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1alpha1.GetAvailablePackageVersionsRequest + var protoReq v1alpha1_0.GetAvailablePackageVersionsRequest var metadata runtime.ServerMetadata var ( @@ -236,7 +236,7 @@ func request_FluxV2PackagesService_GetAvailablePackageVersions_0(ctx context.Con } func local_request_FluxV2PackagesService_GetAvailablePackageVersions_0(ctx context.Context, marshaler runtime.Marshaler, server FluxV2PackagesServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1alpha1.GetAvailablePackageVersionsRequest + var protoReq v1alpha1_0.GetAvailablePackageVersionsRequest var metadata runtime.ServerMetadata var ( @@ -293,7 +293,7 @@ var ( ) func request_FluxV2PackagesService_GetInstalledPackageSummaries_0(ctx context.Context, marshaler runtime.Marshaler, client FluxV2PackagesServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1alpha1.GetInstalledPackageSummariesRequest + var protoReq v1alpha1_0.GetInstalledPackageSummariesRequest var metadata runtime.ServerMetadata if err := req.ParseForm(); err != nil { @@ -309,7 +309,7 @@ func request_FluxV2PackagesService_GetInstalledPackageSummaries_0(ctx context.Co } func local_request_FluxV2PackagesService_GetInstalledPackageSummaries_0(ctx context.Context, marshaler runtime.Marshaler, server FluxV2PackagesServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1alpha1.GetInstalledPackageSummariesRequest + var protoReq v1alpha1_0.GetInstalledPackageSummariesRequest var metadata runtime.ServerMetadata if err := req.ParseForm(); err != nil { @@ -329,7 +329,7 @@ var ( ) func request_FluxV2PackagesService_GetInstalledPackageDetail_0(ctx context.Context, marshaler runtime.Marshaler, client FluxV2PackagesServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1alpha1.GetInstalledPackageDetailRequest + var protoReq v1alpha1_0.GetInstalledPackageDetailRequest var metadata runtime.ServerMetadata var ( @@ -382,7 +382,7 @@ func request_FluxV2PackagesService_GetInstalledPackageDetail_0(ctx context.Conte } func local_request_FluxV2PackagesService_GetInstalledPackageDetail_0(ctx context.Context, marshaler runtime.Marshaler, server FluxV2PackagesServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1alpha1.GetInstalledPackageDetailRequest + var protoReq v1alpha1_0.GetInstalledPackageDetailRequest var metadata runtime.ServerMetadata var ( @@ -435,7 +435,7 @@ func local_request_FluxV2PackagesService_GetInstalledPackageDetail_0(ctx context } func request_FluxV2PackagesService_CreateInstalledPackage_0(ctx context.Context, marshaler runtime.Marshaler, client FluxV2PackagesServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1alpha1.CreateInstalledPackageRequest + var protoReq v1alpha1_0.CreateInstalledPackageRequest var metadata runtime.ServerMetadata newReader, berr := utilities.IOReaderFactory(req.Body) @@ -452,7 +452,7 @@ func request_FluxV2PackagesService_CreateInstalledPackage_0(ctx context.Context, } func local_request_FluxV2PackagesService_CreateInstalledPackage_0(ctx context.Context, marshaler runtime.Marshaler, server FluxV2PackagesServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1alpha1.CreateInstalledPackageRequest + var protoReq v1alpha1_0.CreateInstalledPackageRequest var metadata runtime.ServerMetadata newReader, berr := utilities.IOReaderFactory(req.Body) @@ -469,7 +469,7 @@ func local_request_FluxV2PackagesService_CreateInstalledPackage_0(ctx context.Co } func request_FluxV2PackagesService_UpdateInstalledPackage_0(ctx context.Context, marshaler runtime.Marshaler, client FluxV2PackagesServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1alpha1.UpdateInstalledPackageRequest + var protoReq v1alpha1_0.UpdateInstalledPackageRequest var metadata runtime.ServerMetadata newReader, berr := utilities.IOReaderFactory(req.Body) @@ -523,7 +523,7 @@ func request_FluxV2PackagesService_UpdateInstalledPackage_0(ctx context.Context, } func local_request_FluxV2PackagesService_UpdateInstalledPackage_0(ctx context.Context, marshaler runtime.Marshaler, server FluxV2PackagesServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1alpha1.UpdateInstalledPackageRequest + var protoReq v1alpha1_0.UpdateInstalledPackageRequest var metadata runtime.ServerMetadata newReader, berr := utilities.IOReaderFactory(req.Body) @@ -581,7 +581,7 @@ var ( ) func request_FluxV2PackagesService_DeleteInstalledPackage_0(ctx context.Context, marshaler runtime.Marshaler, client FluxV2PackagesServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1alpha1.DeleteInstalledPackageRequest + var protoReq v1alpha1_0.DeleteInstalledPackageRequest var metadata runtime.ServerMetadata var ( @@ -634,7 +634,7 @@ func request_FluxV2PackagesService_DeleteInstalledPackage_0(ctx context.Context, } func local_request_FluxV2PackagesService_DeleteInstalledPackage_0(ctx context.Context, marshaler runtime.Marshaler, server FluxV2PackagesServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1alpha1.DeleteInstalledPackageRequest + var protoReq v1alpha1_0.DeleteInstalledPackageRequest var metadata runtime.ServerMetadata var ( @@ -691,7 +691,7 @@ var ( ) func request_FluxV2PackagesService_GetInstalledPackageResourceRefs_0(ctx context.Context, marshaler runtime.Marshaler, client FluxV2PackagesServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1alpha1.GetInstalledPackageResourceRefsRequest + var protoReq v1alpha1_0.GetInstalledPackageResourceRefsRequest var metadata runtime.ServerMetadata var ( @@ -744,7 +744,7 @@ func request_FluxV2PackagesService_GetInstalledPackageResourceRefs_0(ctx context } func local_request_FluxV2PackagesService_GetInstalledPackageResourceRefs_0(ctx context.Context, marshaler runtime.Marshaler, server FluxV2PackagesServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1alpha1.GetInstalledPackageResourceRefsRequest + var protoReq v1alpha1_0.GetInstalledPackageResourceRefsRequest var metadata runtime.ServerMetadata var ( @@ -797,7 +797,7 @@ func local_request_FluxV2PackagesService_GetInstalledPackageResourceRefs_0(ctx c } func request_FluxV2RepositoriesService_AddPackageRepository_0(ctx context.Context, marshaler runtime.Marshaler, client FluxV2RepositoriesServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1alpha1.AddPackageRepositoryRequest + var protoReq v1alpha1_0.AddPackageRepositoryRequest var metadata runtime.ServerMetadata newReader, berr := utilities.IOReaderFactory(req.Body) @@ -814,7 +814,7 @@ func request_FluxV2RepositoriesService_AddPackageRepository_0(ctx context.Contex } func local_request_FluxV2RepositoriesService_AddPackageRepository_0(ctx context.Context, marshaler runtime.Marshaler, server FluxV2RepositoriesServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1alpha1.AddPackageRepositoryRequest + var protoReq v1alpha1_0.AddPackageRepositoryRequest var metadata runtime.ServerMetadata newReader, berr := utilities.IOReaderFactory(req.Body) @@ -830,6 +830,156 @@ func local_request_FluxV2RepositoriesService_AddPackageRepository_0(ctx context. } +var ( + filter_FluxV2RepositoriesService_GetPackageRepositoryDetail_0 = &utilities.DoubleArray{Encoding: map[string]int{"package_repo_ref": 0, "plugin": 1, "name": 2, "version": 3, "context": 4, "cluster": 5, "namespace": 6, "identifier": 7}, Base: []int{1, 7, 1, 1, 2, 2, 2, 3, 6, 0, 0, 0, 5, 0, 7, 0}, Check: []int{0, 1, 2, 3, 2, 5, 2, 7, 2, 4, 6, 8, 9, 13, 2, 15}} +) + +func request_FluxV2RepositoriesService_GetPackageRepositoryDetail_0(ctx context.Context, marshaler runtime.Marshaler, client FluxV2RepositoriesServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq v1alpha1_0.GetPackageRepositoryDetailRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["package_repo_ref.plugin.name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "package_repo_ref.plugin.name") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "package_repo_ref.plugin.name", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "package_repo_ref.plugin.name", err) + } + + val, ok = pathParams["package_repo_ref.plugin.version"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "package_repo_ref.plugin.version") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "package_repo_ref.plugin.version", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "package_repo_ref.plugin.version", err) + } + + val, ok = pathParams["package_repo_ref.context.cluster"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "package_repo_ref.context.cluster") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "package_repo_ref.context.cluster", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "package_repo_ref.context.cluster", err) + } + + val, ok = pathParams["package_repo_ref.context.namespace"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "package_repo_ref.context.namespace") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "package_repo_ref.context.namespace", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "package_repo_ref.context.namespace", err) + } + + val, ok = pathParams["package_repo_ref.identifier"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "package_repo_ref.identifier") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "package_repo_ref.identifier", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "package_repo_ref.identifier", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_FluxV2RepositoriesService_GetPackageRepositoryDetail_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetPackageRepositoryDetail(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_FluxV2RepositoriesService_GetPackageRepositoryDetail_0(ctx context.Context, marshaler runtime.Marshaler, server FluxV2RepositoriesServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq v1alpha1_0.GetPackageRepositoryDetailRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["package_repo_ref.plugin.name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "package_repo_ref.plugin.name") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "package_repo_ref.plugin.name", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "package_repo_ref.plugin.name", err) + } + + val, ok = pathParams["package_repo_ref.plugin.version"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "package_repo_ref.plugin.version") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "package_repo_ref.plugin.version", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "package_repo_ref.plugin.version", err) + } + + val, ok = pathParams["package_repo_ref.context.cluster"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "package_repo_ref.context.cluster") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "package_repo_ref.context.cluster", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "package_repo_ref.context.cluster", err) + } + + val, ok = pathParams["package_repo_ref.context.namespace"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "package_repo_ref.context.namespace") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "package_repo_ref.context.namespace", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "package_repo_ref.context.namespace", err) + } + + val, ok = pathParams["package_repo_ref.identifier"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "package_repo_ref.identifier") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "package_repo_ref.identifier", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "package_repo_ref.identifier", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_FluxV2RepositoriesService_GetPackageRepositoryDetail_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetPackageRepositoryDetail(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterFluxV2PackagesServiceHandlerServer registers the http handlers for service FluxV2PackagesService to "mux". // UnaryRPC :call FluxV2PackagesServiceServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -1075,6 +1225,29 @@ func RegisterFluxV2RepositoriesServiceHandlerServer(ctx context.Context, mux *ru }) + mux.Handle("GET", pattern_FluxV2RepositoriesService_GetPackageRepositoryDetail_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/kubeappsapis.plugins.fluxv2.packages.v1alpha1.FluxV2RepositoriesService/GetPackageRepositoryDetail", runtime.WithHTTPPathPattern("/plugins/fluxv2/packages/v1alpha1/repositories/plugin/{package_repo_ref.plugin.name}/{package_repo_ref.plugin.version}/c/{package_repo_ref.context.cluster}/ns/{package_repo_ref.context.namespace}/{package_repo_ref.identifier=**}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_FluxV2RepositoriesService_GetPackageRepositoryDetail_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_FluxV2RepositoriesService_GetPackageRepositoryDetail_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -1397,13 +1570,37 @@ func RegisterFluxV2RepositoriesServiceHandlerClient(ctx context.Context, mux *ru }) + mux.Handle("GET", pattern_FluxV2RepositoriesService_GetPackageRepositoryDetail_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/kubeappsapis.plugins.fluxv2.packages.v1alpha1.FluxV2RepositoriesService/GetPackageRepositoryDetail", runtime.WithHTTPPathPattern("/plugins/fluxv2/packages/v1alpha1/repositories/plugin/{package_repo_ref.plugin.name}/{package_repo_ref.plugin.version}/c/{package_repo_ref.context.cluster}/ns/{package_repo_ref.context.namespace}/{package_repo_ref.identifier=**}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_FluxV2RepositoriesService_GetPackageRepositoryDetail_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_FluxV2RepositoriesService_GetPackageRepositoryDetail_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } var ( pattern_FluxV2RepositoriesService_AddPackageRepository_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"plugins", "fluxv2", "packages", "v1alpha1", "repositories"}, "")) + + pattern_FluxV2RepositoriesService_GetPackageRepositoryDetail_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 2, 5, 1, 0, 4, 1, 5, 6, 1, 0, 4, 1, 5, 7, 2, 8, 1, 0, 4, 1, 5, 9, 2, 10, 1, 0, 4, 1, 5, 11, 3, 0, 4, 1, 5, 12}, []string{"plugins", "fluxv2", "packages", "v1alpha1", "repositories", "plugin", "package_repo_ref.plugin.name", "package_repo_ref.plugin.version", "c", "package_repo_ref.context.cluster", "ns", "package_repo_ref.context.namespace", "package_repo_ref.identifier"}, "")) ) var ( forward_FluxV2RepositoriesService_AddPackageRepository_0 = runtime.ForwardResponseMessage + + forward_FluxV2RepositoriesService_GetPackageRepositoryDetail_0 = runtime.ForwardResponseMessage ) diff --git a/cmd/kubeapps-apis/gen/plugins/fluxv2/packages/v1alpha1/fluxv2_grpc.pb.go b/cmd/kubeapps-apis/gen/plugins/fluxv2/packages/v1alpha1/fluxv2_grpc.pb.go index 5da7ac761d1..3aa42233607 100644 --- a/cmd/kubeapps-apis/gen/plugins/fluxv2/packages/v1alpha1/fluxv2_grpc.pb.go +++ b/cmd/kubeapps-apis/gen/plugins/fluxv2/packages/v1alpha1/fluxv2_grpc.pb.go @@ -1,8 +1,4 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.2.0 -// - protoc (unknown) -// source: kubeappsapis/plugins/fluxv2/packages/v1alpha1/fluxv2.proto package v1alpha1 @@ -418,6 +414,7 @@ type FluxV2RepositoriesServiceClient interface { // AddPackageRepository add an existing package repository to the set of ones already managed by the // 'fluxv2' plugin AddPackageRepository(ctx context.Context, in *v1alpha1.AddPackageRepositoryRequest, opts ...grpc.CallOption) (*v1alpha1.AddPackageRepositoryResponse, error) + GetPackageRepositoryDetail(ctx context.Context, in *v1alpha1.GetPackageRepositoryDetailRequest, opts ...grpc.CallOption) (*v1alpha1.GetPackageRepositoryDetailResponse, error) } type fluxV2RepositoriesServiceClient struct { @@ -437,6 +434,15 @@ func (c *fluxV2RepositoriesServiceClient) AddPackageRepository(ctx context.Conte return out, nil } +func (c *fluxV2RepositoriesServiceClient) GetPackageRepositoryDetail(ctx context.Context, in *v1alpha1.GetPackageRepositoryDetailRequest, opts ...grpc.CallOption) (*v1alpha1.GetPackageRepositoryDetailResponse, error) { + out := new(v1alpha1.GetPackageRepositoryDetailResponse) + err := c.cc.Invoke(ctx, "/kubeappsapis.plugins.fluxv2.packages.v1alpha1.FluxV2RepositoriesService/GetPackageRepositoryDetail", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // FluxV2RepositoriesServiceServer is the server API for FluxV2RepositoriesService service. // All implementations should embed UnimplementedFluxV2RepositoriesServiceServer // for forward compatibility @@ -444,6 +450,7 @@ type FluxV2RepositoriesServiceServer interface { // AddPackageRepository add an existing package repository to the set of ones already managed by the // 'fluxv2' plugin AddPackageRepository(context.Context, *v1alpha1.AddPackageRepositoryRequest) (*v1alpha1.AddPackageRepositoryResponse, error) + GetPackageRepositoryDetail(context.Context, *v1alpha1.GetPackageRepositoryDetailRequest) (*v1alpha1.GetPackageRepositoryDetailResponse, error) } // UnimplementedFluxV2RepositoriesServiceServer should be embedded to have forward compatible implementations. @@ -453,6 +460,9 @@ type UnimplementedFluxV2RepositoriesServiceServer struct { func (UnimplementedFluxV2RepositoriesServiceServer) AddPackageRepository(context.Context, *v1alpha1.AddPackageRepositoryRequest) (*v1alpha1.AddPackageRepositoryResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method AddPackageRepository not implemented") } +func (UnimplementedFluxV2RepositoriesServiceServer) GetPackageRepositoryDetail(context.Context, *v1alpha1.GetPackageRepositoryDetailRequest) (*v1alpha1.GetPackageRepositoryDetailResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetPackageRepositoryDetail not implemented") +} // UnsafeFluxV2RepositoriesServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to FluxV2RepositoriesServiceServer will @@ -483,6 +493,24 @@ func _FluxV2RepositoriesService_AddPackageRepository_Handler(srv interface{}, ct return interceptor(ctx, in, info, handler) } +func _FluxV2RepositoriesService_GetPackageRepositoryDetail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(v1alpha1.GetPackageRepositoryDetailRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(FluxV2RepositoriesServiceServer).GetPackageRepositoryDetail(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/kubeappsapis.plugins.fluxv2.packages.v1alpha1.FluxV2RepositoriesService/GetPackageRepositoryDetail", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(FluxV2RepositoriesServiceServer).GetPackageRepositoryDetail(ctx, req.(*v1alpha1.GetPackageRepositoryDetailRequest)) + } + return interceptor(ctx, in, info, handler) +} + // FluxV2RepositoriesService_ServiceDesc is the grpc.ServiceDesc for FluxV2RepositoriesService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -494,6 +522,10 @@ var FluxV2RepositoriesService_ServiceDesc = grpc.ServiceDesc{ MethodName: "AddPackageRepository", Handler: _FluxV2RepositoriesService_AddPackageRepository_Handler, }, + { + MethodName: "GetPackageRepositoryDetail", + Handler: _FluxV2RepositoriesService_GetPackageRepositoryDetail_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "kubeappsapis/plugins/fluxv2/packages/v1alpha1/fluxv2.proto", diff --git a/cmd/kubeapps-apis/gen/plugins/helm/packages/v1alpha1/helm.pb.go b/cmd/kubeapps-apis/gen/plugins/helm/packages/v1alpha1/helm.pb.go index a53be0e75aa..ee4d9bd02f6 100644 --- a/cmd/kubeapps-apis/gen/plugins/helm/packages/v1alpha1/helm.pb.go +++ b/cmd/kubeapps-apis/gen/plugins/helm/packages/v1alpha1/helm.pb.go @@ -4,7 +4,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.1 -// protoc (unknown) +// protoc v3.17.3 // source: kubeappsapis/plugins/helm/packages/v1alpha1/helm.proto package v1alpha1 diff --git a/cmd/kubeapps-apis/gen/plugins/helm/packages/v1alpha1/helm.pb.gw.go b/cmd/kubeapps-apis/gen/plugins/helm/packages/v1alpha1/helm.pb.gw.go index da457ede20c..66351a7dbf4 100644 --- a/cmd/kubeapps-apis/gen/plugins/helm/packages/v1alpha1/helm.pb.gw.go +++ b/cmd/kubeapps-apis/gen/plugins/helm/packages/v1alpha1/helm.pb.gw.go @@ -15,7 +15,7 @@ import ( "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" - "github.com/kubeapps/kubeapps/cmd/kubeapps-apis/gen/core/packages/v1alpha1" + v1alpha1_1 "github.com/kubeapps/kubeapps/cmd/kubeapps-apis/gen/core/packages/v1alpha1" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" @@ -37,7 +37,7 @@ var ( ) func request_HelmPackagesService_GetAvailablePackageSummaries_0(ctx context.Context, marshaler runtime.Marshaler, client HelmPackagesServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1alpha1.GetAvailablePackageSummariesRequest + var protoReq v1alpha1_1.GetAvailablePackageSummariesRequest var metadata runtime.ServerMetadata if err := req.ParseForm(); err != nil { @@ -53,7 +53,7 @@ func request_HelmPackagesService_GetAvailablePackageSummaries_0(ctx context.Cont } func local_request_HelmPackagesService_GetAvailablePackageSummaries_0(ctx context.Context, marshaler runtime.Marshaler, server HelmPackagesServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1alpha1.GetAvailablePackageSummariesRequest + var protoReq v1alpha1_1.GetAvailablePackageSummariesRequest var metadata runtime.ServerMetadata if err := req.ParseForm(); err != nil { @@ -73,7 +73,7 @@ var ( ) func request_HelmPackagesService_GetAvailablePackageDetail_0(ctx context.Context, marshaler runtime.Marshaler, client HelmPackagesServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1alpha1.GetAvailablePackageDetailRequest + var protoReq v1alpha1_1.GetAvailablePackageDetailRequest var metadata runtime.ServerMetadata var ( @@ -126,7 +126,7 @@ func request_HelmPackagesService_GetAvailablePackageDetail_0(ctx context.Context } func local_request_HelmPackagesService_GetAvailablePackageDetail_0(ctx context.Context, marshaler runtime.Marshaler, server HelmPackagesServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1alpha1.GetAvailablePackageDetailRequest + var protoReq v1alpha1_1.GetAvailablePackageDetailRequest var metadata runtime.ServerMetadata var ( @@ -183,7 +183,7 @@ var ( ) func request_HelmPackagesService_GetAvailablePackageVersions_0(ctx context.Context, marshaler runtime.Marshaler, client HelmPackagesServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1alpha1.GetAvailablePackageVersionsRequest + var protoReq v1alpha1_1.GetAvailablePackageVersionsRequest var metadata runtime.ServerMetadata var ( @@ -236,7 +236,7 @@ func request_HelmPackagesService_GetAvailablePackageVersions_0(ctx context.Conte } func local_request_HelmPackagesService_GetAvailablePackageVersions_0(ctx context.Context, marshaler runtime.Marshaler, server HelmPackagesServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1alpha1.GetAvailablePackageVersionsRequest + var protoReq v1alpha1_1.GetAvailablePackageVersionsRequest var metadata runtime.ServerMetadata var ( @@ -293,7 +293,7 @@ var ( ) func request_HelmPackagesService_GetInstalledPackageSummaries_0(ctx context.Context, marshaler runtime.Marshaler, client HelmPackagesServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1alpha1.GetInstalledPackageSummariesRequest + var protoReq v1alpha1_1.GetInstalledPackageSummariesRequest var metadata runtime.ServerMetadata if err := req.ParseForm(); err != nil { @@ -309,7 +309,7 @@ func request_HelmPackagesService_GetInstalledPackageSummaries_0(ctx context.Cont } func local_request_HelmPackagesService_GetInstalledPackageSummaries_0(ctx context.Context, marshaler runtime.Marshaler, server HelmPackagesServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1alpha1.GetInstalledPackageSummariesRequest + var protoReq v1alpha1_1.GetInstalledPackageSummariesRequest var metadata runtime.ServerMetadata if err := req.ParseForm(); err != nil { @@ -329,7 +329,7 @@ var ( ) func request_HelmPackagesService_GetInstalledPackageDetail_0(ctx context.Context, marshaler runtime.Marshaler, client HelmPackagesServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1alpha1.GetInstalledPackageDetailRequest + var protoReq v1alpha1_1.GetInstalledPackageDetailRequest var metadata runtime.ServerMetadata var ( @@ -382,7 +382,7 @@ func request_HelmPackagesService_GetInstalledPackageDetail_0(ctx context.Context } func local_request_HelmPackagesService_GetInstalledPackageDetail_0(ctx context.Context, marshaler runtime.Marshaler, server HelmPackagesServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1alpha1.GetInstalledPackageDetailRequest + var protoReq v1alpha1_1.GetInstalledPackageDetailRequest var metadata runtime.ServerMetadata var ( @@ -435,7 +435,7 @@ func local_request_HelmPackagesService_GetInstalledPackageDetail_0(ctx context.C } func request_HelmPackagesService_CreateInstalledPackage_0(ctx context.Context, marshaler runtime.Marshaler, client HelmPackagesServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1alpha1.CreateInstalledPackageRequest + var protoReq v1alpha1_1.CreateInstalledPackageRequest var metadata runtime.ServerMetadata newReader, berr := utilities.IOReaderFactory(req.Body) @@ -452,7 +452,7 @@ func request_HelmPackagesService_CreateInstalledPackage_0(ctx context.Context, m } func local_request_HelmPackagesService_CreateInstalledPackage_0(ctx context.Context, marshaler runtime.Marshaler, server HelmPackagesServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1alpha1.CreateInstalledPackageRequest + var protoReq v1alpha1_1.CreateInstalledPackageRequest var metadata runtime.ServerMetadata newReader, berr := utilities.IOReaderFactory(req.Body) @@ -469,7 +469,7 @@ func local_request_HelmPackagesService_CreateInstalledPackage_0(ctx context.Cont } func request_HelmPackagesService_UpdateInstalledPackage_0(ctx context.Context, marshaler runtime.Marshaler, client HelmPackagesServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1alpha1.UpdateInstalledPackageRequest + var protoReq v1alpha1_1.UpdateInstalledPackageRequest var metadata runtime.ServerMetadata newReader, berr := utilities.IOReaderFactory(req.Body) @@ -523,7 +523,7 @@ func request_HelmPackagesService_UpdateInstalledPackage_0(ctx context.Context, m } func local_request_HelmPackagesService_UpdateInstalledPackage_0(ctx context.Context, marshaler runtime.Marshaler, server HelmPackagesServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1alpha1.UpdateInstalledPackageRequest + var protoReq v1alpha1_1.UpdateInstalledPackageRequest var metadata runtime.ServerMetadata newReader, berr := utilities.IOReaderFactory(req.Body) @@ -581,7 +581,7 @@ var ( ) func request_HelmPackagesService_DeleteInstalledPackage_0(ctx context.Context, marshaler runtime.Marshaler, client HelmPackagesServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1alpha1.DeleteInstalledPackageRequest + var protoReq v1alpha1_1.DeleteInstalledPackageRequest var metadata runtime.ServerMetadata var ( @@ -634,7 +634,7 @@ func request_HelmPackagesService_DeleteInstalledPackage_0(ctx context.Context, m } func local_request_HelmPackagesService_DeleteInstalledPackage_0(ctx context.Context, marshaler runtime.Marshaler, server HelmPackagesServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1alpha1.DeleteInstalledPackageRequest + var protoReq v1alpha1_1.DeleteInstalledPackageRequest var metadata runtime.ServerMetadata var ( @@ -799,7 +799,7 @@ var ( ) func request_HelmPackagesService_GetInstalledPackageResourceRefs_0(ctx context.Context, marshaler runtime.Marshaler, client HelmPackagesServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1alpha1.GetInstalledPackageResourceRefsRequest + var protoReq v1alpha1_1.GetInstalledPackageResourceRefsRequest var metadata runtime.ServerMetadata var ( @@ -852,7 +852,7 @@ func request_HelmPackagesService_GetInstalledPackageResourceRefs_0(ctx context.C } func local_request_HelmPackagesService_GetInstalledPackageResourceRefs_0(ctx context.Context, marshaler runtime.Marshaler, server HelmPackagesServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1alpha1.GetInstalledPackageResourceRefsRequest + var protoReq v1alpha1_1.GetInstalledPackageResourceRefsRequest var metadata runtime.ServerMetadata var ( diff --git a/cmd/kubeapps-apis/gen/plugins/helm/packages/v1alpha1/helm_grpc.pb.go b/cmd/kubeapps-apis/gen/plugins/helm/packages/v1alpha1/helm_grpc.pb.go index c081361b70a..c171af29492 100644 --- a/cmd/kubeapps-apis/gen/plugins/helm/packages/v1alpha1/helm_grpc.pb.go +++ b/cmd/kubeapps-apis/gen/plugins/helm/packages/v1alpha1/helm_grpc.pb.go @@ -1,8 +1,4 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.2.0 -// - protoc (unknown) -// source: kubeappsapis/plugins/helm/packages/v1alpha1/helm.proto package v1alpha1 diff --git a/cmd/kubeapps-apis/gen/plugins/kapp_controller/packages/v1alpha1/kapp_controller.pb.go b/cmd/kubeapps-apis/gen/plugins/kapp_controller/packages/v1alpha1/kapp_controller.pb.go index cd80f00fbda..2e02f344ab3 100644 --- a/cmd/kubeapps-apis/gen/plugins/kapp_controller/packages/v1alpha1/kapp_controller.pb.go +++ b/cmd/kubeapps-apis/gen/plugins/kapp_controller/packages/v1alpha1/kapp_controller.pb.go @@ -4,7 +4,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.1 -// protoc (unknown) +// protoc v3.17.3 // source: kubeappsapis/plugins/kapp_controller/packages/v1alpha1/kapp_controller.proto package v1alpha1 diff --git a/cmd/kubeapps-apis/gen/plugins/kapp_controller/packages/v1alpha1/kapp_controller_grpc.pb.go b/cmd/kubeapps-apis/gen/plugins/kapp_controller/packages/v1alpha1/kapp_controller_grpc.pb.go index a18ddf86e51..20ca45fb37e 100644 --- a/cmd/kubeapps-apis/gen/plugins/kapp_controller/packages/v1alpha1/kapp_controller_grpc.pb.go +++ b/cmd/kubeapps-apis/gen/plugins/kapp_controller/packages/v1alpha1/kapp_controller_grpc.pb.go @@ -1,8 +1,4 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.2.0 -// - protoc (unknown) -// source: kubeappsapis/plugins/kapp_controller/packages/v1alpha1/kapp_controller.proto package v1alpha1 diff --git a/cmd/kubeapps-apis/gen/plugins/resources/v1alpha1/resources.pb.go b/cmd/kubeapps-apis/gen/plugins/resources/v1alpha1/resources.pb.go index 18ccc8bf4df..4e0269fcfe5 100644 --- a/cmd/kubeapps-apis/gen/plugins/resources/v1alpha1/resources.pb.go +++ b/cmd/kubeapps-apis/gen/plugins/resources/v1alpha1/resources.pb.go @@ -4,7 +4,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.1 -// protoc (unknown) +// protoc v3.17.3 // source: kubeappsapis/plugins/resources/v1alpha1/resources.proto package v1alpha1 diff --git a/cmd/kubeapps-apis/gen/plugins/resources/v1alpha1/resources_grpc.pb.go b/cmd/kubeapps-apis/gen/plugins/resources/v1alpha1/resources_grpc.pb.go index ddc3ddad1bb..ee4cc9a791d 100644 --- a/cmd/kubeapps-apis/gen/plugins/resources/v1alpha1/resources_grpc.pb.go +++ b/cmd/kubeapps-apis/gen/plugins/resources/v1alpha1/resources_grpc.pb.go @@ -1,8 +1,4 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.2.0 -// - protoc (unknown) -// source: kubeappsapis/plugins/resources/v1alpha1/resources.proto package v1alpha1 diff --git a/cmd/kubeapps-apis/plugin_test/mock_plugin.go b/cmd/kubeapps-apis/plugin_test/mock_plugin.go index 6d24aedda00..36c848576d9 100644 --- a/cmd/kubeapps-apis/plugin_test/mock_plugin.go +++ b/cmd/kubeapps-apis/plugin_test/mock_plugin.go @@ -131,8 +131,9 @@ func (s TestPackagingPluginServer) DeleteInstalledPackage(ctx context.Context, r type TestRepositoriesPluginServer struct { corev1.UnimplementedRepositoriesServiceServer - Plugin *plugins.Plugin - Status codes.Code + Plugin *plugins.Plugin + PackageRepositoryDetail *corev1.PackageRepositoryDetail + Status codes.Code } func NewTestRepositoriesPlugin(plugin *plugins.Plugin) *TestRepositoriesPluginServer { @@ -145,5 +146,20 @@ func (s TestRepositoriesPluginServer) AddPackageRepository(ctx context.Context, if s.Status != codes.OK { return nil, status.Errorf(s.Status, "Non-OK response") } - return &corev1.AddPackageRepositoryResponse{}, nil + return &corev1.AddPackageRepositoryResponse{ + PackageRepoRef: &corev1.PackageRepositoryReference{ + Context: request.GetContext(), + Identifier: request.GetName(), + Plugin: s.Plugin, + }, + }, nil +} + +func (s TestRepositoriesPluginServer) GetPackageRepositoryDetail(ctx context.Context, request *corev1.GetPackageRepositoryDetailRequest) (*corev1.GetPackageRepositoryDetailResponse, error) { + if s.Status != codes.OK { + return nil, status.Errorf(s.Status, "Non-OK response") + } + return &corev1.GetPackageRepositoryDetailResponse{ + Detail: s.PackageRepositoryDetail, + }, nil } diff --git a/cmd/kubeapps-apis/plugin_test/utils.go b/cmd/kubeapps-apis/plugin_test/utils.go index 20e78607b89..f93e55c5a3e 100644 --- a/cmd/kubeapps-apis/plugin_test/utils.go +++ b/cmd/kubeapps-apis/plugin_test/utils.go @@ -30,6 +30,7 @@ const ( DefaultValues = "key: value" DefaultMaintainerName = "me" DefaultMaintainerEmail = "me@example.com" + DefaultRepoInterval = 60 ) var defaultInstalledPackageStatus = &corev1.InstalledPackageStatus{ @@ -38,6 +39,12 @@ var defaultInstalledPackageStatus = &corev1.InstalledPackageStatus{ UserReason: "ReconciliationSucceeded", } +var defaultRepoStatus = &corev1.PackageRepositoryStatus{ + Ready: true, + Reason: corev1.PackageRepositoryStatus_STATUS_REASON_SUCCESS, + UserReason: "IndexationSucceed", +} + func MakeAvailablePackageSummary(name string, plugin *plugins.Plugin) *corev1.AvailablePackageSummary { return &corev1.AvailablePackageSummary{ Name: name, @@ -153,3 +160,23 @@ func MakePackageAppVersion(appVersion, pkgVersion string) *corev1.PackageAppVers PkgVersion: pkgVersion, } } + +func MakePackageRepositoryDetail(name string, plugin *plugins.Plugin) *corev1.PackageRepositoryDetail { + return &corev1.PackageRepositoryDetail{ + PackageRepoRef: &corev1.PackageRepositoryReference{ + Context: &corev1.Context{Cluster: GlobalPackagingCluster, Namespace: DefaultNamespace}, + Identifier: name, + Plugin: plugin, + }, + Name: name, + Description: DefaultDescription, + NamespaceScoped: false, + Type: "helm", + Url: DefaultRepoURL, + Interval: DefaultRepoInterval, + TlsConfig: nil, + Auth: nil, + CustomDetail: nil, + Status: defaultRepoStatus, + } +} diff --git a/cmd/kubeapps-apis/plugins/fluxv2/packages/v1alpha1/chart.go b/cmd/kubeapps-apis/plugins/fluxv2/packages/v1alpha1/chart.go index d0d44cbada8..03629d39d70 100644 --- a/cmd/kubeapps-apis/plugins/fluxv2/packages/v1alpha1/chart.go +++ b/cmd/kubeapps-apis/plugins/fluxv2/packages/v1alpha1/chart.go @@ -37,8 +37,24 @@ func (s *Server) getChartInCluster(ctx context.Context, key types.NamespacedName return &chartObj, nil } -func (s *Server) availableChartDetail(ctx context.Context, repoName types.NamespacedName, chartName, chartVersion string) (*corev1.AvailablePackageDetail, error) { - log.Infof("+availableChartDetail(%s, %s, %s)", repoName, chartName, chartVersion) +func (s *Server) availableChartDetail(ctx context.Context, packageRef *corev1.AvailablePackageReference, chartVersion string) (*corev1.AvailablePackageDetail, error) { + log.Infof("+availableChartDetail(%s, %s)", packageRef, chartVersion) + + repoN, chartName, err := pkgutils.SplitChartIdentifier(packageRef.Identifier) + if err != nil { + return nil, err + } + + // check specified repo exists and is in ready state + repoName := types.NamespacedName{Namespace: packageRef.Context.Namespace, Name: repoN} + + // this verifies that the repo exists + repo, err := s.getRepoInCluster(ctx, repoName) + if err != nil { + return nil, err + } else if !isRepoReady(*repo) { + return nil, status.Errorf(codes.Internal, "repository [%s] is not in Ready state", repoName) + } chartID := fmt.Sprintf("%s/%s", repoName.Name, chartName) // first, try the happy path - we have the chart version and the corresponding entry @@ -81,7 +97,22 @@ func (s *Server) availableChartDetail(ctx context.Context, repoName types.Namesp return nil, err } - return availablePackageDetailFromChartDetail(chartID, chartDetail) + pkgDetail, err := availablePackageDetailFromChartDetail(chartID, chartDetail) + if err != nil { + return nil, err + } + + // fix up a couple of fields that don't come from the chart tarball + repoUrl := repo.Spec.URL + if repoUrl == "" { + return nil, status.Errorf(codes.NotFound, "Missing required field spec.url on repository %q", repoName) + } + + pkgDetail.RepoUrl = repoUrl + pkgDetail.AvailablePackageRef.Context.Namespace = packageRef.Context.Namespace + // per https://github.com/kubeapps/kubeapps/pull/3686#issue-1038093832 + pkgDetail.AvailablePackageRef.Context.Cluster = s.kubeappsCluster + return pkgDetail, nil } func (s *Server) getChart(ctx context.Context, repo types.NamespacedName, chartName string) (*models.Chart, error) { diff --git a/cmd/kubeapps-apis/plugins/fluxv2/packages/v1alpha1/global_vars_test.go b/cmd/kubeapps-apis/plugins/fluxv2/packages/v1alpha1/global_vars_test.go index 331298e70ed..145ab5e4298 100644 --- a/cmd/kubeapps-apis/plugins/fluxv2/packages/v1alpha1/global_vars_test.go +++ b/cmd/kubeapps-apis/plugins/fluxv2/packages/v1alpha1/global_vars_test.go @@ -2227,4 +2227,345 @@ var ( Interval: metav1.Duration{Duration: 1 * time.Minute}, }, } + + get_repo_detail_req_1 = &corev1.GetPackageRepositoryDetailRequest{ + PackageRepoRef: &corev1.PackageRepositoryReference{ + Context: &corev1.Context{ + Namespace: "namespace-1", + }, + Identifier: "repo-1", + }, + } + + get_repo_detail_package_resp_ref = &corev1.PackageRepositoryReference{ + Context: &corev1.Context{ + Cluster: KubeappsCluster, + Namespace: "namespace-1", + }, + Identifier: "repo-1", + Plugin: fluxPlugin, + } + + get_repo_detail_resp_1 = &corev1.GetPackageRepositoryDetailResponse{ + Detail: &corev1.PackageRepositoryDetail{ + PackageRepoRef: get_repo_detail_package_resp_ref, + Name: "repo-1", + Description: "", + NamespaceScoped: false, + Type: "helm", + Url: "https://example.repo.com/charts", + Interval: 60, + Auth: &corev1.PackageRepositoryAuth{ + PassCredentials: false, + }, + Status: &corev1.PackageRepositoryStatus{ + Ready: true, + Reason: corev1.PackageRepositoryStatus_STATUS_REASON_SUCCESS, + UserReason: "IndexationSucceed", + }, + }, + } + + get_repo_detail_req_2 = &corev1.GetPackageRepositoryDetailRequest{ + PackageRepoRef: &corev1.PackageRepositoryReference{ + Context: &corev1.Context{ + Namespace: "namespace-1", + }, + Identifier: "repo-kaka", + }, + } + + get_repo_detail_req_3 = &corev1.GetPackageRepositoryDetailRequest{ + PackageRepoRef: &corev1.PackageRepositoryReference{ + Context: &corev1.Context{ + Namespace: "namespace-kaka", + }, + Identifier: "repo-1", + }, + } + + get_repo_detail_req_4 = &corev1.GetPackageRepositoryDetailRequest{ + PackageRepoRef: &corev1.PackageRepositoryReference{ + Identifier: "repo-1", + }, + } + + get_repo_detail_req_5 = &corev1.GetPackageRepositoryDetailRequest{ + PackageRepoRef: &corev1.PackageRepositoryReference{ + Context: &corev1.Context{ + Namespace: "namespace-1", + Cluster: "this-is-not-the-cluster-youre-looking-for", + }, + Identifier: "repo-1", + }, + } + + get_repo_detail_resp_6 = &corev1.GetPackageRepositoryDetailResponse{ + Detail: &corev1.PackageRepositoryDetail{ + PackageRepoRef: get_repo_detail_package_resp_ref, + Name: "repo-1", + Description: "", + NamespaceScoped: false, + Type: "helm", + Url: "https://example.repo.com/charts", + Interval: 60, + Auth: &corev1.PackageRepositoryAuth{ + PassCredentials: false, + }, + TlsConfig: &corev1.PackageRepositoryTlsConfig{ + InsecureSkipVerify: false, + PackageRepoTlsConfigOneOf: &corev1.PackageRepositoryTlsConfig_SecretRef{ + SecretRef: &corev1.SecretKeyReference{ + Name: "secret-1", + Key: "caFile", + }, + }, + }, + Status: &corev1.PackageRepositoryStatus{ + Ready: true, + Reason: corev1.PackageRepositoryStatus_STATUS_REASON_SUCCESS, + UserReason: "IndexationSucceed", + }, + }, + } + + get_repo_detail_resp_7 = &corev1.GetPackageRepositoryDetailResponse{ + Detail: &corev1.PackageRepositoryDetail{ + PackageRepoRef: get_repo_detail_package_resp_ref, + Name: "repo-1", + Description: "", + NamespaceScoped: false, + Type: "helm", + Url: "https://example.repo.com/charts", + Interval: 60, + Auth: &corev1.PackageRepositoryAuth{ + PassCredentials: false, + }, + Status: &corev1.PackageRepositoryStatus{ + Ready: false, + Reason: corev1.PackageRepositoryStatus_STATUS_REASON_PENDING, + UserReason: "Progressing: reconciliation in progress", + }, + }, + } + + get_repo_detail_resp_8 = &corev1.GetPackageRepositoryDetailResponse{ + Detail: &corev1.PackageRepositoryDetail{ + PackageRepoRef: get_repo_detail_package_resp_ref, + Name: "repo-1", + Description: "", + NamespaceScoped: false, + Type: "helm", + Url: "https://example.repo.com/charts", + Interval: 60, + Auth: &corev1.PackageRepositoryAuth{ + PassCredentials: false, + }, + Status: &corev1.PackageRepositoryStatus{ + Ready: false, + Reason: corev1.PackageRepositoryStatus_STATUS_REASON_FAILED, + UserReason: "IndexationFailed: failed to fetch https://invalid.example.com/index.yaml : 404 Not Found", + }, + }, + } + + get_repo_detail_resp_9 = &corev1.GetPackageRepositoryDetailResponse{ + Detail: &corev1.PackageRepositoryDetail{ + PackageRepoRef: get_repo_detail_package_resp_ref, + Name: "repo-1", + Description: "", + NamespaceScoped: false, + Type: "helm", + Url: "https://example.repo.com/charts", + Interval: 60, + Auth: &corev1.PackageRepositoryAuth{ + PassCredentials: false, + Type: corev1.PackageRepositoryAuth_PACKAGE_REPOSITORY_AUTH_TYPE_TLS, + PackageRepoAuthOneOf: &corev1.PackageRepositoryAuth_SecretRef{ + SecretRef: &corev1.SecretKeyReference{ + Name: "secret-1", + }, + }, + }, + Status: &corev1.PackageRepositoryStatus{ + Ready: true, + Reason: corev1.PackageRepositoryStatus_STATUS_REASON_SUCCESS, + UserReason: "IndexationSucceed", + }, + }, + } + + get_repo_detail_req_6 = &corev1.GetPackageRepositoryDetailRequest{ + PackageRepoRef: &corev1.PackageRepositoryReference{ + Context: &corev1.Context{ + // will be set when test scenario is run + Namespace: "TBD", + }, + Identifier: "my-podinfo", + }, + } + + get_repo_detail_resp_10 = &corev1.GetPackageRepositoryDetailResponse{ + Detail: &corev1.PackageRepositoryDetail{ + PackageRepoRef: get_repo_detail_package_resp_ref, + Name: "repo-1", + Description: "", + NamespaceScoped: false, + Type: "helm", + Url: "https://example.repo.com/charts", + Interval: 60, + Auth: &corev1.PackageRepositoryAuth{ + PassCredentials: false, + Type: corev1.PackageRepositoryAuth_PACKAGE_REPOSITORY_AUTH_TYPE_BASIC_AUTH, + PackageRepoAuthOneOf: &corev1.PackageRepositoryAuth_SecretRef{ + SecretRef: &corev1.SecretKeyReference{ + Name: "secret-1", + }, + }, + }, + Status: &corev1.PackageRepositoryStatus{ + Ready: true, + Reason: corev1.PackageRepositoryStatus_STATUS_REASON_SUCCESS, + UserReason: "IndexationSucceed", + }, + }, + } + + get_repo_detail_resp_11 = &corev1.GetPackageRepositoryDetailResponse{ + Detail: &corev1.PackageRepositoryDetail{ + PackageRepoRef: &corev1.PackageRepositoryReference{ + Context: &corev1.Context{ + Cluster: KubeappsCluster, + // will be set when scenario is run + Namespace: "TBD", + }, + Identifier: "my-podinfo", + Plugin: fluxPlugin, + }, + Name: "my-podinfo", + Description: "", + NamespaceScoped: false, + Type: "helm", + Url: podinfo_repo_url, + Interval: 600, + Auth: &corev1.PackageRepositoryAuth{ + PassCredentials: false, + }, + Status: &corev1.PackageRepositoryStatus{ + Ready: true, + Reason: corev1.PackageRepositoryStatus_STATUS_REASON_SUCCESS, + UserReason: "IndexationSucceed: Fetched revision: 2867920fb8f56575f4bc95ed878ee2a0c8ae79cdd2bca210a72aa3ff04defa1b", + }, + }, + } + + get_repo_detail_req_7 = &corev1.GetPackageRepositoryDetailRequest{ + PackageRepoRef: &corev1.PackageRepositoryReference{ + Context: &corev1.Context{ + // will be set when test scenario is run + Namespace: "TBD", + }, + Identifier: "my-bitnami", + }, + } + + get_repo_detail_resp_12 = &corev1.GetPackageRepositoryDetailResponse{ + Detail: &corev1.PackageRepositoryDetail{ + PackageRepoRef: &corev1.PackageRepositoryReference{ + Context: &corev1.Context{ + Cluster: KubeappsCluster, + // will be set when scenario is run + Namespace: "TBD", + }, + Identifier: "my-bitnami", + Plugin: fluxPlugin, + }, + Name: "my-bitnami", + Description: "", + NamespaceScoped: false, + Type: "helm", + Url: "https://charts.bitnami.com/bitnami", + Interval: 600, + Auth: &corev1.PackageRepositoryAuth{ + PassCredentials: false, + }, + Status: &corev1.PackageRepositoryStatus{ + Ready: true, + Reason: corev1.PackageRepositoryStatus_STATUS_REASON_SUCCESS, + UserReason: "IndexationSucceed: Fetched revision: ", + }, + }, + } + + get_repo_detail_resp_13 = &corev1.GetPackageRepositoryDetailResponse{ + Detail: &corev1.PackageRepositoryDetail{ + PackageRepoRef: &corev1.PackageRepositoryReference{ + Context: &corev1.Context{ + Cluster: KubeappsCluster, + // will be set when scenario is run + Namespace: "TBD", + }, + Identifier: "my-podinfo", + Plugin: fluxPlugin, + }, + Name: "my-podinfo", + Description: "", + NamespaceScoped: false, + Type: "helm", + Url: podinfo_basic_auth_repo_url, + Interval: 600, + Auth: &corev1.PackageRepositoryAuth{ + PassCredentials: false, + }, + Status: &corev1.PackageRepositoryStatus{ + Ready: false, + Reason: corev1.PackageRepositoryStatus_STATUS_REASON_FAILED, + UserReason: "IndexationFailed: failed to download repository index: failed to cache index to temporary file: failed to fetch http://fluxv2plugin-testdata-svc.default.svc.cluster.local:80/podinfo-basic-auth/index.yaml : 401 Unauthorized", + }, + }, + } + + get_repo_detail_resp_14 = &corev1.GetPackageRepositoryDetailResponse{ + Detail: &corev1.PackageRepositoryDetail{ + PackageRepoRef: &corev1.PackageRepositoryReference{ + Context: &corev1.Context{ + Cluster: KubeappsCluster, + // will be set when scenario is run + Namespace: "TBD", + }, + Identifier: "my-podinfo", + Plugin: fluxPlugin, + }, + Name: "my-podinfo", + Description: "", + NamespaceScoped: false, + Type: "helm", + Url: podinfo_basic_auth_repo_url, + Interval: 600, + Auth: &corev1.PackageRepositoryAuth{ + PassCredentials: false, + Type: corev1.PackageRepositoryAuth_PACKAGE_REPOSITORY_AUTH_TYPE_BASIC_AUTH, + PackageRepoAuthOneOf: &corev1.PackageRepositoryAuth_SecretRef{ + SecretRef: &corev1.SecretKeyReference{ + Name: "secret-1", + }, + }, + }, + Status: &corev1.PackageRepositoryStatus{ + Ready: true, + Reason: corev1.PackageRepositoryStatus_STATUS_REASON_SUCCESS, + UserReason: "IndexationSucceed: Fetched revision: 9d3ac1eb708dfaebae14d7c88fd46afce8b1e0f7aace790d91758575dc8ce518", + }, + }, + } + + get_repo_detail_req_8 = &corev1.GetPackageRepositoryDetailRequest{ + PackageRepoRef: &corev1.PackageRepositoryReference{ + Context: &corev1.Context{ + // will be set when test scenario is run + Namespace: "TBD", + }, + Identifier: "my-kaka", + }, + } ) diff --git a/cmd/kubeapps-apis/plugins/fluxv2/packages/v1alpha1/integration_utils_test.go b/cmd/kubeapps-apis/plugins/fluxv2/packages/v1alpha1/integration_utils_test.go index e13eecadf3f..48e17e2a70f 100644 --- a/cmd/kubeapps-apis/plugins/fluxv2/packages/v1alpha1/integration_utils_test.go +++ b/cmd/kubeapps-apis/plugins/fluxv2/packages/v1alpha1/integration_utils_test.go @@ -184,7 +184,7 @@ func getFluxPluginClients(t *testing.T) (fluxplugin.FluxV2PackagesServiceClient, // This creates a flux helm repository CRD. The usage of this func should be minimized as much as // possible in favor of flux Plugin's AddPackageRepository() call func kubeAddHelmRepository(t *testing.T, name, url, namespace, secretName string, interval time.Duration) error { - t.Logf("+kubeCreateHelmRepository(%s,%s)", name, namespace) + t.Logf("+kubeAddHelmRepository(%s,%s)", name, namespace) if interval <= 0 { interval = time.Duration(10 * time.Minute) } @@ -560,7 +560,7 @@ func kubeDeleteServiceAccountWithRoleBindings(t *testing.T, name, namespace stri if err != nil { return err } - for ns, _ := range nsToRole { + for ns := range nsToRole { ctx, cancel := context.WithTimeout(context.Background(), defaultContextTimeout) defer cancel() err = typedClient.RbacV1().RoleBindings(ns).Delete( diff --git a/cmd/kubeapps-apis/plugins/fluxv2/packages/v1alpha1/repo.go b/cmd/kubeapps-apis/plugins/fluxv2/packages/v1alpha1/repo.go index 76e14d63e7d..87e4c064151 100644 --- a/cmd/kubeapps-apis/plugins/fluxv2/packages/v1alpha1/repo.go +++ b/cmd/kubeapps-apis/plugins/fluxv2/packages/v1alpha1/repo.go @@ -346,6 +346,91 @@ func (s *Server) newFluxHelmRepo( return fluxRepo, nil } +func (s *Server) repoDetail(ctx context.Context, repoRef *corev1.PackageRepositoryReference) (*corev1.PackageRepositoryDetail, error) { + key := types.NamespacedName{Namespace: repoRef.Context.Namespace, Name: repoRef.Identifier} + + repo, err := s.getRepoInCluster(ctx, key) + if err != nil { + return nil, err + } + + var tlsConfig *corev1.PackageRepositoryTlsConfig + auth := &corev1.PackageRepositoryAuth{ + Type: corev1.PackageRepositoryAuth_PACKAGE_REPOSITORY_AUTH_TYPE_UNSPECIFIED, + PassCredentials: repo.Spec.PassCredentials, + } + if repo.Spec.SecretRef != nil { + secretName := repo.Spec.SecretRef.Name + if s == nil || s.clientGetter == nil { + return nil, status.Errorf(codes.Internal, "unexpected state in clientGetterHolder instance") + } + typedClient, err := s.clientGetter.Typed(ctx, s.kubeappsCluster) + if err != nil { + return nil, err + } + secret, err := typedClient.CoreV1().Secrets(repo.Namespace).Get(ctx, secretName, metav1.GetOptions{}) + if err != nil { + return nil, statuserror.FromK8sError("get", "secret", secretName, err) + } + if _, ok := secret.Data["caFile"]; ok { + tlsConfig = &corev1.PackageRepositoryTlsConfig{ + // flux plug in doesn't support this option + InsecureSkipVerify: false, + PackageRepoTlsConfigOneOf: &corev1.PackageRepositoryTlsConfig_SecretRef{ + SecretRef: &corev1.SecretKeyReference{ + Name: secretName, + Key: "caFile", + }, + }, + } + } + if _, ok := secret.Data["certFile"]; ok { + if _, ok = secret.Data["keyFile"]; ok { + auth.Type = corev1.PackageRepositoryAuth_PACKAGE_REPOSITORY_AUTH_TYPE_TLS + auth.PackageRepoAuthOneOf = &corev1.PackageRepositoryAuth_SecretRef{ + SecretRef: &corev1.SecretKeyReference{Name: secretName}, + } + } + } else if _, ok := secret.Data["username"]; ok { + if _, ok = secret.Data["password"]; ok { + auth.Type = corev1.PackageRepositoryAuth_PACKAGE_REPOSITORY_AUTH_TYPE_BASIC_AUTH + auth.PackageRepoAuthOneOf = &corev1.PackageRepositoryAuth_SecretRef{ + SecretRef: &corev1.SecretKeyReference{Name: secretName}, + } + } + } else if _, ok := secret.Data[".dockerconfigjson"]; ok { + auth.Type = corev1.PackageRepositoryAuth_PACKAGE_REPOSITORY_AUTH_TYPE_DOCKER_CONFIG_JSON + auth.PackageRepoAuthOneOf = &corev1.PackageRepositoryAuth_SecretRef{ + SecretRef: &corev1.SecretKeyReference{Name: secretName}, + } + } else { + log.Warning("Unrecognized type of secret [%s]", secretName) + } + } + + return &corev1.PackageRepositoryDetail{ + PackageRepoRef: &corev1.PackageRepositoryReference{ + Context: &corev1.Context{ + Namespace: repo.Namespace, + Cluster: s.kubeappsCluster, + }, + Identifier: repo.Name, + Plugin: GetPluginDetail(), + }, + Name: repo.Name, + // TBD Flux HelmRepository CR doesn't have a designated field for description + Description: "", + NamespaceScoped: false, + Type: "helm", + Url: repo.Spec.URL, + Interval: uint32(repo.Spec.Interval.Duration.Seconds()), + TlsConfig: tlsConfig, + Auth: auth, + CustomDetail: nil, + Status: repoStatus(*repo), + }, nil +} + // // implements plug-in specific cache-related functionality // @@ -660,6 +745,23 @@ func isHelmRepositoryReady(repo sourcev1.HelmRepository) (complete bool, success return false, false, reason } +func repoStatus(repo sourcev1.HelmRepository) *corev1.PackageRepositoryStatus { + complete, success, reason := isHelmRepositoryReady(repo) + s := &corev1.PackageRepositoryStatus{ + Ready: complete && success, + Reason: corev1.PackageRepositoryStatus_STATUS_REASON_UNSPECIFIED, + UserReason: reason, + } + if !complete { + s.Reason = corev1.PackageRepositoryStatus_STATUS_REASON_PENDING + } else if success { + s.Reason = corev1.PackageRepositoryStatus_STATUS_REASON_SUCCESS + } else { + s.Reason = corev1.PackageRepositoryStatus_STATUS_REASON_FAILED + } + return s +} + func newLocalOpaqueSecret(name string) *apiv1.Secret { return &apiv1.Secret{ ObjectMeta: metav1.ObjectMeta{ diff --git a/cmd/kubeapps-apis/plugins/fluxv2/packages/v1alpha1/repo_integration_test.go b/cmd/kubeapps-apis/plugins/fluxv2/packages/v1alpha1/repo_integration_test.go index b446cff8787..c6169bef2cd 100644 --- a/cmd/kubeapps-apis/plugins/fluxv2/packages/v1alpha1/repo_integration_test.go +++ b/cmd/kubeapps-apis/plugins/fluxv2/packages/v1alpha1/repo_integration_test.go @@ -5,6 +5,7 @@ package main import ( "context" + "strings" "testing" "time" @@ -12,6 +13,7 @@ import ( "github.com/google/go-cmp/cmp/cmpopts" corev1 "github.com/kubeapps/kubeapps/cmd/kubeapps-apis/gen/core/packages/v1alpha1" plugins "github.com/kubeapps/kubeapps/cmd/kubeapps-apis/gen/core/plugins/v1alpha1" + "github.com/kubeapps/kubeapps/cmd/kubeapps-apis/plugins/fluxv2/packages/v1alpha1/common" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" apiv1 "k8s.io/api/core/v1" @@ -383,3 +385,175 @@ func TestKindClusterAddPackageRepository(t *testing.T) { }) } } + +type integrationTestGetRepoSpec struct { + testName string + request *corev1.GetPackageRepositoryDetailRequest + repoName string + repoUrl string + unauthorized bool + expectedResponse *corev1.GetPackageRepositoryDetailResponse + expectedStatusCode codes.Code + existingSecret *apiv1.Secret +} + +func TestKindClusterGetPackageRepositoryDetail(t *testing.T) { + _, fluxPluginReposClient, err := checkEnv(t) + if err != nil { + t.Fatal(err) + } + + testCases := []integrationTestGetRepoSpec{ + { + testName: "gets detail for podinfo package repository", + request: get_repo_detail_req_6, + repoName: "my-podinfo", + repoUrl: podinfo_repo_url, + expectedStatusCode: codes.OK, + expectedResponse: get_repo_detail_resp_11, + }, + { + testName: "gets detail for bitnami package repository", + request: get_repo_detail_req_7, + repoName: "my-bitnami", + repoUrl: "https://charts.bitnami.com/bitnami", + expectedStatusCode: codes.OK, + expectedResponse: get_repo_detail_resp_12, + }, + { + testName: "get detail fails for podinfo basic auth package repository without creds", + request: get_repo_detail_req_6, + repoName: "my-podinfo", + repoUrl: podinfo_basic_auth_repo_url, + expectedStatusCode: codes.OK, + expectedResponse: get_repo_detail_resp_13, + }, + { + testName: "get detail succeeds for podinfo basic auth package repository with creds", + request: get_repo_detail_req_6, + repoName: "my-podinfo", + repoUrl: podinfo_basic_auth_repo_url, + expectedStatusCode: codes.OK, + expectedResponse: get_repo_detail_resp_14, + existingSecret: newBasicAuthSecret("secret-1", "TBD", "foo", "bar"), + }, + { + testName: "get detail returns NotFound error for wrong repo", + request: get_repo_detail_req_8, + repoName: "my-podinfo", + repoUrl: podinfo_repo_url, + expectedStatusCode: codes.NotFound, + }, + { + testName: "get detail returns PermissionDenied error", + request: get_repo_detail_req_6, + repoName: "my-podinfo", + repoUrl: podinfo_repo_url, + expectedStatusCode: codes.PermissionDenied, + unauthorized: true, + }, + } + + grpcAdmin, err := newGrpcAdminContext(t, "test-get-repo-admin", "default") + if err != nil { + t.Fatal(err) + } + + grpcLoser, err := newGrpcContextForServiceAccountWithoutAccessToAnyNamespace(t, "test-get-repo-loser", "default") + if err != nil { + t.Fatal(err) + } + + for _, tc := range testCases { + t.Run(tc.testName, func(t *testing.T) { + repoNamespace := "test-" + randSeq(4) + + if err := kubeCreateNamespace(t, repoNamespace); err != nil { + t.Fatal(err) + } + t.Cleanup(func() { + if err := kubeDeleteNamespace(t, repoNamespace); err != nil { + t.Logf("Failed to delete namespace [%s] due to [%v]", repoNamespace, err) + } + }) + + secretName := "" + if tc.existingSecret != nil { + tc.existingSecret.Namespace = repoNamespace + if err := kubeCreateSecret(t, tc.existingSecret); err != nil { + t.Fatalf("%v", err) + } + secretName = tc.existingSecret.Name + t.Cleanup(func() { + err := kubeDeleteSecret(t, tc.existingSecret.Namespace, tc.existingSecret.Name) + if err != nil { + t.Logf("Failed to delete secret due to [%v]", err) + } + }) + } + + if err = kubeAddHelmRepository(t, tc.repoName, tc.repoUrl, repoNamespace, secretName, 0); err != nil { + t.Fatal(err) + } + t.Cleanup(func() { + if err = kubeDeleteHelmRepository(t, tc.repoName, repoNamespace); err != nil { + t.Logf("Failed to delete helm source due to [%v]", err) + } + }) + + tc.request.PackageRepoRef.Context.Namespace = repoNamespace + if tc.expectedResponse != nil { + tc.expectedResponse.Detail.PackageRepoRef.Context.Namespace = repoNamespace + } + + var grpcCtx context.Context + var cancel context.CancelFunc + if tc.unauthorized { + grpcCtx, cancel = context.WithTimeout(grpcLoser, defaultContextTimeout) + } else { + grpcCtx, cancel = context.WithTimeout(grpcAdmin, defaultContextTimeout) + } + defer cancel() + + var resp *corev1.GetPackageRepositoryDetailResponse + for { + resp, err = fluxPluginReposClient.GetPackageRepositoryDetail(grpcCtx, tc.request) + if got, want := status.Code(err), tc.expectedStatusCode; got != want { + t.Fatalf("got: %v, want: %v", err, want) + } + if tc.expectedStatusCode != codes.OK { + // we are done + return + } + if resp.Detail.Status.Reason != corev1.PackageRepositoryStatus_STATUS_REASON_PENDING { + break + } else { + t.Logf("Waiting 2s for repository reconciliation to complete...") + time.Sleep(2 * time.Second) + } + } + + opts := cmpopts.IgnoreUnexported( + corev1.Context{}, + corev1.PackageRepositoryReference{}, + plugins.Plugin{}, + corev1.GetPackageRepositoryDetailResponse{}, + corev1.PackageRepositoryDetail{}, + corev1.PackageRepositoryStatus{}, + corev1.PackageRepositoryAuth{}, + corev1.PackageRepositoryTlsConfig{}, + corev1.SecretKeyReference{}, + ) + + opts2 := cmpopts.IgnoreFields(corev1.PackageRepositoryStatus{}, "UserReason") + + if got, want := resp, tc.expectedResponse; !cmp.Equal(want, got, opts, opts2) { + t.Errorf("mismatch (-want +got):\n%s", cmp.Diff(want, got, opts, opts, opts2)) + } + + if !strings.HasPrefix(resp.GetDetail().Status.UserReason, tc.expectedResponse.Detail.Status.UserReason) { + t.Errorf("unexpected response: %s", common.PrettyPrint(resp)) + } + }) + } +} diff --git a/cmd/kubeapps-apis/plugins/fluxv2/packages/v1alpha1/repo_test.go b/cmd/kubeapps-apis/plugins/fluxv2/packages/v1alpha1/repo_test.go index bce14b5947a..ffda317a54b 100644 --- a/cmd/kubeapps-apis/plugins/fluxv2/packages/v1alpha1/repo_test.go +++ b/cmd/kubeapps-apis/plugins/fluxv2/packages/v1alpha1/repo_test.go @@ -1191,7 +1191,6 @@ func TestGetAvailablePackageSummariesAfterCacheResyncQueueIdle(t *testing.T) { } func TestAddPackageRepository(t *testing.T) { - // these will be used further on for TLS-related scenarios. Init // byte arrays up front so they can be re-used in multiple places later ca, pub, priv := getCertsForTesting(t) @@ -1539,6 +1538,213 @@ func TestAddPackageRepository(t *testing.T) { } } +func TestGetPackageRepositoryDetail(t *testing.T) { + ca, pub, priv := getCertsForTesting(t) + testCases := []struct { + name string + request *corev1.GetPackageRepositoryDetailRequest + repoIndex string + repoName string + repoNamespace string + repoSecret *apiv1.Secret + pending bool + failed bool + expectedStatusCode codes.Code + expectedResponse *corev1.GetPackageRepositoryDetailResponse + }{ + { + name: "get package repository detail simplest case", + repoIndex: testYaml("valid-index.yaml"), + repoName: "repo-1", + repoNamespace: "namespace-1", + request: get_repo_detail_req_1, + expectedStatusCode: codes.OK, + expectedResponse: get_repo_detail_resp_1, + }, + { + name: "fails with NotFound when wrong identifier", + repoIndex: testYaml("valid-index.yaml"), + repoName: "repo-1", + repoNamespace: "namespace-1", + request: get_repo_detail_req_2, + expectedStatusCode: codes.NotFound, + }, + { + name: "fails with NotFound when wrong namespace", + repoIndex: testYaml("valid-index.yaml"), + repoName: "repo-1", + repoNamespace: "namespace-1", + request: get_repo_detail_req_3, + expectedStatusCode: codes.NotFound, + }, + { + name: "it returns an invalid arg error status if no context is provided", + repoIndex: testYaml("valid-index.yaml"), + repoName: "repo-1", + repoNamespace: "namespace-1", + request: get_repo_detail_req_4, + expectedStatusCode: codes.InvalidArgument, + }, + { + name: "it returns an error status if cluster is not the global/kubeapps one", + repoIndex: testYaml("valid-index.yaml"), + repoName: "repo-1", + repoNamespace: "namespace-1", + request: get_repo_detail_req_5, + expectedStatusCode: codes.Unimplemented, + }, + { + name: "it returns package repository detail with TLS cert aurthority", + repoIndex: testYaml("valid-index.yaml"), + repoName: "repo-1", + repoNamespace: "namespace-1", + repoSecret: newTlsSecret("secret-1", "namespace-1", nil, nil, ca), + request: get_repo_detail_req_1, + expectedStatusCode: codes.OK, + expectedResponse: get_repo_detail_resp_6, + }, + { + name: "get package repository with pending status", + repoIndex: testYaml("valid-index.yaml"), + repoName: "repo-1", + repoNamespace: "namespace-1", + request: get_repo_detail_req_1, + expectedStatusCode: codes.OK, + expectedResponse: get_repo_detail_resp_7, + pending: true, + }, + { + name: "get package repository with failed status", + repoIndex: testYaml("valid-index.yaml"), + repoName: "repo-1", + repoNamespace: "namespace-1", + request: get_repo_detail_req_1, + expectedStatusCode: codes.OK, + expectedResponse: get_repo_detail_resp_8, + failed: true, + }, + { + name: "it returns package repository detail with TLS cert authentication", + repoIndex: testYaml("valid-index.yaml"), + repoName: "repo-1", + repoNamespace: "namespace-1", + repoSecret: newTlsSecret("secret-1", "namespace-1", pub, priv, nil), + request: get_repo_detail_req_1, + expectedStatusCode: codes.OK, + expectedResponse: get_repo_detail_resp_9, + }, + { + name: "it returns package repository detail with basic authentication", + repoIndex: testYaml("valid-index.yaml"), + repoName: "repo-1", + repoNamespace: "namespace-1", + repoSecret: newBasicAuthSecret("secret-1", "namespace-1", "foo", "bar"), + request: get_repo_detail_req_1, + expectedStatusCode: codes.OK, + expectedResponse: get_repo_detail_resp_10, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + secretRef := "" + secrets := []runtime.Object{} + if tc.repoSecret != nil { + secretRef = tc.repoSecret.Name + secrets = append(secrets, tc.repoSecret) + } + var repo *sourcev1.HelmRepository + if !tc.pending && !tc.failed { + var ts *httptest.Server + var err error + ts, repo, err = newRepoWithIndex(tc.repoIndex, tc.repoName, tc.repoNamespace, nil, secretRef) + if err != nil { + t.Fatalf("%+v", err) + } + defer ts.Close() + } else if tc.pending { + repoSpec := &sourcev1.HelmRepositorySpec{ + URL: "https://example.repo.com/charts", + Interval: metav1.Duration{Duration: 1 * time.Minute}, + } + lastTransitionTime, err := time.Parse(time.RFC3339, "2022-03-20T06:29:40Z") + if err != nil { + t.Fatal(err) + } + repoStatus := &sourcev1.HelmRepositoryStatus{ + Conditions: []metav1.Condition{ + { + LastTransitionTime: metav1.Time{Time: lastTransitionTime}, + Type: "Ready", + Status: "Unknown", + Reason: "Progressing", + Message: "reconciliation in progress", + }, + }, + } + repo1 := newRepo(tc.repoName, tc.repoNamespace, repoSpec, repoStatus) + repo = &repo1 + } else { // failed + repoSpec := &sourcev1.HelmRepositorySpec{ + URL: "https://example.repo.com/charts", + Interval: metav1.Duration{Duration: 1 * time.Minute}, + } + lastTransitionTime, err := time.Parse(time.RFC3339, "2022-03-20T06:29:40Z") + if err != nil { + t.Fatal(err) + } + repoStatus := &sourcev1.HelmRepositoryStatus{ + Conditions: []metav1.Condition{ + { + LastTransitionTime: metav1.Time{Time: lastTransitionTime}, + Type: "Ready", + Status: "False", + Reason: "IndexationFailed", + Message: "failed to fetch https://invalid.example.com/index.yaml : 404 Not Found", + }, + }, + } + repo1 := newRepo(tc.repoName, tc.repoNamespace, repoSpec, repoStatus) + repo = &repo1 + } + + // the index.yaml will contain links to charts but for the purposes + // of this test they do not matter + s, _, err := newServerWithRepos(t, []sourcev1.HelmRepository{*repo}, nil, secrets) + if err != nil { + t.Fatalf("error instantiating the server: %v", err) + } + + ctx := context.Background() + actualResp, err := s.GetPackageRepositoryDetail(ctx, tc.request) + if got, want := status.Code(err), tc.expectedStatusCode; got != want { + t.Fatalf("got: %+v, want: %+v, err: %+v", got, want, err) + } + + if tc.expectedStatusCode == codes.OK { + if actualResp == nil { + t.Fatalf("got: nil, want: response") + } else { + opt1 := cmpopts.IgnoreUnexported( + corev1.Context{}, + corev1.PackageRepositoryReference{}, + plugins.Plugin{}, + corev1.GetPackageRepositoryDetailResponse{}, + corev1.PackageRepositoryDetail{}, + corev1.PackageRepositoryStatus{}, + corev1.PackageRepositoryAuth{}, + corev1.PackageRepositoryTlsConfig{}, + corev1.SecretKeyReference{}, + ) + if got, want := actualResp, tc.expectedResponse; !cmp.Equal(got, want, opt1) { + t.Errorf("mismatch (-want +got):\n%s", cmp.Diff(want, got, opt1)) + } + } + } + }) + } +} + func newServerWithRepos(t *testing.T, repos []sourcev1.HelmRepository, charts []testSpecChartWithUrl, secrets []runtime.Object) (*Server, redismock.ClientMock, error) { typedClient := typfake.NewSimpleClientset(secrets...) @@ -1778,4 +1984,4 @@ func newRepoWithIndex(repoIndex, repoName, repoNamespace string, replaceUrls map } repo := newRepo(repoName, repoNamespace, repoSpec, repoStatus) return ts, &repo, nil -} \ No newline at end of file +} diff --git a/cmd/kubeapps-apis/plugins/fluxv2/packages/v1alpha1/server.go b/cmd/kubeapps-apis/plugins/fluxv2/packages/v1alpha1/server.go index 950c3f2f738..02413b6f9f1 100644 --- a/cmd/kubeapps-apis/plugins/fluxv2/packages/v1alpha1/server.go +++ b/cmd/kubeapps-apis/plugins/fluxv2/packages/v1alpha1/server.go @@ -229,35 +229,11 @@ func (s *Server) GetAvailablePackageDetail(ctx context.Context, request *corev1. cluster) } - repoN, chartName, err := pkgutils.SplitChartIdentifier(packageRef.Identifier) + pkgDetail, err := s.availableChartDetail(ctx, request.GetAvailablePackageRef(), request.GetPkgVersion()) if err != nil { return nil, err } - // check specified repo exists and is in ready state - repoName := types.NamespacedName{Namespace: packageRef.Context.Namespace, Name: repoN} - - // this verifies that the repo exists - repo, err := s.getRepoInCluster(ctx, repoName) - if err != nil { - return nil, err - } - - pkgDetail, err := s.availableChartDetail(ctx, repoName, chartName, request.GetPkgVersion()) - if err != nil { - return nil, err - } - - // fix up a couple of fields that don't come from the chart tarball - repoUrl := repo.Spec.URL - if repoUrl == "" { - return nil, status.Errorf(codes.NotFound, "Missing required field spec.url on repository %q", repoName) - } - pkgDetail.RepoUrl = repoUrl - pkgDetail.AvailablePackageRef.Context.Namespace = packageRef.Context.Namespace - // per https://github.com/kubeapps/kubeapps/pull/3686#issue-1038093832 - pkgDetail.AvailablePackageRef.Context.Cluster = s.kubeappsCluster - return &corev1.GetAvailablePackageDetailResponse{ AvailablePackageDetail: pkgDetail, }, nil @@ -557,6 +533,36 @@ func (s *Server) AddPackageRepository(ctx context.Context, request *corev1.AddPa } } +func (s *Server) GetPackageRepositoryDetail(ctx context.Context, request *corev1.GetPackageRepositoryDetailRequest) (*corev1.GetPackageRepositoryDetailResponse, error) { + log.Infof("+fluxv2 GetPackageRepositoryDetail [%v]", request) + if request == nil || request.PackageRepoRef == nil { + return nil, status.Errorf(codes.InvalidArgument, "no request AvailablePackageRef provided") + } + + repoRef := request.PackageRepoRef + // flux CRDs require a namespace, cluster-wide resources are not supported + if repoRef.Context == nil || len(repoRef.Context.Namespace) == 0 { + return nil, status.Errorf(codes.InvalidArgument, "PackageRepositoryReference is missing required namespace") + } + + cluster := repoRef.Context.Cluster + if cluster != "" && cluster != s.kubeappsCluster { + return nil, status.Errorf( + codes.Unimplemented, + "not supported yet: request.PackageRepoRef.Context.Cluster: [%v]", + cluster) + } + + repoDetail, err := s.repoDetail(ctx, repoRef) + if err != nil { + return nil, err + } + + return &corev1.GetPackageRepositoryDetailResponse{ + Detail: repoDetail, + }, nil +} + // convenience func mostly used by unit tests func (s *Server) newBackgroundClientGetter() clientgetter.BackgroundClientGetterFunc { return func(ctx context.Context) (clientgetter.ClientInterfaces, error) { diff --git a/cmd/kubeapps-apis/proto/kubeappsapis/core/packages/v1alpha1/repositories.proto b/cmd/kubeapps-apis/proto/kubeappsapis/core/packages/v1alpha1/repositories.proto index 16c812e48af..013ff3c604b 100644 --- a/cmd/kubeapps-apis/proto/kubeappsapis/core/packages/v1alpha1/repositories.proto +++ b/cmd/kubeapps-apis/proto/kubeappsapis/core/packages/v1alpha1/repositories.proto @@ -23,6 +23,12 @@ service RepositoriesService { body: "*" }; } + + rpc GetPackageRepositoryDetail(GetPackageRepositoryDetailRequest) returns (GetPackageRepositoryDetailResponse) { + option (google.api.http) = { + get: "/core/packages/v1alpha1/repositories/plugin/{package_repo_ref.plugin.name}/{package_repo_ref.plugin.version}/c/{package_repo_ref.context.cluster}/ns/{package_repo_ref.context.namespace}/{package_repo_ref.identifier=**}" + }; + } } // Standard request and response messages for each required function are defined @@ -221,6 +227,14 @@ message SecretKeyReference { string key = 2; } +// GetPackageRepositoryDetailRequest +// +// Request for GetPackageRepositoryDetail +message GetPackageRepositoryDetailRequest { + PackageRepositoryReference package_repo_ref = 1; +} + + // -- Start definitions of the response messages -- // PackageRepositoryReference @@ -251,3 +265,88 @@ message AddPackageRepositoryResponse { // }; PackageRepositoryReference package_repo_ref = 1; } + +// PackageRepositoryStatus +// +// A PackageRepositoryStatus reports on the current status of the repository. +message PackageRepositoryStatus { + // Ready + // + // An indication of whether the repository is ready or not + bool ready = 1; + + // StatusReason + // + // Generic reasons why a package repository may be ready or not. + // These should make sense across different packaging plugins. + enum StatusReason { + STATUS_REASON_UNSPECIFIED = 0; + STATUS_REASON_SUCCESS = 1; + STATUS_REASON_FAILED = 2; + STATUS_REASON_PENDING = 3; + } + + // Reason + // + // An enum indicating the reason for the current status. + StatusReason reason = 2; + + // UserReason + // + // Optional text to return for user context, which may be plugin specific. + string user_reason = 3; +} + +// PackageRepositoryDetail +// +message PackageRepositoryDetail { + // A reference uniquely identifying the package repository. + PackageRepositoryReference package_repo_ref = 1; + + // A user-provided name for the package repository (e.g. bitnami) + string name = 2; + + // A user-provided description. + string description = 3; + + // Whether this repository is global or namespace-scoped. + bool namespace_scoped = 4; + + // Package storage type + string type = 5; + + // A URL identifying the package repository location. + string url = 6; + + // The interval at which to check the upstream for updates (in seconds) + uint32 interval = 7; + + // TLS-specific parameters for connecting to a repository. + // If the cert authority was configured for this repository, then in the context + // of GetPackageRepositoryDetail() operation, the PackageRepositoryTlsConfig will ALWAYS + // contain an existing SecretKeyReference, rather that cert_authority field + PackageRepositoryTlsConfig tls_config = 8; + + // authentication parameters for connecting to a repository. + // If Basic Auth or TLS or Docker Creds Auth was configured for this repository, + // then in the context of GetPackageRepositoryDetail() operation, the + // PackageRepositoryAuth will ALWAYS contain an existing SecretKeyReference, + // rather that string values that may have been used when package repository was created + // field + PackageRepositoryAuth auth = 9; + + // Custom data added by the plugin + google.protobuf.Any custom_detail = 10; + + // current status of the repository which can include reconciliation + // status, where relevant. + PackageRepositoryStatus status = 11; +} + +// GetPackageRepositoryDetailResponse +// +// Response for GetPackageRepositoryDetail +message GetPackageRepositoryDetailResponse { + // package repository detail + PackageRepositoryDetail detail = 1; +} \ No newline at end of file diff --git a/cmd/kubeapps-apis/proto/kubeappsapis/plugins/fluxv2/packages/v1alpha1/fluxv2.proto b/cmd/kubeapps-apis/proto/kubeappsapis/plugins/fluxv2/packages/v1alpha1/fluxv2.proto index 7d0ec40c036..cd792559d3d 100644 --- a/cmd/kubeapps-apis/proto/kubeappsapis/plugins/fluxv2/packages/v1alpha1/fluxv2.proto +++ b/cmd/kubeapps-apis/proto/kubeappsapis/plugins/fluxv2/packages/v1alpha1/fluxv2.proto @@ -88,4 +88,11 @@ service FluxV2RepositoriesService { body: "*" }; } + + rpc GetPackageRepositoryDetail(kubeappsapis.core.packages.v1alpha1.GetPackageRepositoryDetailRequest) returns (kubeappsapis.core.packages.v1alpha1.GetPackageRepositoryDetailResponse) { + option (google.api.http) = { + get: "/plugins/fluxv2/packages/v1alpha1/repositories/plugin/{package_repo_ref.plugin.name}/{package_repo_ref.plugin.version}/c/{package_repo_ref.context.cluster}/ns/{package_repo_ref.context.namespace}/{package_repo_ref.identifier=**}" + }; + } + } diff --git a/dashboard/src/gen/google/api/http.ts b/dashboard/src/gen/google/api/http.ts index 582b369db23..c22448eb788 100644 --- a/dashboard/src/gen/google/api/http.ts +++ b/dashboard/src/gen/google/api/http.ts @@ -359,9 +359,7 @@ export interface CustomHttpPattern { path: string; } -function createBaseHttp(): Http { - return { rules: [], fullyDecodeReservedExpansion: false }; -} +const baseHttp: object = { fullyDecodeReservedExpansion: false }; export const Http = { encode(message: Http, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -377,7 +375,8 @@ export const Http = { decode(input: _m0.Reader | Uint8Array, length?: number): Http { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseHttp(); + const message = { ...baseHttp } as Http; + message.rules = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -396,12 +395,22 @@ export const Http = { }, fromJSON(object: any): Http { - return { - rules: Array.isArray(object?.rules) ? object.rules.map((e: any) => HttpRule.fromJSON(e)) : [], - fullyDecodeReservedExpansion: isSet(object.fullyDecodeReservedExpansion) - ? Boolean(object.fullyDecodeReservedExpansion) - : false, - }; + const message = { ...baseHttp } as Http; + message.rules = []; + if (object.rules !== undefined && object.rules !== null) { + for (const e of object.rules) { + message.rules.push(HttpRule.fromJSON(e)); + } + } + if ( + object.fullyDecodeReservedExpansion !== undefined && + object.fullyDecodeReservedExpansion !== null + ) { + message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); + } else { + message.fullyDecodeReservedExpansion = false; + } + return message; }, toJSON(message: Http): unknown { @@ -416,28 +425,27 @@ export const Http = { return obj; }, - fromPartial, I>>(object: I): Http { - const message = createBaseHttp(); - message.rules = object.rules?.map(e => HttpRule.fromPartial(e)) || []; - message.fullyDecodeReservedExpansion = object.fullyDecodeReservedExpansion ?? false; + fromPartial(object: DeepPartial): Http { + const message = { ...baseHttp } as Http; + message.rules = []; + if (object.rules !== undefined && object.rules !== null) { + for (const e of object.rules) { + message.rules.push(HttpRule.fromPartial(e)); + } + } + if ( + object.fullyDecodeReservedExpansion !== undefined && + object.fullyDecodeReservedExpansion !== null + ) { + message.fullyDecodeReservedExpansion = object.fullyDecodeReservedExpansion; + } else { + message.fullyDecodeReservedExpansion = false; + } return message; }, }; -function createBaseHttpRule(): HttpRule { - return { - selector: "", - get: undefined, - put: undefined, - post: undefined, - delete: undefined, - patch: undefined, - custom: undefined, - body: "", - responseBody: "", - additionalBindings: [], - }; -} +const baseHttpRule: object = { selector: "", body: "", responseBody: "" }; export const HttpRule = { encode(message: HttpRule, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -477,7 +485,8 @@ export const HttpRule = { decode(input: _m0.Reader | Uint8Array, length?: number): HttpRule { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseHttpRule(); + const message = { ...baseHttpRule } as HttpRule; + message.additionalBindings = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -520,20 +529,59 @@ export const HttpRule = { }, fromJSON(object: any): HttpRule { - return { - selector: isSet(object.selector) ? String(object.selector) : "", - get: isSet(object.get) ? String(object.get) : undefined, - put: isSet(object.put) ? String(object.put) : undefined, - post: isSet(object.post) ? String(object.post) : undefined, - delete: isSet(object.delete) ? String(object.delete) : undefined, - patch: isSet(object.patch) ? String(object.patch) : undefined, - custom: isSet(object.custom) ? CustomHttpPattern.fromJSON(object.custom) : undefined, - body: isSet(object.body) ? String(object.body) : "", - responseBody: isSet(object.responseBody) ? String(object.responseBody) : "", - additionalBindings: Array.isArray(object?.additionalBindings) - ? object.additionalBindings.map((e: any) => HttpRule.fromJSON(e)) - : [], - }; + const message = { ...baseHttpRule } as HttpRule; + message.additionalBindings = []; + if (object.selector !== undefined && object.selector !== null) { + message.selector = String(object.selector); + } else { + message.selector = ""; + } + if (object.get !== undefined && object.get !== null) { + message.get = String(object.get); + } else { + message.get = undefined; + } + if (object.put !== undefined && object.put !== null) { + message.put = String(object.put); + } else { + message.put = undefined; + } + if (object.post !== undefined && object.post !== null) { + message.post = String(object.post); + } else { + message.post = undefined; + } + if (object.delete !== undefined && object.delete !== null) { + message.delete = String(object.delete); + } else { + message.delete = undefined; + } + if (object.patch !== undefined && object.patch !== null) { + message.patch = String(object.patch); + } else { + message.patch = undefined; + } + if (object.custom !== undefined && object.custom !== null) { + message.custom = CustomHttpPattern.fromJSON(object.custom); + } else { + message.custom = undefined; + } + if (object.body !== undefined && object.body !== null) { + message.body = String(object.body); + } else { + message.body = ""; + } + if (object.responseBody !== undefined && object.responseBody !== null) { + message.responseBody = String(object.responseBody); + } else { + message.responseBody = ""; + } + if (object.additionalBindings !== undefined && object.additionalBindings !== null) { + for (const e of object.additionalBindings) { + message.additionalBindings.push(HttpRule.fromJSON(e)); + } + } + return message; }, toJSON(message: HttpRule): unknown { @@ -558,28 +606,64 @@ export const HttpRule = { return obj; }, - fromPartial, I>>(object: I): HttpRule { - const message = createBaseHttpRule(); - message.selector = object.selector ?? ""; - message.get = object.get ?? undefined; - message.put = object.put ?? undefined; - message.post = object.post ?? undefined; - message.delete = object.delete ?? undefined; - message.patch = object.patch ?? undefined; - message.custom = - object.custom !== undefined && object.custom !== null - ? CustomHttpPattern.fromPartial(object.custom) - : undefined; - message.body = object.body ?? ""; - message.responseBody = object.responseBody ?? ""; - message.additionalBindings = object.additionalBindings?.map(e => HttpRule.fromPartial(e)) || []; + fromPartial(object: DeepPartial): HttpRule { + const message = { ...baseHttpRule } as HttpRule; + message.additionalBindings = []; + if (object.selector !== undefined && object.selector !== null) { + message.selector = object.selector; + } else { + message.selector = ""; + } + if (object.get !== undefined && object.get !== null) { + message.get = object.get; + } else { + message.get = undefined; + } + if (object.put !== undefined && object.put !== null) { + message.put = object.put; + } else { + message.put = undefined; + } + if (object.post !== undefined && object.post !== null) { + message.post = object.post; + } else { + message.post = undefined; + } + if (object.delete !== undefined && object.delete !== null) { + message.delete = object.delete; + } else { + message.delete = undefined; + } + if (object.patch !== undefined && object.patch !== null) { + message.patch = object.patch; + } else { + message.patch = undefined; + } + if (object.custom !== undefined && object.custom !== null) { + message.custom = CustomHttpPattern.fromPartial(object.custom); + } else { + message.custom = undefined; + } + if (object.body !== undefined && object.body !== null) { + message.body = object.body; + } else { + message.body = ""; + } + if (object.responseBody !== undefined && object.responseBody !== null) { + message.responseBody = object.responseBody; + } else { + message.responseBody = ""; + } + if (object.additionalBindings !== undefined && object.additionalBindings !== null) { + for (const e of object.additionalBindings) { + message.additionalBindings.push(HttpRule.fromPartial(e)); + } + } return message; }, }; -function createBaseCustomHttpPattern(): CustomHttpPattern { - return { kind: "", path: "" }; -} +const baseCustomHttpPattern: object = { kind: "", path: "" }; export const CustomHttpPattern = { encode(message: CustomHttpPattern, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -595,7 +679,7 @@ export const CustomHttpPattern = { decode(input: _m0.Reader | Uint8Array, length?: number): CustomHttpPattern { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseCustomHttpPattern(); + const message = { ...baseCustomHttpPattern } as CustomHttpPattern; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -614,10 +698,18 @@ export const CustomHttpPattern = { }, fromJSON(object: any): CustomHttpPattern { - return { - kind: isSet(object.kind) ? String(object.kind) : "", - path: isSet(object.path) ? String(object.path) : "", - }; + const message = { ...baseCustomHttpPattern } as CustomHttpPattern; + if (object.kind !== undefined && object.kind !== null) { + message.kind = String(object.kind); + } else { + message.kind = ""; + } + if (object.path !== undefined && object.path !== null) { + message.path = String(object.path); + } else { + message.path = ""; + } + return message; }, toJSON(message: CustomHttpPattern): unknown { @@ -627,16 +719,23 @@ export const CustomHttpPattern = { return obj; }, - fromPartial, I>>(object: I): CustomHttpPattern { - const message = createBaseCustomHttpPattern(); - message.kind = object.kind ?? ""; - message.path = object.path ?? ""; + fromPartial(object: DeepPartial): CustomHttpPattern { + const message = { ...baseCustomHttpPattern } as CustomHttpPattern; + if (object.kind !== undefined && object.kind !== null) { + message.kind = object.kind; + } else { + message.kind = ""; + } + if (object.path !== undefined && object.path !== null) { + message.path = object.path; + } else { + message.path = ""; + } return message; }, }; type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - export type DeepPartial = T extends Builtin ? T : T extends Array @@ -647,16 +746,7 @@ export type DeepPartial = T extends Builtin ? { [K in keyof T]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & Record>, never>; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); } - -function isSet(value: any): boolean { - return value !== null && value !== undefined; -} diff --git a/dashboard/src/gen/google/protobuf/any.ts b/dashboard/src/gen/google/protobuf/any.ts index 1a6f7b41b78..e58955be721 100644 --- a/dashboard/src/gen/google/protobuf/any.ts +++ b/dashboard/src/gen/google/protobuf/any.ts @@ -123,9 +123,7 @@ export interface Any { value: Uint8Array; } -function createBaseAny(): Any { - return { typeUrl: "", value: new Uint8Array() }; -} +const baseAny: object = { typeUrl: "" }; export const Any = { encode(message: Any, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -141,7 +139,8 @@ export const Any = { decode(input: _m0.Reader | Uint8Array, length?: number): Any { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseAny(); + const message = { ...baseAny } as Any; + message.value = new Uint8Array(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -160,10 +159,17 @@ export const Any = { }, fromJSON(object: any): Any { - return { - typeUrl: isSet(object.typeUrl) ? String(object.typeUrl) : "", - value: isSet(object.value) ? bytesFromBase64(object.value) : new Uint8Array(), - }; + const message = { ...baseAny } as Any; + message.value = new Uint8Array(); + if (object.typeUrl !== undefined && object.typeUrl !== null) { + message.typeUrl = String(object.typeUrl); + } else { + message.typeUrl = ""; + } + if (object.value !== undefined && object.value !== null) { + message.value = bytesFromBase64(object.value); + } + return message; }, toJSON(message: Any): unknown { @@ -174,10 +180,18 @@ export const Any = { return obj; }, - fromPartial, I>>(object: I): Any { - const message = createBaseAny(); - message.typeUrl = object.typeUrl ?? ""; - message.value = object.value ?? new Uint8Array(); + fromPartial(object: DeepPartial): Any { + const message = { ...baseAny } as Any; + if (object.typeUrl !== undefined && object.typeUrl !== null) { + message.typeUrl = object.typeUrl; + } else { + message.typeUrl = ""; + } + if (object.value !== undefined && object.value !== null) { + message.value = object.value; + } else { + message.value = new Uint8Array(); + } return message; }, }; @@ -215,7 +229,6 @@ function base64FromBytes(arr: Uint8Array): string { } type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - export type DeepPartial = T extends Builtin ? T : T extends Array @@ -226,16 +239,7 @@ export type DeepPartial = T extends Builtin ? { [K in keyof T]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & Record>, never>; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); } - -function isSet(value: any): boolean { - return value !== null && value !== undefined; -} diff --git a/dashboard/src/gen/google/protobuf/descriptor.ts b/dashboard/src/gen/google/protobuf/descriptor.ts index ca193ea5cc9..02065233855 100644 --- a/dashboard/src/gen/google/protobuf/descriptor.ts +++ b/dashboard/src/gen/google/protobuf/descriptor.ts @@ -1116,9 +1116,7 @@ export interface GeneratedCodeInfo_Annotation { end: number; } -function createBaseFileDescriptorSet(): FileDescriptorSet { - return { file: [] }; -} +const baseFileDescriptorSet: object = {}; export const FileDescriptorSet = { encode(message: FileDescriptorSet, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -1131,7 +1129,8 @@ export const FileDescriptorSet = { decode(input: _m0.Reader | Uint8Array, length?: number): FileDescriptorSet { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseFileDescriptorSet(); + const message = { ...baseFileDescriptorSet } as FileDescriptorSet; + message.file = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1147,11 +1146,14 @@ export const FileDescriptorSet = { }, fromJSON(object: any): FileDescriptorSet { - return { - file: Array.isArray(object?.file) - ? object.file.map((e: any) => FileDescriptorProto.fromJSON(e)) - : [], - }; + const message = { ...baseFileDescriptorSet } as FileDescriptorSet; + message.file = []; + if (object.file !== undefined && object.file !== null) { + for (const e of object.file) { + message.file.push(FileDescriptorProto.fromJSON(e)); + } + } + return message; }, toJSON(message: FileDescriptorSet): unknown { @@ -1164,29 +1166,26 @@ export const FileDescriptorSet = { return obj; }, - fromPartial, I>>(object: I): FileDescriptorSet { - const message = createBaseFileDescriptorSet(); - message.file = object.file?.map(e => FileDescriptorProto.fromPartial(e)) || []; + fromPartial(object: DeepPartial): FileDescriptorSet { + const message = { ...baseFileDescriptorSet } as FileDescriptorSet; + message.file = []; + if (object.file !== undefined && object.file !== null) { + for (const e of object.file) { + message.file.push(FileDescriptorProto.fromPartial(e)); + } + } return message; }, }; -function createBaseFileDescriptorProto(): FileDescriptorProto { - return { - name: "", - package: "", - dependency: [], - publicDependency: [], - weakDependency: [], - messageType: [], - enumType: [], - service: [], - extension: [], - options: undefined, - sourceCodeInfo: undefined, - syntax: "", - }; -} +const baseFileDescriptorProto: object = { + name: "", + package: "", + dependency: "", + publicDependency: 0, + weakDependency: 0, + syntax: "", +}; export const FileDescriptorProto = { encode(message: FileDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -1236,7 +1235,14 @@ export const FileDescriptorProto = { decode(input: _m0.Reader | Uint8Array, length?: number): FileDescriptorProto { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseFileDescriptorProto(); + const message = { ...baseFileDescriptorProto } as FileDescriptorProto; + message.dependency = []; + message.publicDependency = []; + message.weakDependency = []; + message.messageType = []; + message.enumType = []; + message.service = []; + message.extension = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1299,36 +1305,75 @@ export const FileDescriptorProto = { }, fromJSON(object: any): FileDescriptorProto { - return { - name: isSet(object.name) ? String(object.name) : "", - package: isSet(object.package) ? String(object.package) : "", - dependency: Array.isArray(object?.dependency) - ? object.dependency.map((e: any) => String(e)) - : [], - publicDependency: Array.isArray(object?.publicDependency) - ? object.publicDependency.map((e: any) => Number(e)) - : [], - weakDependency: Array.isArray(object?.weakDependency) - ? object.weakDependency.map((e: any) => Number(e)) - : [], - messageType: Array.isArray(object?.messageType) - ? object.messageType.map((e: any) => DescriptorProto.fromJSON(e)) - : [], - enumType: Array.isArray(object?.enumType) - ? object.enumType.map((e: any) => EnumDescriptorProto.fromJSON(e)) - : [], - service: Array.isArray(object?.service) - ? object.service.map((e: any) => ServiceDescriptorProto.fromJSON(e)) - : [], - extension: Array.isArray(object?.extension) - ? object.extension.map((e: any) => FieldDescriptorProto.fromJSON(e)) - : [], - options: isSet(object.options) ? FileOptions.fromJSON(object.options) : undefined, - sourceCodeInfo: isSet(object.sourceCodeInfo) - ? SourceCodeInfo.fromJSON(object.sourceCodeInfo) - : undefined, - syntax: isSet(object.syntax) ? String(object.syntax) : "", - }; + const message = { ...baseFileDescriptorProto } as FileDescriptorProto; + message.dependency = []; + message.publicDependency = []; + message.weakDependency = []; + message.messageType = []; + message.enumType = []; + message.service = []; + message.extension = []; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.package !== undefined && object.package !== null) { + message.package = String(object.package); + } else { + message.package = ""; + } + if (object.dependency !== undefined && object.dependency !== null) { + for (const e of object.dependency) { + message.dependency.push(String(e)); + } + } + if (object.publicDependency !== undefined && object.publicDependency !== null) { + for (const e of object.publicDependency) { + message.publicDependency.push(Number(e)); + } + } + if (object.weakDependency !== undefined && object.weakDependency !== null) { + for (const e of object.weakDependency) { + message.weakDependency.push(Number(e)); + } + } + if (object.messageType !== undefined && object.messageType !== null) { + for (const e of object.messageType) { + message.messageType.push(DescriptorProto.fromJSON(e)); + } + } + if (object.enumType !== undefined && object.enumType !== null) { + for (const e of object.enumType) { + message.enumType.push(EnumDescriptorProto.fromJSON(e)); + } + } + if (object.service !== undefined && object.service !== null) { + for (const e of object.service) { + message.service.push(ServiceDescriptorProto.fromJSON(e)); + } + } + if (object.extension !== undefined && object.extension !== null) { + for (const e of object.extension) { + message.extension.push(FieldDescriptorProto.fromJSON(e)); + } + } + if (object.options !== undefined && object.options !== null) { + message.options = FileOptions.fromJSON(object.options); + } else { + message.options = undefined; + } + if (object.sourceCodeInfo !== undefined && object.sourceCodeInfo !== null) { + message.sourceCodeInfo = SourceCodeInfo.fromJSON(object.sourceCodeInfo); + } else { + message.sourceCodeInfo = undefined; + } + if (object.syntax !== undefined && object.syntax !== null) { + message.syntax = String(object.syntax); + } else { + message.syntax = ""; + } + return message; }, toJSON(message: FileDescriptorProto): unknown { @@ -1341,12 +1386,12 @@ export const FileDescriptorProto = { obj.dependency = []; } if (message.publicDependency) { - obj.publicDependency = message.publicDependency.map(e => Math.round(e)); + obj.publicDependency = message.publicDependency.map(e => e); } else { obj.publicDependency = []; } if (message.weakDependency) { - obj.weakDependency = message.weakDependency.map(e => Math.round(e)); + obj.weakDependency = message.weakDependency.map(e => e); } else { obj.weakDependency = []; } @@ -1380,46 +1425,80 @@ export const FileDescriptorProto = { return obj; }, - fromPartial, I>>( - object: I, - ): FileDescriptorProto { - const message = createBaseFileDescriptorProto(); - message.name = object.name ?? ""; - message.package = object.package ?? ""; - message.dependency = object.dependency?.map(e => e) || []; - message.publicDependency = object.publicDependency?.map(e => e) || []; - message.weakDependency = object.weakDependency?.map(e => e) || []; - message.messageType = object.messageType?.map(e => DescriptorProto.fromPartial(e)) || []; - message.enumType = object.enumType?.map(e => EnumDescriptorProto.fromPartial(e)) || []; - message.service = object.service?.map(e => ServiceDescriptorProto.fromPartial(e)) || []; - message.extension = object.extension?.map(e => FieldDescriptorProto.fromPartial(e)) || []; - message.options = - object.options !== undefined && object.options !== null - ? FileOptions.fromPartial(object.options) - : undefined; - message.sourceCodeInfo = - object.sourceCodeInfo !== undefined && object.sourceCodeInfo !== null - ? SourceCodeInfo.fromPartial(object.sourceCodeInfo) - : undefined; - message.syntax = object.syntax ?? ""; + fromPartial(object: DeepPartial): FileDescriptorProto { + const message = { ...baseFileDescriptorProto } as FileDescriptorProto; + message.dependency = []; + message.publicDependency = []; + message.weakDependency = []; + message.messageType = []; + message.enumType = []; + message.service = []; + message.extension = []; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.package !== undefined && object.package !== null) { + message.package = object.package; + } else { + message.package = ""; + } + if (object.dependency !== undefined && object.dependency !== null) { + for (const e of object.dependency) { + message.dependency.push(e); + } + } + if (object.publicDependency !== undefined && object.publicDependency !== null) { + for (const e of object.publicDependency) { + message.publicDependency.push(e); + } + } + if (object.weakDependency !== undefined && object.weakDependency !== null) { + for (const e of object.weakDependency) { + message.weakDependency.push(e); + } + } + if (object.messageType !== undefined && object.messageType !== null) { + for (const e of object.messageType) { + message.messageType.push(DescriptorProto.fromPartial(e)); + } + } + if (object.enumType !== undefined && object.enumType !== null) { + for (const e of object.enumType) { + message.enumType.push(EnumDescriptorProto.fromPartial(e)); + } + } + if (object.service !== undefined && object.service !== null) { + for (const e of object.service) { + message.service.push(ServiceDescriptorProto.fromPartial(e)); + } + } + if (object.extension !== undefined && object.extension !== null) { + for (const e of object.extension) { + message.extension.push(FieldDescriptorProto.fromPartial(e)); + } + } + if (object.options !== undefined && object.options !== null) { + message.options = FileOptions.fromPartial(object.options); + } else { + message.options = undefined; + } + if (object.sourceCodeInfo !== undefined && object.sourceCodeInfo !== null) { + message.sourceCodeInfo = SourceCodeInfo.fromPartial(object.sourceCodeInfo); + } else { + message.sourceCodeInfo = undefined; + } + if (object.syntax !== undefined && object.syntax !== null) { + message.syntax = object.syntax; + } else { + message.syntax = ""; + } return message; }, }; -function createBaseDescriptorProto(): DescriptorProto { - return { - name: "", - field: [], - extension: [], - nestedType: [], - enumType: [], - extensionRange: [], - oneofDecl: [], - options: undefined, - reservedRange: [], - reservedName: [], - }; -} +const baseDescriptorProto: object = { name: "", reservedName: "" }; export const DescriptorProto = { encode(message: DescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -1459,7 +1538,15 @@ export const DescriptorProto = { decode(input: _m0.Reader | Uint8Array, length?: number): DescriptorProto { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDescriptorProto(); + const message = { ...baseDescriptorProto } as DescriptorProto; + message.field = []; + message.extension = []; + message.nestedType = []; + message.enumType = []; + message.extensionRange = []; + message.oneofDecl = []; + message.reservedRange = []; + message.reservedName = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1504,34 +1591,66 @@ export const DescriptorProto = { }, fromJSON(object: any): DescriptorProto { - return { - name: isSet(object.name) ? String(object.name) : "", - field: Array.isArray(object?.field) - ? object.field.map((e: any) => FieldDescriptorProto.fromJSON(e)) - : [], - extension: Array.isArray(object?.extension) - ? object.extension.map((e: any) => FieldDescriptorProto.fromJSON(e)) - : [], - nestedType: Array.isArray(object?.nestedType) - ? object.nestedType.map((e: any) => DescriptorProto.fromJSON(e)) - : [], - enumType: Array.isArray(object?.enumType) - ? object.enumType.map((e: any) => EnumDescriptorProto.fromJSON(e)) - : [], - extensionRange: Array.isArray(object?.extensionRange) - ? object.extensionRange.map((e: any) => DescriptorProto_ExtensionRange.fromJSON(e)) - : [], - oneofDecl: Array.isArray(object?.oneofDecl) - ? object.oneofDecl.map((e: any) => OneofDescriptorProto.fromJSON(e)) - : [], - options: isSet(object.options) ? MessageOptions.fromJSON(object.options) : undefined, - reservedRange: Array.isArray(object?.reservedRange) - ? object.reservedRange.map((e: any) => DescriptorProto_ReservedRange.fromJSON(e)) - : [], - reservedName: Array.isArray(object?.reservedName) - ? object.reservedName.map((e: any) => String(e)) - : [], - }; + const message = { ...baseDescriptorProto } as DescriptorProto; + message.field = []; + message.extension = []; + message.nestedType = []; + message.enumType = []; + message.extensionRange = []; + message.oneofDecl = []; + message.reservedRange = []; + message.reservedName = []; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.field !== undefined && object.field !== null) { + for (const e of object.field) { + message.field.push(FieldDescriptorProto.fromJSON(e)); + } + } + if (object.extension !== undefined && object.extension !== null) { + for (const e of object.extension) { + message.extension.push(FieldDescriptorProto.fromJSON(e)); + } + } + if (object.nestedType !== undefined && object.nestedType !== null) { + for (const e of object.nestedType) { + message.nestedType.push(DescriptorProto.fromJSON(e)); + } + } + if (object.enumType !== undefined && object.enumType !== null) { + for (const e of object.enumType) { + message.enumType.push(EnumDescriptorProto.fromJSON(e)); + } + } + if (object.extensionRange !== undefined && object.extensionRange !== null) { + for (const e of object.extensionRange) { + message.extensionRange.push(DescriptorProto_ExtensionRange.fromJSON(e)); + } + } + if (object.oneofDecl !== undefined && object.oneofDecl !== null) { + for (const e of object.oneofDecl) { + message.oneofDecl.push(OneofDescriptorProto.fromJSON(e)); + } + } + if (object.options !== undefined && object.options !== null) { + message.options = MessageOptions.fromJSON(object.options); + } else { + message.options = undefined; + } + if (object.reservedRange !== undefined && object.reservedRange !== null) { + for (const e of object.reservedRange) { + message.reservedRange.push(DescriptorProto_ReservedRange.fromJSON(e)); + } + } + if (object.reservedName !== undefined && object.reservedName !== null) { + for (const e of object.reservedName) { + message.reservedName.push(String(e)); + } + } + return message; }, toJSON(message: DescriptorProto): unknown { @@ -1586,30 +1705,71 @@ export const DescriptorProto = { return obj; }, - fromPartial, I>>(object: I): DescriptorProto { - const message = createBaseDescriptorProto(); - message.name = object.name ?? ""; - message.field = object.field?.map(e => FieldDescriptorProto.fromPartial(e)) || []; - message.extension = object.extension?.map(e => FieldDescriptorProto.fromPartial(e)) || []; - message.nestedType = object.nestedType?.map(e => DescriptorProto.fromPartial(e)) || []; - message.enumType = object.enumType?.map(e => EnumDescriptorProto.fromPartial(e)) || []; - message.extensionRange = - object.extensionRange?.map(e => DescriptorProto_ExtensionRange.fromPartial(e)) || []; - message.oneofDecl = object.oneofDecl?.map(e => OneofDescriptorProto.fromPartial(e)) || []; - message.options = - object.options !== undefined && object.options !== null - ? MessageOptions.fromPartial(object.options) - : undefined; - message.reservedRange = - object.reservedRange?.map(e => DescriptorProto_ReservedRange.fromPartial(e)) || []; - message.reservedName = object.reservedName?.map(e => e) || []; + fromPartial(object: DeepPartial): DescriptorProto { + const message = { ...baseDescriptorProto } as DescriptorProto; + message.field = []; + message.extension = []; + message.nestedType = []; + message.enumType = []; + message.extensionRange = []; + message.oneofDecl = []; + message.reservedRange = []; + message.reservedName = []; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.field !== undefined && object.field !== null) { + for (const e of object.field) { + message.field.push(FieldDescriptorProto.fromPartial(e)); + } + } + if (object.extension !== undefined && object.extension !== null) { + for (const e of object.extension) { + message.extension.push(FieldDescriptorProto.fromPartial(e)); + } + } + if (object.nestedType !== undefined && object.nestedType !== null) { + for (const e of object.nestedType) { + message.nestedType.push(DescriptorProto.fromPartial(e)); + } + } + if (object.enumType !== undefined && object.enumType !== null) { + for (const e of object.enumType) { + message.enumType.push(EnumDescriptorProto.fromPartial(e)); + } + } + if (object.extensionRange !== undefined && object.extensionRange !== null) { + for (const e of object.extensionRange) { + message.extensionRange.push(DescriptorProto_ExtensionRange.fromPartial(e)); + } + } + if (object.oneofDecl !== undefined && object.oneofDecl !== null) { + for (const e of object.oneofDecl) { + message.oneofDecl.push(OneofDescriptorProto.fromPartial(e)); + } + } + if (object.options !== undefined && object.options !== null) { + message.options = MessageOptions.fromPartial(object.options); + } else { + message.options = undefined; + } + if (object.reservedRange !== undefined && object.reservedRange !== null) { + for (const e of object.reservedRange) { + message.reservedRange.push(DescriptorProto_ReservedRange.fromPartial(e)); + } + } + if (object.reservedName !== undefined && object.reservedName !== null) { + for (const e of object.reservedName) { + message.reservedName.push(e); + } + } return message; }, }; -function createBaseDescriptorProto_ExtensionRange(): DescriptorProto_ExtensionRange { - return { start: 0, end: 0, options: undefined }; -} +const baseDescriptorProto_ExtensionRange: object = { start: 0, end: 0 }; export const DescriptorProto_ExtensionRange = { encode( @@ -1631,7 +1791,9 @@ export const DescriptorProto_ExtensionRange = { decode(input: _m0.Reader | Uint8Array, length?: number): DescriptorProto_ExtensionRange { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDescriptorProto_ExtensionRange(); + const message = { + ...baseDescriptorProto_ExtensionRange, + } as DescriptorProto_ExtensionRange; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1653,39 +1815,60 @@ export const DescriptorProto_ExtensionRange = { }, fromJSON(object: any): DescriptorProto_ExtensionRange { - return { - start: isSet(object.start) ? Number(object.start) : 0, - end: isSet(object.end) ? Number(object.end) : 0, - options: isSet(object.options) ? ExtensionRangeOptions.fromJSON(object.options) : undefined, - }; + const message = { + ...baseDescriptorProto_ExtensionRange, + } as DescriptorProto_ExtensionRange; + if (object.start !== undefined && object.start !== null) { + message.start = Number(object.start); + } else { + message.start = 0; + } + if (object.end !== undefined && object.end !== null) { + message.end = Number(object.end); + } else { + message.end = 0; + } + if (object.options !== undefined && object.options !== null) { + message.options = ExtensionRangeOptions.fromJSON(object.options); + } else { + message.options = undefined; + } + return message; }, toJSON(message: DescriptorProto_ExtensionRange): unknown { const obj: any = {}; - message.start !== undefined && (obj.start = Math.round(message.start)); - message.end !== undefined && (obj.end = Math.round(message.end)); + message.start !== undefined && (obj.start = message.start); + message.end !== undefined && (obj.end = message.end); message.options !== undefined && (obj.options = message.options ? ExtensionRangeOptions.toJSON(message.options) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): DescriptorProto_ExtensionRange { - const message = createBaseDescriptorProto_ExtensionRange(); - message.start = object.start ?? 0; - message.end = object.end ?? 0; - message.options = - object.options !== undefined && object.options !== null - ? ExtensionRangeOptions.fromPartial(object.options) - : undefined; + fromPartial(object: DeepPartial): DescriptorProto_ExtensionRange { + const message = { + ...baseDescriptorProto_ExtensionRange, + } as DescriptorProto_ExtensionRange; + if (object.start !== undefined && object.start !== null) { + message.start = object.start; + } else { + message.start = 0; + } + if (object.end !== undefined && object.end !== null) { + message.end = object.end; + } else { + message.end = 0; + } + if (object.options !== undefined && object.options !== null) { + message.options = ExtensionRangeOptions.fromPartial(object.options); + } else { + message.options = undefined; + } return message; }, }; -function createBaseDescriptorProto_ReservedRange(): DescriptorProto_ReservedRange { - return { start: 0, end: 0 }; -} +const baseDescriptorProto_ReservedRange: object = { start: 0, end: 0 }; export const DescriptorProto_ReservedRange = { encode( @@ -1704,7 +1887,9 @@ export const DescriptorProto_ReservedRange = { decode(input: _m0.Reader | Uint8Array, length?: number): DescriptorProto_ReservedRange { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDescriptorProto_ReservedRange(); + const message = { + ...baseDescriptorProto_ReservedRange, + } as DescriptorProto_ReservedRange; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1723,32 +1908,48 @@ export const DescriptorProto_ReservedRange = { }, fromJSON(object: any): DescriptorProto_ReservedRange { - return { - start: isSet(object.start) ? Number(object.start) : 0, - end: isSet(object.end) ? Number(object.end) : 0, - }; + const message = { + ...baseDescriptorProto_ReservedRange, + } as DescriptorProto_ReservedRange; + if (object.start !== undefined && object.start !== null) { + message.start = Number(object.start); + } else { + message.start = 0; + } + if (object.end !== undefined && object.end !== null) { + message.end = Number(object.end); + } else { + message.end = 0; + } + return message; }, toJSON(message: DescriptorProto_ReservedRange): unknown { const obj: any = {}; - message.start !== undefined && (obj.start = Math.round(message.start)); - message.end !== undefined && (obj.end = Math.round(message.end)); + message.start !== undefined && (obj.start = message.start); + message.end !== undefined && (obj.end = message.end); return obj; }, - fromPartial, I>>( - object: I, - ): DescriptorProto_ReservedRange { - const message = createBaseDescriptorProto_ReservedRange(); - message.start = object.start ?? 0; - message.end = object.end ?? 0; + fromPartial(object: DeepPartial): DescriptorProto_ReservedRange { + const message = { + ...baseDescriptorProto_ReservedRange, + } as DescriptorProto_ReservedRange; + if (object.start !== undefined && object.start !== null) { + message.start = object.start; + } else { + message.start = 0; + } + if (object.end !== undefined && object.end !== null) { + message.end = object.end; + } else { + message.end = 0; + } return message; }, }; -function createBaseExtensionRangeOptions(): ExtensionRangeOptions { - return { uninterpretedOption: [] }; -} +const baseExtensionRangeOptions: object = {}; export const ExtensionRangeOptions = { encode(message: ExtensionRangeOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -1761,7 +1962,8 @@ export const ExtensionRangeOptions = { decode(input: _m0.Reader | Uint8Array, length?: number): ExtensionRangeOptions { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseExtensionRangeOptions(); + const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; + message.uninterpretedOption = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1777,11 +1979,14 @@ export const ExtensionRangeOptions = { }, fromJSON(object: any): ExtensionRangeOptions { - return { - uninterpretedOption: Array.isArray(object?.uninterpretedOption) - ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) - : [], - }; + const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; + message.uninterpretedOption = []; + if (object.uninterpretedOption !== undefined && object.uninterpretedOption !== null) { + for (const e of object.uninterpretedOption) { + message.uninterpretedOption.push(UninterpretedOption.fromJSON(e)); + } + } + return message; }, toJSON(message: ExtensionRangeOptions): unknown { @@ -1796,31 +2001,30 @@ export const ExtensionRangeOptions = { return obj; }, - fromPartial, I>>( - object: I, - ): ExtensionRangeOptions { - const message = createBaseExtensionRangeOptions(); - message.uninterpretedOption = - object.uninterpretedOption?.map(e => UninterpretedOption.fromPartial(e)) || []; + fromPartial(object: DeepPartial): ExtensionRangeOptions { + const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; + message.uninterpretedOption = []; + if (object.uninterpretedOption !== undefined && object.uninterpretedOption !== null) { + for (const e of object.uninterpretedOption) { + message.uninterpretedOption.push(UninterpretedOption.fromPartial(e)); + } + } return message; }, }; -function createBaseFieldDescriptorProto(): FieldDescriptorProto { - return { - name: "", - number: 0, - label: 1, - type: 1, - typeName: "", - extendee: "", - defaultValue: "", - oneofIndex: 0, - jsonName: "", - options: undefined, - proto3Optional: false, - }; -} +const baseFieldDescriptorProto: object = { + name: "", + number: 0, + label: 1, + type: 1, + typeName: "", + extendee: "", + defaultValue: "", + oneofIndex: 0, + jsonName: "", + proto3Optional: false, +}; export const FieldDescriptorProto = { encode(message: FieldDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -1863,7 +2067,7 @@ export const FieldDescriptorProto = { decode(input: _m0.Reader | Uint8Array, length?: number): FieldDescriptorProto { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseFieldDescriptorProto(); + const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1909,31 +2113,75 @@ export const FieldDescriptorProto = { }, fromJSON(object: any): FieldDescriptorProto { - return { - name: isSet(object.name) ? String(object.name) : "", - number: isSet(object.number) ? Number(object.number) : 0, - label: isSet(object.label) ? fieldDescriptorProto_LabelFromJSON(object.label) : 1, - type: isSet(object.type) ? fieldDescriptorProto_TypeFromJSON(object.type) : 1, - typeName: isSet(object.typeName) ? String(object.typeName) : "", - extendee: isSet(object.extendee) ? String(object.extendee) : "", - defaultValue: isSet(object.defaultValue) ? String(object.defaultValue) : "", - oneofIndex: isSet(object.oneofIndex) ? Number(object.oneofIndex) : 0, - jsonName: isSet(object.jsonName) ? String(object.jsonName) : "", - options: isSet(object.options) ? FieldOptions.fromJSON(object.options) : undefined, - proto3Optional: isSet(object.proto3Optional) ? Boolean(object.proto3Optional) : false, - }; + const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.number !== undefined && object.number !== null) { + message.number = Number(object.number); + } else { + message.number = 0; + } + if (object.label !== undefined && object.label !== null) { + message.label = fieldDescriptorProto_LabelFromJSON(object.label); + } else { + message.label = 1; + } + if (object.type !== undefined && object.type !== null) { + message.type = fieldDescriptorProto_TypeFromJSON(object.type); + } else { + message.type = 1; + } + if (object.typeName !== undefined && object.typeName !== null) { + message.typeName = String(object.typeName); + } else { + message.typeName = ""; + } + if (object.extendee !== undefined && object.extendee !== null) { + message.extendee = String(object.extendee); + } else { + message.extendee = ""; + } + if (object.defaultValue !== undefined && object.defaultValue !== null) { + message.defaultValue = String(object.defaultValue); + } else { + message.defaultValue = ""; + } + if (object.oneofIndex !== undefined && object.oneofIndex !== null) { + message.oneofIndex = Number(object.oneofIndex); + } else { + message.oneofIndex = 0; + } + if (object.jsonName !== undefined && object.jsonName !== null) { + message.jsonName = String(object.jsonName); + } else { + message.jsonName = ""; + } + if (object.options !== undefined && object.options !== null) { + message.options = FieldOptions.fromJSON(object.options); + } else { + message.options = undefined; + } + if (object.proto3Optional !== undefined && object.proto3Optional !== null) { + message.proto3Optional = Boolean(object.proto3Optional); + } else { + message.proto3Optional = false; + } + return message; }, toJSON(message: FieldDescriptorProto): unknown { const obj: any = {}; message.name !== undefined && (obj.name = message.name); - message.number !== undefined && (obj.number = Math.round(message.number)); + message.number !== undefined && (obj.number = message.number); message.label !== undefined && (obj.label = fieldDescriptorProto_LabelToJSON(message.label)); message.type !== undefined && (obj.type = fieldDescriptorProto_TypeToJSON(message.type)); message.typeName !== undefined && (obj.typeName = message.typeName); message.extendee !== undefined && (obj.extendee = message.extendee); message.defaultValue !== undefined && (obj.defaultValue = message.defaultValue); - message.oneofIndex !== undefined && (obj.oneofIndex = Math.round(message.oneofIndex)); + message.oneofIndex !== undefined && (obj.oneofIndex = message.oneofIndex); message.jsonName !== undefined && (obj.jsonName = message.jsonName); message.options !== undefined && (obj.options = message.options ? FieldOptions.toJSON(message.options) : undefined); @@ -1941,31 +2189,68 @@ export const FieldDescriptorProto = { return obj; }, - fromPartial, I>>( - object: I, - ): FieldDescriptorProto { - const message = createBaseFieldDescriptorProto(); - message.name = object.name ?? ""; - message.number = object.number ?? 0; - message.label = object.label ?? 1; - message.type = object.type ?? 1; - message.typeName = object.typeName ?? ""; - message.extendee = object.extendee ?? ""; - message.defaultValue = object.defaultValue ?? ""; - message.oneofIndex = object.oneofIndex ?? 0; - message.jsonName = object.jsonName ?? ""; - message.options = - object.options !== undefined && object.options !== null - ? FieldOptions.fromPartial(object.options) - : undefined; - message.proto3Optional = object.proto3Optional ?? false; + fromPartial(object: DeepPartial): FieldDescriptorProto { + const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.number !== undefined && object.number !== null) { + message.number = object.number; + } else { + message.number = 0; + } + if (object.label !== undefined && object.label !== null) { + message.label = object.label; + } else { + message.label = 1; + } + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } else { + message.type = 1; + } + if (object.typeName !== undefined && object.typeName !== null) { + message.typeName = object.typeName; + } else { + message.typeName = ""; + } + if (object.extendee !== undefined && object.extendee !== null) { + message.extendee = object.extendee; + } else { + message.extendee = ""; + } + if (object.defaultValue !== undefined && object.defaultValue !== null) { + message.defaultValue = object.defaultValue; + } else { + message.defaultValue = ""; + } + if (object.oneofIndex !== undefined && object.oneofIndex !== null) { + message.oneofIndex = object.oneofIndex; + } else { + message.oneofIndex = 0; + } + if (object.jsonName !== undefined && object.jsonName !== null) { + message.jsonName = object.jsonName; + } else { + message.jsonName = ""; + } + if (object.options !== undefined && object.options !== null) { + message.options = FieldOptions.fromPartial(object.options); + } else { + message.options = undefined; + } + if (object.proto3Optional !== undefined && object.proto3Optional !== null) { + message.proto3Optional = object.proto3Optional; + } else { + message.proto3Optional = false; + } return message; }, }; -function createBaseOneofDescriptorProto(): OneofDescriptorProto { - return { name: "", options: undefined }; -} +const baseOneofDescriptorProto: object = { name: "" }; export const OneofDescriptorProto = { encode(message: OneofDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -1981,7 +2266,7 @@ export const OneofDescriptorProto = { decode(input: _m0.Reader | Uint8Array, length?: number): OneofDescriptorProto { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseOneofDescriptorProto(); + const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2000,10 +2285,18 @@ export const OneofDescriptorProto = { }, fromJSON(object: any): OneofDescriptorProto { - return { - name: isSet(object.name) ? String(object.name) : "", - options: isSet(object.options) ? OneofOptions.fromJSON(object.options) : undefined, - }; + const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.options !== undefined && object.options !== null) { + message.options = OneofOptions.fromJSON(object.options); + } else { + message.options = undefined; + } + return message; }, toJSON(message: OneofDescriptorProto): unknown { @@ -2014,28 +2307,23 @@ export const OneofDescriptorProto = { return obj; }, - fromPartial, I>>( - object: I, - ): OneofDescriptorProto { - const message = createBaseOneofDescriptorProto(); - message.name = object.name ?? ""; - message.options = - object.options !== undefined && object.options !== null - ? OneofOptions.fromPartial(object.options) - : undefined; + fromPartial(object: DeepPartial): OneofDescriptorProto { + const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.options !== undefined && object.options !== null) { + message.options = OneofOptions.fromPartial(object.options); + } else { + message.options = undefined; + } return message; }, }; -function createBaseEnumDescriptorProto(): EnumDescriptorProto { - return { - name: "", - value: [], - options: undefined, - reservedRange: [], - reservedName: [], - }; -} +const baseEnumDescriptorProto: object = { name: "", reservedName: "" }; export const EnumDescriptorProto = { encode(message: EnumDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -2060,7 +2348,10 @@ export const EnumDescriptorProto = { decode(input: _m0.Reader | Uint8Array, length?: number): EnumDescriptorProto { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseEnumDescriptorProto(); + const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; + message.value = []; + message.reservedRange = []; + message.reservedName = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2090,19 +2381,36 @@ export const EnumDescriptorProto = { }, fromJSON(object: any): EnumDescriptorProto { - return { - name: isSet(object.name) ? String(object.name) : "", - value: Array.isArray(object?.value) - ? object.value.map((e: any) => EnumValueDescriptorProto.fromJSON(e)) - : [], - options: isSet(object.options) ? EnumOptions.fromJSON(object.options) : undefined, - reservedRange: Array.isArray(object?.reservedRange) - ? object.reservedRange.map((e: any) => EnumDescriptorProto_EnumReservedRange.fromJSON(e)) - : [], - reservedName: Array.isArray(object?.reservedName) - ? object.reservedName.map((e: any) => String(e)) - : [], - }; + const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; + message.value = []; + message.reservedRange = []; + message.reservedName = []; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.value !== undefined && object.value !== null) { + for (const e of object.value) { + message.value.push(EnumValueDescriptorProto.fromJSON(e)); + } + } + if (object.options !== undefined && object.options !== null) { + message.options = EnumOptions.fromJSON(object.options); + } else { + message.options = undefined; + } + if (object.reservedRange !== undefined && object.reservedRange !== null) { + for (const e of object.reservedRange) { + message.reservedRange.push(EnumDescriptorProto_EnumReservedRange.fromJSON(e)); + } + } + if (object.reservedName !== undefined && object.reservedName !== null) { + for (const e of object.reservedName) { + message.reservedName.push(String(e)); + } + } + return message; }, toJSON(message: EnumDescriptorProto): unknown { @@ -2130,26 +2438,41 @@ export const EnumDescriptorProto = { return obj; }, - fromPartial, I>>( - object: I, - ): EnumDescriptorProto { - const message = createBaseEnumDescriptorProto(); - message.name = object.name ?? ""; - message.value = object.value?.map(e => EnumValueDescriptorProto.fromPartial(e)) || []; - message.options = - object.options !== undefined && object.options !== null - ? EnumOptions.fromPartial(object.options) - : undefined; - message.reservedRange = - object.reservedRange?.map(e => EnumDescriptorProto_EnumReservedRange.fromPartial(e)) || []; - message.reservedName = object.reservedName?.map(e => e) || []; + fromPartial(object: DeepPartial): EnumDescriptorProto { + const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; + message.value = []; + message.reservedRange = []; + message.reservedName = []; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.value !== undefined && object.value !== null) { + for (const e of object.value) { + message.value.push(EnumValueDescriptorProto.fromPartial(e)); + } + } + if (object.options !== undefined && object.options !== null) { + message.options = EnumOptions.fromPartial(object.options); + } else { + message.options = undefined; + } + if (object.reservedRange !== undefined && object.reservedRange !== null) { + for (const e of object.reservedRange) { + message.reservedRange.push(EnumDescriptorProto_EnumReservedRange.fromPartial(e)); + } + } + if (object.reservedName !== undefined && object.reservedName !== null) { + for (const e of object.reservedName) { + message.reservedName.push(e); + } + } return message; }, }; -function createBaseEnumDescriptorProto_EnumReservedRange(): EnumDescriptorProto_EnumReservedRange { - return { start: 0, end: 0 }; -} +const baseEnumDescriptorProto_EnumReservedRange: object = { start: 0, end: 0 }; export const EnumDescriptorProto_EnumReservedRange = { encode( @@ -2168,7 +2491,9 @@ export const EnumDescriptorProto_EnumReservedRange = { decode(input: _m0.Reader | Uint8Array, length?: number): EnumDescriptorProto_EnumReservedRange { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseEnumDescriptorProto_EnumReservedRange(); + const message = { + ...baseEnumDescriptorProto_EnumReservedRange, + } as EnumDescriptorProto_EnumReservedRange; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2187,32 +2512,50 @@ export const EnumDescriptorProto_EnumReservedRange = { }, fromJSON(object: any): EnumDescriptorProto_EnumReservedRange { - return { - start: isSet(object.start) ? Number(object.start) : 0, - end: isSet(object.end) ? Number(object.end) : 0, - }; + const message = { + ...baseEnumDescriptorProto_EnumReservedRange, + } as EnumDescriptorProto_EnumReservedRange; + if (object.start !== undefined && object.start !== null) { + message.start = Number(object.start); + } else { + message.start = 0; + } + if (object.end !== undefined && object.end !== null) { + message.end = Number(object.end); + } else { + message.end = 0; + } + return message; }, toJSON(message: EnumDescriptorProto_EnumReservedRange): unknown { const obj: any = {}; - message.start !== undefined && (obj.start = Math.round(message.start)); - message.end !== undefined && (obj.end = Math.round(message.end)); + message.start !== undefined && (obj.start = message.start); + message.end !== undefined && (obj.end = message.end); return obj; }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): EnumDescriptorProto_EnumReservedRange { - const message = createBaseEnumDescriptorProto_EnumReservedRange(); - message.start = object.start ?? 0; - message.end = object.end ?? 0; + const message = { + ...baseEnumDescriptorProto_EnumReservedRange, + } as EnumDescriptorProto_EnumReservedRange; + if (object.start !== undefined && object.start !== null) { + message.start = object.start; + } else { + message.start = 0; + } + if (object.end !== undefined && object.end !== null) { + message.end = object.end; + } else { + message.end = 0; + } return message; }, }; -function createBaseEnumValueDescriptorProto(): EnumValueDescriptorProto { - return { name: "", number: 0, options: undefined }; -} +const baseEnumValueDescriptorProto: object = { name: "", number: 0 }; export const EnumValueDescriptorProto = { encode(message: EnumValueDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -2231,7 +2574,9 @@ export const EnumValueDescriptorProto = { decode(input: _m0.Reader | Uint8Array, length?: number): EnumValueDescriptorProto { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseEnumValueDescriptorProto(); + const message = { + ...baseEnumValueDescriptorProto, + } as EnumValueDescriptorProto; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2253,39 +2598,60 @@ export const EnumValueDescriptorProto = { }, fromJSON(object: any): EnumValueDescriptorProto { - return { - name: isSet(object.name) ? String(object.name) : "", - number: isSet(object.number) ? Number(object.number) : 0, - options: isSet(object.options) ? EnumValueOptions.fromJSON(object.options) : undefined, - }; + const message = { + ...baseEnumValueDescriptorProto, + } as EnumValueDescriptorProto; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.number !== undefined && object.number !== null) { + message.number = Number(object.number); + } else { + message.number = 0; + } + if (object.options !== undefined && object.options !== null) { + message.options = EnumValueOptions.fromJSON(object.options); + } else { + message.options = undefined; + } + return message; }, toJSON(message: EnumValueDescriptorProto): unknown { const obj: any = {}; message.name !== undefined && (obj.name = message.name); - message.number !== undefined && (obj.number = Math.round(message.number)); + message.number !== undefined && (obj.number = message.number); message.options !== undefined && (obj.options = message.options ? EnumValueOptions.toJSON(message.options) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): EnumValueDescriptorProto { - const message = createBaseEnumValueDescriptorProto(); - message.name = object.name ?? ""; - message.number = object.number ?? 0; - message.options = - object.options !== undefined && object.options !== null - ? EnumValueOptions.fromPartial(object.options) - : undefined; + fromPartial(object: DeepPartial): EnumValueDescriptorProto { + const message = { + ...baseEnumValueDescriptorProto, + } as EnumValueDescriptorProto; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.number !== undefined && object.number !== null) { + message.number = object.number; + } else { + message.number = 0; + } + if (object.options !== undefined && object.options !== null) { + message.options = EnumValueOptions.fromPartial(object.options); + } else { + message.options = undefined; + } return message; }, }; -function createBaseServiceDescriptorProto(): ServiceDescriptorProto { - return { name: "", method: [], options: undefined }; -} +const baseServiceDescriptorProto: object = { name: "" }; export const ServiceDescriptorProto = { encode(message: ServiceDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -2304,7 +2670,8 @@ export const ServiceDescriptorProto = { decode(input: _m0.Reader | Uint8Array, length?: number): ServiceDescriptorProto { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseServiceDescriptorProto(); + const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; + message.method = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2326,13 +2693,24 @@ export const ServiceDescriptorProto = { }, fromJSON(object: any): ServiceDescriptorProto { - return { - name: isSet(object.name) ? String(object.name) : "", - method: Array.isArray(object?.method) - ? object.method.map((e: any) => MethodDescriptorProto.fromJSON(e)) - : [], - options: isSet(object.options) ? ServiceOptions.fromJSON(object.options) : undefined, - }; + const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; + message.method = []; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.method !== undefined && object.method !== null) { + for (const e of object.method) { + message.method.push(MethodDescriptorProto.fromJSON(e)); + } + } + if (object.options !== undefined && object.options !== null) { + message.options = ServiceOptions.fromJSON(object.options); + } else { + message.options = undefined; + } + return message; }, toJSON(message: ServiceDescriptorProto): unknown { @@ -2348,30 +2726,35 @@ export const ServiceDescriptorProto = { return obj; }, - fromPartial, I>>( - object: I, - ): ServiceDescriptorProto { - const message = createBaseServiceDescriptorProto(); - message.name = object.name ?? ""; - message.method = object.method?.map(e => MethodDescriptorProto.fromPartial(e)) || []; - message.options = - object.options !== undefined && object.options !== null - ? ServiceOptions.fromPartial(object.options) - : undefined; + fromPartial(object: DeepPartial): ServiceDescriptorProto { + const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; + message.method = []; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.method !== undefined && object.method !== null) { + for (const e of object.method) { + message.method.push(MethodDescriptorProto.fromPartial(e)); + } + } + if (object.options !== undefined && object.options !== null) { + message.options = ServiceOptions.fromPartial(object.options); + } else { + message.options = undefined; + } return message; }, }; -function createBaseMethodDescriptorProto(): MethodDescriptorProto { - return { - name: "", - inputType: "", - outputType: "", - options: undefined, - clientStreaming: false, - serverStreaming: false, - }; -} +const baseMethodDescriptorProto: object = { + name: "", + inputType: "", + outputType: "", + clientStreaming: false, + serverStreaming: false, +}; export const MethodDescriptorProto = { encode(message: MethodDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -2399,7 +2782,7 @@ export const MethodDescriptorProto = { decode(input: _m0.Reader | Uint8Array, length?: number): MethodDescriptorProto { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMethodDescriptorProto(); + const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2430,70 +2813,110 @@ export const MethodDescriptorProto = { }, fromJSON(object: any): MethodDescriptorProto { - return { - name: isSet(object.name) ? String(object.name) : "", - inputType: isSet(object.inputType) ? String(object.inputType) : "", - outputType: isSet(object.outputType) ? String(object.outputType) : "", - options: isSet(object.options) ? MethodOptions.fromJSON(object.options) : undefined, - clientStreaming: isSet(object.clientStreaming) ? Boolean(object.clientStreaming) : false, - serverStreaming: isSet(object.serverStreaming) ? Boolean(object.serverStreaming) : false, - }; - }, - - toJSON(message: MethodDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.inputType !== undefined && (obj.inputType = message.inputType); - message.outputType !== undefined && (obj.outputType = message.outputType); - message.options !== undefined && + const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.inputType !== undefined && object.inputType !== null) { + message.inputType = String(object.inputType); + } else { + message.inputType = ""; + } + if (object.outputType !== undefined && object.outputType !== null) { + message.outputType = String(object.outputType); + } else { + message.outputType = ""; + } + if (object.options !== undefined && object.options !== null) { + message.options = MethodOptions.fromJSON(object.options); + } else { + message.options = undefined; + } + if (object.clientStreaming !== undefined && object.clientStreaming !== null) { + message.clientStreaming = Boolean(object.clientStreaming); + } else { + message.clientStreaming = false; + } + if (object.serverStreaming !== undefined && object.serverStreaming !== null) { + message.serverStreaming = Boolean(object.serverStreaming); + } else { + message.serverStreaming = false; + } + return message; + }, + + toJSON(message: MethodDescriptorProto): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.inputType !== undefined && (obj.inputType = message.inputType); + message.outputType !== undefined && (obj.outputType = message.outputType); + message.options !== undefined && (obj.options = message.options ? MethodOptions.toJSON(message.options) : undefined); message.clientStreaming !== undefined && (obj.clientStreaming = message.clientStreaming); message.serverStreaming !== undefined && (obj.serverStreaming = message.serverStreaming); return obj; }, - fromPartial, I>>( - object: I, - ): MethodDescriptorProto { - const message = createBaseMethodDescriptorProto(); - message.name = object.name ?? ""; - message.inputType = object.inputType ?? ""; - message.outputType = object.outputType ?? ""; - message.options = - object.options !== undefined && object.options !== null - ? MethodOptions.fromPartial(object.options) - : undefined; - message.clientStreaming = object.clientStreaming ?? false; - message.serverStreaming = object.serverStreaming ?? false; + fromPartial(object: DeepPartial): MethodDescriptorProto { + const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.inputType !== undefined && object.inputType !== null) { + message.inputType = object.inputType; + } else { + message.inputType = ""; + } + if (object.outputType !== undefined && object.outputType !== null) { + message.outputType = object.outputType; + } else { + message.outputType = ""; + } + if (object.options !== undefined && object.options !== null) { + message.options = MethodOptions.fromPartial(object.options); + } else { + message.options = undefined; + } + if (object.clientStreaming !== undefined && object.clientStreaming !== null) { + message.clientStreaming = object.clientStreaming; + } else { + message.clientStreaming = false; + } + if (object.serverStreaming !== undefined && object.serverStreaming !== null) { + message.serverStreaming = object.serverStreaming; + } else { + message.serverStreaming = false; + } return message; }, }; -function createBaseFileOptions(): FileOptions { - return { - javaPackage: "", - javaOuterClassname: "", - javaMultipleFiles: false, - javaGenerateEqualsAndHash: false, - javaStringCheckUtf8: false, - optimizeFor: 1, - goPackage: "", - ccGenericServices: false, - javaGenericServices: false, - pyGenericServices: false, - phpGenericServices: false, - deprecated: false, - ccEnableArenas: false, - objcClassPrefix: "", - csharpNamespace: "", - swiftPrefix: "", - phpClassPrefix: "", - phpNamespace: "", - phpMetadataNamespace: "", - rubyPackage: "", - uninterpretedOption: [], - }; -} +const baseFileOptions: object = { + javaPackage: "", + javaOuterClassname: "", + javaMultipleFiles: false, + javaGenerateEqualsAndHash: false, + javaStringCheckUtf8: false, + optimizeFor: 1, + goPackage: "", + ccGenericServices: false, + javaGenericServices: false, + pyGenericServices: false, + phpGenericServices: false, + deprecated: false, + ccEnableArenas: false, + objcClassPrefix: "", + csharpNamespace: "", + swiftPrefix: "", + phpClassPrefix: "", + phpNamespace: "", + phpMetadataNamespace: "", + rubyPackage: "", +}; export const FileOptions = { encode(message: FileOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -2566,7 +2989,8 @@ export const FileOptions = { decode(input: _m0.Reader | Uint8Array, length?: number): FileOptions { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseFileOptions(); + const message = { ...baseFileOptions } as FileOptions; + message.uninterpretedOption = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2642,49 +3066,117 @@ export const FileOptions = { }, fromJSON(object: any): FileOptions { - return { - javaPackage: isSet(object.javaPackage) ? String(object.javaPackage) : "", - javaOuterClassname: isSet(object.javaOuterClassname) ? String(object.javaOuterClassname) : "", - javaMultipleFiles: isSet(object.javaMultipleFiles) - ? Boolean(object.javaMultipleFiles) - : false, - javaGenerateEqualsAndHash: isSet(object.javaGenerateEqualsAndHash) - ? Boolean(object.javaGenerateEqualsAndHash) - : false, - javaStringCheckUtf8: isSet(object.javaStringCheckUtf8) - ? Boolean(object.javaStringCheckUtf8) - : false, - optimizeFor: isSet(object.optimizeFor) - ? fileOptions_OptimizeModeFromJSON(object.optimizeFor) - : 1, - goPackage: isSet(object.goPackage) ? String(object.goPackage) : "", - ccGenericServices: isSet(object.ccGenericServices) - ? Boolean(object.ccGenericServices) - : false, - javaGenericServices: isSet(object.javaGenericServices) - ? Boolean(object.javaGenericServices) - : false, - pyGenericServices: isSet(object.pyGenericServices) - ? Boolean(object.pyGenericServices) - : false, - phpGenericServices: isSet(object.phpGenericServices) - ? Boolean(object.phpGenericServices) - : false, - deprecated: isSet(object.deprecated) ? Boolean(object.deprecated) : false, - ccEnableArenas: isSet(object.ccEnableArenas) ? Boolean(object.ccEnableArenas) : false, - objcClassPrefix: isSet(object.objcClassPrefix) ? String(object.objcClassPrefix) : "", - csharpNamespace: isSet(object.csharpNamespace) ? String(object.csharpNamespace) : "", - swiftPrefix: isSet(object.swiftPrefix) ? String(object.swiftPrefix) : "", - phpClassPrefix: isSet(object.phpClassPrefix) ? String(object.phpClassPrefix) : "", - phpNamespace: isSet(object.phpNamespace) ? String(object.phpNamespace) : "", - phpMetadataNamespace: isSet(object.phpMetadataNamespace) - ? String(object.phpMetadataNamespace) - : "", - rubyPackage: isSet(object.rubyPackage) ? String(object.rubyPackage) : "", - uninterpretedOption: Array.isArray(object?.uninterpretedOption) - ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) - : [], - }; + const message = { ...baseFileOptions } as FileOptions; + message.uninterpretedOption = []; + if (object.javaPackage !== undefined && object.javaPackage !== null) { + message.javaPackage = String(object.javaPackage); + } else { + message.javaPackage = ""; + } + if (object.javaOuterClassname !== undefined && object.javaOuterClassname !== null) { + message.javaOuterClassname = String(object.javaOuterClassname); + } else { + message.javaOuterClassname = ""; + } + if (object.javaMultipleFiles !== undefined && object.javaMultipleFiles !== null) { + message.javaMultipleFiles = Boolean(object.javaMultipleFiles); + } else { + message.javaMultipleFiles = false; + } + if ( + object.javaGenerateEqualsAndHash !== undefined && + object.javaGenerateEqualsAndHash !== null + ) { + message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); + } else { + message.javaGenerateEqualsAndHash = false; + } + if (object.javaStringCheckUtf8 !== undefined && object.javaStringCheckUtf8 !== null) { + message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); + } else { + message.javaStringCheckUtf8 = false; + } + if (object.optimizeFor !== undefined && object.optimizeFor !== null) { + message.optimizeFor = fileOptions_OptimizeModeFromJSON(object.optimizeFor); + } else { + message.optimizeFor = 1; + } + if (object.goPackage !== undefined && object.goPackage !== null) { + message.goPackage = String(object.goPackage); + } else { + message.goPackage = ""; + } + if (object.ccGenericServices !== undefined && object.ccGenericServices !== null) { + message.ccGenericServices = Boolean(object.ccGenericServices); + } else { + message.ccGenericServices = false; + } + if (object.javaGenericServices !== undefined && object.javaGenericServices !== null) { + message.javaGenericServices = Boolean(object.javaGenericServices); + } else { + message.javaGenericServices = false; + } + if (object.pyGenericServices !== undefined && object.pyGenericServices !== null) { + message.pyGenericServices = Boolean(object.pyGenericServices); + } else { + message.pyGenericServices = false; + } + if (object.phpGenericServices !== undefined && object.phpGenericServices !== null) { + message.phpGenericServices = Boolean(object.phpGenericServices); + } else { + message.phpGenericServices = false; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = Boolean(object.deprecated); + } else { + message.deprecated = false; + } + if (object.ccEnableArenas !== undefined && object.ccEnableArenas !== null) { + message.ccEnableArenas = Boolean(object.ccEnableArenas); + } else { + message.ccEnableArenas = false; + } + if (object.objcClassPrefix !== undefined && object.objcClassPrefix !== null) { + message.objcClassPrefix = String(object.objcClassPrefix); + } else { + message.objcClassPrefix = ""; + } + if (object.csharpNamespace !== undefined && object.csharpNamespace !== null) { + message.csharpNamespace = String(object.csharpNamespace); + } else { + message.csharpNamespace = ""; + } + if (object.swiftPrefix !== undefined && object.swiftPrefix !== null) { + message.swiftPrefix = String(object.swiftPrefix); + } else { + message.swiftPrefix = ""; + } + if (object.phpClassPrefix !== undefined && object.phpClassPrefix !== null) { + message.phpClassPrefix = String(object.phpClassPrefix); + } else { + message.phpClassPrefix = ""; + } + if (object.phpNamespace !== undefined && object.phpNamespace !== null) { + message.phpNamespace = String(object.phpNamespace); + } else { + message.phpNamespace = ""; + } + if (object.phpMetadataNamespace !== undefined && object.phpMetadataNamespace !== null) { + message.phpMetadataNamespace = String(object.phpMetadataNamespace); + } else { + message.phpMetadataNamespace = ""; + } + if (object.rubyPackage !== undefined && object.rubyPackage !== null) { + message.rubyPackage = String(object.rubyPackage); + } else { + message.rubyPackage = ""; + } + if (object.uninterpretedOption !== undefined && object.uninterpretedOption !== null) { + for (const e of object.uninterpretedOption) { + message.uninterpretedOption.push(UninterpretedOption.fromJSON(e)); + } + } + return message; }, toJSON(message: FileOptions): unknown { @@ -2726,43 +3218,127 @@ export const FileOptions = { return obj; }, - fromPartial, I>>(object: I): FileOptions { - const message = createBaseFileOptions(); - message.javaPackage = object.javaPackage ?? ""; - message.javaOuterClassname = object.javaOuterClassname ?? ""; - message.javaMultipleFiles = object.javaMultipleFiles ?? false; - message.javaGenerateEqualsAndHash = object.javaGenerateEqualsAndHash ?? false; - message.javaStringCheckUtf8 = object.javaStringCheckUtf8 ?? false; - message.optimizeFor = object.optimizeFor ?? 1; - message.goPackage = object.goPackage ?? ""; - message.ccGenericServices = object.ccGenericServices ?? false; - message.javaGenericServices = object.javaGenericServices ?? false; - message.pyGenericServices = object.pyGenericServices ?? false; - message.phpGenericServices = object.phpGenericServices ?? false; - message.deprecated = object.deprecated ?? false; - message.ccEnableArenas = object.ccEnableArenas ?? false; - message.objcClassPrefix = object.objcClassPrefix ?? ""; - message.csharpNamespace = object.csharpNamespace ?? ""; - message.swiftPrefix = object.swiftPrefix ?? ""; - message.phpClassPrefix = object.phpClassPrefix ?? ""; - message.phpNamespace = object.phpNamespace ?? ""; - message.phpMetadataNamespace = object.phpMetadataNamespace ?? ""; - message.rubyPackage = object.rubyPackage ?? ""; - message.uninterpretedOption = - object.uninterpretedOption?.map(e => UninterpretedOption.fromPartial(e)) || []; + fromPartial(object: DeepPartial): FileOptions { + const message = { ...baseFileOptions } as FileOptions; + message.uninterpretedOption = []; + if (object.javaPackage !== undefined && object.javaPackage !== null) { + message.javaPackage = object.javaPackage; + } else { + message.javaPackage = ""; + } + if (object.javaOuterClassname !== undefined && object.javaOuterClassname !== null) { + message.javaOuterClassname = object.javaOuterClassname; + } else { + message.javaOuterClassname = ""; + } + if (object.javaMultipleFiles !== undefined && object.javaMultipleFiles !== null) { + message.javaMultipleFiles = object.javaMultipleFiles; + } else { + message.javaMultipleFiles = false; + } + if ( + object.javaGenerateEqualsAndHash !== undefined && + object.javaGenerateEqualsAndHash !== null + ) { + message.javaGenerateEqualsAndHash = object.javaGenerateEqualsAndHash; + } else { + message.javaGenerateEqualsAndHash = false; + } + if (object.javaStringCheckUtf8 !== undefined && object.javaStringCheckUtf8 !== null) { + message.javaStringCheckUtf8 = object.javaStringCheckUtf8; + } else { + message.javaStringCheckUtf8 = false; + } + if (object.optimizeFor !== undefined && object.optimizeFor !== null) { + message.optimizeFor = object.optimizeFor; + } else { + message.optimizeFor = 1; + } + if (object.goPackage !== undefined && object.goPackage !== null) { + message.goPackage = object.goPackage; + } else { + message.goPackage = ""; + } + if (object.ccGenericServices !== undefined && object.ccGenericServices !== null) { + message.ccGenericServices = object.ccGenericServices; + } else { + message.ccGenericServices = false; + } + if (object.javaGenericServices !== undefined && object.javaGenericServices !== null) { + message.javaGenericServices = object.javaGenericServices; + } else { + message.javaGenericServices = false; + } + if (object.pyGenericServices !== undefined && object.pyGenericServices !== null) { + message.pyGenericServices = object.pyGenericServices; + } else { + message.pyGenericServices = false; + } + if (object.phpGenericServices !== undefined && object.phpGenericServices !== null) { + message.phpGenericServices = object.phpGenericServices; + } else { + message.phpGenericServices = false; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } else { + message.deprecated = false; + } + if (object.ccEnableArenas !== undefined && object.ccEnableArenas !== null) { + message.ccEnableArenas = object.ccEnableArenas; + } else { + message.ccEnableArenas = false; + } + if (object.objcClassPrefix !== undefined && object.objcClassPrefix !== null) { + message.objcClassPrefix = object.objcClassPrefix; + } else { + message.objcClassPrefix = ""; + } + if (object.csharpNamespace !== undefined && object.csharpNamespace !== null) { + message.csharpNamespace = object.csharpNamespace; + } else { + message.csharpNamespace = ""; + } + if (object.swiftPrefix !== undefined && object.swiftPrefix !== null) { + message.swiftPrefix = object.swiftPrefix; + } else { + message.swiftPrefix = ""; + } + if (object.phpClassPrefix !== undefined && object.phpClassPrefix !== null) { + message.phpClassPrefix = object.phpClassPrefix; + } else { + message.phpClassPrefix = ""; + } + if (object.phpNamespace !== undefined && object.phpNamespace !== null) { + message.phpNamespace = object.phpNamespace; + } else { + message.phpNamespace = ""; + } + if (object.phpMetadataNamespace !== undefined && object.phpMetadataNamespace !== null) { + message.phpMetadataNamespace = object.phpMetadataNamespace; + } else { + message.phpMetadataNamespace = ""; + } + if (object.rubyPackage !== undefined && object.rubyPackage !== null) { + message.rubyPackage = object.rubyPackage; + } else { + message.rubyPackage = ""; + } + if (object.uninterpretedOption !== undefined && object.uninterpretedOption !== null) { + for (const e of object.uninterpretedOption) { + message.uninterpretedOption.push(UninterpretedOption.fromPartial(e)); + } + } return message; }, }; -function createBaseMessageOptions(): MessageOptions { - return { - messageSetWireFormat: false, - noStandardDescriptorAccessor: false, - deprecated: false, - mapEntry: false, - uninterpretedOption: [], - }; -} +const baseMessageOptions: object = { + messageSetWireFormat: false, + noStandardDescriptorAccessor: false, + deprecated: false, + mapEntry: false, +}; export const MessageOptions = { encode(message: MessageOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -2787,7 +3363,8 @@ export const MessageOptions = { decode(input: _m0.Reader | Uint8Array, length?: number): MessageOptions { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMessageOptions(); + const message = { ...baseMessageOptions } as MessageOptions; + message.uninterpretedOption = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2815,19 +3392,37 @@ export const MessageOptions = { }, fromJSON(object: any): MessageOptions { - return { - messageSetWireFormat: isSet(object.messageSetWireFormat) - ? Boolean(object.messageSetWireFormat) - : false, - noStandardDescriptorAccessor: isSet(object.noStandardDescriptorAccessor) - ? Boolean(object.noStandardDescriptorAccessor) - : false, - deprecated: isSet(object.deprecated) ? Boolean(object.deprecated) : false, - mapEntry: isSet(object.mapEntry) ? Boolean(object.mapEntry) : false, - uninterpretedOption: Array.isArray(object?.uninterpretedOption) - ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) - : [], - }; + const message = { ...baseMessageOptions } as MessageOptions; + message.uninterpretedOption = []; + if (object.messageSetWireFormat !== undefined && object.messageSetWireFormat !== null) { + message.messageSetWireFormat = Boolean(object.messageSetWireFormat); + } else { + message.messageSetWireFormat = false; + } + if ( + object.noStandardDescriptorAccessor !== undefined && + object.noStandardDescriptorAccessor !== null + ) { + message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); + } else { + message.noStandardDescriptorAccessor = false; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = Boolean(object.deprecated); + } else { + message.deprecated = false; + } + if (object.mapEntry !== undefined && object.mapEntry !== null) { + message.mapEntry = Boolean(object.mapEntry); + } else { + message.mapEntry = false; + } + if (object.uninterpretedOption !== undefined && object.uninterpretedOption !== null) { + for (const e of object.uninterpretedOption) { + message.uninterpretedOption.push(UninterpretedOption.fromJSON(e)); + } + } + return message; }, toJSON(message: MessageOptions): unknown { @@ -2848,29 +3443,49 @@ export const MessageOptions = { return obj; }, - fromPartial, I>>(object: I): MessageOptions { - const message = createBaseMessageOptions(); - message.messageSetWireFormat = object.messageSetWireFormat ?? false; - message.noStandardDescriptorAccessor = object.noStandardDescriptorAccessor ?? false; - message.deprecated = object.deprecated ?? false; - message.mapEntry = object.mapEntry ?? false; - message.uninterpretedOption = - object.uninterpretedOption?.map(e => UninterpretedOption.fromPartial(e)) || []; + fromPartial(object: DeepPartial): MessageOptions { + const message = { ...baseMessageOptions } as MessageOptions; + message.uninterpretedOption = []; + if (object.messageSetWireFormat !== undefined && object.messageSetWireFormat !== null) { + message.messageSetWireFormat = object.messageSetWireFormat; + } else { + message.messageSetWireFormat = false; + } + if ( + object.noStandardDescriptorAccessor !== undefined && + object.noStandardDescriptorAccessor !== null + ) { + message.noStandardDescriptorAccessor = object.noStandardDescriptorAccessor; + } else { + message.noStandardDescriptorAccessor = false; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } else { + message.deprecated = false; + } + if (object.mapEntry !== undefined && object.mapEntry !== null) { + message.mapEntry = object.mapEntry; + } else { + message.mapEntry = false; + } + if (object.uninterpretedOption !== undefined && object.uninterpretedOption !== null) { + for (const e of object.uninterpretedOption) { + message.uninterpretedOption.push(UninterpretedOption.fromPartial(e)); + } + } return message; }, }; -function createBaseFieldOptions(): FieldOptions { - return { - ctype: 0, - packed: false, - jstype: 0, - lazy: false, - deprecated: false, - weak: false, - uninterpretedOption: [], - }; -} +const baseFieldOptions: object = { + ctype: 0, + packed: false, + jstype: 0, + lazy: false, + deprecated: false, + weak: false, +}; export const FieldOptions = { encode(message: FieldOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -2901,7 +3516,8 @@ export const FieldOptions = { decode(input: _m0.Reader | Uint8Array, length?: number): FieldOptions { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseFieldOptions(); + const message = { ...baseFieldOptions } as FieldOptions; + message.uninterpretedOption = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2935,17 +3551,44 @@ export const FieldOptions = { }, fromJSON(object: any): FieldOptions { - return { - ctype: isSet(object.ctype) ? fieldOptions_CTypeFromJSON(object.ctype) : 0, - packed: isSet(object.packed) ? Boolean(object.packed) : false, - jstype: isSet(object.jstype) ? fieldOptions_JSTypeFromJSON(object.jstype) : 0, - lazy: isSet(object.lazy) ? Boolean(object.lazy) : false, - deprecated: isSet(object.deprecated) ? Boolean(object.deprecated) : false, - weak: isSet(object.weak) ? Boolean(object.weak) : false, - uninterpretedOption: Array.isArray(object?.uninterpretedOption) - ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) - : [], - }; + const message = { ...baseFieldOptions } as FieldOptions; + message.uninterpretedOption = []; + if (object.ctype !== undefined && object.ctype !== null) { + message.ctype = fieldOptions_CTypeFromJSON(object.ctype); + } else { + message.ctype = 0; + } + if (object.packed !== undefined && object.packed !== null) { + message.packed = Boolean(object.packed); + } else { + message.packed = false; + } + if (object.jstype !== undefined && object.jstype !== null) { + message.jstype = fieldOptions_JSTypeFromJSON(object.jstype); + } else { + message.jstype = 0; + } + if (object.lazy !== undefined && object.lazy !== null) { + message.lazy = Boolean(object.lazy); + } else { + message.lazy = false; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = Boolean(object.deprecated); + } else { + message.deprecated = false; + } + if (object.weak !== undefined && object.weak !== null) { + message.weak = Boolean(object.weak); + } else { + message.weak = false; + } + if (object.uninterpretedOption !== undefined && object.uninterpretedOption !== null) { + for (const e of object.uninterpretedOption) { + message.uninterpretedOption.push(UninterpretedOption.fromJSON(e)); + } + } + return message; }, toJSON(message: FieldOptions): unknown { @@ -2966,23 +3609,49 @@ export const FieldOptions = { return obj; }, - fromPartial, I>>(object: I): FieldOptions { - const message = createBaseFieldOptions(); - message.ctype = object.ctype ?? 0; - message.packed = object.packed ?? false; - message.jstype = object.jstype ?? 0; - message.lazy = object.lazy ?? false; - message.deprecated = object.deprecated ?? false; - message.weak = object.weak ?? false; - message.uninterpretedOption = - object.uninterpretedOption?.map(e => UninterpretedOption.fromPartial(e)) || []; + fromPartial(object: DeepPartial): FieldOptions { + const message = { ...baseFieldOptions } as FieldOptions; + message.uninterpretedOption = []; + if (object.ctype !== undefined && object.ctype !== null) { + message.ctype = object.ctype; + } else { + message.ctype = 0; + } + if (object.packed !== undefined && object.packed !== null) { + message.packed = object.packed; + } else { + message.packed = false; + } + if (object.jstype !== undefined && object.jstype !== null) { + message.jstype = object.jstype; + } else { + message.jstype = 0; + } + if (object.lazy !== undefined && object.lazy !== null) { + message.lazy = object.lazy; + } else { + message.lazy = false; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } else { + message.deprecated = false; + } + if (object.weak !== undefined && object.weak !== null) { + message.weak = object.weak; + } else { + message.weak = false; + } + if (object.uninterpretedOption !== undefined && object.uninterpretedOption !== null) { + for (const e of object.uninterpretedOption) { + message.uninterpretedOption.push(UninterpretedOption.fromPartial(e)); + } + } return message; }, }; -function createBaseOneofOptions(): OneofOptions { - return { uninterpretedOption: [] }; -} +const baseOneofOptions: object = {}; export const OneofOptions = { encode(message: OneofOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -2995,7 +3664,8 @@ export const OneofOptions = { decode(input: _m0.Reader | Uint8Array, length?: number): OneofOptions { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseOneofOptions(); + const message = { ...baseOneofOptions } as OneofOptions; + message.uninterpretedOption = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -3011,11 +3681,14 @@ export const OneofOptions = { }, fromJSON(object: any): OneofOptions { - return { - uninterpretedOption: Array.isArray(object?.uninterpretedOption) - ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) - : [], - }; + const message = { ...baseOneofOptions } as OneofOptions; + message.uninterpretedOption = []; + if (object.uninterpretedOption !== undefined && object.uninterpretedOption !== null) { + for (const e of object.uninterpretedOption) { + message.uninterpretedOption.push(UninterpretedOption.fromJSON(e)); + } + } + return message; }, toJSON(message: OneofOptions): unknown { @@ -3030,17 +3703,19 @@ export const OneofOptions = { return obj; }, - fromPartial, I>>(object: I): OneofOptions { - const message = createBaseOneofOptions(); - message.uninterpretedOption = - object.uninterpretedOption?.map(e => UninterpretedOption.fromPartial(e)) || []; + fromPartial(object: DeepPartial): OneofOptions { + const message = { ...baseOneofOptions } as OneofOptions; + message.uninterpretedOption = []; + if (object.uninterpretedOption !== undefined && object.uninterpretedOption !== null) { + for (const e of object.uninterpretedOption) { + message.uninterpretedOption.push(UninterpretedOption.fromPartial(e)); + } + } return message; }, }; -function createBaseEnumOptions(): EnumOptions { - return { allowAlias: false, deprecated: false, uninterpretedOption: [] }; -} +const baseEnumOptions: object = { allowAlias: false, deprecated: false }; export const EnumOptions = { encode(message: EnumOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -3059,7 +3734,8 @@ export const EnumOptions = { decode(input: _m0.Reader | Uint8Array, length?: number): EnumOptions { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseEnumOptions(); + const message = { ...baseEnumOptions } as EnumOptions; + message.uninterpretedOption = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -3081,13 +3757,24 @@ export const EnumOptions = { }, fromJSON(object: any): EnumOptions { - return { - allowAlias: isSet(object.allowAlias) ? Boolean(object.allowAlias) : false, - deprecated: isSet(object.deprecated) ? Boolean(object.deprecated) : false, - uninterpretedOption: Array.isArray(object?.uninterpretedOption) - ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) - : [], - }; + const message = { ...baseEnumOptions } as EnumOptions; + message.uninterpretedOption = []; + if (object.allowAlias !== undefined && object.allowAlias !== null) { + message.allowAlias = Boolean(object.allowAlias); + } else { + message.allowAlias = false; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = Boolean(object.deprecated); + } else { + message.deprecated = false; + } + if (object.uninterpretedOption !== undefined && object.uninterpretedOption !== null) { + for (const e of object.uninterpretedOption) { + message.uninterpretedOption.push(UninterpretedOption.fromJSON(e)); + } + } + return message; }, toJSON(message: EnumOptions): unknown { @@ -3104,19 +3791,29 @@ export const EnumOptions = { return obj; }, - fromPartial, I>>(object: I): EnumOptions { - const message = createBaseEnumOptions(); - message.allowAlias = object.allowAlias ?? false; - message.deprecated = object.deprecated ?? false; - message.uninterpretedOption = - object.uninterpretedOption?.map(e => UninterpretedOption.fromPartial(e)) || []; + fromPartial(object: DeepPartial): EnumOptions { + const message = { ...baseEnumOptions } as EnumOptions; + message.uninterpretedOption = []; + if (object.allowAlias !== undefined && object.allowAlias !== null) { + message.allowAlias = object.allowAlias; + } else { + message.allowAlias = false; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } else { + message.deprecated = false; + } + if (object.uninterpretedOption !== undefined && object.uninterpretedOption !== null) { + for (const e of object.uninterpretedOption) { + message.uninterpretedOption.push(UninterpretedOption.fromPartial(e)); + } + } return message; }, }; -function createBaseEnumValueOptions(): EnumValueOptions { - return { deprecated: false, uninterpretedOption: [] }; -} +const baseEnumValueOptions: object = { deprecated: false }; export const EnumValueOptions = { encode(message: EnumValueOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -3132,7 +3829,8 @@ export const EnumValueOptions = { decode(input: _m0.Reader | Uint8Array, length?: number): EnumValueOptions { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseEnumValueOptions(); + const message = { ...baseEnumValueOptions } as EnumValueOptions; + message.uninterpretedOption = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -3151,12 +3849,19 @@ export const EnumValueOptions = { }, fromJSON(object: any): EnumValueOptions { - return { - deprecated: isSet(object.deprecated) ? Boolean(object.deprecated) : false, - uninterpretedOption: Array.isArray(object?.uninterpretedOption) - ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) - : [], - }; + const message = { ...baseEnumValueOptions } as EnumValueOptions; + message.uninterpretedOption = []; + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = Boolean(object.deprecated); + } else { + message.deprecated = false; + } + if (object.uninterpretedOption !== undefined && object.uninterpretedOption !== null) { + for (const e of object.uninterpretedOption) { + message.uninterpretedOption.push(UninterpretedOption.fromJSON(e)); + } + } + return message; }, toJSON(message: EnumValueOptions): unknown { @@ -3172,18 +3877,24 @@ export const EnumValueOptions = { return obj; }, - fromPartial, I>>(object: I): EnumValueOptions { - const message = createBaseEnumValueOptions(); - message.deprecated = object.deprecated ?? false; - message.uninterpretedOption = - object.uninterpretedOption?.map(e => UninterpretedOption.fromPartial(e)) || []; + fromPartial(object: DeepPartial): EnumValueOptions { + const message = { ...baseEnumValueOptions } as EnumValueOptions; + message.uninterpretedOption = []; + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } else { + message.deprecated = false; + } + if (object.uninterpretedOption !== undefined && object.uninterpretedOption !== null) { + for (const e of object.uninterpretedOption) { + message.uninterpretedOption.push(UninterpretedOption.fromPartial(e)); + } + } return message; }, }; -function createBaseServiceOptions(): ServiceOptions { - return { deprecated: false, uninterpretedOption: [] }; -} +const baseServiceOptions: object = { deprecated: false }; export const ServiceOptions = { encode(message: ServiceOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -3199,7 +3910,8 @@ export const ServiceOptions = { decode(input: _m0.Reader | Uint8Array, length?: number): ServiceOptions { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseServiceOptions(); + const message = { ...baseServiceOptions } as ServiceOptions; + message.uninterpretedOption = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -3218,12 +3930,19 @@ export const ServiceOptions = { }, fromJSON(object: any): ServiceOptions { - return { - deprecated: isSet(object.deprecated) ? Boolean(object.deprecated) : false, - uninterpretedOption: Array.isArray(object?.uninterpretedOption) - ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) - : [], - }; + const message = { ...baseServiceOptions } as ServiceOptions; + message.uninterpretedOption = []; + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = Boolean(object.deprecated); + } else { + message.deprecated = false; + } + if (object.uninterpretedOption !== undefined && object.uninterpretedOption !== null) { + for (const e of object.uninterpretedOption) { + message.uninterpretedOption.push(UninterpretedOption.fromJSON(e)); + } + } + return message; }, toJSON(message: ServiceOptions): unknown { @@ -3239,18 +3958,24 @@ export const ServiceOptions = { return obj; }, - fromPartial, I>>(object: I): ServiceOptions { - const message = createBaseServiceOptions(); - message.deprecated = object.deprecated ?? false; - message.uninterpretedOption = - object.uninterpretedOption?.map(e => UninterpretedOption.fromPartial(e)) || []; + fromPartial(object: DeepPartial): ServiceOptions { + const message = { ...baseServiceOptions } as ServiceOptions; + message.uninterpretedOption = []; + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } else { + message.deprecated = false; + } + if (object.uninterpretedOption !== undefined && object.uninterpretedOption !== null) { + for (const e of object.uninterpretedOption) { + message.uninterpretedOption.push(UninterpretedOption.fromPartial(e)); + } + } return message; }, }; -function createBaseMethodOptions(): MethodOptions { - return { deprecated: false, idempotencyLevel: 0, uninterpretedOption: [] }; -} +const baseMethodOptions: object = { deprecated: false, idempotencyLevel: 0 }; export const MethodOptions = { encode(message: MethodOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -3269,7 +3994,8 @@ export const MethodOptions = { decode(input: _m0.Reader | Uint8Array, length?: number): MethodOptions { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMethodOptions(); + const message = { ...baseMethodOptions } as MethodOptions; + message.uninterpretedOption = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -3291,15 +4017,24 @@ export const MethodOptions = { }, fromJSON(object: any): MethodOptions { - return { - deprecated: isSet(object.deprecated) ? Boolean(object.deprecated) : false, - idempotencyLevel: isSet(object.idempotencyLevel) - ? methodOptions_IdempotencyLevelFromJSON(object.idempotencyLevel) - : 0, - uninterpretedOption: Array.isArray(object?.uninterpretedOption) - ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) - : [], - }; + const message = { ...baseMethodOptions } as MethodOptions; + message.uninterpretedOption = []; + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = Boolean(object.deprecated); + } else { + message.deprecated = false; + } + if (object.idempotencyLevel !== undefined && object.idempotencyLevel !== null) { + message.idempotencyLevel = methodOptions_IdempotencyLevelFromJSON(object.idempotencyLevel); + } else { + message.idempotencyLevel = 0; + } + if (object.uninterpretedOption !== undefined && object.uninterpretedOption !== null) { + for (const e of object.uninterpretedOption) { + message.uninterpretedOption.push(UninterpretedOption.fromJSON(e)); + } + } + return message; }, toJSON(message: MethodOptions): unknown { @@ -3317,27 +4052,35 @@ export const MethodOptions = { return obj; }, - fromPartial, I>>(object: I): MethodOptions { - const message = createBaseMethodOptions(); - message.deprecated = object.deprecated ?? false; - message.idempotencyLevel = object.idempotencyLevel ?? 0; - message.uninterpretedOption = - object.uninterpretedOption?.map(e => UninterpretedOption.fromPartial(e)) || []; + fromPartial(object: DeepPartial): MethodOptions { + const message = { ...baseMethodOptions } as MethodOptions; + message.uninterpretedOption = []; + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } else { + message.deprecated = false; + } + if (object.idempotencyLevel !== undefined && object.idempotencyLevel !== null) { + message.idempotencyLevel = object.idempotencyLevel; + } else { + message.idempotencyLevel = 0; + } + if (object.uninterpretedOption !== undefined && object.uninterpretedOption !== null) { + for (const e of object.uninterpretedOption) { + message.uninterpretedOption.push(UninterpretedOption.fromPartial(e)); + } + } return message; }, }; -function createBaseUninterpretedOption(): UninterpretedOption { - return { - name: [], - identifierValue: "", - positiveIntValue: 0, - negativeIntValue: 0, - doubleValue: 0, - stringValue: new Uint8Array(), - aggregateValue: "", - }; -} +const baseUninterpretedOption: object = { + identifierValue: "", + positiveIntValue: 0, + negativeIntValue: 0, + doubleValue: 0, + aggregateValue: "", +}; export const UninterpretedOption = { encode(message: UninterpretedOption, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -3368,7 +4111,9 @@ export const UninterpretedOption = { decode(input: _m0.Reader | Uint8Array, length?: number): UninterpretedOption { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseUninterpretedOption(); + const message = { ...baseUninterpretedOption } as UninterpretedOption; + message.name = []; + message.stringValue = new Uint8Array(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -3402,19 +4147,43 @@ export const UninterpretedOption = { }, fromJSON(object: any): UninterpretedOption { - return { - name: Array.isArray(object?.name) - ? object.name.map((e: any) => UninterpretedOption_NamePart.fromJSON(e)) - : [], - identifierValue: isSet(object.identifierValue) ? String(object.identifierValue) : "", - positiveIntValue: isSet(object.positiveIntValue) ? Number(object.positiveIntValue) : 0, - negativeIntValue: isSet(object.negativeIntValue) ? Number(object.negativeIntValue) : 0, - doubleValue: isSet(object.doubleValue) ? Number(object.doubleValue) : 0, - stringValue: isSet(object.stringValue) - ? bytesFromBase64(object.stringValue) - : new Uint8Array(), - aggregateValue: isSet(object.aggregateValue) ? String(object.aggregateValue) : "", - }; + const message = { ...baseUninterpretedOption } as UninterpretedOption; + message.name = []; + message.stringValue = new Uint8Array(); + if (object.name !== undefined && object.name !== null) { + for (const e of object.name) { + message.name.push(UninterpretedOption_NamePart.fromJSON(e)); + } + } + if (object.identifierValue !== undefined && object.identifierValue !== null) { + message.identifierValue = String(object.identifierValue); + } else { + message.identifierValue = ""; + } + if (object.positiveIntValue !== undefined && object.positiveIntValue !== null) { + message.positiveIntValue = Number(object.positiveIntValue); + } else { + message.positiveIntValue = 0; + } + if (object.negativeIntValue !== undefined && object.negativeIntValue !== null) { + message.negativeIntValue = Number(object.negativeIntValue); + } else { + message.negativeIntValue = 0; + } + if (object.doubleValue !== undefined && object.doubleValue !== null) { + message.doubleValue = Number(object.doubleValue); + } else { + message.doubleValue = 0; + } + if (object.stringValue !== undefined && object.stringValue !== null) { + message.stringValue = bytesFromBase64(object.stringValue); + } + if (object.aggregateValue !== undefined && object.aggregateValue !== null) { + message.aggregateValue = String(object.aggregateValue); + } else { + message.aggregateValue = ""; + } + return message; }, toJSON(message: UninterpretedOption): unknown { @@ -3425,10 +4194,8 @@ export const UninterpretedOption = { obj.name = []; } message.identifierValue !== undefined && (obj.identifierValue = message.identifierValue); - message.positiveIntValue !== undefined && - (obj.positiveIntValue = Math.round(message.positiveIntValue)); - message.negativeIntValue !== undefined && - (obj.negativeIntValue = Math.round(message.negativeIntValue)); + message.positiveIntValue !== undefined && (obj.positiveIntValue = message.positiveIntValue); + message.negativeIntValue !== undefined && (obj.negativeIntValue = message.negativeIntValue); message.doubleValue !== undefined && (obj.doubleValue = message.doubleValue); message.stringValue !== undefined && (obj.stringValue = base64FromBytes( @@ -3438,24 +4205,52 @@ export const UninterpretedOption = { return obj; }, - fromPartial, I>>( - object: I, - ): UninterpretedOption { - const message = createBaseUninterpretedOption(); - message.name = object.name?.map(e => UninterpretedOption_NamePart.fromPartial(e)) || []; - message.identifierValue = object.identifierValue ?? ""; - message.positiveIntValue = object.positiveIntValue ?? 0; - message.negativeIntValue = object.negativeIntValue ?? 0; - message.doubleValue = object.doubleValue ?? 0; - message.stringValue = object.stringValue ?? new Uint8Array(); - message.aggregateValue = object.aggregateValue ?? ""; + fromPartial(object: DeepPartial): UninterpretedOption { + const message = { ...baseUninterpretedOption } as UninterpretedOption; + message.name = []; + if (object.name !== undefined && object.name !== null) { + for (const e of object.name) { + message.name.push(UninterpretedOption_NamePart.fromPartial(e)); + } + } + if (object.identifierValue !== undefined && object.identifierValue !== null) { + message.identifierValue = object.identifierValue; + } else { + message.identifierValue = ""; + } + if (object.positiveIntValue !== undefined && object.positiveIntValue !== null) { + message.positiveIntValue = object.positiveIntValue; + } else { + message.positiveIntValue = 0; + } + if (object.negativeIntValue !== undefined && object.negativeIntValue !== null) { + message.negativeIntValue = object.negativeIntValue; + } else { + message.negativeIntValue = 0; + } + if (object.doubleValue !== undefined && object.doubleValue !== null) { + message.doubleValue = object.doubleValue; + } else { + message.doubleValue = 0; + } + if (object.stringValue !== undefined && object.stringValue !== null) { + message.stringValue = object.stringValue; + } else { + message.stringValue = new Uint8Array(); + } + if (object.aggregateValue !== undefined && object.aggregateValue !== null) { + message.aggregateValue = object.aggregateValue; + } else { + message.aggregateValue = ""; + } return message; }, }; -function createBaseUninterpretedOption_NamePart(): UninterpretedOption_NamePart { - return { namePart: "", isExtension: false }; -} +const baseUninterpretedOption_NamePart: object = { + namePart: "", + isExtension: false, +}; export const UninterpretedOption_NamePart = { encode( @@ -3474,7 +4269,9 @@ export const UninterpretedOption_NamePart = { decode(input: _m0.Reader | Uint8Array, length?: number): UninterpretedOption_NamePart { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseUninterpretedOption_NamePart(); + const message = { + ...baseUninterpretedOption_NamePart, + } as UninterpretedOption_NamePart; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -3493,10 +4290,20 @@ export const UninterpretedOption_NamePart = { }, fromJSON(object: any): UninterpretedOption_NamePart { - return { - namePart: isSet(object.namePart) ? String(object.namePart) : "", - isExtension: isSet(object.isExtension) ? Boolean(object.isExtension) : false, - }; + const message = { + ...baseUninterpretedOption_NamePart, + } as UninterpretedOption_NamePart; + if (object.namePart !== undefined && object.namePart !== null) { + message.namePart = String(object.namePart); + } else { + message.namePart = ""; + } + if (object.isExtension !== undefined && object.isExtension !== null) { + message.isExtension = Boolean(object.isExtension); + } else { + message.isExtension = false; + } + return message; }, toJSON(message: UninterpretedOption_NamePart): unknown { @@ -3506,19 +4313,25 @@ export const UninterpretedOption_NamePart = { return obj; }, - fromPartial, I>>( - object: I, - ): UninterpretedOption_NamePart { - const message = createBaseUninterpretedOption_NamePart(); - message.namePart = object.namePart ?? ""; - message.isExtension = object.isExtension ?? false; + fromPartial(object: DeepPartial): UninterpretedOption_NamePart { + const message = { + ...baseUninterpretedOption_NamePart, + } as UninterpretedOption_NamePart; + if (object.namePart !== undefined && object.namePart !== null) { + message.namePart = object.namePart; + } else { + message.namePart = ""; + } + if (object.isExtension !== undefined && object.isExtension !== null) { + message.isExtension = object.isExtension; + } else { + message.isExtension = false; + } return message; }, }; -function createBaseSourceCodeInfo(): SourceCodeInfo { - return { location: [] }; -} +const baseSourceCodeInfo: object = {}; export const SourceCodeInfo = { encode(message: SourceCodeInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -3531,7 +4344,8 @@ export const SourceCodeInfo = { decode(input: _m0.Reader | Uint8Array, length?: number): SourceCodeInfo { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseSourceCodeInfo(); + const message = { ...baseSourceCodeInfo } as SourceCodeInfo; + message.location = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -3547,11 +4361,14 @@ export const SourceCodeInfo = { }, fromJSON(object: any): SourceCodeInfo { - return { - location: Array.isArray(object?.location) - ? object.location.map((e: any) => SourceCodeInfo_Location.fromJSON(e)) - : [], - }; + const message = { ...baseSourceCodeInfo } as SourceCodeInfo; + message.location = []; + if (object.location !== undefined && object.location !== null) { + for (const e of object.location) { + message.location.push(SourceCodeInfo_Location.fromJSON(e)); + } + } + return message; }, toJSON(message: SourceCodeInfo): unknown { @@ -3564,22 +4381,25 @@ export const SourceCodeInfo = { return obj; }, - fromPartial, I>>(object: I): SourceCodeInfo { - const message = createBaseSourceCodeInfo(); - message.location = object.location?.map(e => SourceCodeInfo_Location.fromPartial(e)) || []; + fromPartial(object: DeepPartial): SourceCodeInfo { + const message = { ...baseSourceCodeInfo } as SourceCodeInfo; + message.location = []; + if (object.location !== undefined && object.location !== null) { + for (const e of object.location) { + message.location.push(SourceCodeInfo_Location.fromPartial(e)); + } + } return message; }, }; -function createBaseSourceCodeInfo_Location(): SourceCodeInfo_Location { - return { - path: [], - span: [], - leadingComments: "", - trailingComments: "", - leadingDetachedComments: [], - }; -} +const baseSourceCodeInfo_Location: object = { + path: 0, + span: 0, + leadingComments: "", + trailingComments: "", + leadingDetachedComments: "", +}; export const SourceCodeInfo_Location = { encode(message: SourceCodeInfo_Location, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -3608,7 +4428,12 @@ export const SourceCodeInfo_Location = { decode(input: _m0.Reader | Uint8Array, length?: number): SourceCodeInfo_Location { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseSourceCodeInfo_Location(); + const message = { + ...baseSourceCodeInfo_Location, + } as SourceCodeInfo_Location; + message.path = []; + message.span = []; + message.leadingDetachedComments = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -3650,26 +4475,49 @@ export const SourceCodeInfo_Location = { }, fromJSON(object: any): SourceCodeInfo_Location { - return { - path: Array.isArray(object?.path) ? object.path.map((e: any) => Number(e)) : [], - span: Array.isArray(object?.span) ? object.span.map((e: any) => Number(e)) : [], - leadingComments: isSet(object.leadingComments) ? String(object.leadingComments) : "", - trailingComments: isSet(object.trailingComments) ? String(object.trailingComments) : "", - leadingDetachedComments: Array.isArray(object?.leadingDetachedComments) - ? object.leadingDetachedComments.map((e: any) => String(e)) - : [], - }; + const message = { + ...baseSourceCodeInfo_Location, + } as SourceCodeInfo_Location; + message.path = []; + message.span = []; + message.leadingDetachedComments = []; + if (object.path !== undefined && object.path !== null) { + for (const e of object.path) { + message.path.push(Number(e)); + } + } + if (object.span !== undefined && object.span !== null) { + for (const e of object.span) { + message.span.push(Number(e)); + } + } + if (object.leadingComments !== undefined && object.leadingComments !== null) { + message.leadingComments = String(object.leadingComments); + } else { + message.leadingComments = ""; + } + if (object.trailingComments !== undefined && object.trailingComments !== null) { + message.trailingComments = String(object.trailingComments); + } else { + message.trailingComments = ""; + } + if (object.leadingDetachedComments !== undefined && object.leadingDetachedComments !== null) { + for (const e of object.leadingDetachedComments) { + message.leadingDetachedComments.push(String(e)); + } + } + return message; }, toJSON(message: SourceCodeInfo_Location): unknown { const obj: any = {}; if (message.path) { - obj.path = message.path.map(e => Math.round(e)); + obj.path = message.path.map(e => e); } else { obj.path = []; } if (message.span) { - obj.span = message.span.map(e => Math.round(e)); + obj.span = message.span.map(e => e); } else { obj.span = []; } @@ -3683,22 +4531,43 @@ export const SourceCodeInfo_Location = { return obj; }, - fromPartial, I>>( - object: I, - ): SourceCodeInfo_Location { - const message = createBaseSourceCodeInfo_Location(); - message.path = object.path?.map(e => e) || []; - message.span = object.span?.map(e => e) || []; - message.leadingComments = object.leadingComments ?? ""; - message.trailingComments = object.trailingComments ?? ""; - message.leadingDetachedComments = object.leadingDetachedComments?.map(e => e) || []; + fromPartial(object: DeepPartial): SourceCodeInfo_Location { + const message = { + ...baseSourceCodeInfo_Location, + } as SourceCodeInfo_Location; + message.path = []; + message.span = []; + message.leadingDetachedComments = []; + if (object.path !== undefined && object.path !== null) { + for (const e of object.path) { + message.path.push(e); + } + } + if (object.span !== undefined && object.span !== null) { + for (const e of object.span) { + message.span.push(e); + } + } + if (object.leadingComments !== undefined && object.leadingComments !== null) { + message.leadingComments = object.leadingComments; + } else { + message.leadingComments = ""; + } + if (object.trailingComments !== undefined && object.trailingComments !== null) { + message.trailingComments = object.trailingComments; + } else { + message.trailingComments = ""; + } + if (object.leadingDetachedComments !== undefined && object.leadingDetachedComments !== null) { + for (const e of object.leadingDetachedComments) { + message.leadingDetachedComments.push(e); + } + } return message; }, }; -function createBaseGeneratedCodeInfo(): GeneratedCodeInfo { - return { annotation: [] }; -} +const baseGeneratedCodeInfo: object = {}; export const GeneratedCodeInfo = { encode(message: GeneratedCodeInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -3711,7 +4580,8 @@ export const GeneratedCodeInfo = { decode(input: _m0.Reader | Uint8Array, length?: number): GeneratedCodeInfo { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGeneratedCodeInfo(); + const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; + message.annotation = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -3727,11 +4597,14 @@ export const GeneratedCodeInfo = { }, fromJSON(object: any): GeneratedCodeInfo { - return { - annotation: Array.isArray(object?.annotation) - ? object.annotation.map((e: any) => GeneratedCodeInfo_Annotation.fromJSON(e)) - : [], - }; + const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; + message.annotation = []; + if (object.annotation !== undefined && object.annotation !== null) { + for (const e of object.annotation) { + message.annotation.push(GeneratedCodeInfo_Annotation.fromJSON(e)); + } + } + return message; }, toJSON(message: GeneratedCodeInfo): unknown { @@ -3746,17 +4619,24 @@ export const GeneratedCodeInfo = { return obj; }, - fromPartial, I>>(object: I): GeneratedCodeInfo { - const message = createBaseGeneratedCodeInfo(); - message.annotation = - object.annotation?.map(e => GeneratedCodeInfo_Annotation.fromPartial(e)) || []; + fromPartial(object: DeepPartial): GeneratedCodeInfo { + const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; + message.annotation = []; + if (object.annotation !== undefined && object.annotation !== null) { + for (const e of object.annotation) { + message.annotation.push(GeneratedCodeInfo_Annotation.fromPartial(e)); + } + } return message; }, }; -function createBaseGeneratedCodeInfo_Annotation(): GeneratedCodeInfo_Annotation { - return { path: [], sourceFile: "", begin: 0, end: 0 }; -} +const baseGeneratedCodeInfo_Annotation: object = { + path: 0, + sourceFile: "", + begin: 0, + end: 0, +}; export const GeneratedCodeInfo_Annotation = { encode( @@ -3783,7 +4663,10 @@ export const GeneratedCodeInfo_Annotation = { decode(input: _m0.Reader | Uint8Array, length?: number): GeneratedCodeInfo_Annotation { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGeneratedCodeInfo_Annotation(); + const message = { + ...baseGeneratedCodeInfo_Annotation, + } as GeneratedCodeInfo_Annotation; + message.path = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -3815,35 +4698,71 @@ export const GeneratedCodeInfo_Annotation = { }, fromJSON(object: any): GeneratedCodeInfo_Annotation { - return { - path: Array.isArray(object?.path) ? object.path.map((e: any) => Number(e)) : [], - sourceFile: isSet(object.sourceFile) ? String(object.sourceFile) : "", - begin: isSet(object.begin) ? Number(object.begin) : 0, - end: isSet(object.end) ? Number(object.end) : 0, - }; + const message = { + ...baseGeneratedCodeInfo_Annotation, + } as GeneratedCodeInfo_Annotation; + message.path = []; + if (object.path !== undefined && object.path !== null) { + for (const e of object.path) { + message.path.push(Number(e)); + } + } + if (object.sourceFile !== undefined && object.sourceFile !== null) { + message.sourceFile = String(object.sourceFile); + } else { + message.sourceFile = ""; + } + if (object.begin !== undefined && object.begin !== null) { + message.begin = Number(object.begin); + } else { + message.begin = 0; + } + if (object.end !== undefined && object.end !== null) { + message.end = Number(object.end); + } else { + message.end = 0; + } + return message; }, toJSON(message: GeneratedCodeInfo_Annotation): unknown { const obj: any = {}; if (message.path) { - obj.path = message.path.map(e => Math.round(e)); + obj.path = message.path.map(e => e); } else { obj.path = []; } message.sourceFile !== undefined && (obj.sourceFile = message.sourceFile); - message.begin !== undefined && (obj.begin = Math.round(message.begin)); - message.end !== undefined && (obj.end = Math.round(message.end)); + message.begin !== undefined && (obj.begin = message.begin); + message.end !== undefined && (obj.end = message.end); return obj; }, - fromPartial, I>>( - object: I, - ): GeneratedCodeInfo_Annotation { - const message = createBaseGeneratedCodeInfo_Annotation(); - message.path = object.path?.map(e => e) || []; - message.sourceFile = object.sourceFile ?? ""; - message.begin = object.begin ?? 0; - message.end = object.end ?? 0; + fromPartial(object: DeepPartial): GeneratedCodeInfo_Annotation { + const message = { + ...baseGeneratedCodeInfo_Annotation, + } as GeneratedCodeInfo_Annotation; + message.path = []; + if (object.path !== undefined && object.path !== null) { + for (const e of object.path) { + message.path.push(e); + } + } + if (object.sourceFile !== undefined && object.sourceFile !== null) { + message.sourceFile = object.sourceFile; + } else { + message.sourceFile = ""; + } + if (object.begin !== undefined && object.begin !== null) { + message.begin = object.begin; + } else { + message.begin = 0; + } + if (object.end !== undefined && object.end !== null) { + message.end = object.end; + } else { + message.end = 0; + } return message; }, }; @@ -3881,7 +4800,6 @@ function base64FromBytes(arr: Uint8Array): string { } type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - export type DeepPartial = T extends Builtin ? T : T extends Array @@ -3892,11 +4810,6 @@ export type DeepPartial = T extends Builtin ? { [K in keyof T]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & Record>, never>; - function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); @@ -3908,7 +4821,3 @@ if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); } - -function isSet(value: any): boolean { - return value !== null && value !== undefined; -} diff --git a/dashboard/src/gen/google/protobuf/struct.ts b/dashboard/src/gen/google/protobuf/struct.ts index 4b9007044b6..2a6866b5fff 100644 --- a/dashboard/src/gen/google/protobuf/struct.ts +++ b/dashboard/src/gen/google/protobuf/struct.ts @@ -49,19 +49,19 @@ export function nullValueToJSON(object: NullValue): string { */ export interface Struct { /** Unordered map of dynamically typed values. */ - fields: { [key: string]: any }; + fields: { [key: string]: Value }; } export interface Struct_FieldsEntry { key: string; - value?: any; + value?: Value; } /** * `Value` represents a dynamically typed value which can be either * null, a number, a string, a boolean, a recursive struct value, or a - * list of values. A producer of value is expected to set one of these - * variants. Absence of any variant indicates an error. + * list of values. A producer of value is expected to set one of that + * variants, absence of any variant indicates an error. * * The JSON representation for `Value` is JSON value. */ @@ -75,9 +75,9 @@ export interface Value { /** Represents a boolean value. */ boolValue: boolean | undefined; /** Represents a structured value. */ - structValue?: { [key: string]: any }; + structValue?: Struct | undefined; /** Represents a repeated `Value`. */ - listValue?: Array; + listValue?: ListValue | undefined; } /** @@ -87,19 +87,15 @@ export interface Value { */ export interface ListValue { /** Repeated field of dynamically typed values. */ - values: any[]; + values: Value[]; } -function createBaseStruct(): Struct { - return { fields: {} }; -} +const baseStruct: object = {}; export const Struct = { encode(message: Struct, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { Object.entries(message.fields).forEach(([key, value]) => { - if (value !== undefined) { - Struct_FieldsEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).ldelim(); - } + Struct_FieldsEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).ldelim(); }); return writer; }, @@ -107,7 +103,8 @@ export const Struct = { decode(input: _m0.Reader | Uint8Array, length?: number): Struct { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseStruct(); + const message = { ...baseStruct } as Struct; + message.fields = {}; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -126,14 +123,14 @@ export const Struct = { }, fromJSON(object: any): Struct { - return { - fields: isObject(object.fields) - ? Object.entries(object.fields).reduce<{ [key: string]: any }>((acc, [key, value]) => { - acc[key] = value as any; - return acc; - }, {}) - : {}, - }; + const message = { ...baseStruct } as Struct; + message.fields = {}; + if (object.fields !== undefined && object.fields !== null) { + Object.entries(object.fields).forEach(([key, value]) => { + message.fields[key] = Value.fromJSON(value); + }); + } + return message; }, toJSON(message: Struct): unknown { @@ -141,47 +138,27 @@ export const Struct = { obj.fields = {}; if (message.fields) { Object.entries(message.fields).forEach(([k, v]) => { - obj.fields[k] = v; + obj.fields[k] = Value.toJSON(v); }); } return obj; }, - fromPartial, I>>(object: I): Struct { - const message = createBaseStruct(); - message.fields = Object.entries(object.fields ?? {}).reduce<{ - [key: string]: any; - }>((acc, [key, value]) => { - if (value !== undefined) { - acc[key] = value; - } - return acc; - }, {}); - return message; - }, - - wrap(object: { [key: string]: any } | undefined): Struct { - const struct = createBaseStruct(); - if (object !== undefined) { - Object.keys(object).forEach(key => { - struct.fields[key] = object[key]; + fromPartial(object: DeepPartial): Struct { + const message = { ...baseStruct } as Struct; + message.fields = {}; + if (object.fields !== undefined && object.fields !== null) { + Object.entries(object.fields).forEach(([key, value]) => { + if (value !== undefined) { + message.fields[key] = Value.fromPartial(value); + } }); } - return struct; - }, - - unwrap(message: Struct): { [key: string]: any } { - const object: { [key: string]: any } = {}; - Object.keys(message.fields).forEach(key => { - object[key] = message.fields[key]; - }); - return object; + return message; }, }; -function createBaseStruct_FieldsEntry(): Struct_FieldsEntry { - return { key: "", value: undefined }; -} +const baseStruct_FieldsEntry: object = { key: "" }; export const Struct_FieldsEntry = { encode(message: Struct_FieldsEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -189,7 +166,7 @@ export const Struct_FieldsEntry = { writer.uint32(10).string(message.key); } if (message.value !== undefined) { - Value.encode(Value.wrap(message.value), writer.uint32(18).fork()).ldelim(); + Value.encode(message.value, writer.uint32(18).fork()).ldelim(); } return writer; }, @@ -197,7 +174,7 @@ export const Struct_FieldsEntry = { decode(input: _m0.Reader | Uint8Array, length?: number): Struct_FieldsEntry { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseStruct_FieldsEntry(); + const message = { ...baseStruct_FieldsEntry } as Struct_FieldsEntry; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -205,7 +182,7 @@ export const Struct_FieldsEntry = { message.key = reader.string(); break; case 2: - message.value = Value.unwrap(Value.decode(reader, reader.uint32())); + message.value = Value.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -216,37 +193,45 @@ export const Struct_FieldsEntry = { }, fromJSON(object: any): Struct_FieldsEntry { - return { - key: isSet(object.key) ? String(object.key) : "", - value: isSet(object?.value) ? object.value : undefined, - }; + const message = { ...baseStruct_FieldsEntry } as Struct_FieldsEntry; + if (object.key !== undefined && object.key !== null) { + message.key = String(object.key); + } else { + message.key = ""; + } + if (object.value !== undefined && object.value !== null) { + message.value = Value.fromJSON(object.value); + } else { + message.value = undefined; + } + return message; }, toJSON(message: Struct_FieldsEntry): unknown { const obj: any = {}; message.key !== undefined && (obj.key = message.key); - message.value !== undefined && (obj.value = message.value); + message.value !== undefined && + (obj.value = message.value ? Value.toJSON(message.value) : undefined); return obj; }, - fromPartial, I>>(object: I): Struct_FieldsEntry { - const message = createBaseStruct_FieldsEntry(); - message.key = object.key ?? ""; - message.value = object.value ?? undefined; + fromPartial(object: DeepPartial): Struct_FieldsEntry { + const message = { ...baseStruct_FieldsEntry } as Struct_FieldsEntry; + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } else { + message.key = ""; + } + if (object.value !== undefined && object.value !== null) { + message.value = Value.fromPartial(object.value); + } else { + message.value = undefined; + } return message; }, }; -function createBaseValue(): Value { - return { - nullValue: undefined, - numberValue: undefined, - stringValue: undefined, - boolValue: undefined, - structValue: undefined, - listValue: undefined, - }; -} +const baseValue: object = {}; export const Value = { encode(message: Value, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -263,10 +248,10 @@ export const Value = { writer.uint32(32).bool(message.boolValue); } if (message.structValue !== undefined) { - Struct.encode(Struct.wrap(message.structValue), writer.uint32(42).fork()).ldelim(); + Struct.encode(message.structValue, writer.uint32(42).fork()).ldelim(); } if (message.listValue !== undefined) { - ListValue.encode(ListValue.wrap(message.listValue), writer.uint32(50).fork()).ldelim(); + ListValue.encode(message.listValue, writer.uint32(50).fork()).ldelim(); } return writer; }, @@ -274,7 +259,7 @@ export const Value = { decode(input: _m0.Reader | Uint8Array, length?: number): Value { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseValue(); + const message = { ...baseValue } as Value; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -291,10 +276,10 @@ export const Value = { message.boolValue = reader.bool(); break; case 5: - message.structValue = Struct.unwrap(Struct.decode(reader, reader.uint32())); + message.structValue = Struct.decode(reader, reader.uint32()); break; case 6: - message.listValue = ListValue.unwrap(ListValue.decode(reader, reader.uint32())); + message.listValue = ListValue.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -305,14 +290,38 @@ export const Value = { }, fromJSON(object: any): Value { - return { - nullValue: isSet(object.nullValue) ? nullValueFromJSON(object.nullValue) : undefined, - numberValue: isSet(object.numberValue) ? Number(object.numberValue) : undefined, - stringValue: isSet(object.stringValue) ? String(object.stringValue) : undefined, - boolValue: isSet(object.boolValue) ? Boolean(object.boolValue) : undefined, - structValue: isObject(object.structValue) ? object.structValue : undefined, - listValue: Array.isArray(object.listValue) ? [...object.listValue] : undefined, - }; + const message = { ...baseValue } as Value; + if (object.nullValue !== undefined && object.nullValue !== null) { + message.nullValue = nullValueFromJSON(object.nullValue); + } else { + message.nullValue = undefined; + } + if (object.numberValue !== undefined && object.numberValue !== null) { + message.numberValue = Number(object.numberValue); + } else { + message.numberValue = undefined; + } + if (object.stringValue !== undefined && object.stringValue !== null) { + message.stringValue = String(object.stringValue); + } else { + message.stringValue = undefined; + } + if (object.boolValue !== undefined && object.boolValue !== null) { + message.boolValue = Boolean(object.boolValue); + } else { + message.boolValue = undefined; + } + if (object.structValue !== undefined && object.structValue !== null) { + message.structValue = Struct.fromJSON(object.structValue); + } else { + message.structValue = undefined; + } + if (object.listValue !== undefined && object.listValue !== null) { + message.listValue = ListValue.fromJSON(object.listValue); + } else { + message.listValue = undefined; + } + return message; }, toJSON(message: Value): unknown { @@ -323,70 +332,55 @@ export const Value = { message.numberValue !== undefined && (obj.numberValue = message.numberValue); message.stringValue !== undefined && (obj.stringValue = message.stringValue); message.boolValue !== undefined && (obj.boolValue = message.boolValue); - message.structValue !== undefined && (obj.structValue = message.structValue); - message.listValue !== undefined && (obj.listValue = message.listValue); + message.structValue !== undefined && + (obj.structValue = message.structValue ? Struct.toJSON(message.structValue) : undefined); + message.listValue !== undefined && + (obj.listValue = message.listValue ? ListValue.toJSON(message.listValue) : undefined); return obj; }, - fromPartial, I>>(object: I): Value { - const message = createBaseValue(); - message.nullValue = object.nullValue ?? undefined; - message.numberValue = object.numberValue ?? undefined; - message.stringValue = object.stringValue ?? undefined; - message.boolValue = object.boolValue ?? undefined; - message.structValue = object.structValue ?? undefined; - message.listValue = object.listValue ?? undefined; + fromPartial(object: DeepPartial): Value { + const message = { ...baseValue } as Value; + if (object.nullValue !== undefined && object.nullValue !== null) { + message.nullValue = object.nullValue; + } else { + message.nullValue = undefined; + } + if (object.numberValue !== undefined && object.numberValue !== null) { + message.numberValue = object.numberValue; + } else { + message.numberValue = undefined; + } + if (object.stringValue !== undefined && object.stringValue !== null) { + message.stringValue = object.stringValue; + } else { + message.stringValue = undefined; + } + if (object.boolValue !== undefined && object.boolValue !== null) { + message.boolValue = object.boolValue; + } else { + message.boolValue = undefined; + } + if (object.structValue !== undefined && object.structValue !== null) { + message.structValue = Struct.fromPartial(object.structValue); + } else { + message.structValue = undefined; + } + if (object.listValue !== undefined && object.listValue !== null) { + message.listValue = ListValue.fromPartial(object.listValue); + } else { + message.listValue = undefined; + } return message; }, - - wrap(value: any): Value { - const result = createBaseValue(); - - if (value === null) { - result.nullValue = NullValue.NULL_VALUE; - } else if (typeof value === "boolean") { - result.boolValue = value; - } else if (typeof value === "number") { - result.numberValue = value; - } else if (typeof value === "string") { - result.stringValue = value; - } else if (Array.isArray(value)) { - result.listValue = value; - } else if (typeof value === "object") { - result.structValue = value; - } else if (typeof value !== "undefined") { - throw new Error("Unsupported any value type: " + typeof value); - } - - return result; - }, - - unwrap(message: Value): string | number | boolean | Object | null | Array | undefined { - if (message?.stringValue !== undefined) { - return message.stringValue; - } else if (message?.numberValue !== undefined) { - return message.numberValue; - } else if (message?.boolValue !== undefined) { - return message.boolValue; - } else if (message?.structValue !== undefined) { - return message.structValue; - } else if (message?.listValue !== undefined) { - return message.listValue; - } else if (message?.nullValue !== undefined) { - return null; - } - return undefined; - }, }; -function createBaseListValue(): ListValue { - return { values: [] }; -} +const baseListValue: object = {}; export const ListValue = { encode(message: ListValue, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.values) { - Value.encode(Value.wrap(v!), writer.uint32(10).fork()).ldelim(); + Value.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, @@ -394,12 +388,13 @@ export const ListValue = { decode(input: _m0.Reader | Uint8Array, length?: number): ListValue { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseListValue(); + const message = { ...baseListValue } as ListValue; + message.values = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.values.push(Value.unwrap(Value.decode(reader, reader.uint32()))); + message.values.push(Value.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -410,42 +405,39 @@ export const ListValue = { }, fromJSON(object: any): ListValue { - return { - values: Array.isArray(object?.values) ? [...object.values] : [], - }; + const message = { ...baseListValue } as ListValue; + message.values = []; + if (object.values !== undefined && object.values !== null) { + for (const e of object.values) { + message.values.push(Value.fromJSON(e)); + } + } + return message; }, toJSON(message: ListValue): unknown { const obj: any = {}; if (message.values) { - obj.values = message.values.map(e => e); + obj.values = message.values.map(e => (e ? Value.toJSON(e) : undefined)); } else { obj.values = []; } return obj; }, - fromPartial, I>>(object: I): ListValue { - const message = createBaseListValue(); - message.values = object.values?.map(e => e) || []; + fromPartial(object: DeepPartial): ListValue { + const message = { ...baseListValue } as ListValue; + message.values = []; + if (object.values !== undefined && object.values !== null) { + for (const e of object.values) { + message.values.push(Value.fromPartial(e)); + } + } return message; }, - - wrap(value: Array | undefined): ListValue { - const result = createBaseListValue(); - - result.values = value ?? []; - - return result; - }, - - unwrap(message: ListValue): Array { - return message.values; - }, }; type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - export type DeepPartial = T extends Builtin ? T : T extends Array @@ -456,20 +448,7 @@ export type DeepPartial = T extends Builtin ? { [K in keyof T]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & Record>, never>; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); } - -function isObject(value: any): boolean { - return typeof value === "object" && value !== null; -} - -function isSet(value: any): boolean { - return value !== null && value !== undefined; -} diff --git a/dashboard/src/gen/kubeappsapis/core/packages/v1alpha1/packages.ts b/dashboard/src/gen/kubeappsapis/core/packages/v1alpha1/packages.ts index 07277373806..baf21ae2851 100644 --- a/dashboard/src/gen/kubeappsapis/core/packages/v1alpha1/packages.ts +++ b/dashboard/src/gen/kubeappsapis/core/packages/v1alpha1/packages.ts @@ -997,13 +997,7 @@ export interface ResourceRef { namespace: string; } -function createBaseGetAvailablePackageSummariesRequest(): GetAvailablePackageSummariesRequest { - return { - context: undefined, - filterOptions: undefined, - paginationOptions: undefined, - }; -} +const baseGetAvailablePackageSummariesRequest: object = {}; export const GetAvailablePackageSummariesRequest = { encode( @@ -1025,7 +1019,9 @@ export const GetAvailablePackageSummariesRequest = { decode(input: _m0.Reader | Uint8Array, length?: number): GetAvailablePackageSummariesRequest { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetAvailablePackageSummariesRequest(); + const message = { + ...baseGetAvailablePackageSummariesRequest, + } as GetAvailablePackageSummariesRequest; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1047,15 +1043,25 @@ export const GetAvailablePackageSummariesRequest = { }, fromJSON(object: any): GetAvailablePackageSummariesRequest { - return { - context: isSet(object.context) ? Context.fromJSON(object.context) : undefined, - filterOptions: isSet(object.filterOptions) - ? FilterOptions.fromJSON(object.filterOptions) - : undefined, - paginationOptions: isSet(object.paginationOptions) - ? PaginationOptions.fromJSON(object.paginationOptions) - : undefined, - }; + const message = { + ...baseGetAvailablePackageSummariesRequest, + } as GetAvailablePackageSummariesRequest; + if (object.context !== undefined && object.context !== null) { + message.context = Context.fromJSON(object.context); + } else { + message.context = undefined; + } + if (object.filterOptions !== undefined && object.filterOptions !== null) { + message.filterOptions = FilterOptions.fromJSON(object.filterOptions); + } else { + message.filterOptions = undefined; + } + if (object.paginationOptions !== undefined && object.paginationOptions !== null) { + message.paginationOptions = PaginationOptions.fromJSON(object.paginationOptions); + } else { + message.paginationOptions = undefined; + } + return message; }, toJSON(message: GetAvailablePackageSummariesRequest): unknown { @@ -1073,29 +1079,32 @@ export const GetAvailablePackageSummariesRequest = { return obj; }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): GetAvailablePackageSummariesRequest { - const message = createBaseGetAvailablePackageSummariesRequest(); - message.context = - object.context !== undefined && object.context !== null - ? Context.fromPartial(object.context) - : undefined; - message.filterOptions = - object.filterOptions !== undefined && object.filterOptions !== null - ? FilterOptions.fromPartial(object.filterOptions) - : undefined; - message.paginationOptions = - object.paginationOptions !== undefined && object.paginationOptions !== null - ? PaginationOptions.fromPartial(object.paginationOptions) - : undefined; + const message = { + ...baseGetAvailablePackageSummariesRequest, + } as GetAvailablePackageSummariesRequest; + if (object.context !== undefined && object.context !== null) { + message.context = Context.fromPartial(object.context); + } else { + message.context = undefined; + } + if (object.filterOptions !== undefined && object.filterOptions !== null) { + message.filterOptions = FilterOptions.fromPartial(object.filterOptions); + } else { + message.filterOptions = undefined; + } + if (object.paginationOptions !== undefined && object.paginationOptions !== null) { + message.paginationOptions = PaginationOptions.fromPartial(object.paginationOptions); + } else { + message.paginationOptions = undefined; + } return message; }, }; -function createBaseGetAvailablePackageDetailRequest(): GetAvailablePackageDetailRequest { - return { availablePackageRef: undefined, pkgVersion: "" }; -} +const baseGetAvailablePackageDetailRequest: object = { pkgVersion: "" }; export const GetAvailablePackageDetailRequest = { encode( @@ -1117,7 +1126,9 @@ export const GetAvailablePackageDetailRequest = { decode(input: _m0.Reader | Uint8Array, length?: number): GetAvailablePackageDetailRequest { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetAvailablePackageDetailRequest(); + const message = { + ...baseGetAvailablePackageDetailRequest, + } as GetAvailablePackageDetailRequest; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1136,12 +1147,20 @@ export const GetAvailablePackageDetailRequest = { }, fromJSON(object: any): GetAvailablePackageDetailRequest { - return { - availablePackageRef: isSet(object.availablePackageRef) - ? AvailablePackageReference.fromJSON(object.availablePackageRef) - : undefined, - pkgVersion: isSet(object.pkgVersion) ? String(object.pkgVersion) : "", - }; + const message = { + ...baseGetAvailablePackageDetailRequest, + } as GetAvailablePackageDetailRequest; + if (object.availablePackageRef !== undefined && object.availablePackageRef !== null) { + message.availablePackageRef = AvailablePackageReference.fromJSON(object.availablePackageRef); + } else { + message.availablePackageRef = undefined; + } + if (object.pkgVersion !== undefined && object.pkgVersion !== null) { + message.pkgVersion = String(object.pkgVersion); + } else { + message.pkgVersion = ""; + } + return message; }, toJSON(message: GetAvailablePackageDetailRequest): unknown { @@ -1154,22 +1173,29 @@ export const GetAvailablePackageDetailRequest = { return obj; }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): GetAvailablePackageDetailRequest { - const message = createBaseGetAvailablePackageDetailRequest(); - message.availablePackageRef = - object.availablePackageRef !== undefined && object.availablePackageRef !== null - ? AvailablePackageReference.fromPartial(object.availablePackageRef) - : undefined; - message.pkgVersion = object.pkgVersion ?? ""; + const message = { + ...baseGetAvailablePackageDetailRequest, + } as GetAvailablePackageDetailRequest; + if (object.availablePackageRef !== undefined && object.availablePackageRef !== null) { + message.availablePackageRef = AvailablePackageReference.fromPartial( + object.availablePackageRef, + ); + } else { + message.availablePackageRef = undefined; + } + if (object.pkgVersion !== undefined && object.pkgVersion !== null) { + message.pkgVersion = object.pkgVersion; + } else { + message.pkgVersion = ""; + } return message; }, }; -function createBaseGetAvailablePackageVersionsRequest(): GetAvailablePackageVersionsRequest { - return { availablePackageRef: undefined, pkgVersion: "" }; -} +const baseGetAvailablePackageVersionsRequest: object = { pkgVersion: "" }; export const GetAvailablePackageVersionsRequest = { encode( @@ -1191,7 +1217,9 @@ export const GetAvailablePackageVersionsRequest = { decode(input: _m0.Reader | Uint8Array, length?: number): GetAvailablePackageVersionsRequest { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetAvailablePackageVersionsRequest(); + const message = { + ...baseGetAvailablePackageVersionsRequest, + } as GetAvailablePackageVersionsRequest; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1210,12 +1238,20 @@ export const GetAvailablePackageVersionsRequest = { }, fromJSON(object: any): GetAvailablePackageVersionsRequest { - return { - availablePackageRef: isSet(object.availablePackageRef) - ? AvailablePackageReference.fromJSON(object.availablePackageRef) - : undefined, - pkgVersion: isSet(object.pkgVersion) ? String(object.pkgVersion) : "", - }; + const message = { + ...baseGetAvailablePackageVersionsRequest, + } as GetAvailablePackageVersionsRequest; + if (object.availablePackageRef !== undefined && object.availablePackageRef !== null) { + message.availablePackageRef = AvailablePackageReference.fromJSON(object.availablePackageRef); + } else { + message.availablePackageRef = undefined; + } + if (object.pkgVersion !== undefined && object.pkgVersion !== null) { + message.pkgVersion = String(object.pkgVersion); + } else { + message.pkgVersion = ""; + } + return message; }, toJSON(message: GetAvailablePackageVersionsRequest): unknown { @@ -1228,22 +1264,29 @@ export const GetAvailablePackageVersionsRequest = { return obj; }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): GetAvailablePackageVersionsRequest { - const message = createBaseGetAvailablePackageVersionsRequest(); - message.availablePackageRef = - object.availablePackageRef !== undefined && object.availablePackageRef !== null - ? AvailablePackageReference.fromPartial(object.availablePackageRef) - : undefined; - message.pkgVersion = object.pkgVersion ?? ""; + const message = { + ...baseGetAvailablePackageVersionsRequest, + } as GetAvailablePackageVersionsRequest; + if (object.availablePackageRef !== undefined && object.availablePackageRef !== null) { + message.availablePackageRef = AvailablePackageReference.fromPartial( + object.availablePackageRef, + ); + } else { + message.availablePackageRef = undefined; + } + if (object.pkgVersion !== undefined && object.pkgVersion !== null) { + message.pkgVersion = object.pkgVersion; + } else { + message.pkgVersion = ""; + } return message; }, }; -function createBaseGetInstalledPackageSummariesRequest(): GetInstalledPackageSummariesRequest { - return { context: undefined, paginationOptions: undefined }; -} +const baseGetInstalledPackageSummariesRequest: object = {}; export const GetInstalledPackageSummariesRequest = { encode( @@ -1262,7 +1305,9 @@ export const GetInstalledPackageSummariesRequest = { decode(input: _m0.Reader | Uint8Array, length?: number): GetInstalledPackageSummariesRequest { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetInstalledPackageSummariesRequest(); + const message = { + ...baseGetInstalledPackageSummariesRequest, + } as GetInstalledPackageSummariesRequest; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1281,12 +1326,20 @@ export const GetInstalledPackageSummariesRequest = { }, fromJSON(object: any): GetInstalledPackageSummariesRequest { - return { - context: isSet(object.context) ? Context.fromJSON(object.context) : undefined, - paginationOptions: isSet(object.paginationOptions) - ? PaginationOptions.fromJSON(object.paginationOptions) - : undefined, - }; + const message = { + ...baseGetInstalledPackageSummariesRequest, + } as GetInstalledPackageSummariesRequest; + if (object.context !== undefined && object.context !== null) { + message.context = Context.fromJSON(object.context); + } else { + message.context = undefined; + } + if (object.paginationOptions !== undefined && object.paginationOptions !== null) { + message.paginationOptions = PaginationOptions.fromJSON(object.paginationOptions); + } else { + message.paginationOptions = undefined; + } + return message; }, toJSON(message: GetInstalledPackageSummariesRequest): unknown { @@ -1300,25 +1353,27 @@ export const GetInstalledPackageSummariesRequest = { return obj; }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): GetInstalledPackageSummariesRequest { - const message = createBaseGetInstalledPackageSummariesRequest(); - message.context = - object.context !== undefined && object.context !== null - ? Context.fromPartial(object.context) - : undefined; - message.paginationOptions = - object.paginationOptions !== undefined && object.paginationOptions !== null - ? PaginationOptions.fromPartial(object.paginationOptions) - : undefined; + const message = { + ...baseGetInstalledPackageSummariesRequest, + } as GetInstalledPackageSummariesRequest; + if (object.context !== undefined && object.context !== null) { + message.context = Context.fromPartial(object.context); + } else { + message.context = undefined; + } + if (object.paginationOptions !== undefined && object.paginationOptions !== null) { + message.paginationOptions = PaginationOptions.fromPartial(object.paginationOptions); + } else { + message.paginationOptions = undefined; + } return message; }, }; -function createBaseGetInstalledPackageDetailRequest(): GetInstalledPackageDetailRequest { - return { installedPackageRef: undefined }; -} +const baseGetInstalledPackageDetailRequest: object = {}; export const GetInstalledPackageDetailRequest = { encode( @@ -1337,7 +1392,9 @@ export const GetInstalledPackageDetailRequest = { decode(input: _m0.Reader | Uint8Array, length?: number): GetInstalledPackageDetailRequest { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetInstalledPackageDetailRequest(); + const message = { + ...baseGetInstalledPackageDetailRequest, + } as GetInstalledPackageDetailRequest; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1353,11 +1410,15 @@ export const GetInstalledPackageDetailRequest = { }, fromJSON(object: any): GetInstalledPackageDetailRequest { - return { - installedPackageRef: isSet(object.installedPackageRef) - ? InstalledPackageReference.fromJSON(object.installedPackageRef) - : undefined, - }; + const message = { + ...baseGetInstalledPackageDetailRequest, + } as GetInstalledPackageDetailRequest; + if (object.installedPackageRef !== undefined && object.installedPackageRef !== null) { + message.installedPackageRef = InstalledPackageReference.fromJSON(object.installedPackageRef); + } else { + message.installedPackageRef = undefined; + } + return message; }, toJSON(message: GetInstalledPackageDetailRequest): unknown { @@ -1369,28 +1430,24 @@ export const GetInstalledPackageDetailRequest = { return obj; }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): GetInstalledPackageDetailRequest { - const message = createBaseGetInstalledPackageDetailRequest(); - message.installedPackageRef = - object.installedPackageRef !== undefined && object.installedPackageRef !== null - ? InstalledPackageReference.fromPartial(object.installedPackageRef) - : undefined; + const message = { + ...baseGetInstalledPackageDetailRequest, + } as GetInstalledPackageDetailRequest; + if (object.installedPackageRef !== undefined && object.installedPackageRef !== null) { + message.installedPackageRef = InstalledPackageReference.fromPartial( + object.installedPackageRef, + ); + } else { + message.installedPackageRef = undefined; + } return message; }, }; -function createBaseCreateInstalledPackageRequest(): CreateInstalledPackageRequest { - return { - availablePackageRef: undefined, - targetContext: undefined, - name: "", - pkgVersionReference: undefined, - values: "", - reconciliationOptions: undefined, - }; -} +const baseCreateInstalledPackageRequest: object = { name: "", values: "" }; export const CreateInstalledPackageRequest = { encode( @@ -1427,7 +1484,9 @@ export const CreateInstalledPackageRequest = { decode(input: _m0.Reader | Uint8Array, length?: number): CreateInstalledPackageRequest { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseCreateInstalledPackageRequest(); + const message = { + ...baseCreateInstalledPackageRequest, + } as CreateInstalledPackageRequest; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1458,22 +1517,40 @@ export const CreateInstalledPackageRequest = { }, fromJSON(object: any): CreateInstalledPackageRequest { - return { - availablePackageRef: isSet(object.availablePackageRef) - ? AvailablePackageReference.fromJSON(object.availablePackageRef) - : undefined, - targetContext: isSet(object.targetContext) - ? Context.fromJSON(object.targetContext) - : undefined, - name: isSet(object.name) ? String(object.name) : "", - pkgVersionReference: isSet(object.pkgVersionReference) - ? VersionReference.fromJSON(object.pkgVersionReference) - : undefined, - values: isSet(object.values) ? String(object.values) : "", - reconciliationOptions: isSet(object.reconciliationOptions) - ? ReconciliationOptions.fromJSON(object.reconciliationOptions) - : undefined, - }; + const message = { + ...baseCreateInstalledPackageRequest, + } as CreateInstalledPackageRequest; + if (object.availablePackageRef !== undefined && object.availablePackageRef !== null) { + message.availablePackageRef = AvailablePackageReference.fromJSON(object.availablePackageRef); + } else { + message.availablePackageRef = undefined; + } + if (object.targetContext !== undefined && object.targetContext !== null) { + message.targetContext = Context.fromJSON(object.targetContext); + } else { + message.targetContext = undefined; + } + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.pkgVersionReference !== undefined && object.pkgVersionReference !== null) { + message.pkgVersionReference = VersionReference.fromJSON(object.pkgVersionReference); + } else { + message.pkgVersionReference = undefined; + } + if (object.values !== undefined && object.values !== null) { + message.values = String(object.values); + } else { + message.values = ""; + } + if (object.reconciliationOptions !== undefined && object.reconciliationOptions !== null) { + message.reconciliationOptions = ReconciliationOptions.fromJSON(object.reconciliationOptions); + } else { + message.reconciliationOptions = undefined; + } + return message; }, toJSON(message: CreateInstalledPackageRequest): unknown { @@ -1499,40 +1576,49 @@ export const CreateInstalledPackageRequest = { return obj; }, - fromPartial, I>>( - object: I, - ): CreateInstalledPackageRequest { - const message = createBaseCreateInstalledPackageRequest(); - message.availablePackageRef = - object.availablePackageRef !== undefined && object.availablePackageRef !== null - ? AvailablePackageReference.fromPartial(object.availablePackageRef) - : undefined; - message.targetContext = - object.targetContext !== undefined && object.targetContext !== null - ? Context.fromPartial(object.targetContext) - : undefined; - message.name = object.name ?? ""; - message.pkgVersionReference = - object.pkgVersionReference !== undefined && object.pkgVersionReference !== null - ? VersionReference.fromPartial(object.pkgVersionReference) - : undefined; - message.values = object.values ?? ""; - message.reconciliationOptions = - object.reconciliationOptions !== undefined && object.reconciliationOptions !== null - ? ReconciliationOptions.fromPartial(object.reconciliationOptions) - : undefined; + fromPartial(object: DeepPartial): CreateInstalledPackageRequest { + const message = { + ...baseCreateInstalledPackageRequest, + } as CreateInstalledPackageRequest; + if (object.availablePackageRef !== undefined && object.availablePackageRef !== null) { + message.availablePackageRef = AvailablePackageReference.fromPartial( + object.availablePackageRef, + ); + } else { + message.availablePackageRef = undefined; + } + if (object.targetContext !== undefined && object.targetContext !== null) { + message.targetContext = Context.fromPartial(object.targetContext); + } else { + message.targetContext = undefined; + } + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.pkgVersionReference !== undefined && object.pkgVersionReference !== null) { + message.pkgVersionReference = VersionReference.fromPartial(object.pkgVersionReference); + } else { + message.pkgVersionReference = undefined; + } + if (object.values !== undefined && object.values !== null) { + message.values = object.values; + } else { + message.values = ""; + } + if (object.reconciliationOptions !== undefined && object.reconciliationOptions !== null) { + message.reconciliationOptions = ReconciliationOptions.fromPartial( + object.reconciliationOptions, + ); + } else { + message.reconciliationOptions = undefined; + } return message; }, }; -function createBaseUpdateInstalledPackageRequest(): UpdateInstalledPackageRequest { - return { - installedPackageRef: undefined, - pkgVersionReference: undefined, - values: "", - reconciliationOptions: undefined, - }; -} +const baseUpdateInstalledPackageRequest: object = { values: "" }; export const UpdateInstalledPackageRequest = { encode( @@ -1563,7 +1649,9 @@ export const UpdateInstalledPackageRequest = { decode(input: _m0.Reader | Uint8Array, length?: number): UpdateInstalledPackageRequest { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseUpdateInstalledPackageRequest(); + const message = { + ...baseUpdateInstalledPackageRequest, + } as UpdateInstalledPackageRequest; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1588,18 +1676,30 @@ export const UpdateInstalledPackageRequest = { }, fromJSON(object: any): UpdateInstalledPackageRequest { - return { - installedPackageRef: isSet(object.installedPackageRef) - ? InstalledPackageReference.fromJSON(object.installedPackageRef) - : undefined, - pkgVersionReference: isSet(object.pkgVersionReference) - ? VersionReference.fromJSON(object.pkgVersionReference) - : undefined, - values: isSet(object.values) ? String(object.values) : "", - reconciliationOptions: isSet(object.reconciliationOptions) - ? ReconciliationOptions.fromJSON(object.reconciliationOptions) - : undefined, - }; + const message = { + ...baseUpdateInstalledPackageRequest, + } as UpdateInstalledPackageRequest; + if (object.installedPackageRef !== undefined && object.installedPackageRef !== null) { + message.installedPackageRef = InstalledPackageReference.fromJSON(object.installedPackageRef); + } else { + message.installedPackageRef = undefined; + } + if (object.pkgVersionReference !== undefined && object.pkgVersionReference !== null) { + message.pkgVersionReference = VersionReference.fromJSON(object.pkgVersionReference); + } else { + message.pkgVersionReference = undefined; + } + if (object.values !== undefined && object.values !== null) { + message.values = String(object.values); + } else { + message.values = ""; + } + if (object.reconciliationOptions !== undefined && object.reconciliationOptions !== null) { + message.reconciliationOptions = ReconciliationOptions.fromJSON(object.reconciliationOptions); + } else { + message.reconciliationOptions = undefined; + } + return message; }, toJSON(message: UpdateInstalledPackageRequest): unknown { @@ -1620,30 +1720,39 @@ export const UpdateInstalledPackageRequest = { return obj; }, - fromPartial, I>>( - object: I, - ): UpdateInstalledPackageRequest { - const message = createBaseUpdateInstalledPackageRequest(); - message.installedPackageRef = - object.installedPackageRef !== undefined && object.installedPackageRef !== null - ? InstalledPackageReference.fromPartial(object.installedPackageRef) - : undefined; - message.pkgVersionReference = - object.pkgVersionReference !== undefined && object.pkgVersionReference !== null - ? VersionReference.fromPartial(object.pkgVersionReference) - : undefined; - message.values = object.values ?? ""; - message.reconciliationOptions = - object.reconciliationOptions !== undefined && object.reconciliationOptions !== null - ? ReconciliationOptions.fromPartial(object.reconciliationOptions) - : undefined; + fromPartial(object: DeepPartial): UpdateInstalledPackageRequest { + const message = { + ...baseUpdateInstalledPackageRequest, + } as UpdateInstalledPackageRequest; + if (object.installedPackageRef !== undefined && object.installedPackageRef !== null) { + message.installedPackageRef = InstalledPackageReference.fromPartial( + object.installedPackageRef, + ); + } else { + message.installedPackageRef = undefined; + } + if (object.pkgVersionReference !== undefined && object.pkgVersionReference !== null) { + message.pkgVersionReference = VersionReference.fromPartial(object.pkgVersionReference); + } else { + message.pkgVersionReference = undefined; + } + if (object.values !== undefined && object.values !== null) { + message.values = object.values; + } else { + message.values = ""; + } + if (object.reconciliationOptions !== undefined && object.reconciliationOptions !== null) { + message.reconciliationOptions = ReconciliationOptions.fromPartial( + object.reconciliationOptions, + ); + } else { + message.reconciliationOptions = undefined; + } return message; }, }; -function createBaseDeleteInstalledPackageRequest(): DeleteInstalledPackageRequest { - return { installedPackageRef: undefined }; -} +const baseDeleteInstalledPackageRequest: object = {}; export const DeleteInstalledPackageRequest = { encode( @@ -1662,7 +1771,9 @@ export const DeleteInstalledPackageRequest = { decode(input: _m0.Reader | Uint8Array, length?: number): DeleteInstalledPackageRequest { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDeleteInstalledPackageRequest(); + const message = { + ...baseDeleteInstalledPackageRequest, + } as DeleteInstalledPackageRequest; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1678,11 +1789,15 @@ export const DeleteInstalledPackageRequest = { }, fromJSON(object: any): DeleteInstalledPackageRequest { - return { - installedPackageRef: isSet(object.installedPackageRef) - ? InstalledPackageReference.fromJSON(object.installedPackageRef) - : undefined, - }; + const message = { + ...baseDeleteInstalledPackageRequest, + } as DeleteInstalledPackageRequest; + if (object.installedPackageRef !== undefined && object.installedPackageRef !== null) { + message.installedPackageRef = InstalledPackageReference.fromJSON(object.installedPackageRef); + } else { + message.installedPackageRef = undefined; + } + return message; }, toJSON(message: DeleteInstalledPackageRequest): unknown { @@ -1694,21 +1809,22 @@ export const DeleteInstalledPackageRequest = { return obj; }, - fromPartial, I>>( - object: I, - ): DeleteInstalledPackageRequest { - const message = createBaseDeleteInstalledPackageRequest(); - message.installedPackageRef = - object.installedPackageRef !== undefined && object.installedPackageRef !== null - ? InstalledPackageReference.fromPartial(object.installedPackageRef) - : undefined; + fromPartial(object: DeepPartial): DeleteInstalledPackageRequest { + const message = { + ...baseDeleteInstalledPackageRequest, + } as DeleteInstalledPackageRequest; + if (object.installedPackageRef !== undefined && object.installedPackageRef !== null) { + message.installedPackageRef = InstalledPackageReference.fromPartial( + object.installedPackageRef, + ); + } else { + message.installedPackageRef = undefined; + } return message; }, }; -function createBaseGetInstalledPackageResourceRefsRequest(): GetInstalledPackageResourceRefsRequest { - return { installedPackageRef: undefined }; -} +const baseGetInstalledPackageResourceRefsRequest: object = {}; export const GetInstalledPackageResourceRefsRequest = { encode( @@ -1727,7 +1843,9 @@ export const GetInstalledPackageResourceRefsRequest = { decode(input: _m0.Reader | Uint8Array, length?: number): GetInstalledPackageResourceRefsRequest { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetInstalledPackageResourceRefsRequest(); + const message = { + ...baseGetInstalledPackageResourceRefsRequest, + } as GetInstalledPackageResourceRefsRequest; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1743,11 +1861,15 @@ export const GetInstalledPackageResourceRefsRequest = { }, fromJSON(object: any): GetInstalledPackageResourceRefsRequest { - return { - installedPackageRef: isSet(object.installedPackageRef) - ? InstalledPackageReference.fromJSON(object.installedPackageRef) - : undefined, - }; + const message = { + ...baseGetInstalledPackageResourceRefsRequest, + } as GetInstalledPackageResourceRefsRequest; + if (object.installedPackageRef !== undefined && object.installedPackageRef !== null) { + message.installedPackageRef = InstalledPackageReference.fromJSON(object.installedPackageRef); + } else { + message.installedPackageRef = undefined; + } + return message; }, toJSON(message: GetInstalledPackageResourceRefsRequest): unknown { @@ -1759,21 +1881,27 @@ export const GetInstalledPackageResourceRefsRequest = { return obj; }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): GetInstalledPackageResourceRefsRequest { - const message = createBaseGetInstalledPackageResourceRefsRequest(); - message.installedPackageRef = - object.installedPackageRef !== undefined && object.installedPackageRef !== null - ? InstalledPackageReference.fromPartial(object.installedPackageRef) - : undefined; + const message = { + ...baseGetInstalledPackageResourceRefsRequest, + } as GetInstalledPackageResourceRefsRequest; + if (object.installedPackageRef !== undefined && object.installedPackageRef !== null) { + message.installedPackageRef = InstalledPackageReference.fromPartial( + object.installedPackageRef, + ); + } else { + message.installedPackageRef = undefined; + } return message; }, }; -function createBaseGetAvailablePackageSummariesResponse(): GetAvailablePackageSummariesResponse { - return { availablePackageSummaries: [], nextPageToken: "", categories: [] }; -} +const baseGetAvailablePackageSummariesResponse: object = { + nextPageToken: "", + categories: "", +}; export const GetAvailablePackageSummariesResponse = { encode( @@ -1795,7 +1923,11 @@ export const GetAvailablePackageSummariesResponse = { decode(input: _m0.Reader | Uint8Array, length?: number): GetAvailablePackageSummariesResponse { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetAvailablePackageSummariesResponse(); + const message = { + ...baseGetAvailablePackageSummariesResponse, + } as GetAvailablePackageSummariesResponse; + message.availablePackageSummaries = []; + message.categories = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1819,15 +1951,30 @@ export const GetAvailablePackageSummariesResponse = { }, fromJSON(object: any): GetAvailablePackageSummariesResponse { - return { - availablePackageSummaries: Array.isArray(object?.availablePackageSummaries) - ? object.availablePackageSummaries.map((e: any) => AvailablePackageSummary.fromJSON(e)) - : [], - nextPageToken: isSet(object.nextPageToken) ? String(object.nextPageToken) : "", - categories: Array.isArray(object?.categories) - ? object.categories.map((e: any) => String(e)) - : [], - }; + const message = { + ...baseGetAvailablePackageSummariesResponse, + } as GetAvailablePackageSummariesResponse; + message.availablePackageSummaries = []; + message.categories = []; + if ( + object.availablePackageSummaries !== undefined && + object.availablePackageSummaries !== null + ) { + for (const e of object.availablePackageSummaries) { + message.availablePackageSummaries.push(AvailablePackageSummary.fromJSON(e)); + } + } + if (object.nextPageToken !== undefined && object.nextPageToken !== null) { + message.nextPageToken = String(object.nextPageToken); + } else { + message.nextPageToken = ""; + } + if (object.categories !== undefined && object.categories !== null) { + for (const e of object.categories) { + message.categories.push(String(e)); + } + } + return message; }, toJSON(message: GetAvailablePackageSummariesResponse): unknown { @@ -1848,21 +1995,37 @@ export const GetAvailablePackageSummariesResponse = { return obj; }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): GetAvailablePackageSummariesResponse { - const message = createBaseGetAvailablePackageSummariesResponse(); - message.availablePackageSummaries = - object.availablePackageSummaries?.map(e => AvailablePackageSummary.fromPartial(e)) || []; - message.nextPageToken = object.nextPageToken ?? ""; - message.categories = object.categories?.map(e => e) || []; + const message = { + ...baseGetAvailablePackageSummariesResponse, + } as GetAvailablePackageSummariesResponse; + message.availablePackageSummaries = []; + message.categories = []; + if ( + object.availablePackageSummaries !== undefined && + object.availablePackageSummaries !== null + ) { + for (const e of object.availablePackageSummaries) { + message.availablePackageSummaries.push(AvailablePackageSummary.fromPartial(e)); + } + } + if (object.nextPageToken !== undefined && object.nextPageToken !== null) { + message.nextPageToken = object.nextPageToken; + } else { + message.nextPageToken = ""; + } + if (object.categories !== undefined && object.categories !== null) { + for (const e of object.categories) { + message.categories.push(e); + } + } return message; }, }; -function createBaseGetAvailablePackageDetailResponse(): GetAvailablePackageDetailResponse { - return { availablePackageDetail: undefined }; -} +const baseGetAvailablePackageDetailResponse: object = {}; export const GetAvailablePackageDetailResponse = { encode( @@ -1881,7 +2044,9 @@ export const GetAvailablePackageDetailResponse = { decode(input: _m0.Reader | Uint8Array, length?: number): GetAvailablePackageDetailResponse { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetAvailablePackageDetailResponse(); + const message = { + ...baseGetAvailablePackageDetailResponse, + } as GetAvailablePackageDetailResponse; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1897,11 +2062,17 @@ export const GetAvailablePackageDetailResponse = { }, fromJSON(object: any): GetAvailablePackageDetailResponse { - return { - availablePackageDetail: isSet(object.availablePackageDetail) - ? AvailablePackageDetail.fromJSON(object.availablePackageDetail) - : undefined, - }; + const message = { + ...baseGetAvailablePackageDetailResponse, + } as GetAvailablePackageDetailResponse; + if (object.availablePackageDetail !== undefined && object.availablePackageDetail !== null) { + message.availablePackageDetail = AvailablePackageDetail.fromJSON( + object.availablePackageDetail, + ); + } else { + message.availablePackageDetail = undefined; + } + return message; }, toJSON(message: GetAvailablePackageDetailResponse): unknown { @@ -1913,21 +2084,24 @@ export const GetAvailablePackageDetailResponse = { return obj; }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): GetAvailablePackageDetailResponse { - const message = createBaseGetAvailablePackageDetailResponse(); - message.availablePackageDetail = - object.availablePackageDetail !== undefined && object.availablePackageDetail !== null - ? AvailablePackageDetail.fromPartial(object.availablePackageDetail) - : undefined; + const message = { + ...baseGetAvailablePackageDetailResponse, + } as GetAvailablePackageDetailResponse; + if (object.availablePackageDetail !== undefined && object.availablePackageDetail !== null) { + message.availablePackageDetail = AvailablePackageDetail.fromPartial( + object.availablePackageDetail, + ); + } else { + message.availablePackageDetail = undefined; + } return message; }, }; -function createBaseGetAvailablePackageVersionsResponse(): GetAvailablePackageVersionsResponse { - return { packageAppVersions: [] }; -} +const baseGetAvailablePackageVersionsResponse: object = {}; export const GetAvailablePackageVersionsResponse = { encode( @@ -1943,7 +2117,10 @@ export const GetAvailablePackageVersionsResponse = { decode(input: _m0.Reader | Uint8Array, length?: number): GetAvailablePackageVersionsResponse { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetAvailablePackageVersionsResponse(); + const message = { + ...baseGetAvailablePackageVersionsResponse, + } as GetAvailablePackageVersionsResponse; + message.packageAppVersions = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1959,11 +2136,16 @@ export const GetAvailablePackageVersionsResponse = { }, fromJSON(object: any): GetAvailablePackageVersionsResponse { - return { - packageAppVersions: Array.isArray(object?.packageAppVersions) - ? object.packageAppVersions.map((e: any) => PackageAppVersion.fromJSON(e)) - : [], - }; + const message = { + ...baseGetAvailablePackageVersionsResponse, + } as GetAvailablePackageVersionsResponse; + message.packageAppVersions = []; + if (object.packageAppVersions !== undefined && object.packageAppVersions !== null) { + for (const e of object.packageAppVersions) { + message.packageAppVersions.push(PackageAppVersion.fromJSON(e)); + } + } + return message; }, toJSON(message: GetAvailablePackageVersionsResponse): unknown { @@ -1978,19 +2160,23 @@ export const GetAvailablePackageVersionsResponse = { return obj; }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): GetAvailablePackageVersionsResponse { - const message = createBaseGetAvailablePackageVersionsResponse(); - message.packageAppVersions = - object.packageAppVersions?.map(e => PackageAppVersion.fromPartial(e)) || []; + const message = { + ...baseGetAvailablePackageVersionsResponse, + } as GetAvailablePackageVersionsResponse; + message.packageAppVersions = []; + if (object.packageAppVersions !== undefined && object.packageAppVersions !== null) { + for (const e of object.packageAppVersions) { + message.packageAppVersions.push(PackageAppVersion.fromPartial(e)); + } + } return message; }, }; -function createBaseGetInstalledPackageSummariesResponse(): GetInstalledPackageSummariesResponse { - return { installedPackageSummaries: [], nextPageToken: "" }; -} +const baseGetInstalledPackageSummariesResponse: object = { nextPageToken: "" }; export const GetInstalledPackageSummariesResponse = { encode( @@ -2009,7 +2195,10 @@ export const GetInstalledPackageSummariesResponse = { decode(input: _m0.Reader | Uint8Array, length?: number): GetInstalledPackageSummariesResponse { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetInstalledPackageSummariesResponse(); + const message = { + ...baseGetInstalledPackageSummariesResponse, + } as GetInstalledPackageSummariesResponse; + message.installedPackageSummaries = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2030,12 +2219,24 @@ export const GetInstalledPackageSummariesResponse = { }, fromJSON(object: any): GetInstalledPackageSummariesResponse { - return { - installedPackageSummaries: Array.isArray(object?.installedPackageSummaries) - ? object.installedPackageSummaries.map((e: any) => InstalledPackageSummary.fromJSON(e)) - : [], - nextPageToken: isSet(object.nextPageToken) ? String(object.nextPageToken) : "", - }; + const message = { + ...baseGetInstalledPackageSummariesResponse, + } as GetInstalledPackageSummariesResponse; + message.installedPackageSummaries = []; + if ( + object.installedPackageSummaries !== undefined && + object.installedPackageSummaries !== null + ) { + for (const e of object.installedPackageSummaries) { + message.installedPackageSummaries.push(InstalledPackageSummary.fromJSON(e)); + } + } + if (object.nextPageToken !== undefined && object.nextPageToken !== null) { + message.nextPageToken = String(object.nextPageToken); + } else { + message.nextPageToken = ""; + } + return message; }, toJSON(message: GetInstalledPackageSummariesResponse): unknown { @@ -2051,20 +2252,31 @@ export const GetInstalledPackageSummariesResponse = { return obj; }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): GetInstalledPackageSummariesResponse { - const message = createBaseGetInstalledPackageSummariesResponse(); - message.installedPackageSummaries = - object.installedPackageSummaries?.map(e => InstalledPackageSummary.fromPartial(e)) || []; - message.nextPageToken = object.nextPageToken ?? ""; + const message = { + ...baseGetInstalledPackageSummariesResponse, + } as GetInstalledPackageSummariesResponse; + message.installedPackageSummaries = []; + if ( + object.installedPackageSummaries !== undefined && + object.installedPackageSummaries !== null + ) { + for (const e of object.installedPackageSummaries) { + message.installedPackageSummaries.push(InstalledPackageSummary.fromPartial(e)); + } + } + if (object.nextPageToken !== undefined && object.nextPageToken !== null) { + message.nextPageToken = object.nextPageToken; + } else { + message.nextPageToken = ""; + } return message; }, }; -function createBaseGetInstalledPackageDetailResponse(): GetInstalledPackageDetailResponse { - return { installedPackageDetail: undefined }; -} +const baseGetInstalledPackageDetailResponse: object = {}; export const GetInstalledPackageDetailResponse = { encode( @@ -2083,7 +2295,9 @@ export const GetInstalledPackageDetailResponse = { decode(input: _m0.Reader | Uint8Array, length?: number): GetInstalledPackageDetailResponse { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetInstalledPackageDetailResponse(); + const message = { + ...baseGetInstalledPackageDetailResponse, + } as GetInstalledPackageDetailResponse; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2099,11 +2313,17 @@ export const GetInstalledPackageDetailResponse = { }, fromJSON(object: any): GetInstalledPackageDetailResponse { - return { - installedPackageDetail: isSet(object.installedPackageDetail) - ? InstalledPackageDetail.fromJSON(object.installedPackageDetail) - : undefined, - }; + const message = { + ...baseGetInstalledPackageDetailResponse, + } as GetInstalledPackageDetailResponse; + if (object.installedPackageDetail !== undefined && object.installedPackageDetail !== null) { + message.installedPackageDetail = InstalledPackageDetail.fromJSON( + object.installedPackageDetail, + ); + } else { + message.installedPackageDetail = undefined; + } + return message; }, toJSON(message: GetInstalledPackageDetailResponse): unknown { @@ -2115,21 +2335,24 @@ export const GetInstalledPackageDetailResponse = { return obj; }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): GetInstalledPackageDetailResponse { - const message = createBaseGetInstalledPackageDetailResponse(); - message.installedPackageDetail = - object.installedPackageDetail !== undefined && object.installedPackageDetail !== null - ? InstalledPackageDetail.fromPartial(object.installedPackageDetail) - : undefined; + const message = { + ...baseGetInstalledPackageDetailResponse, + } as GetInstalledPackageDetailResponse; + if (object.installedPackageDetail !== undefined && object.installedPackageDetail !== null) { + message.installedPackageDetail = InstalledPackageDetail.fromPartial( + object.installedPackageDetail, + ); + } else { + message.installedPackageDetail = undefined; + } return message; }, }; -function createBaseCreateInstalledPackageResponse(): CreateInstalledPackageResponse { - return { installedPackageRef: undefined }; -} +const baseCreateInstalledPackageResponse: object = {}; export const CreateInstalledPackageResponse = { encode( @@ -2148,7 +2371,9 @@ export const CreateInstalledPackageResponse = { decode(input: _m0.Reader | Uint8Array, length?: number): CreateInstalledPackageResponse { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseCreateInstalledPackageResponse(); + const message = { + ...baseCreateInstalledPackageResponse, + } as CreateInstalledPackageResponse; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2164,11 +2389,15 @@ export const CreateInstalledPackageResponse = { }, fromJSON(object: any): CreateInstalledPackageResponse { - return { - installedPackageRef: isSet(object.installedPackageRef) - ? InstalledPackageReference.fromJSON(object.installedPackageRef) - : undefined, - }; + const message = { + ...baseCreateInstalledPackageResponse, + } as CreateInstalledPackageResponse; + if (object.installedPackageRef !== undefined && object.installedPackageRef !== null) { + message.installedPackageRef = InstalledPackageReference.fromJSON(object.installedPackageRef); + } else { + message.installedPackageRef = undefined; + } + return message; }, toJSON(message: CreateInstalledPackageResponse): unknown { @@ -2180,21 +2409,22 @@ export const CreateInstalledPackageResponse = { return obj; }, - fromPartial, I>>( - object: I, - ): CreateInstalledPackageResponse { - const message = createBaseCreateInstalledPackageResponse(); - message.installedPackageRef = - object.installedPackageRef !== undefined && object.installedPackageRef !== null - ? InstalledPackageReference.fromPartial(object.installedPackageRef) - : undefined; + fromPartial(object: DeepPartial): CreateInstalledPackageResponse { + const message = { + ...baseCreateInstalledPackageResponse, + } as CreateInstalledPackageResponse; + if (object.installedPackageRef !== undefined && object.installedPackageRef !== null) { + message.installedPackageRef = InstalledPackageReference.fromPartial( + object.installedPackageRef, + ); + } else { + message.installedPackageRef = undefined; + } return message; }, }; -function createBaseUpdateInstalledPackageResponse(): UpdateInstalledPackageResponse { - return { installedPackageRef: undefined }; -} +const baseUpdateInstalledPackageResponse: object = {}; export const UpdateInstalledPackageResponse = { encode( @@ -2213,7 +2443,9 @@ export const UpdateInstalledPackageResponse = { decode(input: _m0.Reader | Uint8Array, length?: number): UpdateInstalledPackageResponse { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseUpdateInstalledPackageResponse(); + const message = { + ...baseUpdateInstalledPackageResponse, + } as UpdateInstalledPackageResponse; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2229,11 +2461,15 @@ export const UpdateInstalledPackageResponse = { }, fromJSON(object: any): UpdateInstalledPackageResponse { - return { - installedPackageRef: isSet(object.installedPackageRef) - ? InstalledPackageReference.fromJSON(object.installedPackageRef) - : undefined, - }; + const message = { + ...baseUpdateInstalledPackageResponse, + } as UpdateInstalledPackageResponse; + if (object.installedPackageRef !== undefined && object.installedPackageRef !== null) { + message.installedPackageRef = InstalledPackageReference.fromJSON(object.installedPackageRef); + } else { + message.installedPackageRef = undefined; + } + return message; }, toJSON(message: UpdateInstalledPackageResponse): unknown { @@ -2245,21 +2481,22 @@ export const UpdateInstalledPackageResponse = { return obj; }, - fromPartial, I>>( - object: I, - ): UpdateInstalledPackageResponse { - const message = createBaseUpdateInstalledPackageResponse(); - message.installedPackageRef = - object.installedPackageRef !== undefined && object.installedPackageRef !== null - ? InstalledPackageReference.fromPartial(object.installedPackageRef) - : undefined; + fromPartial(object: DeepPartial): UpdateInstalledPackageResponse { + const message = { + ...baseUpdateInstalledPackageResponse, + } as UpdateInstalledPackageResponse; + if (object.installedPackageRef !== undefined && object.installedPackageRef !== null) { + message.installedPackageRef = InstalledPackageReference.fromPartial( + object.installedPackageRef, + ); + } else { + message.installedPackageRef = undefined; + } return message; }, }; -function createBaseDeleteInstalledPackageResponse(): DeleteInstalledPackageResponse { - return {}; -} +const baseDeleteInstalledPackageResponse: object = {}; export const DeleteInstalledPackageResponse = { encode(_: DeleteInstalledPackageResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -2269,7 +2506,9 @@ export const DeleteInstalledPackageResponse = { decode(input: _m0.Reader | Uint8Array, length?: number): DeleteInstalledPackageResponse { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDeleteInstalledPackageResponse(); + const message = { + ...baseDeleteInstalledPackageResponse, + } as DeleteInstalledPackageResponse; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2282,7 +2521,10 @@ export const DeleteInstalledPackageResponse = { }, fromJSON(_: any): DeleteInstalledPackageResponse { - return {}; + const message = { + ...baseDeleteInstalledPackageResponse, + } as DeleteInstalledPackageResponse; + return message; }, toJSON(_: DeleteInstalledPackageResponse): unknown { @@ -2290,17 +2532,15 @@ export const DeleteInstalledPackageResponse = { return obj; }, - fromPartial, I>>( - _: I, - ): DeleteInstalledPackageResponse { - const message = createBaseDeleteInstalledPackageResponse(); + fromPartial(_: DeepPartial): DeleteInstalledPackageResponse { + const message = { + ...baseDeleteInstalledPackageResponse, + } as DeleteInstalledPackageResponse; return message; }, }; -function createBaseGetInstalledPackageResourceRefsResponse(): GetInstalledPackageResourceRefsResponse { - return { context: undefined, resourceRefs: [] }; -} +const baseGetInstalledPackageResourceRefsResponse: object = {}; export const GetInstalledPackageResourceRefsResponse = { encode( @@ -2319,7 +2559,10 @@ export const GetInstalledPackageResourceRefsResponse = { decode(input: _m0.Reader | Uint8Array, length?: number): GetInstalledPackageResourceRefsResponse { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetInstalledPackageResourceRefsResponse(); + const message = { + ...baseGetInstalledPackageResourceRefsResponse, + } as GetInstalledPackageResourceRefsResponse; + message.resourceRefs = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2338,12 +2581,21 @@ export const GetInstalledPackageResourceRefsResponse = { }, fromJSON(object: any): GetInstalledPackageResourceRefsResponse { - return { - context: isSet(object.context) ? Context.fromJSON(object.context) : undefined, - resourceRefs: Array.isArray(object?.resourceRefs) - ? object.resourceRefs.map((e: any) => ResourceRef.fromJSON(e)) - : [], - }; + const message = { + ...baseGetInstalledPackageResourceRefsResponse, + } as GetInstalledPackageResourceRefsResponse; + message.resourceRefs = []; + if (object.context !== undefined && object.context !== null) { + message.context = Context.fromJSON(object.context); + } else { + message.context = undefined; + } + if (object.resourceRefs !== undefined && object.resourceRefs !== null) { + for (const e of object.resourceRefs) { + message.resourceRefs.push(ResourceRef.fromJSON(e)); + } + } + return message; }, toJSON(message: GetInstalledPackageResourceRefsResponse): unknown { @@ -2358,30 +2610,34 @@ export const GetInstalledPackageResourceRefsResponse = { return obj; }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): GetInstalledPackageResourceRefsResponse { - const message = createBaseGetInstalledPackageResourceRefsResponse(); - message.context = - object.context !== undefined && object.context !== null - ? Context.fromPartial(object.context) - : undefined; - message.resourceRefs = object.resourceRefs?.map(e => ResourceRef.fromPartial(e)) || []; + const message = { + ...baseGetInstalledPackageResourceRefsResponse, + } as GetInstalledPackageResourceRefsResponse; + message.resourceRefs = []; + if (object.context !== undefined && object.context !== null) { + message.context = Context.fromPartial(object.context); + } else { + message.context = undefined; + } + if (object.resourceRefs !== undefined && object.resourceRefs !== null) { + for (const e of object.resourceRefs) { + message.resourceRefs.push(ResourceRef.fromPartial(e)); + } + } return message; }, }; -function createBaseAvailablePackageSummary(): AvailablePackageSummary { - return { - availablePackageRef: undefined, - name: "", - latestVersion: undefined, - iconUrl: "", - displayName: "", - shortDescription: "", - categories: [], - }; -} +const baseAvailablePackageSummary: object = { + name: "", + iconUrl: "", + displayName: "", + shortDescription: "", + categories: "", +}; export const AvailablePackageSummary = { encode(message: AvailablePackageSummary, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -2415,7 +2671,10 @@ export const AvailablePackageSummary = { decode(input: _m0.Reader | Uint8Array, length?: number): AvailablePackageSummary { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseAvailablePackageSummary(); + const message = { + ...baseAvailablePackageSummary, + } as AvailablePackageSummary; + message.categories = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2449,21 +2708,46 @@ export const AvailablePackageSummary = { }, fromJSON(object: any): AvailablePackageSummary { - return { - availablePackageRef: isSet(object.availablePackageRef) - ? AvailablePackageReference.fromJSON(object.availablePackageRef) - : undefined, - name: isSet(object.name) ? String(object.name) : "", - latestVersion: isSet(object.latestVersion) - ? PackageAppVersion.fromJSON(object.latestVersion) - : undefined, - iconUrl: isSet(object.iconUrl) ? String(object.iconUrl) : "", - displayName: isSet(object.displayName) ? String(object.displayName) : "", - shortDescription: isSet(object.shortDescription) ? String(object.shortDescription) : "", - categories: Array.isArray(object?.categories) - ? object.categories.map((e: any) => String(e)) - : [], - }; + const message = { + ...baseAvailablePackageSummary, + } as AvailablePackageSummary; + message.categories = []; + if (object.availablePackageRef !== undefined && object.availablePackageRef !== null) { + message.availablePackageRef = AvailablePackageReference.fromJSON(object.availablePackageRef); + } else { + message.availablePackageRef = undefined; + } + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.latestVersion !== undefined && object.latestVersion !== null) { + message.latestVersion = PackageAppVersion.fromJSON(object.latestVersion); + } else { + message.latestVersion = undefined; + } + if (object.iconUrl !== undefined && object.iconUrl !== null) { + message.iconUrl = String(object.iconUrl); + } else { + message.iconUrl = ""; + } + if (object.displayName !== undefined && object.displayName !== null) { + message.displayName = String(object.displayName); + } else { + message.displayName = ""; + } + if (object.shortDescription !== undefined && object.shortDescription !== null) { + message.shortDescription = String(object.shortDescription); + } else { + message.shortDescription = ""; + } + if (object.categories !== undefined && object.categories !== null) { + for (const e of object.categories) { + message.categories.push(String(e)); + } + } + return message; }, toJSON(message: AvailablePackageSummary): unknown { @@ -2488,47 +2772,66 @@ export const AvailablePackageSummary = { return obj; }, - fromPartial, I>>( - object: I, - ): AvailablePackageSummary { - const message = createBaseAvailablePackageSummary(); - message.availablePackageRef = - object.availablePackageRef !== undefined && object.availablePackageRef !== null - ? AvailablePackageReference.fromPartial(object.availablePackageRef) - : undefined; - message.name = object.name ?? ""; - message.latestVersion = - object.latestVersion !== undefined && object.latestVersion !== null - ? PackageAppVersion.fromPartial(object.latestVersion) - : undefined; - message.iconUrl = object.iconUrl ?? ""; - message.displayName = object.displayName ?? ""; - message.shortDescription = object.shortDescription ?? ""; - message.categories = object.categories?.map(e => e) || []; + fromPartial(object: DeepPartial): AvailablePackageSummary { + const message = { + ...baseAvailablePackageSummary, + } as AvailablePackageSummary; + message.categories = []; + if (object.availablePackageRef !== undefined && object.availablePackageRef !== null) { + message.availablePackageRef = AvailablePackageReference.fromPartial( + object.availablePackageRef, + ); + } else { + message.availablePackageRef = undefined; + } + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.latestVersion !== undefined && object.latestVersion !== null) { + message.latestVersion = PackageAppVersion.fromPartial(object.latestVersion); + } else { + message.latestVersion = undefined; + } + if (object.iconUrl !== undefined && object.iconUrl !== null) { + message.iconUrl = object.iconUrl; + } else { + message.iconUrl = ""; + } + if (object.displayName !== undefined && object.displayName !== null) { + message.displayName = object.displayName; + } else { + message.displayName = ""; + } + if (object.shortDescription !== undefined && object.shortDescription !== null) { + message.shortDescription = object.shortDescription; + } else { + message.shortDescription = ""; + } + if (object.categories !== undefined && object.categories !== null) { + for (const e of object.categories) { + message.categories.push(e); + } + } return message; }, }; -function createBaseAvailablePackageDetail(): AvailablePackageDetail { - return { - availablePackageRef: undefined, - name: "", - version: undefined, - repoUrl: "", - homeUrl: "", - iconUrl: "", - displayName: "", - shortDescription: "", - longDescription: "", - readme: "", - defaultValues: "", - valuesSchema: "", - sourceUrls: [], - maintainers: [], - categories: [], - customDetail: undefined, - }; -} +const baseAvailablePackageDetail: object = { + name: "", + repoUrl: "", + homeUrl: "", + iconUrl: "", + displayName: "", + shortDescription: "", + longDescription: "", + readme: "", + defaultValues: "", + valuesSchema: "", + sourceUrls: "", + categories: "", +}; export const AvailablePackageDetail = { encode(message: AvailablePackageDetail, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -2589,7 +2892,10 @@ export const AvailablePackageDetail = { decode(input: _m0.Reader | Uint8Array, length?: number): AvailablePackageDetail { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseAvailablePackageDetail(); + const message = { ...baseAvailablePackageDetail } as AvailablePackageDetail; + message.sourceUrls = []; + message.maintainers = []; + message.categories = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2650,32 +2956,91 @@ export const AvailablePackageDetail = { }, fromJSON(object: any): AvailablePackageDetail { - return { - availablePackageRef: isSet(object.availablePackageRef) - ? AvailablePackageReference.fromJSON(object.availablePackageRef) - : undefined, - name: isSet(object.name) ? String(object.name) : "", - version: isSet(object.version) ? PackageAppVersion.fromJSON(object.version) : undefined, - repoUrl: isSet(object.repoUrl) ? String(object.repoUrl) : "", - homeUrl: isSet(object.homeUrl) ? String(object.homeUrl) : "", - iconUrl: isSet(object.iconUrl) ? String(object.iconUrl) : "", - displayName: isSet(object.displayName) ? String(object.displayName) : "", - shortDescription: isSet(object.shortDescription) ? String(object.shortDescription) : "", - longDescription: isSet(object.longDescription) ? String(object.longDescription) : "", - readme: isSet(object.readme) ? String(object.readme) : "", - defaultValues: isSet(object.defaultValues) ? String(object.defaultValues) : "", - valuesSchema: isSet(object.valuesSchema) ? String(object.valuesSchema) : "", - sourceUrls: Array.isArray(object?.sourceUrls) - ? object.sourceUrls.map((e: any) => String(e)) - : [], - maintainers: Array.isArray(object?.maintainers) - ? object.maintainers.map((e: any) => Maintainer.fromJSON(e)) - : [], - categories: Array.isArray(object?.categories) - ? object.categories.map((e: any) => String(e)) - : [], - customDetail: isSet(object.customDetail) ? Any.fromJSON(object.customDetail) : undefined, - }; + const message = { ...baseAvailablePackageDetail } as AvailablePackageDetail; + message.sourceUrls = []; + message.maintainers = []; + message.categories = []; + if (object.availablePackageRef !== undefined && object.availablePackageRef !== null) { + message.availablePackageRef = AvailablePackageReference.fromJSON(object.availablePackageRef); + } else { + message.availablePackageRef = undefined; + } + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.version !== undefined && object.version !== null) { + message.version = PackageAppVersion.fromJSON(object.version); + } else { + message.version = undefined; + } + if (object.repoUrl !== undefined && object.repoUrl !== null) { + message.repoUrl = String(object.repoUrl); + } else { + message.repoUrl = ""; + } + if (object.homeUrl !== undefined && object.homeUrl !== null) { + message.homeUrl = String(object.homeUrl); + } else { + message.homeUrl = ""; + } + if (object.iconUrl !== undefined && object.iconUrl !== null) { + message.iconUrl = String(object.iconUrl); + } else { + message.iconUrl = ""; + } + if (object.displayName !== undefined && object.displayName !== null) { + message.displayName = String(object.displayName); + } else { + message.displayName = ""; + } + if (object.shortDescription !== undefined && object.shortDescription !== null) { + message.shortDescription = String(object.shortDescription); + } else { + message.shortDescription = ""; + } + if (object.longDescription !== undefined && object.longDescription !== null) { + message.longDescription = String(object.longDescription); + } else { + message.longDescription = ""; + } + if (object.readme !== undefined && object.readme !== null) { + message.readme = String(object.readme); + } else { + message.readme = ""; + } + if (object.defaultValues !== undefined && object.defaultValues !== null) { + message.defaultValues = String(object.defaultValues); + } else { + message.defaultValues = ""; + } + if (object.valuesSchema !== undefined && object.valuesSchema !== null) { + message.valuesSchema = String(object.valuesSchema); + } else { + message.valuesSchema = ""; + } + if (object.sourceUrls !== undefined && object.sourceUrls !== null) { + for (const e of object.sourceUrls) { + message.sourceUrls.push(String(e)); + } + } + if (object.maintainers !== undefined && object.maintainers !== null) { + for (const e of object.maintainers) { + message.maintainers.push(Maintainer.fromJSON(e)); + } + } + if (object.categories !== undefined && object.categories !== null) { + for (const e of object.categories) { + message.categories.push(String(e)); + } + } + if (object.customDetail !== undefined && object.customDetail !== null) { + message.customDetail = Any.fromJSON(object.customDetail); + } else { + message.customDetail = undefined; + } + return message; }, toJSON(message: AvailablePackageDetail): unknown { @@ -2711,58 +3076,108 @@ export const AvailablePackageDetail = { } else { obj.categories = []; } - message.customDetail !== undefined && - (obj.customDetail = message.customDetail ? Any.toJSON(message.customDetail) : undefined); - return obj; - }, - - fromPartial, I>>( - object: I, - ): AvailablePackageDetail { - const message = createBaseAvailablePackageDetail(); - message.availablePackageRef = - object.availablePackageRef !== undefined && object.availablePackageRef !== null - ? AvailablePackageReference.fromPartial(object.availablePackageRef) - : undefined; - message.name = object.name ?? ""; - message.version = - object.version !== undefined && object.version !== null - ? PackageAppVersion.fromPartial(object.version) - : undefined; - message.repoUrl = object.repoUrl ?? ""; - message.homeUrl = object.homeUrl ?? ""; - message.iconUrl = object.iconUrl ?? ""; - message.displayName = object.displayName ?? ""; - message.shortDescription = object.shortDescription ?? ""; - message.longDescription = object.longDescription ?? ""; - message.readme = object.readme ?? ""; - message.defaultValues = object.defaultValues ?? ""; - message.valuesSchema = object.valuesSchema ?? ""; - message.sourceUrls = object.sourceUrls?.map(e => e) || []; - message.maintainers = object.maintainers?.map(e => Maintainer.fromPartial(e)) || []; - message.categories = object.categories?.map(e => e) || []; - message.customDetail = - object.customDetail !== undefined && object.customDetail !== null - ? Any.fromPartial(object.customDetail) - : undefined; + message.customDetail !== undefined && + (obj.customDetail = message.customDetail ? Any.toJSON(message.customDetail) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): AvailablePackageDetail { + const message = { ...baseAvailablePackageDetail } as AvailablePackageDetail; + message.sourceUrls = []; + message.maintainers = []; + message.categories = []; + if (object.availablePackageRef !== undefined && object.availablePackageRef !== null) { + message.availablePackageRef = AvailablePackageReference.fromPartial( + object.availablePackageRef, + ); + } else { + message.availablePackageRef = undefined; + } + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.version !== undefined && object.version !== null) { + message.version = PackageAppVersion.fromPartial(object.version); + } else { + message.version = undefined; + } + if (object.repoUrl !== undefined && object.repoUrl !== null) { + message.repoUrl = object.repoUrl; + } else { + message.repoUrl = ""; + } + if (object.homeUrl !== undefined && object.homeUrl !== null) { + message.homeUrl = object.homeUrl; + } else { + message.homeUrl = ""; + } + if (object.iconUrl !== undefined && object.iconUrl !== null) { + message.iconUrl = object.iconUrl; + } else { + message.iconUrl = ""; + } + if (object.displayName !== undefined && object.displayName !== null) { + message.displayName = object.displayName; + } else { + message.displayName = ""; + } + if (object.shortDescription !== undefined && object.shortDescription !== null) { + message.shortDescription = object.shortDescription; + } else { + message.shortDescription = ""; + } + if (object.longDescription !== undefined && object.longDescription !== null) { + message.longDescription = object.longDescription; + } else { + message.longDescription = ""; + } + if (object.readme !== undefined && object.readme !== null) { + message.readme = object.readme; + } else { + message.readme = ""; + } + if (object.defaultValues !== undefined && object.defaultValues !== null) { + message.defaultValues = object.defaultValues; + } else { + message.defaultValues = ""; + } + if (object.valuesSchema !== undefined && object.valuesSchema !== null) { + message.valuesSchema = object.valuesSchema; + } else { + message.valuesSchema = ""; + } + if (object.sourceUrls !== undefined && object.sourceUrls !== null) { + for (const e of object.sourceUrls) { + message.sourceUrls.push(e); + } + } + if (object.maintainers !== undefined && object.maintainers !== null) { + for (const e of object.maintainers) { + message.maintainers.push(Maintainer.fromPartial(e)); + } + } + if (object.categories !== undefined && object.categories !== null) { + for (const e of object.categories) { + message.categories.push(e); + } + } + if (object.customDetail !== undefined && object.customDetail !== null) { + message.customDetail = Any.fromPartial(object.customDetail); + } else { + message.customDetail = undefined; + } return message; }, }; -function createBaseInstalledPackageSummary(): InstalledPackageSummary { - return { - installedPackageRef: undefined, - name: "", - pkgVersionReference: undefined, - currentVersion: undefined, - iconUrl: "", - pkgDisplayName: "", - shortDescription: "", - latestMatchingVersion: undefined, - latestVersion: undefined, - status: undefined, - }; -} +const baseInstalledPackageSummary: object = { + name: "", + iconUrl: "", + pkgDisplayName: "", + shortDescription: "", +}; export const InstalledPackageSummary = { encode(message: InstalledPackageSummary, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -2805,7 +3220,9 @@ export const InstalledPackageSummary = { decode(input: _m0.Reader | Uint8Array, length?: number): InstalledPackageSummary { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseInstalledPackageSummary(); + const message = { + ...baseInstalledPackageSummary, + } as InstalledPackageSummary; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2848,28 +3265,60 @@ export const InstalledPackageSummary = { }, fromJSON(object: any): InstalledPackageSummary { - return { - installedPackageRef: isSet(object.installedPackageRef) - ? InstalledPackageReference.fromJSON(object.installedPackageRef) - : undefined, - name: isSet(object.name) ? String(object.name) : "", - pkgVersionReference: isSet(object.pkgVersionReference) - ? VersionReference.fromJSON(object.pkgVersionReference) - : undefined, - currentVersion: isSet(object.currentVersion) - ? PackageAppVersion.fromJSON(object.currentVersion) - : undefined, - iconUrl: isSet(object.iconUrl) ? String(object.iconUrl) : "", - pkgDisplayName: isSet(object.pkgDisplayName) ? String(object.pkgDisplayName) : "", - shortDescription: isSet(object.shortDescription) ? String(object.shortDescription) : "", - latestMatchingVersion: isSet(object.latestMatchingVersion) - ? PackageAppVersion.fromJSON(object.latestMatchingVersion) - : undefined, - latestVersion: isSet(object.latestVersion) - ? PackageAppVersion.fromJSON(object.latestVersion) - : undefined, - status: isSet(object.status) ? InstalledPackageStatus.fromJSON(object.status) : undefined, - }; + const message = { + ...baseInstalledPackageSummary, + } as InstalledPackageSummary; + if (object.installedPackageRef !== undefined && object.installedPackageRef !== null) { + message.installedPackageRef = InstalledPackageReference.fromJSON(object.installedPackageRef); + } else { + message.installedPackageRef = undefined; + } + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.pkgVersionReference !== undefined && object.pkgVersionReference !== null) { + message.pkgVersionReference = VersionReference.fromJSON(object.pkgVersionReference); + } else { + message.pkgVersionReference = undefined; + } + if (object.currentVersion !== undefined && object.currentVersion !== null) { + message.currentVersion = PackageAppVersion.fromJSON(object.currentVersion); + } else { + message.currentVersion = undefined; + } + if (object.iconUrl !== undefined && object.iconUrl !== null) { + message.iconUrl = String(object.iconUrl); + } else { + message.iconUrl = ""; + } + if (object.pkgDisplayName !== undefined && object.pkgDisplayName !== null) { + message.pkgDisplayName = String(object.pkgDisplayName); + } else { + message.pkgDisplayName = ""; + } + if (object.shortDescription !== undefined && object.shortDescription !== null) { + message.shortDescription = String(object.shortDescription); + } else { + message.shortDescription = ""; + } + if (object.latestMatchingVersion !== undefined && object.latestMatchingVersion !== null) { + message.latestMatchingVersion = PackageAppVersion.fromJSON(object.latestMatchingVersion); + } else { + message.latestMatchingVersion = undefined; + } + if (object.latestVersion !== undefined && object.latestVersion !== null) { + message.latestVersion = PackageAppVersion.fromJSON(object.latestVersion); + } else { + message.latestVersion = undefined; + } + if (object.status !== undefined && object.status !== null) { + message.status = InstalledPackageStatus.fromJSON(object.status); + } else { + message.status = undefined; + } + return message; }, toJSON(message: InstalledPackageSummary): unknown { @@ -2903,58 +3352,71 @@ export const InstalledPackageSummary = { return obj; }, - fromPartial, I>>( - object: I, - ): InstalledPackageSummary { - const message = createBaseInstalledPackageSummary(); - message.installedPackageRef = - object.installedPackageRef !== undefined && object.installedPackageRef !== null - ? InstalledPackageReference.fromPartial(object.installedPackageRef) - : undefined; - message.name = object.name ?? ""; - message.pkgVersionReference = - object.pkgVersionReference !== undefined && object.pkgVersionReference !== null - ? VersionReference.fromPartial(object.pkgVersionReference) - : undefined; - message.currentVersion = - object.currentVersion !== undefined && object.currentVersion !== null - ? PackageAppVersion.fromPartial(object.currentVersion) - : undefined; - message.iconUrl = object.iconUrl ?? ""; - message.pkgDisplayName = object.pkgDisplayName ?? ""; - message.shortDescription = object.shortDescription ?? ""; - message.latestMatchingVersion = - object.latestMatchingVersion !== undefined && object.latestMatchingVersion !== null - ? PackageAppVersion.fromPartial(object.latestMatchingVersion) - : undefined; - message.latestVersion = - object.latestVersion !== undefined && object.latestVersion !== null - ? PackageAppVersion.fromPartial(object.latestVersion) - : undefined; - message.status = - object.status !== undefined && object.status !== null - ? InstalledPackageStatus.fromPartial(object.status) - : undefined; + fromPartial(object: DeepPartial): InstalledPackageSummary { + const message = { + ...baseInstalledPackageSummary, + } as InstalledPackageSummary; + if (object.installedPackageRef !== undefined && object.installedPackageRef !== null) { + message.installedPackageRef = InstalledPackageReference.fromPartial( + object.installedPackageRef, + ); + } else { + message.installedPackageRef = undefined; + } + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.pkgVersionReference !== undefined && object.pkgVersionReference !== null) { + message.pkgVersionReference = VersionReference.fromPartial(object.pkgVersionReference); + } else { + message.pkgVersionReference = undefined; + } + if (object.currentVersion !== undefined && object.currentVersion !== null) { + message.currentVersion = PackageAppVersion.fromPartial(object.currentVersion); + } else { + message.currentVersion = undefined; + } + if (object.iconUrl !== undefined && object.iconUrl !== null) { + message.iconUrl = object.iconUrl; + } else { + message.iconUrl = ""; + } + if (object.pkgDisplayName !== undefined && object.pkgDisplayName !== null) { + message.pkgDisplayName = object.pkgDisplayName; + } else { + message.pkgDisplayName = ""; + } + if (object.shortDescription !== undefined && object.shortDescription !== null) { + message.shortDescription = object.shortDescription; + } else { + message.shortDescription = ""; + } + if (object.latestMatchingVersion !== undefined && object.latestMatchingVersion !== null) { + message.latestMatchingVersion = PackageAppVersion.fromPartial(object.latestMatchingVersion); + } else { + message.latestMatchingVersion = undefined; + } + if (object.latestVersion !== undefined && object.latestVersion !== null) { + message.latestVersion = PackageAppVersion.fromPartial(object.latestVersion); + } else { + message.latestVersion = undefined; + } + if (object.status !== undefined && object.status !== null) { + message.status = InstalledPackageStatus.fromPartial(object.status); + } else { + message.status = undefined; + } return message; }, }; -function createBaseInstalledPackageDetail(): InstalledPackageDetail { - return { - installedPackageRef: undefined, - pkgVersionReference: undefined, - name: "", - currentVersion: undefined, - valuesApplied: "", - reconciliationOptions: undefined, - status: undefined, - postInstallationNotes: "", - availablePackageRef: undefined, - latestMatchingVersion: undefined, - latestVersion: undefined, - customDetail: undefined, - }; -} +const baseInstalledPackageDetail: object = { + name: "", + valuesApplied: "", + postInstallationNotes: "", +}; export const InstalledPackageDetail = { encode(message: InstalledPackageDetail, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -3009,7 +3471,7 @@ export const InstalledPackageDetail = { decode(input: _m0.Reader | Uint8Array, length?: number): InstalledPackageDetail { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseInstalledPackageDetail(); + const message = { ...baseInstalledPackageDetail } as InstalledPackageDetail; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -3058,36 +3520,68 @@ export const InstalledPackageDetail = { }, fromJSON(object: any): InstalledPackageDetail { - return { - installedPackageRef: isSet(object.installedPackageRef) - ? InstalledPackageReference.fromJSON(object.installedPackageRef) - : undefined, - pkgVersionReference: isSet(object.pkgVersionReference) - ? VersionReference.fromJSON(object.pkgVersionReference) - : undefined, - name: isSet(object.name) ? String(object.name) : "", - currentVersion: isSet(object.currentVersion) - ? PackageAppVersion.fromJSON(object.currentVersion) - : undefined, - valuesApplied: isSet(object.valuesApplied) ? String(object.valuesApplied) : "", - reconciliationOptions: isSet(object.reconciliationOptions) - ? ReconciliationOptions.fromJSON(object.reconciliationOptions) - : undefined, - status: isSet(object.status) ? InstalledPackageStatus.fromJSON(object.status) : undefined, - postInstallationNotes: isSet(object.postInstallationNotes) - ? String(object.postInstallationNotes) - : "", - availablePackageRef: isSet(object.availablePackageRef) - ? AvailablePackageReference.fromJSON(object.availablePackageRef) - : undefined, - latestMatchingVersion: isSet(object.latestMatchingVersion) - ? PackageAppVersion.fromJSON(object.latestMatchingVersion) - : undefined, - latestVersion: isSet(object.latestVersion) - ? PackageAppVersion.fromJSON(object.latestVersion) - : undefined, - customDetail: isSet(object.customDetail) ? Any.fromJSON(object.customDetail) : undefined, - }; + const message = { ...baseInstalledPackageDetail } as InstalledPackageDetail; + if (object.installedPackageRef !== undefined && object.installedPackageRef !== null) { + message.installedPackageRef = InstalledPackageReference.fromJSON(object.installedPackageRef); + } else { + message.installedPackageRef = undefined; + } + if (object.pkgVersionReference !== undefined && object.pkgVersionReference !== null) { + message.pkgVersionReference = VersionReference.fromJSON(object.pkgVersionReference); + } else { + message.pkgVersionReference = undefined; + } + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.currentVersion !== undefined && object.currentVersion !== null) { + message.currentVersion = PackageAppVersion.fromJSON(object.currentVersion); + } else { + message.currentVersion = undefined; + } + if (object.valuesApplied !== undefined && object.valuesApplied !== null) { + message.valuesApplied = String(object.valuesApplied); + } else { + message.valuesApplied = ""; + } + if (object.reconciliationOptions !== undefined && object.reconciliationOptions !== null) { + message.reconciliationOptions = ReconciliationOptions.fromJSON(object.reconciliationOptions); + } else { + message.reconciliationOptions = undefined; + } + if (object.status !== undefined && object.status !== null) { + message.status = InstalledPackageStatus.fromJSON(object.status); + } else { + message.status = undefined; + } + if (object.postInstallationNotes !== undefined && object.postInstallationNotes !== null) { + message.postInstallationNotes = String(object.postInstallationNotes); + } else { + message.postInstallationNotes = ""; + } + if (object.availablePackageRef !== undefined && object.availablePackageRef !== null) { + message.availablePackageRef = AvailablePackageReference.fromJSON(object.availablePackageRef); + } else { + message.availablePackageRef = undefined; + } + if (object.latestMatchingVersion !== undefined && object.latestMatchingVersion !== null) { + message.latestMatchingVersion = PackageAppVersion.fromJSON(object.latestMatchingVersion); + } else { + message.latestMatchingVersion = undefined; + } + if (object.latestVersion !== undefined && object.latestVersion !== null) { + message.latestVersion = PackageAppVersion.fromJSON(object.latestVersion); + } else { + message.latestVersion = undefined; + } + if (object.customDetail !== undefined && object.customDetail !== null) { + message.customDetail = Any.fromJSON(object.customDetail); + } else { + message.customDetail = undefined; + } + return message; }, toJSON(message: InstalledPackageDetail): unknown { @@ -3131,56 +3625,79 @@ export const InstalledPackageDetail = { return obj; }, - fromPartial, I>>( - object: I, - ): InstalledPackageDetail { - const message = createBaseInstalledPackageDetail(); - message.installedPackageRef = - object.installedPackageRef !== undefined && object.installedPackageRef !== null - ? InstalledPackageReference.fromPartial(object.installedPackageRef) - : undefined; - message.pkgVersionReference = - object.pkgVersionReference !== undefined && object.pkgVersionReference !== null - ? VersionReference.fromPartial(object.pkgVersionReference) - : undefined; - message.name = object.name ?? ""; - message.currentVersion = - object.currentVersion !== undefined && object.currentVersion !== null - ? PackageAppVersion.fromPartial(object.currentVersion) - : undefined; - message.valuesApplied = object.valuesApplied ?? ""; - message.reconciliationOptions = - object.reconciliationOptions !== undefined && object.reconciliationOptions !== null - ? ReconciliationOptions.fromPartial(object.reconciliationOptions) - : undefined; - message.status = - object.status !== undefined && object.status !== null - ? InstalledPackageStatus.fromPartial(object.status) - : undefined; - message.postInstallationNotes = object.postInstallationNotes ?? ""; - message.availablePackageRef = - object.availablePackageRef !== undefined && object.availablePackageRef !== null - ? AvailablePackageReference.fromPartial(object.availablePackageRef) - : undefined; - message.latestMatchingVersion = - object.latestMatchingVersion !== undefined && object.latestMatchingVersion !== null - ? PackageAppVersion.fromPartial(object.latestMatchingVersion) - : undefined; - message.latestVersion = - object.latestVersion !== undefined && object.latestVersion !== null - ? PackageAppVersion.fromPartial(object.latestVersion) - : undefined; - message.customDetail = - object.customDetail !== undefined && object.customDetail !== null - ? Any.fromPartial(object.customDetail) - : undefined; + fromPartial(object: DeepPartial): InstalledPackageDetail { + const message = { ...baseInstalledPackageDetail } as InstalledPackageDetail; + if (object.installedPackageRef !== undefined && object.installedPackageRef !== null) { + message.installedPackageRef = InstalledPackageReference.fromPartial( + object.installedPackageRef, + ); + } else { + message.installedPackageRef = undefined; + } + if (object.pkgVersionReference !== undefined && object.pkgVersionReference !== null) { + message.pkgVersionReference = VersionReference.fromPartial(object.pkgVersionReference); + } else { + message.pkgVersionReference = undefined; + } + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.currentVersion !== undefined && object.currentVersion !== null) { + message.currentVersion = PackageAppVersion.fromPartial(object.currentVersion); + } else { + message.currentVersion = undefined; + } + if (object.valuesApplied !== undefined && object.valuesApplied !== null) { + message.valuesApplied = object.valuesApplied; + } else { + message.valuesApplied = ""; + } + if (object.reconciliationOptions !== undefined && object.reconciliationOptions !== null) { + message.reconciliationOptions = ReconciliationOptions.fromPartial( + object.reconciliationOptions, + ); + } else { + message.reconciliationOptions = undefined; + } + if (object.status !== undefined && object.status !== null) { + message.status = InstalledPackageStatus.fromPartial(object.status); + } else { + message.status = undefined; + } + if (object.postInstallationNotes !== undefined && object.postInstallationNotes !== null) { + message.postInstallationNotes = object.postInstallationNotes; + } else { + message.postInstallationNotes = ""; + } + if (object.availablePackageRef !== undefined && object.availablePackageRef !== null) { + message.availablePackageRef = AvailablePackageReference.fromPartial( + object.availablePackageRef, + ); + } else { + message.availablePackageRef = undefined; + } + if (object.latestMatchingVersion !== undefined && object.latestMatchingVersion !== null) { + message.latestMatchingVersion = PackageAppVersion.fromPartial(object.latestMatchingVersion); + } else { + message.latestMatchingVersion = undefined; + } + if (object.latestVersion !== undefined && object.latestVersion !== null) { + message.latestVersion = PackageAppVersion.fromPartial(object.latestVersion); + } else { + message.latestVersion = undefined; + } + if (object.customDetail !== undefined && object.customDetail !== null) { + message.customDetail = Any.fromPartial(object.customDetail); + } else { + message.customDetail = undefined; + } return message; }, }; -function createBaseContext(): Context { - return { cluster: "", namespace: "" }; -} +const baseContext: object = { cluster: "", namespace: "" }; export const Context = { encode(message: Context, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -3196,7 +3713,7 @@ export const Context = { decode(input: _m0.Reader | Uint8Array, length?: number): Context { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseContext(); + const message = { ...baseContext } as Context; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -3215,10 +3732,18 @@ export const Context = { }, fromJSON(object: any): Context { - return { - cluster: isSet(object.cluster) ? String(object.cluster) : "", - namespace: isSet(object.namespace) ? String(object.namespace) : "", - }; + const message = { ...baseContext } as Context; + if (object.cluster !== undefined && object.cluster !== null) { + message.cluster = String(object.cluster); + } else { + message.cluster = ""; + } + if (object.namespace !== undefined && object.namespace !== null) { + message.namespace = String(object.namespace); + } else { + message.namespace = ""; + } + return message; }, toJSON(message: Context): unknown { @@ -3228,17 +3753,23 @@ export const Context = { return obj; }, - fromPartial, I>>(object: I): Context { - const message = createBaseContext(); - message.cluster = object.cluster ?? ""; - message.namespace = object.namespace ?? ""; + fromPartial(object: DeepPartial): Context { + const message = { ...baseContext } as Context; + if (object.cluster !== undefined && object.cluster !== null) { + message.cluster = object.cluster; + } else { + message.cluster = ""; + } + if (object.namespace !== undefined && object.namespace !== null) { + message.namespace = object.namespace; + } else { + message.namespace = ""; + } return message; }, }; -function createBaseAvailablePackageReference(): AvailablePackageReference { - return { context: undefined, identifier: "", plugin: undefined }; -} +const baseAvailablePackageReference: object = { identifier: "" }; export const AvailablePackageReference = { encode(message: AvailablePackageReference, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -3257,7 +3788,9 @@ export const AvailablePackageReference = { decode(input: _m0.Reader | Uint8Array, length?: number): AvailablePackageReference { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseAvailablePackageReference(); + const message = { + ...baseAvailablePackageReference, + } as AvailablePackageReference; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -3279,11 +3812,25 @@ export const AvailablePackageReference = { }, fromJSON(object: any): AvailablePackageReference { - return { - context: isSet(object.context) ? Context.fromJSON(object.context) : undefined, - identifier: isSet(object.identifier) ? String(object.identifier) : "", - plugin: isSet(object.plugin) ? Plugin.fromJSON(object.plugin) : undefined, - }; + const message = { + ...baseAvailablePackageReference, + } as AvailablePackageReference; + if (object.context !== undefined && object.context !== null) { + message.context = Context.fromJSON(object.context); + } else { + message.context = undefined; + } + if (object.identifier !== undefined && object.identifier !== null) { + message.identifier = String(object.identifier); + } else { + message.identifier = ""; + } + if (object.plugin !== undefined && object.plugin !== null) { + message.plugin = Plugin.fromJSON(object.plugin); + } else { + message.plugin = undefined; + } + return message; }, toJSON(message: AvailablePackageReference): unknown { @@ -3296,26 +3843,30 @@ export const AvailablePackageReference = { return obj; }, - fromPartial, I>>( - object: I, - ): AvailablePackageReference { - const message = createBaseAvailablePackageReference(); - message.context = - object.context !== undefined && object.context !== null - ? Context.fromPartial(object.context) - : undefined; - message.identifier = object.identifier ?? ""; - message.plugin = - object.plugin !== undefined && object.plugin !== null - ? Plugin.fromPartial(object.plugin) - : undefined; + fromPartial(object: DeepPartial): AvailablePackageReference { + const message = { + ...baseAvailablePackageReference, + } as AvailablePackageReference; + if (object.context !== undefined && object.context !== null) { + message.context = Context.fromPartial(object.context); + } else { + message.context = undefined; + } + if (object.identifier !== undefined && object.identifier !== null) { + message.identifier = object.identifier; + } else { + message.identifier = ""; + } + if (object.plugin !== undefined && object.plugin !== null) { + message.plugin = Plugin.fromPartial(object.plugin); + } else { + message.plugin = undefined; + } return message; }, }; -function createBaseMaintainer(): Maintainer { - return { name: "", email: "" }; -} +const baseMaintainer: object = { name: "", email: "" }; export const Maintainer = { encode(message: Maintainer, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -3331,7 +3882,7 @@ export const Maintainer = { decode(input: _m0.Reader | Uint8Array, length?: number): Maintainer { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMaintainer(); + const message = { ...baseMaintainer } as Maintainer; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -3350,10 +3901,18 @@ export const Maintainer = { }, fromJSON(object: any): Maintainer { - return { - name: isSet(object.name) ? String(object.name) : "", - email: isSet(object.email) ? String(object.email) : "", - }; + const message = { ...baseMaintainer } as Maintainer; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.email !== undefined && object.email !== null) { + message.email = String(object.email); + } else { + message.email = ""; + } + return message; }, toJSON(message: Maintainer): unknown { @@ -3363,23 +3922,29 @@ export const Maintainer = { return obj; }, - fromPartial, I>>(object: I): Maintainer { - const message = createBaseMaintainer(); - message.name = object.name ?? ""; - message.email = object.email ?? ""; + fromPartial(object: DeepPartial): Maintainer { + const message = { ...baseMaintainer } as Maintainer; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.email !== undefined && object.email !== null) { + message.email = object.email; + } else { + message.email = ""; + } return message; }, }; -function createBaseFilterOptions(): FilterOptions { - return { - query: "", - categories: [], - repositories: [], - pkgVersion: "", - appVersion: "", - }; -} +const baseFilterOptions: object = { + query: "", + categories: "", + repositories: "", + pkgVersion: "", + appVersion: "", +}; export const FilterOptions = { encode(message: FilterOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -3404,7 +3969,9 @@ export const FilterOptions = { decode(input: _m0.Reader | Uint8Array, length?: number): FilterOptions { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseFilterOptions(); + const message = { ...baseFilterOptions } as FilterOptions; + message.categories = []; + message.repositories = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -3432,17 +3999,35 @@ export const FilterOptions = { }, fromJSON(object: any): FilterOptions { - return { - query: isSet(object.query) ? String(object.query) : "", - categories: Array.isArray(object?.categories) - ? object.categories.map((e: any) => String(e)) - : [], - repositories: Array.isArray(object?.repositories) - ? object.repositories.map((e: any) => String(e)) - : [], - pkgVersion: isSet(object.pkgVersion) ? String(object.pkgVersion) : "", - appVersion: isSet(object.appVersion) ? String(object.appVersion) : "", - }; + const message = { ...baseFilterOptions } as FilterOptions; + message.categories = []; + message.repositories = []; + if (object.query !== undefined && object.query !== null) { + message.query = String(object.query); + } else { + message.query = ""; + } + if (object.categories !== undefined && object.categories !== null) { + for (const e of object.categories) { + message.categories.push(String(e)); + } + } + if (object.repositories !== undefined && object.repositories !== null) { + for (const e of object.repositories) { + message.repositories.push(String(e)); + } + } + if (object.pkgVersion !== undefined && object.pkgVersion !== null) { + message.pkgVersion = String(object.pkgVersion); + } else { + message.pkgVersion = ""; + } + if (object.appVersion !== undefined && object.appVersion !== null) { + message.appVersion = String(object.appVersion); + } else { + message.appVersion = ""; + } + return message; }, toJSON(message: FilterOptions): unknown { @@ -3463,20 +4048,40 @@ export const FilterOptions = { return obj; }, - fromPartial, I>>(object: I): FilterOptions { - const message = createBaseFilterOptions(); - message.query = object.query ?? ""; - message.categories = object.categories?.map(e => e) || []; - message.repositories = object.repositories?.map(e => e) || []; - message.pkgVersion = object.pkgVersion ?? ""; - message.appVersion = object.appVersion ?? ""; + fromPartial(object: DeepPartial): FilterOptions { + const message = { ...baseFilterOptions } as FilterOptions; + message.categories = []; + message.repositories = []; + if (object.query !== undefined && object.query !== null) { + message.query = object.query; + } else { + message.query = ""; + } + if (object.categories !== undefined && object.categories !== null) { + for (const e of object.categories) { + message.categories.push(e); + } + } + if (object.repositories !== undefined && object.repositories !== null) { + for (const e of object.repositories) { + message.repositories.push(e); + } + } + if (object.pkgVersion !== undefined && object.pkgVersion !== null) { + message.pkgVersion = object.pkgVersion; + } else { + message.pkgVersion = ""; + } + if (object.appVersion !== undefined && object.appVersion !== null) { + message.appVersion = object.appVersion; + } else { + message.appVersion = ""; + } return message; }, }; -function createBasePaginationOptions(): PaginationOptions { - return { pageToken: "", pageSize: 0 }; -} +const basePaginationOptions: object = { pageToken: "", pageSize: 0 }; export const PaginationOptions = { encode(message: PaginationOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -3492,7 +4097,7 @@ export const PaginationOptions = { decode(input: _m0.Reader | Uint8Array, length?: number): PaginationOptions { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBasePaginationOptions(); + const message = { ...basePaginationOptions } as PaginationOptions; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -3511,30 +4116,44 @@ export const PaginationOptions = { }, fromJSON(object: any): PaginationOptions { - return { - pageToken: isSet(object.pageToken) ? String(object.pageToken) : "", - pageSize: isSet(object.pageSize) ? Number(object.pageSize) : 0, - }; + const message = { ...basePaginationOptions } as PaginationOptions; + if (object.pageToken !== undefined && object.pageToken !== null) { + message.pageToken = String(object.pageToken); + } else { + message.pageToken = ""; + } + if (object.pageSize !== undefined && object.pageSize !== null) { + message.pageSize = Number(object.pageSize); + } else { + message.pageSize = 0; + } + return message; }, toJSON(message: PaginationOptions): unknown { const obj: any = {}; message.pageToken !== undefined && (obj.pageToken = message.pageToken); - message.pageSize !== undefined && (obj.pageSize = Math.round(message.pageSize)); + message.pageSize !== undefined && (obj.pageSize = message.pageSize); return obj; }, - fromPartial, I>>(object: I): PaginationOptions { - const message = createBasePaginationOptions(); - message.pageToken = object.pageToken ?? ""; - message.pageSize = object.pageSize ?? 0; + fromPartial(object: DeepPartial): PaginationOptions { + const message = { ...basePaginationOptions } as PaginationOptions; + if (object.pageToken !== undefined && object.pageToken !== null) { + message.pageToken = object.pageToken; + } else { + message.pageToken = ""; + } + if (object.pageSize !== undefined && object.pageSize !== null) { + message.pageSize = object.pageSize; + } else { + message.pageSize = 0; + } return message; }, }; -function createBaseInstalledPackageReference(): InstalledPackageReference { - return { context: undefined, identifier: "", plugin: undefined }; -} +const baseInstalledPackageReference: object = { identifier: "" }; export const InstalledPackageReference = { encode(message: InstalledPackageReference, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -3553,7 +4172,9 @@ export const InstalledPackageReference = { decode(input: _m0.Reader | Uint8Array, length?: number): InstalledPackageReference { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseInstalledPackageReference(); + const message = { + ...baseInstalledPackageReference, + } as InstalledPackageReference; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -3575,11 +4196,25 @@ export const InstalledPackageReference = { }, fromJSON(object: any): InstalledPackageReference { - return { - context: isSet(object.context) ? Context.fromJSON(object.context) : undefined, - identifier: isSet(object.identifier) ? String(object.identifier) : "", - plugin: isSet(object.plugin) ? Plugin.fromJSON(object.plugin) : undefined, - }; + const message = { + ...baseInstalledPackageReference, + } as InstalledPackageReference; + if (object.context !== undefined && object.context !== null) { + message.context = Context.fromJSON(object.context); + } else { + message.context = undefined; + } + if (object.identifier !== undefined && object.identifier !== null) { + message.identifier = String(object.identifier); + } else { + message.identifier = ""; + } + if (object.plugin !== undefined && object.plugin !== null) { + message.plugin = Plugin.fromJSON(object.plugin); + } else { + message.plugin = undefined; + } + return message; }, toJSON(message: InstalledPackageReference): unknown { @@ -3592,26 +4227,30 @@ export const InstalledPackageReference = { return obj; }, - fromPartial, I>>( - object: I, - ): InstalledPackageReference { - const message = createBaseInstalledPackageReference(); - message.context = - object.context !== undefined && object.context !== null - ? Context.fromPartial(object.context) - : undefined; - message.identifier = object.identifier ?? ""; - message.plugin = - object.plugin !== undefined && object.plugin !== null - ? Plugin.fromPartial(object.plugin) - : undefined; + fromPartial(object: DeepPartial): InstalledPackageReference { + const message = { + ...baseInstalledPackageReference, + } as InstalledPackageReference; + if (object.context !== undefined && object.context !== null) { + message.context = Context.fromPartial(object.context); + } else { + message.context = undefined; + } + if (object.identifier !== undefined && object.identifier !== null) { + message.identifier = object.identifier; + } else { + message.identifier = ""; + } + if (object.plugin !== undefined && object.plugin !== null) { + message.plugin = Plugin.fromPartial(object.plugin); + } else { + message.plugin = undefined; + } return message; }, }; -function createBaseVersionReference(): VersionReference { - return { version: "" }; -} +const baseVersionReference: object = { version: "" }; export const VersionReference = { encode(message: VersionReference, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -3624,7 +4263,7 @@ export const VersionReference = { decode(input: _m0.Reader | Uint8Array, length?: number): VersionReference { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseVersionReference(); + const message = { ...baseVersionReference } as VersionReference; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -3640,9 +4279,13 @@ export const VersionReference = { }, fromJSON(object: any): VersionReference { - return { - version: isSet(object.version) ? String(object.version) : "", - }; + const message = { ...baseVersionReference } as VersionReference; + if (object.version !== undefined && object.version !== null) { + message.version = String(object.version); + } else { + message.version = ""; + } + return message; }, toJSON(message: VersionReference): unknown { @@ -3651,16 +4294,22 @@ export const VersionReference = { return obj; }, - fromPartial, I>>(object: I): VersionReference { - const message = createBaseVersionReference(); - message.version = object.version ?? ""; + fromPartial(object: DeepPartial): VersionReference { + const message = { ...baseVersionReference } as VersionReference; + if (object.version !== undefined && object.version !== null) { + message.version = object.version; + } else { + message.version = ""; + } return message; }, }; -function createBaseInstalledPackageStatus(): InstalledPackageStatus { - return { ready: false, reason: 0, userReason: "" }; -} +const baseInstalledPackageStatus: object = { + ready: false, + reason: 0, + userReason: "", +}; export const InstalledPackageStatus = { encode(message: InstalledPackageStatus, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -3679,7 +4328,7 @@ export const InstalledPackageStatus = { decode(input: _m0.Reader | Uint8Array, length?: number): InstalledPackageStatus { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseInstalledPackageStatus(); + const message = { ...baseInstalledPackageStatus } as InstalledPackageStatus; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -3701,11 +4350,23 @@ export const InstalledPackageStatus = { }, fromJSON(object: any): InstalledPackageStatus { - return { - ready: isSet(object.ready) ? Boolean(object.ready) : false, - reason: isSet(object.reason) ? installedPackageStatus_StatusReasonFromJSON(object.reason) : 0, - userReason: isSet(object.userReason) ? String(object.userReason) : "", - }; + const message = { ...baseInstalledPackageStatus } as InstalledPackageStatus; + if (object.ready !== undefined && object.ready !== null) { + message.ready = Boolean(object.ready); + } else { + message.ready = false; + } + if (object.reason !== undefined && object.reason !== null) { + message.reason = installedPackageStatus_StatusReasonFromJSON(object.reason); + } else { + message.reason = 0; + } + if (object.userReason !== undefined && object.userReason !== null) { + message.userReason = String(object.userReason); + } else { + message.userReason = ""; + } + return message; }, toJSON(message: InstalledPackageStatus): unknown { @@ -3717,20 +4378,32 @@ export const InstalledPackageStatus = { return obj; }, - fromPartial, I>>( - object: I, - ): InstalledPackageStatus { - const message = createBaseInstalledPackageStatus(); - message.ready = object.ready ?? false; - message.reason = object.reason ?? 0; - message.userReason = object.userReason ?? ""; + fromPartial(object: DeepPartial): InstalledPackageStatus { + const message = { ...baseInstalledPackageStatus } as InstalledPackageStatus; + if (object.ready !== undefined && object.ready !== null) { + message.ready = object.ready; + } else { + message.ready = false; + } + if (object.reason !== undefined && object.reason !== null) { + message.reason = object.reason; + } else { + message.reason = 0; + } + if (object.userReason !== undefined && object.userReason !== null) { + message.userReason = object.userReason; + } else { + message.userReason = ""; + } return message; }, }; -function createBaseReconciliationOptions(): ReconciliationOptions { - return { interval: 0, suspend: false, serviceAccountName: "" }; -} +const baseReconciliationOptions: object = { + interval: 0, + suspend: false, + serviceAccountName: "", +}; export const ReconciliationOptions = { encode(message: ReconciliationOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -3749,7 +4422,7 @@ export const ReconciliationOptions = { decode(input: _m0.Reader | Uint8Array, length?: number): ReconciliationOptions { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseReconciliationOptions(); + const message = { ...baseReconciliationOptions } as ReconciliationOptions; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -3771,36 +4444,56 @@ export const ReconciliationOptions = { }, fromJSON(object: any): ReconciliationOptions { - return { - interval: isSet(object.interval) ? Number(object.interval) : 0, - suspend: isSet(object.suspend) ? Boolean(object.suspend) : false, - serviceAccountName: isSet(object.serviceAccountName) ? String(object.serviceAccountName) : "", - }; + const message = { ...baseReconciliationOptions } as ReconciliationOptions; + if (object.interval !== undefined && object.interval !== null) { + message.interval = Number(object.interval); + } else { + message.interval = 0; + } + if (object.suspend !== undefined && object.suspend !== null) { + message.suspend = Boolean(object.suspend); + } else { + message.suspend = false; + } + if (object.serviceAccountName !== undefined && object.serviceAccountName !== null) { + message.serviceAccountName = String(object.serviceAccountName); + } else { + message.serviceAccountName = ""; + } + return message; }, toJSON(message: ReconciliationOptions): unknown { const obj: any = {}; - message.interval !== undefined && (obj.interval = Math.round(message.interval)); + message.interval !== undefined && (obj.interval = message.interval); message.suspend !== undefined && (obj.suspend = message.suspend); message.serviceAccountName !== undefined && (obj.serviceAccountName = message.serviceAccountName); return obj; }, - fromPartial, I>>( - object: I, - ): ReconciliationOptions { - const message = createBaseReconciliationOptions(); - message.interval = object.interval ?? 0; - message.suspend = object.suspend ?? false; - message.serviceAccountName = object.serviceAccountName ?? ""; + fromPartial(object: DeepPartial): ReconciliationOptions { + const message = { ...baseReconciliationOptions } as ReconciliationOptions; + if (object.interval !== undefined && object.interval !== null) { + message.interval = object.interval; + } else { + message.interval = 0; + } + if (object.suspend !== undefined && object.suspend !== null) { + message.suspend = object.suspend; + } else { + message.suspend = false; + } + if (object.serviceAccountName !== undefined && object.serviceAccountName !== null) { + message.serviceAccountName = object.serviceAccountName; + } else { + message.serviceAccountName = ""; + } return message; }, }; -function createBasePackageAppVersion(): PackageAppVersion { - return { pkgVersion: "", appVersion: "" }; -} +const basePackageAppVersion: object = { pkgVersion: "", appVersion: "" }; export const PackageAppVersion = { encode(message: PackageAppVersion, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -3816,7 +4509,7 @@ export const PackageAppVersion = { decode(input: _m0.Reader | Uint8Array, length?: number): PackageAppVersion { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBasePackageAppVersion(); + const message = { ...basePackageAppVersion } as PackageAppVersion; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -3835,10 +4528,18 @@ export const PackageAppVersion = { }, fromJSON(object: any): PackageAppVersion { - return { - pkgVersion: isSet(object.pkgVersion) ? String(object.pkgVersion) : "", - appVersion: isSet(object.appVersion) ? String(object.appVersion) : "", - }; + const message = { ...basePackageAppVersion } as PackageAppVersion; + if (object.pkgVersion !== undefined && object.pkgVersion !== null) { + message.pkgVersion = String(object.pkgVersion); + } else { + message.pkgVersion = ""; + } + if (object.appVersion !== undefined && object.appVersion !== null) { + message.appVersion = String(object.appVersion); + } else { + message.appVersion = ""; + } + return message; }, toJSON(message: PackageAppVersion): unknown { @@ -3848,17 +4549,28 @@ export const PackageAppVersion = { return obj; }, - fromPartial, I>>(object: I): PackageAppVersion { - const message = createBasePackageAppVersion(); - message.pkgVersion = object.pkgVersion ?? ""; - message.appVersion = object.appVersion ?? ""; + fromPartial(object: DeepPartial): PackageAppVersion { + const message = { ...basePackageAppVersion } as PackageAppVersion; + if (object.pkgVersion !== undefined && object.pkgVersion !== null) { + message.pkgVersion = object.pkgVersion; + } else { + message.pkgVersion = ""; + } + if (object.appVersion !== undefined && object.appVersion !== null) { + message.appVersion = object.appVersion; + } else { + message.appVersion = ""; + } return message; }, }; -function createBaseResourceRef(): ResourceRef { - return { apiVersion: "", kind: "", name: "", namespace: "" }; -} +const baseResourceRef: object = { + apiVersion: "", + kind: "", + name: "", + namespace: "", +}; export const ResourceRef = { encode(message: ResourceRef, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -3880,7 +4592,7 @@ export const ResourceRef = { decode(input: _m0.Reader | Uint8Array, length?: number): ResourceRef { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseResourceRef(); + const message = { ...baseResourceRef } as ResourceRef; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -3905,12 +4617,28 @@ export const ResourceRef = { }, fromJSON(object: any): ResourceRef { - return { - apiVersion: isSet(object.apiVersion) ? String(object.apiVersion) : "", - kind: isSet(object.kind) ? String(object.kind) : "", - name: isSet(object.name) ? String(object.name) : "", - namespace: isSet(object.namespace) ? String(object.namespace) : "", - }; + const message = { ...baseResourceRef } as ResourceRef; + if (object.apiVersion !== undefined && object.apiVersion !== null) { + message.apiVersion = String(object.apiVersion); + } else { + message.apiVersion = ""; + } + if (object.kind !== undefined && object.kind !== null) { + message.kind = String(object.kind); + } else { + message.kind = ""; + } + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.namespace !== undefined && object.namespace !== null) { + message.namespace = String(object.namespace); + } else { + message.namespace = ""; + } + return message; }, toJSON(message: ResourceRef): unknown { @@ -3922,12 +4650,28 @@ export const ResourceRef = { return obj; }, - fromPartial, I>>(object: I): ResourceRef { - const message = createBaseResourceRef(); - message.apiVersion = object.apiVersion ?? ""; - message.kind = object.kind ?? ""; - message.name = object.name ?? ""; - message.namespace = object.namespace ?? ""; + fromPartial(object: DeepPartial): ResourceRef { + const message = { ...baseResourceRef } as ResourceRef; + if (object.apiVersion !== undefined && object.apiVersion !== null) { + message.apiVersion = object.apiVersion; + } else { + message.apiVersion = ""; + } + if (object.kind !== undefined && object.kind !== null) { + message.kind = object.kind; + } else { + message.kind = ""; + } + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.namespace !== undefined && object.namespace !== null) { + message.namespace = object.namespace; + } else { + message.namespace = ""; + } return message; }, }; @@ -4363,7 +5107,6 @@ export class GrpcWebImpl { } type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - export type DeepPartial = T extends Builtin ? T : T extends Array @@ -4374,16 +5117,7 @@ export type DeepPartial = T extends Builtin ? { [K in keyof T]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & Record>, never>; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); } - -function isSet(value: any): boolean { - return value !== null && value !== undefined; -} diff --git a/dashboard/src/gen/kubeappsapis/core/packages/v1alpha1/repositories.ts b/dashboard/src/gen/kubeappsapis/core/packages/v1alpha1/repositories.ts index e1374057d43..8435b307489 100644 --- a/dashboard/src/gen/kubeappsapis/core/packages/v1alpha1/repositories.ts +++ b/dashboard/src/gen/kubeappsapis/core/packages/v1alpha1/repositories.ts @@ -250,6 +250,15 @@ export interface SecretKeyReference { key: string; } +/** + * GetPackageRepositoryDetailRequest + * + * Request for GetPackageRepositoryDetail + */ +export interface GetPackageRepositoryDetailRequest { + packageRepoRef?: PackageRepositoryReference; +} + /** * PackageRepositoryReference * @@ -287,22 +296,146 @@ export interface AddPackageRepositoryResponse { packageRepoRef?: PackageRepositoryReference; } -function createBaseAddPackageRepositoryRequest(): AddPackageRepositoryRequest { - return { - context: undefined, - name: "", - description: "", - namespaceScoped: false, - type: "", - url: "", - interval: 0, - tlsConfig: undefined, - auth: undefined, - plugin: undefined, - customDetail: undefined, - }; +/** + * PackageRepositoryStatus + * + * A PackageRepositoryStatus reports on the current status of the repository. + */ +export interface PackageRepositoryStatus { + /** + * Ready + * + * An indication of whether the repository is ready or not + */ + ready: boolean; + /** + * Reason + * + * An enum indicating the reason for the current status. + */ + reason: PackageRepositoryStatus_StatusReason; + /** + * UserReason + * + * Optional text to return for user context, which may be plugin specific. + */ + userReason: string; +} + +/** + * StatusReason + * + * Generic reasons why a package repository may be ready or not. + * These should make sense across different packaging plugins. + */ +export enum PackageRepositoryStatus_StatusReason { + STATUS_REASON_UNSPECIFIED = 0, + STATUS_REASON_SUCCESS = 1, + STATUS_REASON_FAILED = 2, + STATUS_REASON_PENDING = 3, + UNRECOGNIZED = -1, +} + +export function packageRepositoryStatus_StatusReasonFromJSON( + object: any, +): PackageRepositoryStatus_StatusReason { + switch (object) { + case 0: + case "STATUS_REASON_UNSPECIFIED": + return PackageRepositoryStatus_StatusReason.STATUS_REASON_UNSPECIFIED; + case 1: + case "STATUS_REASON_SUCCESS": + return PackageRepositoryStatus_StatusReason.STATUS_REASON_SUCCESS; + case 2: + case "STATUS_REASON_FAILED": + return PackageRepositoryStatus_StatusReason.STATUS_REASON_FAILED; + case 3: + case "STATUS_REASON_PENDING": + return PackageRepositoryStatus_StatusReason.STATUS_REASON_PENDING; + case -1: + case "UNRECOGNIZED": + default: + return PackageRepositoryStatus_StatusReason.UNRECOGNIZED; + } +} + +export function packageRepositoryStatus_StatusReasonToJSON( + object: PackageRepositoryStatus_StatusReason, +): string { + switch (object) { + case PackageRepositoryStatus_StatusReason.STATUS_REASON_UNSPECIFIED: + return "STATUS_REASON_UNSPECIFIED"; + case PackageRepositoryStatus_StatusReason.STATUS_REASON_SUCCESS: + return "STATUS_REASON_SUCCESS"; + case PackageRepositoryStatus_StatusReason.STATUS_REASON_FAILED: + return "STATUS_REASON_FAILED"; + case PackageRepositoryStatus_StatusReason.STATUS_REASON_PENDING: + return "STATUS_REASON_PENDING"; + default: + return "UNKNOWN"; + } +} + +/** PackageRepositoryDetail */ +export interface PackageRepositoryDetail { + /** A reference uniquely identifying the package repository. */ + packageRepoRef?: PackageRepositoryReference; + /** A user-provided name for the package repository (e.g. bitnami) */ + name: string; + /** A user-provided description. */ + description: string; + /** Whether this repository is global or namespace-scoped. */ + namespaceScoped: boolean; + /** Package storage type */ + type: string; + /** A URL identifying the package repository location. */ + url: string; + /** The interval at which to check the upstream for updates (in seconds) */ + interval: number; + /** + * TLS-specific parameters for connecting to a repository. + * If the cert authority was configured for this repository, then in the context + * of GetPackageRepositoryDetail() operation, the PackageRepositoryTlsConfig will ALWAYS + * contain an existing SecretKeyReference, rather that cert_authority field + */ + tlsConfig?: PackageRepositoryTlsConfig; + /** + * authentication parameters for connecting to a repository. + * If Basic Auth or TLS or Docker Creds Auth was configured for this repository, + * then in the context of GetPackageRepositoryDetail() operation, the + * PackageRepositoryAuth will ALWAYS contain an existing SecretKeyReference, + * rather that string values that may have been used when package repository was created + * field + */ + auth?: PackageRepositoryAuth; + /** Custom data added by the plugin */ + customDetail?: Any; + /** + * current status of the repository which can include reconciliation + * status, where relevant. + */ + status?: PackageRepositoryStatus; +} + +/** + * GetPackageRepositoryDetailResponse + * + * Response for GetPackageRepositoryDetail + */ +export interface GetPackageRepositoryDetailResponse { + /** package repository detail */ + detail?: PackageRepositoryDetail; } +const baseAddPackageRepositoryRequest: object = { + name: "", + description: "", + namespaceScoped: false, + type: "", + url: "", + interval: 0, +}; + export const AddPackageRepositoryRequest = { encode( message: AddPackageRepositoryRequest, @@ -347,7 +480,9 @@ export const AddPackageRepositoryRequest = { decode(input: _m0.Reader | Uint8Array, length?: number): AddPackageRepositoryRequest { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseAddPackageRepositoryRequest(); + const message = { + ...baseAddPackageRepositoryRequest, + } as AddPackageRepositoryRequest; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -393,21 +528,65 @@ export const AddPackageRepositoryRequest = { }, fromJSON(object: any): AddPackageRepositoryRequest { - return { - context: isSet(object.context) ? Context.fromJSON(object.context) : undefined, - name: isSet(object.name) ? String(object.name) : "", - description: isSet(object.description) ? String(object.description) : "", - namespaceScoped: isSet(object.namespaceScoped) ? Boolean(object.namespaceScoped) : false, - type: isSet(object.type) ? String(object.type) : "", - url: isSet(object.url) ? String(object.url) : "", - interval: isSet(object.interval) ? Number(object.interval) : 0, - tlsConfig: isSet(object.tlsConfig) - ? PackageRepositoryTlsConfig.fromJSON(object.tlsConfig) - : undefined, - auth: isSet(object.auth) ? PackageRepositoryAuth.fromJSON(object.auth) : undefined, - plugin: isSet(object.plugin) ? Plugin.fromJSON(object.plugin) : undefined, - customDetail: isSet(object.customDetail) ? Any.fromJSON(object.customDetail) : undefined, - }; + const message = { + ...baseAddPackageRepositoryRequest, + } as AddPackageRepositoryRequest; + if (object.context !== undefined && object.context !== null) { + message.context = Context.fromJSON(object.context); + } else { + message.context = undefined; + } + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.description !== undefined && object.description !== null) { + message.description = String(object.description); + } else { + message.description = ""; + } + if (object.namespaceScoped !== undefined && object.namespaceScoped !== null) { + message.namespaceScoped = Boolean(object.namespaceScoped); + } else { + message.namespaceScoped = false; + } + if (object.type !== undefined && object.type !== null) { + message.type = String(object.type); + } else { + message.type = ""; + } + if (object.url !== undefined && object.url !== null) { + message.url = String(object.url); + } else { + message.url = ""; + } + if (object.interval !== undefined && object.interval !== null) { + message.interval = Number(object.interval); + } else { + message.interval = 0; + } + if (object.tlsConfig !== undefined && object.tlsConfig !== null) { + message.tlsConfig = PackageRepositoryTlsConfig.fromJSON(object.tlsConfig); + } else { + message.tlsConfig = undefined; + } + if (object.auth !== undefined && object.auth !== null) { + message.auth = PackageRepositoryAuth.fromJSON(object.auth); + } else { + message.auth = undefined; + } + if (object.plugin !== undefined && object.plugin !== null) { + message.plugin = Plugin.fromJSON(object.plugin); + } else { + message.plugin = undefined; + } + if (object.customDetail !== undefined && object.customDetail !== null) { + message.customDetail = Any.fromJSON(object.customDetail); + } else { + message.customDetail = undefined; + } + return message; }, toJSON(message: AddPackageRepositoryRequest): unknown { @@ -419,7 +598,7 @@ export const AddPackageRepositoryRequest = { message.namespaceScoped !== undefined && (obj.namespaceScoped = message.namespaceScoped); message.type !== undefined && (obj.type = message.type); message.url !== undefined && (obj.url = message.url); - message.interval !== undefined && (obj.interval = Math.round(message.interval)); + message.interval !== undefined && (obj.interval = message.interval); message.tlsConfig !== undefined && (obj.tlsConfig = message.tlsConfig ? PackageRepositoryTlsConfig.toJSON(message.tlsConfig) @@ -433,47 +612,70 @@ export const AddPackageRepositoryRequest = { return obj; }, - fromPartial, I>>( - object: I, - ): AddPackageRepositoryRequest { - const message = createBaseAddPackageRepositoryRequest(); - message.context = - object.context !== undefined && object.context !== null - ? Context.fromPartial(object.context) - : undefined; - message.name = object.name ?? ""; - message.description = object.description ?? ""; - message.namespaceScoped = object.namespaceScoped ?? false; - message.type = object.type ?? ""; - message.url = object.url ?? ""; - message.interval = object.interval ?? 0; - message.tlsConfig = - object.tlsConfig !== undefined && object.tlsConfig !== null - ? PackageRepositoryTlsConfig.fromPartial(object.tlsConfig) - : undefined; - message.auth = - object.auth !== undefined && object.auth !== null - ? PackageRepositoryAuth.fromPartial(object.auth) - : undefined; - message.plugin = - object.plugin !== undefined && object.plugin !== null - ? Plugin.fromPartial(object.plugin) - : undefined; - message.customDetail = - object.customDetail !== undefined && object.customDetail !== null - ? Any.fromPartial(object.customDetail) - : undefined; + fromPartial(object: DeepPartial): AddPackageRepositoryRequest { + const message = { + ...baseAddPackageRepositoryRequest, + } as AddPackageRepositoryRequest; + if (object.context !== undefined && object.context !== null) { + message.context = Context.fromPartial(object.context); + } else { + message.context = undefined; + } + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } else { + message.description = ""; + } + if (object.namespaceScoped !== undefined && object.namespaceScoped !== null) { + message.namespaceScoped = object.namespaceScoped; + } else { + message.namespaceScoped = false; + } + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } else { + message.type = ""; + } + if (object.url !== undefined && object.url !== null) { + message.url = object.url; + } else { + message.url = ""; + } + if (object.interval !== undefined && object.interval !== null) { + message.interval = object.interval; + } else { + message.interval = 0; + } + if (object.tlsConfig !== undefined && object.tlsConfig !== null) { + message.tlsConfig = PackageRepositoryTlsConfig.fromPartial(object.tlsConfig); + } else { + message.tlsConfig = undefined; + } + if (object.auth !== undefined && object.auth !== null) { + message.auth = PackageRepositoryAuth.fromPartial(object.auth); + } else { + message.auth = undefined; + } + if (object.plugin !== undefined && object.plugin !== null) { + message.plugin = Plugin.fromPartial(object.plugin); + } else { + message.plugin = undefined; + } + if (object.customDetail !== undefined && object.customDetail !== null) { + message.customDetail = Any.fromPartial(object.customDetail); + } else { + message.customDetail = undefined; + } return message; }, }; -function createBasePackageRepositoryTlsConfig(): PackageRepositoryTlsConfig { - return { - insecureSkipVerify: false, - certAuthority: undefined, - secretRef: undefined, - }; -} +const basePackageRepositoryTlsConfig: object = { insecureSkipVerify: false }; export const PackageRepositoryTlsConfig = { encode( @@ -495,7 +697,9 @@ export const PackageRepositoryTlsConfig = { decode(input: _m0.Reader | Uint8Array, length?: number): PackageRepositoryTlsConfig { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBasePackageRepositoryTlsConfig(); + const message = { + ...basePackageRepositoryTlsConfig, + } as PackageRepositoryTlsConfig; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -517,15 +721,25 @@ export const PackageRepositoryTlsConfig = { }, fromJSON(object: any): PackageRepositoryTlsConfig { - return { - insecureSkipVerify: isSet(object.insecureSkipVerify) - ? Boolean(object.insecureSkipVerify) - : false, - certAuthority: isSet(object.certAuthority) ? String(object.certAuthority) : undefined, - secretRef: isSet(object.secretRef) - ? SecretKeyReference.fromJSON(object.secretRef) - : undefined, - }; + const message = { + ...basePackageRepositoryTlsConfig, + } as PackageRepositoryTlsConfig; + if (object.insecureSkipVerify !== undefined && object.insecureSkipVerify !== null) { + message.insecureSkipVerify = Boolean(object.insecureSkipVerify); + } else { + message.insecureSkipVerify = false; + } + if (object.certAuthority !== undefined && object.certAuthority !== null) { + message.certAuthority = String(object.certAuthority); + } else { + message.certAuthority = undefined; + } + if (object.secretRef !== undefined && object.secretRef !== null) { + message.secretRef = SecretKeyReference.fromJSON(object.secretRef); + } else { + message.secretRef = undefined; + } + return message; }, toJSON(message: PackageRepositoryTlsConfig): unknown { @@ -540,31 +754,30 @@ export const PackageRepositoryTlsConfig = { return obj; }, - fromPartial, I>>( - object: I, - ): PackageRepositoryTlsConfig { - const message = createBasePackageRepositoryTlsConfig(); - message.insecureSkipVerify = object.insecureSkipVerify ?? false; - message.certAuthority = object.certAuthority ?? undefined; - message.secretRef = - object.secretRef !== undefined && object.secretRef !== null - ? SecretKeyReference.fromPartial(object.secretRef) - : undefined; + fromPartial(object: DeepPartial): PackageRepositoryTlsConfig { + const message = { + ...basePackageRepositoryTlsConfig, + } as PackageRepositoryTlsConfig; + if (object.insecureSkipVerify !== undefined && object.insecureSkipVerify !== null) { + message.insecureSkipVerify = object.insecureSkipVerify; + } else { + message.insecureSkipVerify = false; + } + if (object.certAuthority !== undefined && object.certAuthority !== null) { + message.certAuthority = object.certAuthority; + } else { + message.certAuthority = undefined; + } + if (object.secretRef !== undefined && object.secretRef !== null) { + message.secretRef = SecretKeyReference.fromPartial(object.secretRef); + } else { + message.secretRef = undefined; + } return message; }, }; -function createBasePackageRepositoryAuth(): PackageRepositoryAuth { - return { - type: 0, - usernamePassword: undefined, - tlsCertKey: undefined, - dockerCreds: undefined, - header: undefined, - secretRef: undefined, - passCredentials: false, - }; -} +const basePackageRepositoryAuth: object = { type: 0, passCredentials: false }; export const PackageRepositoryAuth = { encode(message: PackageRepositoryAuth, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -595,7 +808,7 @@ export const PackageRepositoryAuth = { decode(input: _m0.Reader | Uint8Array, length?: number): PackageRepositoryAuth { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBasePackageRepositoryAuth(); + const message = { ...basePackageRepositoryAuth } as PackageRepositoryAuth; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -629,23 +842,43 @@ export const PackageRepositoryAuth = { }, fromJSON(object: any): PackageRepositoryAuth { - return { - type: isSet(object.type) - ? packageRepositoryAuth_PackageRepositoryAuthTypeFromJSON(object.type) - : 0, - usernamePassword: isSet(object.usernamePassword) - ? UsernamePassword.fromJSON(object.usernamePassword) - : undefined, - tlsCertKey: isSet(object.tlsCertKey) ? TlsCertKey.fromJSON(object.tlsCertKey) : undefined, - dockerCreds: isSet(object.dockerCreds) - ? DockerCredentials.fromJSON(object.dockerCreds) - : undefined, - header: isSet(object.header) ? String(object.header) : undefined, - secretRef: isSet(object.secretRef) - ? SecretKeyReference.fromJSON(object.secretRef) - : undefined, - passCredentials: isSet(object.passCredentials) ? Boolean(object.passCredentials) : false, - }; + const message = { ...basePackageRepositoryAuth } as PackageRepositoryAuth; + if (object.type !== undefined && object.type !== null) { + message.type = packageRepositoryAuth_PackageRepositoryAuthTypeFromJSON(object.type); + } else { + message.type = 0; + } + if (object.usernamePassword !== undefined && object.usernamePassword !== null) { + message.usernamePassword = UsernamePassword.fromJSON(object.usernamePassword); + } else { + message.usernamePassword = undefined; + } + if (object.tlsCertKey !== undefined && object.tlsCertKey !== null) { + message.tlsCertKey = TlsCertKey.fromJSON(object.tlsCertKey); + } else { + message.tlsCertKey = undefined; + } + if (object.dockerCreds !== undefined && object.dockerCreds !== null) { + message.dockerCreds = DockerCredentials.fromJSON(object.dockerCreds); + } else { + message.dockerCreds = undefined; + } + if (object.header !== undefined && object.header !== null) { + message.header = String(object.header); + } else { + message.header = undefined; + } + if (object.secretRef !== undefined && object.secretRef !== null) { + message.secretRef = SecretKeyReference.fromJSON(object.secretRef); + } else { + message.secretRef = undefined; + } + if (object.passCredentials !== undefined && object.passCredentials !== null) { + message.passCredentials = Boolean(object.passCredentials); + } else { + message.passCredentials = false; + } + return message; }, toJSON(message: PackageRepositoryAuth): unknown { @@ -671,36 +904,48 @@ export const PackageRepositoryAuth = { return obj; }, - fromPartial, I>>( - object: I, - ): PackageRepositoryAuth { - const message = createBasePackageRepositoryAuth(); - message.type = object.type ?? 0; - message.usernamePassword = - object.usernamePassword !== undefined && object.usernamePassword !== null - ? UsernamePassword.fromPartial(object.usernamePassword) - : undefined; - message.tlsCertKey = - object.tlsCertKey !== undefined && object.tlsCertKey !== null - ? TlsCertKey.fromPartial(object.tlsCertKey) - : undefined; - message.dockerCreds = - object.dockerCreds !== undefined && object.dockerCreds !== null - ? DockerCredentials.fromPartial(object.dockerCreds) - : undefined; - message.header = object.header ?? undefined; - message.secretRef = - object.secretRef !== undefined && object.secretRef !== null - ? SecretKeyReference.fromPartial(object.secretRef) - : undefined; - message.passCredentials = object.passCredentials ?? false; + fromPartial(object: DeepPartial): PackageRepositoryAuth { + const message = { ...basePackageRepositoryAuth } as PackageRepositoryAuth; + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } else { + message.type = 0; + } + if (object.usernamePassword !== undefined && object.usernamePassword !== null) { + message.usernamePassword = UsernamePassword.fromPartial(object.usernamePassword); + } else { + message.usernamePassword = undefined; + } + if (object.tlsCertKey !== undefined && object.tlsCertKey !== null) { + message.tlsCertKey = TlsCertKey.fromPartial(object.tlsCertKey); + } else { + message.tlsCertKey = undefined; + } + if (object.dockerCreds !== undefined && object.dockerCreds !== null) { + message.dockerCreds = DockerCredentials.fromPartial(object.dockerCreds); + } else { + message.dockerCreds = undefined; + } + if (object.header !== undefined && object.header !== null) { + message.header = object.header; + } else { + message.header = undefined; + } + if (object.secretRef !== undefined && object.secretRef !== null) { + message.secretRef = SecretKeyReference.fromPartial(object.secretRef); + } else { + message.secretRef = undefined; + } + if (object.passCredentials !== undefined && object.passCredentials !== null) { + message.passCredentials = object.passCredentials; + } else { + message.passCredentials = false; + } return message; }, }; -function createBaseUsernamePassword(): UsernamePassword { - return { username: "", password: "" }; -} +const baseUsernamePassword: object = { username: "", password: "" }; export const UsernamePassword = { encode(message: UsernamePassword, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -716,7 +961,7 @@ export const UsernamePassword = { decode(input: _m0.Reader | Uint8Array, length?: number): UsernamePassword { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseUsernamePassword(); + const message = { ...baseUsernamePassword } as UsernamePassword; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -735,10 +980,18 @@ export const UsernamePassword = { }, fromJSON(object: any): UsernamePassword { - return { - username: isSet(object.username) ? String(object.username) : "", - password: isSet(object.password) ? String(object.password) : "", - }; + const message = { ...baseUsernamePassword } as UsernamePassword; + if (object.username !== undefined && object.username !== null) { + message.username = String(object.username); + } else { + message.username = ""; + } + if (object.password !== undefined && object.password !== null) { + message.password = String(object.password); + } else { + message.password = ""; + } + return message; }, toJSON(message: UsernamePassword): unknown { @@ -748,17 +1001,23 @@ export const UsernamePassword = { return obj; }, - fromPartial, I>>(object: I): UsernamePassword { - const message = createBaseUsernamePassword(); - message.username = object.username ?? ""; - message.password = object.password ?? ""; + fromPartial(object: DeepPartial): UsernamePassword { + const message = { ...baseUsernamePassword } as UsernamePassword; + if (object.username !== undefined && object.username !== null) { + message.username = object.username; + } else { + message.username = ""; + } + if (object.password !== undefined && object.password !== null) { + message.password = object.password; + } else { + message.password = ""; + } return message; }, }; -function createBaseTlsCertKey(): TlsCertKey { - return { cert: "", key: "" }; -} +const baseTlsCertKey: object = { cert: "", key: "" }; export const TlsCertKey = { encode(message: TlsCertKey, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -774,7 +1033,7 @@ export const TlsCertKey = { decode(input: _m0.Reader | Uint8Array, length?: number): TlsCertKey { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseTlsCertKey(); + const message = { ...baseTlsCertKey } as TlsCertKey; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -793,10 +1052,18 @@ export const TlsCertKey = { }, fromJSON(object: any): TlsCertKey { - return { - cert: isSet(object.cert) ? String(object.cert) : "", - key: isSet(object.key) ? String(object.key) : "", - }; + const message = { ...baseTlsCertKey } as TlsCertKey; + if (object.cert !== undefined && object.cert !== null) { + message.cert = String(object.cert); + } else { + message.cert = ""; + } + if (object.key !== undefined && object.key !== null) { + message.key = String(object.key); + } else { + message.key = ""; + } + return message; }, toJSON(message: TlsCertKey): unknown { @@ -806,17 +1073,28 @@ export const TlsCertKey = { return obj; }, - fromPartial, I>>(object: I): TlsCertKey { - const message = createBaseTlsCertKey(); - message.cert = object.cert ?? ""; - message.key = object.key ?? ""; + fromPartial(object: DeepPartial): TlsCertKey { + const message = { ...baseTlsCertKey } as TlsCertKey; + if (object.cert !== undefined && object.cert !== null) { + message.cert = object.cert; + } else { + message.cert = ""; + } + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } else { + message.key = ""; + } return message; }, }; -function createBaseDockerCredentials(): DockerCredentials { - return { server: "", username: "", password: "", email: "" }; -} +const baseDockerCredentials: object = { + server: "", + username: "", + password: "", + email: "", +}; export const DockerCredentials = { encode(message: DockerCredentials, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -838,7 +1116,7 @@ export const DockerCredentials = { decode(input: _m0.Reader | Uint8Array, length?: number): DockerCredentials { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDockerCredentials(); + const message = { ...baseDockerCredentials } as DockerCredentials; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -863,12 +1141,28 @@ export const DockerCredentials = { }, fromJSON(object: any): DockerCredentials { - return { - server: isSet(object.server) ? String(object.server) : "", - username: isSet(object.username) ? String(object.username) : "", - password: isSet(object.password) ? String(object.password) : "", - email: isSet(object.email) ? String(object.email) : "", - }; + const message = { ...baseDockerCredentials } as DockerCredentials; + if (object.server !== undefined && object.server !== null) { + message.server = String(object.server); + } else { + message.server = ""; + } + if (object.username !== undefined && object.username !== null) { + message.username = String(object.username); + } else { + message.username = ""; + } + if (object.password !== undefined && object.password !== null) { + message.password = String(object.password); + } else { + message.password = ""; + } + if (object.email !== undefined && object.email !== null) { + message.email = String(object.email); + } else { + message.email = ""; + } + return message; }, toJSON(message: DockerCredentials): unknown { @@ -880,19 +1174,33 @@ export const DockerCredentials = { return obj; }, - fromPartial, I>>(object: I): DockerCredentials { - const message = createBaseDockerCredentials(); - message.server = object.server ?? ""; - message.username = object.username ?? ""; - message.password = object.password ?? ""; - message.email = object.email ?? ""; + fromPartial(object: DeepPartial): DockerCredentials { + const message = { ...baseDockerCredentials } as DockerCredentials; + if (object.server !== undefined && object.server !== null) { + message.server = object.server; + } else { + message.server = ""; + } + if (object.username !== undefined && object.username !== null) { + message.username = object.username; + } else { + message.username = ""; + } + if (object.password !== undefined && object.password !== null) { + message.password = object.password; + } else { + message.password = ""; + } + if (object.email !== undefined && object.email !== null) { + message.email = object.email; + } else { + message.email = ""; + } return message; }, }; -function createBaseSecretKeyReference(): SecretKeyReference { - return { name: "", key: "" }; -} +const baseSecretKeyReference: object = { name: "", key: "" }; export const SecretKeyReference = { encode(message: SecretKeyReference, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -908,7 +1216,7 @@ export const SecretKeyReference = { decode(input: _m0.Reader | Uint8Array, length?: number): SecretKeyReference { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseSecretKeyReference(); + const message = { ...baseSecretKeyReference } as SecretKeyReference; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -927,10 +1235,18 @@ export const SecretKeyReference = { }, fromJSON(object: any): SecretKeyReference { - return { - name: isSet(object.name) ? String(object.name) : "", - key: isSet(object.key) ? String(object.key) : "", - }; + const message = { ...baseSecretKeyReference } as SecretKeyReference; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.key !== undefined && object.key !== null) { + message.key = String(object.key); + } else { + message.key = ""; + } + return message; }, toJSON(message: SecretKeyReference): unknown { @@ -940,17 +1256,92 @@ export const SecretKeyReference = { return obj; }, - fromPartial, I>>(object: I): SecretKeyReference { - const message = createBaseSecretKeyReference(); - message.name = object.name ?? ""; - message.key = object.key ?? ""; + fromPartial(object: DeepPartial): SecretKeyReference { + const message = { ...baseSecretKeyReference } as SecretKeyReference; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } else { + message.key = ""; + } return message; }, }; -function createBasePackageRepositoryReference(): PackageRepositoryReference { - return { context: undefined, identifier: "", plugin: undefined }; -} +const baseGetPackageRepositoryDetailRequest: object = {}; + +export const GetPackageRepositoryDetailRequest = { + encode( + message: GetPackageRepositoryDetailRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.packageRepoRef !== undefined) { + PackageRepositoryReference.encode(message.packageRepoRef, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GetPackageRepositoryDetailRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseGetPackageRepositoryDetailRequest, + } as GetPackageRepositoryDetailRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.packageRepoRef = PackageRepositoryReference.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetPackageRepositoryDetailRequest { + const message = { + ...baseGetPackageRepositoryDetailRequest, + } as GetPackageRepositoryDetailRequest; + if (object.packageRepoRef !== undefined && object.packageRepoRef !== null) { + message.packageRepoRef = PackageRepositoryReference.fromJSON(object.packageRepoRef); + } else { + message.packageRepoRef = undefined; + } + return message; + }, + + toJSON(message: GetPackageRepositoryDetailRequest): unknown { + const obj: any = {}; + message.packageRepoRef !== undefined && + (obj.packageRepoRef = message.packageRepoRef + ? PackageRepositoryReference.toJSON(message.packageRepoRef) + : undefined); + return obj; + }, + + fromPartial( + object: DeepPartial, + ): GetPackageRepositoryDetailRequest { + const message = { + ...baseGetPackageRepositoryDetailRequest, + } as GetPackageRepositoryDetailRequest; + if (object.packageRepoRef !== undefined && object.packageRepoRef !== null) { + message.packageRepoRef = PackageRepositoryReference.fromPartial(object.packageRepoRef); + } else { + message.packageRepoRef = undefined; + } + return message; + }, +}; + +const basePackageRepositoryReference: object = { identifier: "" }; export const PackageRepositoryReference = { encode( @@ -972,7 +1363,9 @@ export const PackageRepositoryReference = { decode(input: _m0.Reader | Uint8Array, length?: number): PackageRepositoryReference { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBasePackageRepositoryReference(); + const message = { + ...basePackageRepositoryReference, + } as PackageRepositoryReference; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -994,11 +1387,25 @@ export const PackageRepositoryReference = { }, fromJSON(object: any): PackageRepositoryReference { - return { - context: isSet(object.context) ? Context.fromJSON(object.context) : undefined, - identifier: isSet(object.identifier) ? String(object.identifier) : "", - plugin: isSet(object.plugin) ? Plugin.fromJSON(object.plugin) : undefined, - }; + const message = { + ...basePackageRepositoryReference, + } as PackageRepositoryReference; + if (object.context !== undefined && object.context !== null) { + message.context = Context.fromJSON(object.context); + } else { + message.context = undefined; + } + if (object.identifier !== undefined && object.identifier !== null) { + message.identifier = String(object.identifier); + } else { + message.identifier = ""; + } + if (object.plugin !== undefined && object.plugin !== null) { + message.plugin = Plugin.fromJSON(object.plugin); + } else { + message.plugin = undefined; + } + return message; }, toJSON(message: PackageRepositoryReference): unknown { @@ -1011,26 +1418,30 @@ export const PackageRepositoryReference = { return obj; }, - fromPartial, I>>( - object: I, - ): PackageRepositoryReference { - const message = createBasePackageRepositoryReference(); - message.context = - object.context !== undefined && object.context !== null - ? Context.fromPartial(object.context) - : undefined; - message.identifier = object.identifier ?? ""; - message.plugin = - object.plugin !== undefined && object.plugin !== null - ? Plugin.fromPartial(object.plugin) - : undefined; + fromPartial(object: DeepPartial): PackageRepositoryReference { + const message = { + ...basePackageRepositoryReference, + } as PackageRepositoryReference; + if (object.context !== undefined && object.context !== null) { + message.context = Context.fromPartial(object.context); + } else { + message.context = undefined; + } + if (object.identifier !== undefined && object.identifier !== null) { + message.identifier = object.identifier; + } else { + message.identifier = ""; + } + if (object.plugin !== undefined && object.plugin !== null) { + message.plugin = Plugin.fromPartial(object.plugin); + } else { + message.plugin = undefined; + } return message; }, }; -function createBaseAddPackageRepositoryResponse(): AddPackageRepositoryResponse { - return { packageRepoRef: undefined }; -} +const baseAddPackageRepositoryResponse: object = {}; export const AddPackageRepositoryResponse = { encode( @@ -1046,7 +1457,9 @@ export const AddPackageRepositoryResponse = { decode(input: _m0.Reader | Uint8Array, length?: number): AddPackageRepositoryResponse { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseAddPackageRepositoryResponse(); + const message = { + ...baseAddPackageRepositoryResponse, + } as AddPackageRepositoryResponse; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1062,11 +1475,15 @@ export const AddPackageRepositoryResponse = { }, fromJSON(object: any): AddPackageRepositoryResponse { - return { - packageRepoRef: isSet(object.packageRepoRef) - ? PackageRepositoryReference.fromJSON(object.packageRepoRef) - : undefined, - }; + const message = { + ...baseAddPackageRepositoryResponse, + } as AddPackageRepositoryResponse; + if (object.packageRepoRef !== undefined && object.packageRepoRef !== null) { + message.packageRepoRef = PackageRepositoryReference.fromJSON(object.packageRepoRef); + } else { + message.packageRepoRef = undefined; + } + return message; }, toJSON(message: AddPackageRepositoryResponse): unknown { @@ -1078,14 +1495,429 @@ export const AddPackageRepositoryResponse = { return obj; }, - fromPartial, I>>( - object: I, - ): AddPackageRepositoryResponse { - const message = createBaseAddPackageRepositoryResponse(); - message.packageRepoRef = - object.packageRepoRef !== undefined && object.packageRepoRef !== null - ? PackageRepositoryReference.fromPartial(object.packageRepoRef) - : undefined; + fromPartial(object: DeepPartial): AddPackageRepositoryResponse { + const message = { + ...baseAddPackageRepositoryResponse, + } as AddPackageRepositoryResponse; + if (object.packageRepoRef !== undefined && object.packageRepoRef !== null) { + message.packageRepoRef = PackageRepositoryReference.fromPartial(object.packageRepoRef); + } else { + message.packageRepoRef = undefined; + } + return message; + }, +}; + +const basePackageRepositoryStatus: object = { + ready: false, + reason: 0, + userReason: "", +}; + +export const PackageRepositoryStatus = { + encode(message: PackageRepositoryStatus, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.ready === true) { + writer.uint32(8).bool(message.ready); + } + if (message.reason !== 0) { + writer.uint32(16).int32(message.reason); + } + if (message.userReason !== "") { + writer.uint32(26).string(message.userReason); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): PackageRepositoryStatus { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...basePackageRepositoryStatus, + } as PackageRepositoryStatus; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ready = reader.bool(); + break; + case 2: + message.reason = reader.int32() as any; + break; + case 3: + message.userReason = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PackageRepositoryStatus { + const message = { + ...basePackageRepositoryStatus, + } as PackageRepositoryStatus; + if (object.ready !== undefined && object.ready !== null) { + message.ready = Boolean(object.ready); + } else { + message.ready = false; + } + if (object.reason !== undefined && object.reason !== null) { + message.reason = packageRepositoryStatus_StatusReasonFromJSON(object.reason); + } else { + message.reason = 0; + } + if (object.userReason !== undefined && object.userReason !== null) { + message.userReason = String(object.userReason); + } else { + message.userReason = ""; + } + return message; + }, + + toJSON(message: PackageRepositoryStatus): unknown { + const obj: any = {}; + message.ready !== undefined && (obj.ready = message.ready); + message.reason !== undefined && + (obj.reason = packageRepositoryStatus_StatusReasonToJSON(message.reason)); + message.userReason !== undefined && (obj.userReason = message.userReason); + return obj; + }, + + fromPartial(object: DeepPartial): PackageRepositoryStatus { + const message = { + ...basePackageRepositoryStatus, + } as PackageRepositoryStatus; + if (object.ready !== undefined && object.ready !== null) { + message.ready = object.ready; + } else { + message.ready = false; + } + if (object.reason !== undefined && object.reason !== null) { + message.reason = object.reason; + } else { + message.reason = 0; + } + if (object.userReason !== undefined && object.userReason !== null) { + message.userReason = object.userReason; + } else { + message.userReason = ""; + } + return message; + }, +}; + +const basePackageRepositoryDetail: object = { + name: "", + description: "", + namespaceScoped: false, + type: "", + url: "", + interval: 0, +}; + +export const PackageRepositoryDetail = { + encode(message: PackageRepositoryDetail, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.packageRepoRef !== undefined) { + PackageRepositoryReference.encode(message.packageRepoRef, writer.uint32(10).fork()).ldelim(); + } + if (message.name !== "") { + writer.uint32(18).string(message.name); + } + if (message.description !== "") { + writer.uint32(26).string(message.description); + } + if (message.namespaceScoped === true) { + writer.uint32(32).bool(message.namespaceScoped); + } + if (message.type !== "") { + writer.uint32(42).string(message.type); + } + if (message.url !== "") { + writer.uint32(50).string(message.url); + } + if (message.interval !== 0) { + writer.uint32(56).uint32(message.interval); + } + if (message.tlsConfig !== undefined) { + PackageRepositoryTlsConfig.encode(message.tlsConfig, writer.uint32(66).fork()).ldelim(); + } + if (message.auth !== undefined) { + PackageRepositoryAuth.encode(message.auth, writer.uint32(74).fork()).ldelim(); + } + if (message.customDetail !== undefined) { + Any.encode(message.customDetail, writer.uint32(82).fork()).ldelim(); + } + if (message.status !== undefined) { + PackageRepositoryStatus.encode(message.status, writer.uint32(90).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): PackageRepositoryDetail { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...basePackageRepositoryDetail, + } as PackageRepositoryDetail; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.packageRepoRef = PackageRepositoryReference.decode(reader, reader.uint32()); + break; + case 2: + message.name = reader.string(); + break; + case 3: + message.description = reader.string(); + break; + case 4: + message.namespaceScoped = reader.bool(); + break; + case 5: + message.type = reader.string(); + break; + case 6: + message.url = reader.string(); + break; + case 7: + message.interval = reader.uint32(); + break; + case 8: + message.tlsConfig = PackageRepositoryTlsConfig.decode(reader, reader.uint32()); + break; + case 9: + message.auth = PackageRepositoryAuth.decode(reader, reader.uint32()); + break; + case 10: + message.customDetail = Any.decode(reader, reader.uint32()); + break; + case 11: + message.status = PackageRepositoryStatus.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PackageRepositoryDetail { + const message = { + ...basePackageRepositoryDetail, + } as PackageRepositoryDetail; + if (object.packageRepoRef !== undefined && object.packageRepoRef !== null) { + message.packageRepoRef = PackageRepositoryReference.fromJSON(object.packageRepoRef); + } else { + message.packageRepoRef = undefined; + } + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.description !== undefined && object.description !== null) { + message.description = String(object.description); + } else { + message.description = ""; + } + if (object.namespaceScoped !== undefined && object.namespaceScoped !== null) { + message.namespaceScoped = Boolean(object.namespaceScoped); + } else { + message.namespaceScoped = false; + } + if (object.type !== undefined && object.type !== null) { + message.type = String(object.type); + } else { + message.type = ""; + } + if (object.url !== undefined && object.url !== null) { + message.url = String(object.url); + } else { + message.url = ""; + } + if (object.interval !== undefined && object.interval !== null) { + message.interval = Number(object.interval); + } else { + message.interval = 0; + } + if (object.tlsConfig !== undefined && object.tlsConfig !== null) { + message.tlsConfig = PackageRepositoryTlsConfig.fromJSON(object.tlsConfig); + } else { + message.tlsConfig = undefined; + } + if (object.auth !== undefined && object.auth !== null) { + message.auth = PackageRepositoryAuth.fromJSON(object.auth); + } else { + message.auth = undefined; + } + if (object.customDetail !== undefined && object.customDetail !== null) { + message.customDetail = Any.fromJSON(object.customDetail); + } else { + message.customDetail = undefined; + } + if (object.status !== undefined && object.status !== null) { + message.status = PackageRepositoryStatus.fromJSON(object.status); + } else { + message.status = undefined; + } + return message; + }, + + toJSON(message: PackageRepositoryDetail): unknown { + const obj: any = {}; + message.packageRepoRef !== undefined && + (obj.packageRepoRef = message.packageRepoRef + ? PackageRepositoryReference.toJSON(message.packageRepoRef) + : undefined); + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && (obj.description = message.description); + message.namespaceScoped !== undefined && (obj.namespaceScoped = message.namespaceScoped); + message.type !== undefined && (obj.type = message.type); + message.url !== undefined && (obj.url = message.url); + message.interval !== undefined && (obj.interval = message.interval); + message.tlsConfig !== undefined && + (obj.tlsConfig = message.tlsConfig + ? PackageRepositoryTlsConfig.toJSON(message.tlsConfig) + : undefined); + message.auth !== undefined && + (obj.auth = message.auth ? PackageRepositoryAuth.toJSON(message.auth) : undefined); + message.customDetail !== undefined && + (obj.customDetail = message.customDetail ? Any.toJSON(message.customDetail) : undefined); + message.status !== undefined && + (obj.status = message.status ? PackageRepositoryStatus.toJSON(message.status) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): PackageRepositoryDetail { + const message = { + ...basePackageRepositoryDetail, + } as PackageRepositoryDetail; + if (object.packageRepoRef !== undefined && object.packageRepoRef !== null) { + message.packageRepoRef = PackageRepositoryReference.fromPartial(object.packageRepoRef); + } else { + message.packageRepoRef = undefined; + } + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } else { + message.description = ""; + } + if (object.namespaceScoped !== undefined && object.namespaceScoped !== null) { + message.namespaceScoped = object.namespaceScoped; + } else { + message.namespaceScoped = false; + } + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } else { + message.type = ""; + } + if (object.url !== undefined && object.url !== null) { + message.url = object.url; + } else { + message.url = ""; + } + if (object.interval !== undefined && object.interval !== null) { + message.interval = object.interval; + } else { + message.interval = 0; + } + if (object.tlsConfig !== undefined && object.tlsConfig !== null) { + message.tlsConfig = PackageRepositoryTlsConfig.fromPartial(object.tlsConfig); + } else { + message.tlsConfig = undefined; + } + if (object.auth !== undefined && object.auth !== null) { + message.auth = PackageRepositoryAuth.fromPartial(object.auth); + } else { + message.auth = undefined; + } + if (object.customDetail !== undefined && object.customDetail !== null) { + message.customDetail = Any.fromPartial(object.customDetail); + } else { + message.customDetail = undefined; + } + if (object.status !== undefined && object.status !== null) { + message.status = PackageRepositoryStatus.fromPartial(object.status); + } else { + message.status = undefined; + } + return message; + }, +}; + +const baseGetPackageRepositoryDetailResponse: object = {}; + +export const GetPackageRepositoryDetailResponse = { + encode( + message: GetPackageRepositoryDetailResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.detail !== undefined) { + PackageRepositoryDetail.encode(message.detail, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GetPackageRepositoryDetailResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseGetPackageRepositoryDetailResponse, + } as GetPackageRepositoryDetailResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.detail = PackageRepositoryDetail.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetPackageRepositoryDetailResponse { + const message = { + ...baseGetPackageRepositoryDetailResponse, + } as GetPackageRepositoryDetailResponse; + if (object.detail !== undefined && object.detail !== null) { + message.detail = PackageRepositoryDetail.fromJSON(object.detail); + } else { + message.detail = undefined; + } + return message; + }, + + toJSON(message: GetPackageRepositoryDetailResponse): unknown { + const obj: any = {}; + message.detail !== undefined && + (obj.detail = message.detail ? PackageRepositoryDetail.toJSON(message.detail) : undefined); + return obj; + }, + + fromPartial( + object: DeepPartial, + ): GetPackageRepositoryDetailResponse { + const message = { + ...baseGetPackageRepositoryDetailResponse, + } as GetPackageRepositoryDetailResponse; + if (object.detail !== undefined && object.detail !== null) { + message.detail = PackageRepositoryDetail.fromPartial(object.detail); + } else { + message.detail = undefined; + } return message; }, }; @@ -1096,6 +1928,10 @@ export interface RepositoriesService { request: DeepPartial, metadata?: grpc.Metadata, ): Promise; + GetPackageRepositoryDetail( + request: DeepPartial, + metadata?: grpc.Metadata, + ): Promise; } export class RepositoriesServiceClientImpl implements RepositoriesService { @@ -1104,6 +1940,7 @@ export class RepositoriesServiceClientImpl implements RepositoriesService { constructor(rpc: Rpc) { this.rpc = rpc; this.AddPackageRepository = this.AddPackageRepository.bind(this); + this.GetPackageRepositoryDetail = this.GetPackageRepositoryDetail.bind(this); } AddPackageRepository( @@ -1116,6 +1953,17 @@ export class RepositoriesServiceClientImpl implements RepositoriesService { metadata, ); } + + GetPackageRepositoryDetail( + request: DeepPartial, + metadata?: grpc.Metadata, + ): Promise { + return this.rpc.unary( + RepositoriesServiceGetPackageRepositoryDetailDesc, + GetPackageRepositoryDetailRequest.fromPartial(request), + metadata, + ); + } } export const RepositoriesServiceDesc = { @@ -1144,6 +1992,28 @@ export const RepositoriesServiceAddPackageRepositoryDesc: UnaryMethodDefinitioni } as any, }; +export const RepositoriesServiceGetPackageRepositoryDetailDesc: UnaryMethodDefinitionish = { + methodName: "GetPackageRepositoryDetail", + service: RepositoriesServiceDesc, + requestStream: false, + responseStream: false, + requestType: { + serializeBinary() { + return GetPackageRepositoryDetailRequest.encode(this).finish(); + }, + } as any, + responseType: { + deserializeBinary(data: Uint8Array) { + return { + ...GetPackageRepositoryDetailResponse.decode(data), + toObject() { + return this; + }, + }; + }, + } as any, +}; + interface UnaryMethodDefinitionishR extends grpc.UnaryMethodDefinition { requestStream: any; responseStream: any; @@ -1217,7 +2087,6 @@ export class GrpcWebImpl { } type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - export type DeepPartial = T extends Builtin ? T : T extends Array @@ -1228,16 +2097,7 @@ export type DeepPartial = T extends Builtin ? { [K in keyof T]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & Record>, never>; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); } - -function isSet(value: any): boolean { - return value !== null && value !== undefined; -} diff --git a/dashboard/src/gen/kubeappsapis/core/plugins/v1alpha1/plugins.ts b/dashboard/src/gen/kubeappsapis/core/plugins/v1alpha1/plugins.ts index f2bb4f15682..21ebec26470 100644 --- a/dashboard/src/gen/kubeappsapis/core/plugins/v1alpha1/plugins.ts +++ b/dashboard/src/gen/kubeappsapis/core/plugins/v1alpha1/plugins.ts @@ -47,9 +47,7 @@ export interface Plugin { version: string; } -function createBaseGetConfiguredPluginsRequest(): GetConfiguredPluginsRequest { - return {}; -} +const baseGetConfiguredPluginsRequest: object = {}; export const GetConfiguredPluginsRequest = { encode(_: GetConfiguredPluginsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -59,7 +57,9 @@ export const GetConfiguredPluginsRequest = { decode(input: _m0.Reader | Uint8Array, length?: number): GetConfiguredPluginsRequest { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetConfiguredPluginsRequest(); + const message = { + ...baseGetConfiguredPluginsRequest, + } as GetConfiguredPluginsRequest; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -72,7 +72,10 @@ export const GetConfiguredPluginsRequest = { }, fromJSON(_: any): GetConfiguredPluginsRequest { - return {}; + const message = { + ...baseGetConfiguredPluginsRequest, + } as GetConfiguredPluginsRequest; + return message; }, toJSON(_: GetConfiguredPluginsRequest): unknown { @@ -80,17 +83,15 @@ export const GetConfiguredPluginsRequest = { return obj; }, - fromPartial, I>>( - _: I, - ): GetConfiguredPluginsRequest { - const message = createBaseGetConfiguredPluginsRequest(); + fromPartial(_: DeepPartial): GetConfiguredPluginsRequest { + const message = { + ...baseGetConfiguredPluginsRequest, + } as GetConfiguredPluginsRequest; return message; }, }; -function createBaseGetConfiguredPluginsResponse(): GetConfiguredPluginsResponse { - return { plugins: [] }; -} +const baseGetConfiguredPluginsResponse: object = {}; export const GetConfiguredPluginsResponse = { encode( @@ -106,7 +107,10 @@ export const GetConfiguredPluginsResponse = { decode(input: _m0.Reader | Uint8Array, length?: number): GetConfiguredPluginsResponse { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetConfiguredPluginsResponse(); + const message = { + ...baseGetConfiguredPluginsResponse, + } as GetConfiguredPluginsResponse; + message.plugins = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -122,11 +126,16 @@ export const GetConfiguredPluginsResponse = { }, fromJSON(object: any): GetConfiguredPluginsResponse { - return { - plugins: Array.isArray(object?.plugins) - ? object.plugins.map((e: any) => Plugin.fromJSON(e)) - : [], - }; + const message = { + ...baseGetConfiguredPluginsResponse, + } as GetConfiguredPluginsResponse; + message.plugins = []; + if (object.plugins !== undefined && object.plugins !== null) { + for (const e of object.plugins) { + message.plugins.push(Plugin.fromJSON(e)); + } + } + return message; }, toJSON(message: GetConfiguredPluginsResponse): unknown { @@ -139,18 +148,21 @@ export const GetConfiguredPluginsResponse = { return obj; }, - fromPartial, I>>( - object: I, - ): GetConfiguredPluginsResponse { - const message = createBaseGetConfiguredPluginsResponse(); - message.plugins = object.plugins?.map(e => Plugin.fromPartial(e)) || []; + fromPartial(object: DeepPartial): GetConfiguredPluginsResponse { + const message = { + ...baseGetConfiguredPluginsResponse, + } as GetConfiguredPluginsResponse; + message.plugins = []; + if (object.plugins !== undefined && object.plugins !== null) { + for (const e of object.plugins) { + message.plugins.push(Plugin.fromPartial(e)); + } + } return message; }, }; -function createBasePlugin(): Plugin { - return { name: "", version: "" }; -} +const basePlugin: object = { name: "", version: "" }; export const Plugin = { encode(message: Plugin, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -166,7 +178,7 @@ export const Plugin = { decode(input: _m0.Reader | Uint8Array, length?: number): Plugin { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBasePlugin(); + const message = { ...basePlugin } as Plugin; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -185,10 +197,18 @@ export const Plugin = { }, fromJSON(object: any): Plugin { - return { - name: isSet(object.name) ? String(object.name) : "", - version: isSet(object.version) ? String(object.version) : "", - }; + const message = { ...basePlugin } as Plugin; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.version !== undefined && object.version !== null) { + message.version = String(object.version); + } else { + message.version = ""; + } + return message; }, toJSON(message: Plugin): unknown { @@ -198,10 +218,18 @@ export const Plugin = { return obj; }, - fromPartial, I>>(object: I): Plugin { - const message = createBasePlugin(); - message.name = object.name ?? ""; - message.version = object.version ?? ""; + fromPartial(object: DeepPartial): Plugin { + const message = { ...basePlugin } as Plugin; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.version !== undefined && object.version !== null) { + message.version = object.version; + } else { + message.version = ""; + } return message; }, }; @@ -333,7 +361,6 @@ export class GrpcWebImpl { } type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - export type DeepPartial = T extends Builtin ? T : T extends Array @@ -344,16 +371,7 @@ export type DeepPartial = T extends Builtin ? { [K in keyof T]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & Record>, never>; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); } - -function isSet(value: any): boolean { - return value !== null && value !== undefined; -} diff --git a/dashboard/src/gen/kubeappsapis/plugins/fluxv2/packages/v1alpha1/fluxv2.ts b/dashboard/src/gen/kubeappsapis/plugins/fluxv2/packages/v1alpha1/fluxv2.ts index dddc9cdb4aa..b320b2d91cb 100644 --- a/dashboard/src/gen/kubeappsapis/plugins/fluxv2/packages/v1alpha1/fluxv2.ts +++ b/dashboard/src/gen/kubeappsapis/plugins/fluxv2/packages/v1alpha1/fluxv2.ts @@ -24,7 +24,9 @@ import { } from "../../../../../kubeappsapis/core/packages/v1alpha1/packages"; import { AddPackageRepositoryRequest, + GetPackageRepositoryDetailRequest, AddPackageRepositoryResponse, + GetPackageRepositoryDetailResponse, } from "../../../../../kubeappsapis/core/packages/v1alpha1/repositories"; import { BrowserHeaders } from "browser-headers"; @@ -408,6 +410,10 @@ export interface FluxV2RepositoriesService { request: DeepPartial, metadata?: grpc.Metadata, ): Promise; + GetPackageRepositoryDetail( + request: DeepPartial, + metadata?: grpc.Metadata, + ): Promise; } export class FluxV2RepositoriesServiceClientImpl implements FluxV2RepositoriesService { @@ -416,6 +422,7 @@ export class FluxV2RepositoriesServiceClientImpl implements FluxV2RepositoriesSe constructor(rpc: Rpc) { this.rpc = rpc; this.AddPackageRepository = this.AddPackageRepository.bind(this); + this.GetPackageRepositoryDetail = this.GetPackageRepositoryDetail.bind(this); } AddPackageRepository( @@ -428,6 +435,17 @@ export class FluxV2RepositoriesServiceClientImpl implements FluxV2RepositoriesSe metadata, ); } + + GetPackageRepositoryDetail( + request: DeepPartial, + metadata?: grpc.Metadata, + ): Promise { + return this.rpc.unary( + FluxV2RepositoriesServiceGetPackageRepositoryDetailDesc, + GetPackageRepositoryDetailRequest.fromPartial(request), + metadata, + ); + } } export const FluxV2RepositoriesServiceDesc = { @@ -456,6 +474,28 @@ export const FluxV2RepositoriesServiceAddPackageRepositoryDesc: UnaryMethodDefin } as any, }; +export const FluxV2RepositoriesServiceGetPackageRepositoryDetailDesc: UnaryMethodDefinitionish = { + methodName: "GetPackageRepositoryDetail", + service: FluxV2RepositoriesServiceDesc, + requestStream: false, + responseStream: false, + requestType: { + serializeBinary() { + return GetPackageRepositoryDetailRequest.encode(this).finish(); + }, + } as any, + responseType: { + deserializeBinary(data: Uint8Array) { + return { + ...GetPackageRepositoryDetailResponse.decode(data), + toObject() { + return this; + }, + }; + }, + } as any, +}; + interface UnaryMethodDefinitionishR extends grpc.UnaryMethodDefinition { requestStream: any; responseStream: any; @@ -529,7 +569,6 @@ export class GrpcWebImpl { } type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - export type DeepPartial = T extends Builtin ? T : T extends Array diff --git a/dashboard/src/gen/kubeappsapis/plugins/helm/packages/v1alpha1/helm.ts b/dashboard/src/gen/kubeappsapis/plugins/helm/packages/v1alpha1/helm.ts index 9a2b07cea43..10bd74dcede 100644 --- a/dashboard/src/gen/kubeappsapis/plugins/helm/packages/v1alpha1/helm.ts +++ b/dashboard/src/gen/kubeappsapis/plugins/helm/packages/v1alpha1/helm.ts @@ -72,9 +72,7 @@ export interface RollbackInstalledPackageResponse { installedPackageRef?: InstalledPackageReference; } -function createBaseInstalledPackageDetailCustomDataHelm(): InstalledPackageDetailCustomDataHelm { - return { releaseRevision: 0 }; -} +const baseInstalledPackageDetailCustomDataHelm: object = { releaseRevision: 0 }; export const InstalledPackageDetailCustomDataHelm = { encode( @@ -90,7 +88,9 @@ export const InstalledPackageDetailCustomDataHelm = { decode(input: _m0.Reader | Uint8Array, length?: number): InstalledPackageDetailCustomDataHelm { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseInstalledPackageDetailCustomDataHelm(); + const message = { + ...baseInstalledPackageDetailCustomDataHelm, + } as InstalledPackageDetailCustomDataHelm; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -106,30 +106,39 @@ export const InstalledPackageDetailCustomDataHelm = { }, fromJSON(object: any): InstalledPackageDetailCustomDataHelm { - return { - releaseRevision: isSet(object.releaseRevision) ? Number(object.releaseRevision) : 0, - }; + const message = { + ...baseInstalledPackageDetailCustomDataHelm, + } as InstalledPackageDetailCustomDataHelm; + if (object.releaseRevision !== undefined && object.releaseRevision !== null) { + message.releaseRevision = Number(object.releaseRevision); + } else { + message.releaseRevision = 0; + } + return message; }, toJSON(message: InstalledPackageDetailCustomDataHelm): unknown { const obj: any = {}; - message.releaseRevision !== undefined && - (obj.releaseRevision = Math.round(message.releaseRevision)); + message.releaseRevision !== undefined && (obj.releaseRevision = message.releaseRevision); return obj; }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): InstalledPackageDetailCustomDataHelm { - const message = createBaseInstalledPackageDetailCustomDataHelm(); - message.releaseRevision = object.releaseRevision ?? 0; + const message = { + ...baseInstalledPackageDetailCustomDataHelm, + } as InstalledPackageDetailCustomDataHelm; + if (object.releaseRevision !== undefined && object.releaseRevision !== null) { + message.releaseRevision = object.releaseRevision; + } else { + message.releaseRevision = 0; + } return message; }, }; -function createBaseRollbackInstalledPackageRequest(): RollbackInstalledPackageRequest { - return { installedPackageRef: undefined, releaseRevision: 0 }; -} +const baseRollbackInstalledPackageRequest: object = { releaseRevision: 0 }; export const RollbackInstalledPackageRequest = { encode( @@ -151,7 +160,9 @@ export const RollbackInstalledPackageRequest = { decode(input: _m0.Reader | Uint8Array, length?: number): RollbackInstalledPackageRequest { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseRollbackInstalledPackageRequest(); + const message = { + ...baseRollbackInstalledPackageRequest, + } as RollbackInstalledPackageRequest; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -170,12 +181,20 @@ export const RollbackInstalledPackageRequest = { }, fromJSON(object: any): RollbackInstalledPackageRequest { - return { - installedPackageRef: isSet(object.installedPackageRef) - ? InstalledPackageReference.fromJSON(object.installedPackageRef) - : undefined, - releaseRevision: isSet(object.releaseRevision) ? Number(object.releaseRevision) : 0, - }; + const message = { + ...baseRollbackInstalledPackageRequest, + } as RollbackInstalledPackageRequest; + if (object.installedPackageRef !== undefined && object.installedPackageRef !== null) { + message.installedPackageRef = InstalledPackageReference.fromJSON(object.installedPackageRef); + } else { + message.installedPackageRef = undefined; + } + if (object.releaseRevision !== undefined && object.releaseRevision !== null) { + message.releaseRevision = Number(object.releaseRevision); + } else { + message.releaseRevision = 0; + } + return message; }, toJSON(message: RollbackInstalledPackageRequest): unknown { @@ -184,27 +203,33 @@ export const RollbackInstalledPackageRequest = { (obj.installedPackageRef = message.installedPackageRef ? InstalledPackageReference.toJSON(message.installedPackageRef) : undefined); - message.releaseRevision !== undefined && - (obj.releaseRevision = Math.round(message.releaseRevision)); + message.releaseRevision !== undefined && (obj.releaseRevision = message.releaseRevision); return obj; }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): RollbackInstalledPackageRequest { - const message = createBaseRollbackInstalledPackageRequest(); - message.installedPackageRef = - object.installedPackageRef !== undefined && object.installedPackageRef !== null - ? InstalledPackageReference.fromPartial(object.installedPackageRef) - : undefined; - message.releaseRevision = object.releaseRevision ?? 0; + const message = { + ...baseRollbackInstalledPackageRequest, + } as RollbackInstalledPackageRequest; + if (object.installedPackageRef !== undefined && object.installedPackageRef !== null) { + message.installedPackageRef = InstalledPackageReference.fromPartial( + object.installedPackageRef, + ); + } else { + message.installedPackageRef = undefined; + } + if (object.releaseRevision !== undefined && object.releaseRevision !== null) { + message.releaseRevision = object.releaseRevision; + } else { + message.releaseRevision = 0; + } return message; }, }; -function createBaseRollbackInstalledPackageResponse(): RollbackInstalledPackageResponse { - return { installedPackageRef: undefined }; -} +const baseRollbackInstalledPackageResponse: object = {}; export const RollbackInstalledPackageResponse = { encode( @@ -223,7 +248,9 @@ export const RollbackInstalledPackageResponse = { decode(input: _m0.Reader | Uint8Array, length?: number): RollbackInstalledPackageResponse { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseRollbackInstalledPackageResponse(); + const message = { + ...baseRollbackInstalledPackageResponse, + } as RollbackInstalledPackageResponse; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -239,11 +266,15 @@ export const RollbackInstalledPackageResponse = { }, fromJSON(object: any): RollbackInstalledPackageResponse { - return { - installedPackageRef: isSet(object.installedPackageRef) - ? InstalledPackageReference.fromJSON(object.installedPackageRef) - : undefined, - }; + const message = { + ...baseRollbackInstalledPackageResponse, + } as RollbackInstalledPackageResponse; + if (object.installedPackageRef !== undefined && object.installedPackageRef !== null) { + message.installedPackageRef = InstalledPackageReference.fromJSON(object.installedPackageRef); + } else { + message.installedPackageRef = undefined; + } + return message; }, toJSON(message: RollbackInstalledPackageResponse): unknown { @@ -255,14 +286,19 @@ export const RollbackInstalledPackageResponse = { return obj; }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): RollbackInstalledPackageResponse { - const message = createBaseRollbackInstalledPackageResponse(); - message.installedPackageRef = - object.installedPackageRef !== undefined && object.installedPackageRef !== null - ? InstalledPackageReference.fromPartial(object.installedPackageRef) - : undefined; + const message = { + ...baseRollbackInstalledPackageResponse, + } as RollbackInstalledPackageResponse; + if (object.installedPackageRef !== undefined && object.installedPackageRef !== null) { + message.installedPackageRef = InstalledPackageReference.fromPartial( + object.installedPackageRef, + ); + } else { + message.installedPackageRef = undefined; + } return message; }, }; @@ -748,7 +784,6 @@ export class GrpcWebImpl { } type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - export type DeepPartial = T extends Builtin ? T : T extends Array @@ -759,16 +794,7 @@ export type DeepPartial = T extends Builtin ? { [K in keyof T]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & Record>, never>; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); } - -function isSet(value: any): boolean { - return value !== null && value !== undefined; -} diff --git a/dashboard/src/gen/kubeappsapis/plugins/kapp_controller/packages/v1alpha1/kapp_controller.ts b/dashboard/src/gen/kubeappsapis/plugins/kapp_controller/packages/v1alpha1/kapp_controller.ts index acc54171cf8..52e45f335a1 100644 --- a/dashboard/src/gen/kubeappsapis/plugins/kapp_controller/packages/v1alpha1/kapp_controller.ts +++ b/dashboard/src/gen/kubeappsapis/plugins/kapp_controller/packages/v1alpha1/kapp_controller.ts @@ -84,9 +84,7 @@ export interface PackageRepository { plugin?: Plugin; } -function createBaseGetPackageRepositoriesRequest(): GetPackageRepositoriesRequest { - return { context: undefined }; -} +const baseGetPackageRepositoriesRequest: object = {}; export const GetPackageRepositoriesRequest = { encode( @@ -102,7 +100,9 @@ export const GetPackageRepositoriesRequest = { decode(input: _m0.Reader | Uint8Array, length?: number): GetPackageRepositoriesRequest { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetPackageRepositoriesRequest(); + const message = { + ...baseGetPackageRepositoriesRequest, + } as GetPackageRepositoriesRequest; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -118,9 +118,15 @@ export const GetPackageRepositoriesRequest = { }, fromJSON(object: any): GetPackageRepositoriesRequest { - return { - context: isSet(object.context) ? Context.fromJSON(object.context) : undefined, - }; + const message = { + ...baseGetPackageRepositoriesRequest, + } as GetPackageRepositoriesRequest; + if (object.context !== undefined && object.context !== null) { + message.context = Context.fromJSON(object.context); + } else { + message.context = undefined; + } + return message; }, toJSON(message: GetPackageRepositoriesRequest): unknown { @@ -130,21 +136,20 @@ export const GetPackageRepositoriesRequest = { return obj; }, - fromPartial, I>>( - object: I, - ): GetPackageRepositoriesRequest { - const message = createBaseGetPackageRepositoriesRequest(); - message.context = - object.context !== undefined && object.context !== null - ? Context.fromPartial(object.context) - : undefined; + fromPartial(object: DeepPartial): GetPackageRepositoriesRequest { + const message = { + ...baseGetPackageRepositoriesRequest, + } as GetPackageRepositoriesRequest; + if (object.context !== undefined && object.context !== null) { + message.context = Context.fromPartial(object.context); + } else { + message.context = undefined; + } return message; }, }; -function createBaseGetPackageRepositoriesResponse(): GetPackageRepositoriesResponse { - return { repositories: [] }; -} +const baseGetPackageRepositoriesResponse: object = {}; export const GetPackageRepositoriesResponse = { encode( @@ -160,7 +165,10 @@ export const GetPackageRepositoriesResponse = { decode(input: _m0.Reader | Uint8Array, length?: number): GetPackageRepositoriesResponse { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetPackageRepositoriesResponse(); + const message = { + ...baseGetPackageRepositoriesResponse, + } as GetPackageRepositoriesResponse; + message.repositories = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -176,11 +184,16 @@ export const GetPackageRepositoriesResponse = { }, fromJSON(object: any): GetPackageRepositoriesResponse { - return { - repositories: Array.isArray(object?.repositories) - ? object.repositories.map((e: any) => PackageRepository.fromJSON(e)) - : [], - }; + const message = { + ...baseGetPackageRepositoriesResponse, + } as GetPackageRepositoriesResponse; + message.repositories = []; + if (object.repositories !== undefined && object.repositories !== null) { + for (const e of object.repositories) { + message.repositories.push(PackageRepository.fromJSON(e)); + } + } + return message; }, toJSON(message: GetPackageRepositoriesResponse): unknown { @@ -195,18 +208,21 @@ export const GetPackageRepositoriesResponse = { return obj; }, - fromPartial, I>>( - object: I, - ): GetPackageRepositoriesResponse { - const message = createBaseGetPackageRepositoriesResponse(); - message.repositories = object.repositories?.map(e => PackageRepository.fromPartial(e)) || []; + fromPartial(object: DeepPartial): GetPackageRepositoriesResponse { + const message = { + ...baseGetPackageRepositoriesResponse, + } as GetPackageRepositoriesResponse; + message.repositories = []; + if (object.repositories !== undefined && object.repositories !== null) { + for (const e of object.repositories) { + message.repositories.push(PackageRepository.fromPartial(e)); + } + } return message; }, }; -function createBasePackageRepository(): PackageRepository { - return { name: "", namespace: "", url: "", plugin: undefined }; -} +const basePackageRepository: object = { name: "", namespace: "", url: "" }; export const PackageRepository = { encode(message: PackageRepository, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -228,7 +244,7 @@ export const PackageRepository = { decode(input: _m0.Reader | Uint8Array, length?: number): PackageRepository { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBasePackageRepository(); + const message = { ...basePackageRepository } as PackageRepository; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -253,12 +269,28 @@ export const PackageRepository = { }, fromJSON(object: any): PackageRepository { - return { - name: isSet(object.name) ? String(object.name) : "", - namespace: isSet(object.namespace) ? String(object.namespace) : "", - url: isSet(object.url) ? String(object.url) : "", - plugin: isSet(object.plugin) ? Plugin.fromJSON(object.plugin) : undefined, - }; + const message = { ...basePackageRepository } as PackageRepository; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.namespace !== undefined && object.namespace !== null) { + message.namespace = String(object.namespace); + } else { + message.namespace = ""; + } + if (object.url !== undefined && object.url !== null) { + message.url = String(object.url); + } else { + message.url = ""; + } + if (object.plugin !== undefined && object.plugin !== null) { + message.plugin = Plugin.fromJSON(object.plugin); + } else { + message.plugin = undefined; + } + return message; }, toJSON(message: PackageRepository): unknown { @@ -271,15 +303,28 @@ export const PackageRepository = { return obj; }, - fromPartial, I>>(object: I): PackageRepository { - const message = createBasePackageRepository(); - message.name = object.name ?? ""; - message.namespace = object.namespace ?? ""; - message.url = object.url ?? ""; - message.plugin = - object.plugin !== undefined && object.plugin !== null - ? Plugin.fromPartial(object.plugin) - : undefined; + fromPartial(object: DeepPartial): PackageRepository { + const message = { ...basePackageRepository } as PackageRepository; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.namespace !== undefined && object.namespace !== null) { + message.namespace = object.namespace; + } else { + message.namespace = ""; + } + if (object.url !== undefined && object.url !== null) { + message.url = object.url; + } else { + message.url = ""; + } + if (object.plugin !== undefined && object.plugin !== null) { + message.plugin = Plugin.fromPartial(object.plugin); + } else { + message.plugin = undefined; + } return message; }, }; @@ -772,7 +817,6 @@ export class GrpcWebImpl { } type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - export type DeepPartial = T extends Builtin ? T : T extends Array @@ -783,16 +827,7 @@ export type DeepPartial = T extends Builtin ? { [K in keyof T]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & Record>, never>; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); } - -function isSet(value: any): boolean { - return value !== null && value !== undefined; -} diff --git a/dashboard/src/gen/kubeappsapis/plugins/resources/v1alpha1/resources.ts b/dashboard/src/gen/kubeappsapis/plugins/resources/v1alpha1/resources.ts index d0b916add09..e362229288a 100644 --- a/dashboard/src/gen/kubeappsapis/plugins/resources/v1alpha1/resources.ts +++ b/dashboard/src/gen/kubeappsapis/plugins/resources/v1alpha1/resources.ts @@ -320,9 +320,7 @@ export interface GetSecretNamesResponse_SecretNamesEntry { value: SecretType; } -function createBaseGetResourcesRequest(): GetResourcesRequest { - return { installedPackageRef: undefined, resourceRefs: [], watch: false }; -} +const baseGetResourcesRequest: object = { watch: false }; export const GetResourcesRequest = { encode(message: GetResourcesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -344,7 +342,8 @@ export const GetResourcesRequest = { decode(input: _m0.Reader | Uint8Array, length?: number): GetResourcesRequest { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetResourcesRequest(); + const message = { ...baseGetResourcesRequest } as GetResourcesRequest; + message.resourceRefs = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -366,15 +365,24 @@ export const GetResourcesRequest = { }, fromJSON(object: any): GetResourcesRequest { - return { - installedPackageRef: isSet(object.installedPackageRef) - ? InstalledPackageReference.fromJSON(object.installedPackageRef) - : undefined, - resourceRefs: Array.isArray(object?.resourceRefs) - ? object.resourceRefs.map((e: any) => ResourceRef.fromJSON(e)) - : [], - watch: isSet(object.watch) ? Boolean(object.watch) : false, - }; + const message = { ...baseGetResourcesRequest } as GetResourcesRequest; + message.resourceRefs = []; + if (object.installedPackageRef !== undefined && object.installedPackageRef !== null) { + message.installedPackageRef = InstalledPackageReference.fromJSON(object.installedPackageRef); + } else { + message.installedPackageRef = undefined; + } + if (object.resourceRefs !== undefined && object.resourceRefs !== null) { + for (const e of object.resourceRefs) { + message.resourceRefs.push(ResourceRef.fromJSON(e)); + } + } + if (object.watch !== undefined && object.watch !== null) { + message.watch = Boolean(object.watch); + } else { + message.watch = false; + } + return message; }, toJSON(message: GetResourcesRequest): unknown { @@ -392,23 +400,31 @@ export const GetResourcesRequest = { return obj; }, - fromPartial, I>>( - object: I, - ): GetResourcesRequest { - const message = createBaseGetResourcesRequest(); - message.installedPackageRef = - object.installedPackageRef !== undefined && object.installedPackageRef !== null - ? InstalledPackageReference.fromPartial(object.installedPackageRef) - : undefined; - message.resourceRefs = object.resourceRefs?.map(e => ResourceRef.fromPartial(e)) || []; - message.watch = object.watch ?? false; + fromPartial(object: DeepPartial): GetResourcesRequest { + const message = { ...baseGetResourcesRequest } as GetResourcesRequest; + message.resourceRefs = []; + if (object.installedPackageRef !== undefined && object.installedPackageRef !== null) { + message.installedPackageRef = InstalledPackageReference.fromPartial( + object.installedPackageRef, + ); + } else { + message.installedPackageRef = undefined; + } + if (object.resourceRefs !== undefined && object.resourceRefs !== null) { + for (const e of object.resourceRefs) { + message.resourceRefs.push(ResourceRef.fromPartial(e)); + } + } + if (object.watch !== undefined && object.watch !== null) { + message.watch = object.watch; + } else { + message.watch = false; + } return message; }, }; -function createBaseGetResourcesResponse(): GetResourcesResponse { - return { resourceRef: undefined, manifest: "" }; -} +const baseGetResourcesResponse: object = { manifest: "" }; export const GetResourcesResponse = { encode(message: GetResourcesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -424,7 +440,7 @@ export const GetResourcesResponse = { decode(input: _m0.Reader | Uint8Array, length?: number): GetResourcesResponse { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetResourcesResponse(); + const message = { ...baseGetResourcesResponse } as GetResourcesResponse; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -443,10 +459,18 @@ export const GetResourcesResponse = { }, fromJSON(object: any): GetResourcesResponse { - return { - resourceRef: isSet(object.resourceRef) ? ResourceRef.fromJSON(object.resourceRef) : undefined, - manifest: isSet(object.manifest) ? String(object.manifest) : "", - }; + const message = { ...baseGetResourcesResponse } as GetResourcesResponse; + if (object.resourceRef !== undefined && object.resourceRef !== null) { + message.resourceRef = ResourceRef.fromJSON(object.resourceRef); + } else { + message.resourceRef = undefined; + } + if (object.manifest !== undefined && object.manifest !== null) { + message.manifest = String(object.manifest); + } else { + message.manifest = ""; + } + return message; }, toJSON(message: GetResourcesResponse): unknown { @@ -457,22 +481,23 @@ export const GetResourcesResponse = { return obj; }, - fromPartial, I>>( - object: I, - ): GetResourcesResponse { - const message = createBaseGetResourcesResponse(); - message.resourceRef = - object.resourceRef !== undefined && object.resourceRef !== null - ? ResourceRef.fromPartial(object.resourceRef) - : undefined; - message.manifest = object.manifest ?? ""; + fromPartial(object: DeepPartial): GetResourcesResponse { + const message = { ...baseGetResourcesResponse } as GetResourcesResponse; + if (object.resourceRef !== undefined && object.resourceRef !== null) { + message.resourceRef = ResourceRef.fromPartial(object.resourceRef); + } else { + message.resourceRef = undefined; + } + if (object.manifest !== undefined && object.manifest !== null) { + message.manifest = object.manifest; + } else { + message.manifest = ""; + } return message; }, }; -function createBaseGetServiceAccountNamesRequest(): GetServiceAccountNamesRequest { - return { context: undefined }; -} +const baseGetServiceAccountNamesRequest: object = {}; export const GetServiceAccountNamesRequest = { encode( @@ -488,7 +513,9 @@ export const GetServiceAccountNamesRequest = { decode(input: _m0.Reader | Uint8Array, length?: number): GetServiceAccountNamesRequest { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetServiceAccountNamesRequest(); + const message = { + ...baseGetServiceAccountNamesRequest, + } as GetServiceAccountNamesRequest; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -504,9 +531,15 @@ export const GetServiceAccountNamesRequest = { }, fromJSON(object: any): GetServiceAccountNamesRequest { - return { - context: isSet(object.context) ? Context.fromJSON(object.context) : undefined, - }; + const message = { + ...baseGetServiceAccountNamesRequest, + } as GetServiceAccountNamesRequest; + if (object.context !== undefined && object.context !== null) { + message.context = Context.fromJSON(object.context); + } else { + message.context = undefined; + } + return message; }, toJSON(message: GetServiceAccountNamesRequest): unknown { @@ -516,21 +549,20 @@ export const GetServiceAccountNamesRequest = { return obj; }, - fromPartial, I>>( - object: I, - ): GetServiceAccountNamesRequest { - const message = createBaseGetServiceAccountNamesRequest(); - message.context = - object.context !== undefined && object.context !== null - ? Context.fromPartial(object.context) - : undefined; + fromPartial(object: DeepPartial): GetServiceAccountNamesRequest { + const message = { + ...baseGetServiceAccountNamesRequest, + } as GetServiceAccountNamesRequest; + if (object.context !== undefined && object.context !== null) { + message.context = Context.fromPartial(object.context); + } else { + message.context = undefined; + } return message; }, }; -function createBaseGetServiceAccountNamesResponse(): GetServiceAccountNamesResponse { - return { serviceaccountNames: [] }; -} +const baseGetServiceAccountNamesResponse: object = { serviceaccountNames: "" }; export const GetServiceAccountNamesResponse = { encode( @@ -546,7 +578,10 @@ export const GetServiceAccountNamesResponse = { decode(input: _m0.Reader | Uint8Array, length?: number): GetServiceAccountNamesResponse { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetServiceAccountNamesResponse(); + const message = { + ...baseGetServiceAccountNamesResponse, + } as GetServiceAccountNamesResponse; + message.serviceaccountNames = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -562,11 +597,16 @@ export const GetServiceAccountNamesResponse = { }, fromJSON(object: any): GetServiceAccountNamesResponse { - return { - serviceaccountNames: Array.isArray(object?.serviceaccountNames) - ? object.serviceaccountNames.map((e: any) => String(e)) - : [], - }; + const message = { + ...baseGetServiceAccountNamesResponse, + } as GetServiceAccountNamesResponse; + message.serviceaccountNames = []; + if (object.serviceaccountNames !== undefined && object.serviceaccountNames !== null) { + for (const e of object.serviceaccountNames) { + message.serviceaccountNames.push(String(e)); + } + } + return message; }, toJSON(message: GetServiceAccountNamesResponse): unknown { @@ -579,18 +619,21 @@ export const GetServiceAccountNamesResponse = { return obj; }, - fromPartial, I>>( - object: I, - ): GetServiceAccountNamesResponse { - const message = createBaseGetServiceAccountNamesResponse(); - message.serviceaccountNames = object.serviceaccountNames?.map(e => e) || []; + fromPartial(object: DeepPartial): GetServiceAccountNamesResponse { + const message = { + ...baseGetServiceAccountNamesResponse, + } as GetServiceAccountNamesResponse; + message.serviceaccountNames = []; + if (object.serviceaccountNames !== undefined && object.serviceaccountNames !== null) { + for (const e of object.serviceaccountNames) { + message.serviceaccountNames.push(e); + } + } return message; }, }; -function createBaseGetNamespaceNamesRequest(): GetNamespaceNamesRequest { - return { cluster: "" }; -} +const baseGetNamespaceNamesRequest: object = { cluster: "" }; export const GetNamespaceNamesRequest = { encode(message: GetNamespaceNamesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -603,7 +646,9 @@ export const GetNamespaceNamesRequest = { decode(input: _m0.Reader | Uint8Array, length?: number): GetNamespaceNamesRequest { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetNamespaceNamesRequest(); + const message = { + ...baseGetNamespaceNamesRequest, + } as GetNamespaceNamesRequest; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -619,9 +664,15 @@ export const GetNamespaceNamesRequest = { }, fromJSON(object: any): GetNamespaceNamesRequest { - return { - cluster: isSet(object.cluster) ? String(object.cluster) : "", - }; + const message = { + ...baseGetNamespaceNamesRequest, + } as GetNamespaceNamesRequest; + if (object.cluster !== undefined && object.cluster !== null) { + message.cluster = String(object.cluster); + } else { + message.cluster = ""; + } + return message; }, toJSON(message: GetNamespaceNamesRequest): unknown { @@ -630,18 +681,20 @@ export const GetNamespaceNamesRequest = { return obj; }, - fromPartial, I>>( - object: I, - ): GetNamespaceNamesRequest { - const message = createBaseGetNamespaceNamesRequest(); - message.cluster = object.cluster ?? ""; + fromPartial(object: DeepPartial): GetNamespaceNamesRequest { + const message = { + ...baseGetNamespaceNamesRequest, + } as GetNamespaceNamesRequest; + if (object.cluster !== undefined && object.cluster !== null) { + message.cluster = object.cluster; + } else { + message.cluster = ""; + } return message; }, }; -function createBaseGetNamespaceNamesResponse(): GetNamespaceNamesResponse { - return { namespaceNames: [] }; -} +const baseGetNamespaceNamesResponse: object = { namespaceNames: "" }; export const GetNamespaceNamesResponse = { encode(message: GetNamespaceNamesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -654,7 +707,10 @@ export const GetNamespaceNamesResponse = { decode(input: _m0.Reader | Uint8Array, length?: number): GetNamespaceNamesResponse { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetNamespaceNamesResponse(); + const message = { + ...baseGetNamespaceNamesResponse, + } as GetNamespaceNamesResponse; + message.namespaceNames = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -670,11 +726,16 @@ export const GetNamespaceNamesResponse = { }, fromJSON(object: any): GetNamespaceNamesResponse { - return { - namespaceNames: Array.isArray(object?.namespaceNames) - ? object.namespaceNames.map((e: any) => String(e)) - : [], - }; + const message = { + ...baseGetNamespaceNamesResponse, + } as GetNamespaceNamesResponse; + message.namespaceNames = []; + if (object.namespaceNames !== undefined && object.namespaceNames !== null) { + for (const e of object.namespaceNames) { + message.namespaceNames.push(String(e)); + } + } + return message; }, toJSON(message: GetNamespaceNamesResponse): unknown { @@ -687,18 +748,21 @@ export const GetNamespaceNamesResponse = { return obj; }, - fromPartial, I>>( - object: I, - ): GetNamespaceNamesResponse { - const message = createBaseGetNamespaceNamesResponse(); - message.namespaceNames = object.namespaceNames?.map(e => e) || []; + fromPartial(object: DeepPartial): GetNamespaceNamesResponse { + const message = { + ...baseGetNamespaceNamesResponse, + } as GetNamespaceNamesResponse; + message.namespaceNames = []; + if (object.namespaceNames !== undefined && object.namespaceNames !== null) { + for (const e of object.namespaceNames) { + message.namespaceNames.push(e); + } + } return message; }, }; -function createBaseCreateNamespaceRequest(): CreateNamespaceRequest { - return { context: undefined }; -} +const baseCreateNamespaceRequest: object = {}; export const CreateNamespaceRequest = { encode(message: CreateNamespaceRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -711,7 +775,7 @@ export const CreateNamespaceRequest = { decode(input: _m0.Reader | Uint8Array, length?: number): CreateNamespaceRequest { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseCreateNamespaceRequest(); + const message = { ...baseCreateNamespaceRequest } as CreateNamespaceRequest; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -727,9 +791,13 @@ export const CreateNamespaceRequest = { }, fromJSON(object: any): CreateNamespaceRequest { - return { - context: isSet(object.context) ? Context.fromJSON(object.context) : undefined, - }; + const message = { ...baseCreateNamespaceRequest } as CreateNamespaceRequest; + if (object.context !== undefined && object.context !== null) { + message.context = Context.fromJSON(object.context); + } else { + message.context = undefined; + } + return message; }, toJSON(message: CreateNamespaceRequest): unknown { @@ -739,21 +807,18 @@ export const CreateNamespaceRequest = { return obj; }, - fromPartial, I>>( - object: I, - ): CreateNamespaceRequest { - const message = createBaseCreateNamespaceRequest(); - message.context = - object.context !== undefined && object.context !== null - ? Context.fromPartial(object.context) - : undefined; + fromPartial(object: DeepPartial): CreateNamespaceRequest { + const message = { ...baseCreateNamespaceRequest } as CreateNamespaceRequest; + if (object.context !== undefined && object.context !== null) { + message.context = Context.fromPartial(object.context); + } else { + message.context = undefined; + } return message; }, }; -function createBaseCreateNamespaceResponse(): CreateNamespaceResponse { - return {}; -} +const baseCreateNamespaceResponse: object = {}; export const CreateNamespaceResponse = { encode(_: CreateNamespaceResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -763,7 +828,9 @@ export const CreateNamespaceResponse = { decode(input: _m0.Reader | Uint8Array, length?: number): CreateNamespaceResponse { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseCreateNamespaceResponse(); + const message = { + ...baseCreateNamespaceResponse, + } as CreateNamespaceResponse; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -776,7 +843,10 @@ export const CreateNamespaceResponse = { }, fromJSON(_: any): CreateNamespaceResponse { - return {}; + const message = { + ...baseCreateNamespaceResponse, + } as CreateNamespaceResponse; + return message; }, toJSON(_: CreateNamespaceResponse): unknown { @@ -784,17 +854,15 @@ export const CreateNamespaceResponse = { return obj; }, - fromPartial, I>>( - _: I, - ): CreateNamespaceResponse { - const message = createBaseCreateNamespaceResponse(); + fromPartial(_: DeepPartial): CreateNamespaceResponse { + const message = { + ...baseCreateNamespaceResponse, + } as CreateNamespaceResponse; return message; }, }; -function createBaseCheckNamespaceExistsRequest(): CheckNamespaceExistsRequest { - return { context: undefined }; -} +const baseCheckNamespaceExistsRequest: object = {}; export const CheckNamespaceExistsRequest = { encode( @@ -810,7 +878,9 @@ export const CheckNamespaceExistsRequest = { decode(input: _m0.Reader | Uint8Array, length?: number): CheckNamespaceExistsRequest { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseCheckNamespaceExistsRequest(); + const message = { + ...baseCheckNamespaceExistsRequest, + } as CheckNamespaceExistsRequest; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -826,9 +896,15 @@ export const CheckNamespaceExistsRequest = { }, fromJSON(object: any): CheckNamespaceExistsRequest { - return { - context: isSet(object.context) ? Context.fromJSON(object.context) : undefined, - }; + const message = { + ...baseCheckNamespaceExistsRequest, + } as CheckNamespaceExistsRequest; + if (object.context !== undefined && object.context !== null) { + message.context = Context.fromJSON(object.context); + } else { + message.context = undefined; + } + return message; }, toJSON(message: CheckNamespaceExistsRequest): unknown { @@ -838,21 +914,20 @@ export const CheckNamespaceExistsRequest = { return obj; }, - fromPartial, I>>( - object: I, - ): CheckNamespaceExistsRequest { - const message = createBaseCheckNamespaceExistsRequest(); - message.context = - object.context !== undefined && object.context !== null - ? Context.fromPartial(object.context) - : undefined; + fromPartial(object: DeepPartial): CheckNamespaceExistsRequest { + const message = { + ...baseCheckNamespaceExistsRequest, + } as CheckNamespaceExistsRequest; + if (object.context !== undefined && object.context !== null) { + message.context = Context.fromPartial(object.context); + } else { + message.context = undefined; + } return message; }, }; -function createBaseCheckNamespaceExistsResponse(): CheckNamespaceExistsResponse { - return { exists: false }; -} +const baseCheckNamespaceExistsResponse: object = { exists: false }; export const CheckNamespaceExistsResponse = { encode( @@ -868,7 +943,9 @@ export const CheckNamespaceExistsResponse = { decode(input: _m0.Reader | Uint8Array, length?: number): CheckNamespaceExistsResponse { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseCheckNamespaceExistsResponse(); + const message = { + ...baseCheckNamespaceExistsResponse, + } as CheckNamespaceExistsResponse; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -884,9 +961,15 @@ export const CheckNamespaceExistsResponse = { }, fromJSON(object: any): CheckNamespaceExistsResponse { - return { - exists: isSet(object.exists) ? Boolean(object.exists) : false, - }; + const message = { + ...baseCheckNamespaceExistsResponse, + } as CheckNamespaceExistsResponse; + if (object.exists !== undefined && object.exists !== null) { + message.exists = Boolean(object.exists); + } else { + message.exists = false; + } + return message; }, toJSON(message: CheckNamespaceExistsResponse): unknown { @@ -895,18 +978,20 @@ export const CheckNamespaceExistsResponse = { return obj; }, - fromPartial, I>>( - object: I, - ): CheckNamespaceExistsResponse { - const message = createBaseCheckNamespaceExistsResponse(); - message.exists = object.exists ?? false; + fromPartial(object: DeepPartial): CheckNamespaceExistsResponse { + const message = { + ...baseCheckNamespaceExistsResponse, + } as CheckNamespaceExistsResponse; + if (object.exists !== undefined && object.exists !== null) { + message.exists = object.exists; + } else { + message.exists = false; + } return message; }, }; -function createBaseCreateSecretRequest(): CreateSecretRequest { - return { context: undefined, type: 0, name: "", stringData: {} }; -} +const baseCreateSecretRequest: object = { type: 0, name: "" }; export const CreateSecretRequest = { encode(message: CreateSecretRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -931,7 +1016,8 @@ export const CreateSecretRequest = { decode(input: _m0.Reader | Uint8Array, length?: number): CreateSecretRequest { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseCreateSecretRequest(); + const message = { ...baseCreateSecretRequest } as CreateSecretRequest; + message.stringData = {}; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -959,20 +1045,29 @@ export const CreateSecretRequest = { }, fromJSON(object: any): CreateSecretRequest { - return { - context: isSet(object.context) ? Context.fromJSON(object.context) : undefined, - type: isSet(object.type) ? secretTypeFromJSON(object.type) : 0, - name: isSet(object.name) ? String(object.name) : "", - stringData: isObject(object.stringData) - ? Object.entries(object.stringData).reduce<{ [key: string]: string }>( - (acc, [key, value]) => { - acc[key] = String(value); - return acc; - }, - {}, - ) - : {}, - }; + const message = { ...baseCreateSecretRequest } as CreateSecretRequest; + message.stringData = {}; + if (object.context !== undefined && object.context !== null) { + message.context = Context.fromJSON(object.context); + } else { + message.context = undefined; + } + if (object.type !== undefined && object.type !== null) { + message.type = secretTypeFromJSON(object.type); + } else { + message.type = 0; + } + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.stringData !== undefined && object.stringData !== null) { + Object.entries(object.stringData).forEach(([key, value]) => { + message.stringData[key] = String(value); + }); + } + return message; }, toJSON(message: CreateSecretRequest): unknown { @@ -990,31 +1085,36 @@ export const CreateSecretRequest = { return obj; }, - fromPartial, I>>( - object: I, - ): CreateSecretRequest { - const message = createBaseCreateSecretRequest(); - message.context = - object.context !== undefined && object.context !== null - ? Context.fromPartial(object.context) - : undefined; - message.type = object.type ?? 0; - message.name = object.name ?? ""; - message.stringData = Object.entries(object.stringData ?? {}).reduce<{ - [key: string]: string; - }>((acc, [key, value]) => { - if (value !== undefined) { - acc[key] = String(value); - } - return acc; - }, {}); + fromPartial(object: DeepPartial): CreateSecretRequest { + const message = { ...baseCreateSecretRequest } as CreateSecretRequest; + message.stringData = {}; + if (object.context !== undefined && object.context !== null) { + message.context = Context.fromPartial(object.context); + } else { + message.context = undefined; + } + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } else { + message.type = 0; + } + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.stringData !== undefined && object.stringData !== null) { + Object.entries(object.stringData).forEach(([key, value]) => { + if (value !== undefined) { + message.stringData[key] = String(value); + } + }); + } return message; }, }; -function createBaseCreateSecretRequest_StringDataEntry(): CreateSecretRequest_StringDataEntry { - return { key: "", value: "" }; -} +const baseCreateSecretRequest_StringDataEntry: object = { key: "", value: "" }; export const CreateSecretRequest_StringDataEntry = { encode( @@ -1033,7 +1133,9 @@ export const CreateSecretRequest_StringDataEntry = { decode(input: _m0.Reader | Uint8Array, length?: number): CreateSecretRequest_StringDataEntry { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseCreateSecretRequest_StringDataEntry(); + const message = { + ...baseCreateSecretRequest_StringDataEntry, + } as CreateSecretRequest_StringDataEntry; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1052,10 +1154,20 @@ export const CreateSecretRequest_StringDataEntry = { }, fromJSON(object: any): CreateSecretRequest_StringDataEntry { - return { - key: isSet(object.key) ? String(object.key) : "", - value: isSet(object.value) ? String(object.value) : "", - }; + const message = { + ...baseCreateSecretRequest_StringDataEntry, + } as CreateSecretRequest_StringDataEntry; + if (object.key !== undefined && object.key !== null) { + message.key = String(object.key); + } else { + message.key = ""; + } + if (object.value !== undefined && object.value !== null) { + message.value = String(object.value); + } else { + message.value = ""; + } + return message; }, toJSON(message: CreateSecretRequest_StringDataEntry): unknown { @@ -1065,19 +1177,27 @@ export const CreateSecretRequest_StringDataEntry = { return obj; }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): CreateSecretRequest_StringDataEntry { - const message = createBaseCreateSecretRequest_StringDataEntry(); - message.key = object.key ?? ""; - message.value = object.value ?? ""; + const message = { + ...baseCreateSecretRequest_StringDataEntry, + } as CreateSecretRequest_StringDataEntry; + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } else { + message.key = ""; + } + if (object.value !== undefined && object.value !== null) { + message.value = object.value; + } else { + message.value = ""; + } return message; }, }; -function createBaseCreateSecretResponse(): CreateSecretResponse { - return {}; -} +const baseCreateSecretResponse: object = {}; export const CreateSecretResponse = { encode(_: CreateSecretResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -1087,7 +1207,7 @@ export const CreateSecretResponse = { decode(input: _m0.Reader | Uint8Array, length?: number): CreateSecretResponse { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseCreateSecretResponse(); + const message = { ...baseCreateSecretResponse } as CreateSecretResponse; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1100,7 +1220,8 @@ export const CreateSecretResponse = { }, fromJSON(_: any): CreateSecretResponse { - return {}; + const message = { ...baseCreateSecretResponse } as CreateSecretResponse; + return message; }, toJSON(_: CreateSecretResponse): unknown { @@ -1108,15 +1229,13 @@ export const CreateSecretResponse = { return obj; }, - fromPartial, I>>(_: I): CreateSecretResponse { - const message = createBaseCreateSecretResponse(); + fromPartial(_: DeepPartial): CreateSecretResponse { + const message = { ...baseCreateSecretResponse } as CreateSecretResponse; return message; }, }; -function createBaseGetSecretNamesRequest(): GetSecretNamesRequest { - return { context: undefined }; -} +const baseGetSecretNamesRequest: object = {}; export const GetSecretNamesRequest = { encode(message: GetSecretNamesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -1129,7 +1248,7 @@ export const GetSecretNamesRequest = { decode(input: _m0.Reader | Uint8Array, length?: number): GetSecretNamesRequest { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetSecretNamesRequest(); + const message = { ...baseGetSecretNamesRequest } as GetSecretNamesRequest; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1145,9 +1264,13 @@ export const GetSecretNamesRequest = { }, fromJSON(object: any): GetSecretNamesRequest { - return { - context: isSet(object.context) ? Context.fromJSON(object.context) : undefined, - }; + const message = { ...baseGetSecretNamesRequest } as GetSecretNamesRequest; + if (object.context !== undefined && object.context !== null) { + message.context = Context.fromJSON(object.context); + } else { + message.context = undefined; + } + return message; }, toJSON(message: GetSecretNamesRequest): unknown { @@ -1157,21 +1280,18 @@ export const GetSecretNamesRequest = { return obj; }, - fromPartial, I>>( - object: I, - ): GetSecretNamesRequest { - const message = createBaseGetSecretNamesRequest(); - message.context = - object.context !== undefined && object.context !== null - ? Context.fromPartial(object.context) - : undefined; + fromPartial(object: DeepPartial): GetSecretNamesRequest { + const message = { ...baseGetSecretNamesRequest } as GetSecretNamesRequest; + if (object.context !== undefined && object.context !== null) { + message.context = Context.fromPartial(object.context); + } else { + message.context = undefined; + } return message; }, }; -function createBaseGetSecretNamesResponse(): GetSecretNamesResponse { - return { secretNames: {} }; -} +const baseGetSecretNamesResponse: object = {}; export const GetSecretNamesResponse = { encode(message: GetSecretNamesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -1187,7 +1307,8 @@ export const GetSecretNamesResponse = { decode(input: _m0.Reader | Uint8Array, length?: number): GetSecretNamesResponse { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetSecretNamesResponse(); + const message = { ...baseGetSecretNamesResponse } as GetSecretNamesResponse; + message.secretNames = {}; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1206,16 +1327,14 @@ export const GetSecretNamesResponse = { }, fromJSON(object: any): GetSecretNamesResponse { - return { - secretNames: isObject(object.secretNames) - ? Object.entries(object.secretNames).reduce<{ - [key: string]: SecretType; - }>((acc, [key, value]) => { - acc[key] = value as number; - return acc; - }, {}) - : {}, - }; + const message = { ...baseGetSecretNamesResponse } as GetSecretNamesResponse; + message.secretNames = {}; + if (object.secretNames !== undefined && object.secretNames !== null) { + Object.entries(object.secretNames).forEach(([key, value]) => { + message.secretNames[key] = value as number; + }); + } + return message; }, toJSON(message: GetSecretNamesResponse): unknown { @@ -1229,25 +1348,24 @@ export const GetSecretNamesResponse = { return obj; }, - fromPartial, I>>( - object: I, - ): GetSecretNamesResponse { - const message = createBaseGetSecretNamesResponse(); - message.secretNames = Object.entries(object.secretNames ?? {}).reduce<{ - [key: string]: SecretType; - }>((acc, [key, value]) => { - if (value !== undefined) { - acc[key] = value as number; - } - return acc; - }, {}); + fromPartial(object: DeepPartial): GetSecretNamesResponse { + const message = { ...baseGetSecretNamesResponse } as GetSecretNamesResponse; + message.secretNames = {}; + if (object.secretNames !== undefined && object.secretNames !== null) { + Object.entries(object.secretNames).forEach(([key, value]) => { + if (value !== undefined) { + message.secretNames[key] = value as number; + } + }); + } return message; }, }; -function createBaseGetSecretNamesResponse_SecretNamesEntry(): GetSecretNamesResponse_SecretNamesEntry { - return { key: "", value: 0 }; -} +const baseGetSecretNamesResponse_SecretNamesEntry: object = { + key: "", + value: 0, +}; export const GetSecretNamesResponse_SecretNamesEntry = { encode( @@ -1266,7 +1384,9 @@ export const GetSecretNamesResponse_SecretNamesEntry = { decode(input: _m0.Reader | Uint8Array, length?: number): GetSecretNamesResponse_SecretNamesEntry { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetSecretNamesResponse_SecretNamesEntry(); + const message = { + ...baseGetSecretNamesResponse_SecretNamesEntry, + } as GetSecretNamesResponse_SecretNamesEntry; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1285,10 +1405,20 @@ export const GetSecretNamesResponse_SecretNamesEntry = { }, fromJSON(object: any): GetSecretNamesResponse_SecretNamesEntry { - return { - key: isSet(object.key) ? String(object.key) : "", - value: isSet(object.value) ? secretTypeFromJSON(object.value) : 0, - }; + const message = { + ...baseGetSecretNamesResponse_SecretNamesEntry, + } as GetSecretNamesResponse_SecretNamesEntry; + if (object.key !== undefined && object.key !== null) { + message.key = String(object.key); + } else { + message.key = ""; + } + if (object.value !== undefined && object.value !== null) { + message.value = secretTypeFromJSON(object.value); + } else { + message.value = 0; + } + return message; }, toJSON(message: GetSecretNamesResponse_SecretNamesEntry): unknown { @@ -1298,12 +1428,22 @@ export const GetSecretNamesResponse_SecretNamesEntry = { return obj; }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): GetSecretNamesResponse_SecretNamesEntry { - const message = createBaseGetSecretNamesResponse_SecretNamesEntry(); - message.key = object.key ?? ""; - message.value = object.value ?? 0; + const message = { + ...baseGetSecretNamesResponse_SecretNamesEntry, + } as GetSecretNamesResponse_SecretNamesEntry; + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } else { + message.key = ""; + } + if (object.value !== undefined && object.value !== null) { + message.value = object.value; + } else { + message.value = 0; + } return message; }, }; @@ -1714,7 +1854,6 @@ export class GrpcWebImpl { } type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - export type DeepPartial = T extends Builtin ? T : T extends Array @@ -1725,20 +1864,7 @@ export type DeepPartial = T extends Builtin ? { [K in keyof T]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & Record>, never>; - if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); } - -function isObject(value: any): boolean { - return typeof value === "object" && value !== null; -} - -function isSet(value: any): boolean { - return value !== null && value !== undefined; -} diff --git a/dashboard/src/gen/protoc-gen-openapiv2/options/openapiv2.ts b/dashboard/src/gen/protoc-gen-openapiv2/options/openapiv2.ts index e7012dcef0b..63320f4c780 100644 --- a/dashboard/src/gen/protoc-gen-openapiv2/options/openapiv2.ts +++ b/dashboard/src/gen/protoc-gen-openapiv2/options/openapiv2.ts @@ -151,7 +151,7 @@ export interface Swagger { security: SecurityRequirement[]; /** Additional external documentation. */ externalDocs?: ExternalDocumentation; - extensions: { [key: string]: any }; + extensions: { [key: string]: Value }; } export interface Swagger_ResponsesEntry { @@ -161,7 +161,7 @@ export interface Swagger_ResponsesEntry { export interface Swagger_ExtensionsEntry { key: string; - value?: any; + value?: Value; } /** @@ -252,7 +252,7 @@ export interface Operation { * security declaration, an empty array can be used. */ security: SecurityRequirement[]; - extensions: { [key: string]: any }; + extensions: { [key: string]: Value }; } export interface Operation_ResponsesEntry { @@ -262,7 +262,7 @@ export interface Operation_ResponsesEntry { export interface Operation_ExtensionsEntry { key: string; - value?: any; + value?: Value; } /** @@ -314,7 +314,7 @@ export interface Response { * See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#example-object */ examples: { [key: string]: string }; - extensions: { [key: string]: any }; + extensions: { [key: string]: Value }; } export interface Response_HeadersEntry { @@ -329,7 +329,7 @@ export interface Response_ExamplesEntry { export interface Response_ExtensionsEntry { key: string; - value?: any; + value?: Value; } /** @@ -376,12 +376,12 @@ export interface Info { * with the specification version). */ version: string; - extensions: { [key: string]: any }; + extensions: { [key: string]: Value }; } export interface Info_ExtensionsEntry { key: string; - value?: any; + value?: Value; } /** @@ -752,7 +752,7 @@ export interface SecurityScheme { * Valid for oauth2. */ scopes?: Scopes; - extensions: { [key: string]: any }; + extensions: { [key: string]: Value }; } /** @@ -898,7 +898,7 @@ export function securityScheme_FlowToJSON(object: SecurityScheme_Flow): string { export interface SecurityScheme_ExtensionsEntry { key: string; - value?: any; + value?: Value; } /** @@ -960,22 +960,14 @@ export interface Scopes_ScopeEntry { value: string; } -function createBaseSwagger(): Swagger { - return { - swagger: "", - info: undefined, - host: "", - basePath: "", - schemes: [], - consumes: [], - produces: [], - responses: {}, - securityDefinitions: undefined, - security: [], - externalDocs: undefined, - extensions: {}, - }; -} +const baseSwagger: object = { + swagger: "", + host: "", + basePath: "", + schemes: 0, + consumes: "", + produces: "", +}; export const Swagger = { encode(message: Swagger, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -1015,12 +1007,10 @@ export const Swagger = { ExternalDocumentation.encode(message.externalDocs, writer.uint32(114).fork()).ldelim(); } Object.entries(message.extensions).forEach(([key, value]) => { - if (value !== undefined) { - Swagger_ExtensionsEntry.encode( - { key: key as any, value }, - writer.uint32(122).fork(), - ).ldelim(); - } + Swagger_ExtensionsEntry.encode( + { key: key as any, value }, + writer.uint32(122).fork(), + ).ldelim(); }); return writer; }, @@ -1028,7 +1018,13 @@ export const Swagger = { decode(input: _m0.Reader | Uint8Array, length?: number): Swagger { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseSwagger(); + const message = { ...baseSwagger } as Swagger; + message.schemes = []; + message.consumes = []; + message.produces = []; + message.responses = {}; + message.security = []; + message.extensions = {}; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1090,41 +1086,74 @@ export const Swagger = { }, fromJSON(object: any): Swagger { - return { - swagger: isSet(object.swagger) ? String(object.swagger) : "", - info: isSet(object.info) ? Info.fromJSON(object.info) : undefined, - host: isSet(object.host) ? String(object.host) : "", - basePath: isSet(object.basePath) ? String(object.basePath) : "", - schemes: Array.isArray(object?.schemes) - ? object.schemes.map((e: any) => schemeFromJSON(e)) - : [], - consumes: Array.isArray(object?.consumes) ? object.consumes.map((e: any) => String(e)) : [], - produces: Array.isArray(object?.produces) ? object.produces.map((e: any) => String(e)) : [], - responses: isObject(object.responses) - ? Object.entries(object.responses).reduce<{ [key: string]: Response }>( - (acc, [key, value]) => { - acc[key] = Response.fromJSON(value); - return acc; - }, - {}, - ) - : {}, - securityDefinitions: isSet(object.securityDefinitions) - ? SecurityDefinitions.fromJSON(object.securityDefinitions) - : undefined, - security: Array.isArray(object?.security) - ? object.security.map((e: any) => SecurityRequirement.fromJSON(e)) - : [], - externalDocs: isSet(object.externalDocs) - ? ExternalDocumentation.fromJSON(object.externalDocs) - : undefined, - extensions: isObject(object.extensions) - ? Object.entries(object.extensions).reduce<{ [key: string]: any }>((acc, [key, value]) => { - acc[key] = value as any; - return acc; - }, {}) - : {}, - }; + const message = { ...baseSwagger } as Swagger; + message.schemes = []; + message.consumes = []; + message.produces = []; + message.responses = {}; + message.security = []; + message.extensions = {}; + if (object.swagger !== undefined && object.swagger !== null) { + message.swagger = String(object.swagger); + } else { + message.swagger = ""; + } + if (object.info !== undefined && object.info !== null) { + message.info = Info.fromJSON(object.info); + } else { + message.info = undefined; + } + if (object.host !== undefined && object.host !== null) { + message.host = String(object.host); + } else { + message.host = ""; + } + if (object.basePath !== undefined && object.basePath !== null) { + message.basePath = String(object.basePath); + } else { + message.basePath = ""; + } + if (object.schemes !== undefined && object.schemes !== null) { + for (const e of object.schemes) { + message.schemes.push(schemeFromJSON(e)); + } + } + if (object.consumes !== undefined && object.consumes !== null) { + for (const e of object.consumes) { + message.consumes.push(String(e)); + } + } + if (object.produces !== undefined && object.produces !== null) { + for (const e of object.produces) { + message.produces.push(String(e)); + } + } + if (object.responses !== undefined && object.responses !== null) { + Object.entries(object.responses).forEach(([key, value]) => { + message.responses[key] = Response.fromJSON(value); + }); + } + if (object.securityDefinitions !== undefined && object.securityDefinitions !== null) { + message.securityDefinitions = SecurityDefinitions.fromJSON(object.securityDefinitions); + } else { + message.securityDefinitions = undefined; + } + if (object.security !== undefined && object.security !== null) { + for (const e of object.security) { + message.security.push(SecurityRequirement.fromJSON(e)); + } + } + if (object.externalDocs !== undefined && object.externalDocs !== null) { + message.externalDocs = ExternalDocumentation.fromJSON(object.externalDocs); + } else { + message.externalDocs = undefined; + } + if (object.extensions !== undefined && object.extensions !== null) { + Object.entries(object.extensions).forEach(([key, value]) => { + message.extensions[key] = Value.fromJSON(value); + }); + } + return message; }, toJSON(message: Swagger): unknown { @@ -1170,54 +1199,89 @@ export const Swagger = { obj.extensions = {}; if (message.extensions) { Object.entries(message.extensions).forEach(([k, v]) => { - obj.extensions[k] = v; + obj.extensions[k] = Value.toJSON(v); }); } return obj; }, - fromPartial, I>>(object: I): Swagger { - const message = createBaseSwagger(); - message.swagger = object.swagger ?? ""; - message.info = - object.info !== undefined && object.info !== null ? Info.fromPartial(object.info) : undefined; - message.host = object.host ?? ""; - message.basePath = object.basePath ?? ""; - message.schemes = object.schemes?.map(e => e) || []; - message.consumes = object.consumes?.map(e => e) || []; - message.produces = object.produces?.map(e => e) || []; - message.responses = Object.entries(object.responses ?? {}).reduce<{ - [key: string]: Response; - }>((acc, [key, value]) => { - if (value !== undefined) { - acc[key] = Response.fromPartial(value); + fromPartial(object: DeepPartial): Swagger { + const message = { ...baseSwagger } as Swagger; + message.schemes = []; + message.consumes = []; + message.produces = []; + message.responses = {}; + message.security = []; + message.extensions = {}; + if (object.swagger !== undefined && object.swagger !== null) { + message.swagger = object.swagger; + } else { + message.swagger = ""; + } + if (object.info !== undefined && object.info !== null) { + message.info = Info.fromPartial(object.info); + } else { + message.info = undefined; + } + if (object.host !== undefined && object.host !== null) { + message.host = object.host; + } else { + message.host = ""; + } + if (object.basePath !== undefined && object.basePath !== null) { + message.basePath = object.basePath; + } else { + message.basePath = ""; + } + if (object.schemes !== undefined && object.schemes !== null) { + for (const e of object.schemes) { + message.schemes.push(e); + } + } + if (object.consumes !== undefined && object.consumes !== null) { + for (const e of object.consumes) { + message.consumes.push(e); + } + } + if (object.produces !== undefined && object.produces !== null) { + for (const e of object.produces) { + message.produces.push(e); } - return acc; - }, {}); - message.securityDefinitions = - object.securityDefinitions !== undefined && object.securityDefinitions !== null - ? SecurityDefinitions.fromPartial(object.securityDefinitions) - : undefined; - message.security = object.security?.map(e => SecurityRequirement.fromPartial(e)) || []; - message.externalDocs = - object.externalDocs !== undefined && object.externalDocs !== null - ? ExternalDocumentation.fromPartial(object.externalDocs) - : undefined; - message.extensions = Object.entries(object.extensions ?? {}).reduce<{ - [key: string]: any; - }>((acc, [key, value]) => { - if (value !== undefined) { - acc[key] = value; + } + if (object.responses !== undefined && object.responses !== null) { + Object.entries(object.responses).forEach(([key, value]) => { + if (value !== undefined) { + message.responses[key] = Response.fromPartial(value); + } + }); + } + if (object.securityDefinitions !== undefined && object.securityDefinitions !== null) { + message.securityDefinitions = SecurityDefinitions.fromPartial(object.securityDefinitions); + } else { + message.securityDefinitions = undefined; + } + if (object.security !== undefined && object.security !== null) { + for (const e of object.security) { + message.security.push(SecurityRequirement.fromPartial(e)); } - return acc; - }, {}); + } + if (object.externalDocs !== undefined && object.externalDocs !== null) { + message.externalDocs = ExternalDocumentation.fromPartial(object.externalDocs); + } else { + message.externalDocs = undefined; + } + if (object.extensions !== undefined && object.extensions !== null) { + Object.entries(object.extensions).forEach(([key, value]) => { + if (value !== undefined) { + message.extensions[key] = Value.fromPartial(value); + } + }); + } return message; }, }; -function createBaseSwagger_ResponsesEntry(): Swagger_ResponsesEntry { - return { key: "", value: undefined }; -} +const baseSwagger_ResponsesEntry: object = { key: "" }; export const Swagger_ResponsesEntry = { encode(message: Swagger_ResponsesEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -1233,7 +1297,7 @@ export const Swagger_ResponsesEntry = { decode(input: _m0.Reader | Uint8Array, length?: number): Swagger_ResponsesEntry { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseSwagger_ResponsesEntry(); + const message = { ...baseSwagger_ResponsesEntry } as Swagger_ResponsesEntry; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1252,10 +1316,18 @@ export const Swagger_ResponsesEntry = { }, fromJSON(object: any): Swagger_ResponsesEntry { - return { - key: isSet(object.key) ? String(object.key) : "", - value: isSet(object.value) ? Response.fromJSON(object.value) : undefined, - }; + const message = { ...baseSwagger_ResponsesEntry } as Swagger_ResponsesEntry; + if (object.key !== undefined && object.key !== null) { + message.key = String(object.key); + } else { + message.key = ""; + } + if (object.value !== undefined && object.value !== null) { + message.value = Response.fromJSON(object.value); + } else { + message.value = undefined; + } + return message; }, toJSON(message: Swagger_ResponsesEntry): unknown { @@ -1266,22 +1338,23 @@ export const Swagger_ResponsesEntry = { return obj; }, - fromPartial, I>>( - object: I, - ): Swagger_ResponsesEntry { - const message = createBaseSwagger_ResponsesEntry(); - message.key = object.key ?? ""; - message.value = - object.value !== undefined && object.value !== null - ? Response.fromPartial(object.value) - : undefined; + fromPartial(object: DeepPartial): Swagger_ResponsesEntry { + const message = { ...baseSwagger_ResponsesEntry } as Swagger_ResponsesEntry; + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } else { + message.key = ""; + } + if (object.value !== undefined && object.value !== null) { + message.value = Response.fromPartial(object.value); + } else { + message.value = undefined; + } return message; }, }; -function createBaseSwagger_ExtensionsEntry(): Swagger_ExtensionsEntry { - return { key: "", value: undefined }; -} +const baseSwagger_ExtensionsEntry: object = { key: "" }; export const Swagger_ExtensionsEntry = { encode(message: Swagger_ExtensionsEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -1289,7 +1362,7 @@ export const Swagger_ExtensionsEntry = { writer.uint32(10).string(message.key); } if (message.value !== undefined) { - Value.encode(Value.wrap(message.value), writer.uint32(18).fork()).ldelim(); + Value.encode(message.value, writer.uint32(18).fork()).ldelim(); } return writer; }, @@ -1297,7 +1370,9 @@ export const Swagger_ExtensionsEntry = { decode(input: _m0.Reader | Uint8Array, length?: number): Swagger_ExtensionsEntry { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseSwagger_ExtensionsEntry(); + const message = { + ...baseSwagger_ExtensionsEntry, + } as Swagger_ExtensionsEntry; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1305,7 +1380,7 @@ export const Swagger_ExtensionsEntry = { message.key = reader.string(); break; case 2: - message.value = Value.unwrap(Value.decode(reader, reader.uint32())); + message.value = Value.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -1316,45 +1391,58 @@ export const Swagger_ExtensionsEntry = { }, fromJSON(object: any): Swagger_ExtensionsEntry { - return { - key: isSet(object.key) ? String(object.key) : "", - value: isSet(object?.value) ? object.value : undefined, - }; + const message = { + ...baseSwagger_ExtensionsEntry, + } as Swagger_ExtensionsEntry; + if (object.key !== undefined && object.key !== null) { + message.key = String(object.key); + } else { + message.key = ""; + } + if (object.value !== undefined && object.value !== null) { + message.value = Value.fromJSON(object.value); + } else { + message.value = undefined; + } + return message; }, toJSON(message: Swagger_ExtensionsEntry): unknown { const obj: any = {}; message.key !== undefined && (obj.key = message.key); - message.value !== undefined && (obj.value = message.value); + message.value !== undefined && + (obj.value = message.value ? Value.toJSON(message.value) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): Swagger_ExtensionsEntry { - const message = createBaseSwagger_ExtensionsEntry(); - message.key = object.key ?? ""; - message.value = object.value ?? undefined; + fromPartial(object: DeepPartial): Swagger_ExtensionsEntry { + const message = { + ...baseSwagger_ExtensionsEntry, + } as Swagger_ExtensionsEntry; + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } else { + message.key = ""; + } + if (object.value !== undefined && object.value !== null) { + message.value = Value.fromPartial(object.value); + } else { + message.value = undefined; + } return message; }, }; -function createBaseOperation(): Operation { - return { - tags: [], - summary: "", - description: "", - externalDocs: undefined, - operationId: "", - consumes: [], - produces: [], - responses: {}, - schemes: [], - deprecated: false, - security: [], - extensions: {}, - }; -} +const baseOperation: object = { + tags: "", + summary: "", + description: "", + operationId: "", + consumes: "", + produces: "", + schemes: 0, + deprecated: false, +}; export const Operation = { encode(message: Operation, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -1397,12 +1485,10 @@ export const Operation = { SecurityRequirement.encode(v!, writer.uint32(98).fork()).ldelim(); } Object.entries(message.extensions).forEach(([key, value]) => { - if (value !== undefined) { - Operation_ExtensionsEntry.encode( - { key: key as any, value }, - writer.uint32(106).fork(), - ).ldelim(); - } + Operation_ExtensionsEntry.encode( + { key: key as any, value }, + writer.uint32(106).fork(), + ).ldelim(); }); return writer; }, @@ -1410,7 +1496,14 @@ export const Operation = { decode(input: _m0.Reader | Uint8Array, length?: number): Operation { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseOperation(); + const message = { ...baseOperation } as Operation; + message.tags = []; + message.consumes = []; + message.produces = []; + message.responses = {}; + message.schemes = []; + message.security = []; + message.extensions = {}; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1472,39 +1565,75 @@ export const Operation = { }, fromJSON(object: any): Operation { - return { - tags: Array.isArray(object?.tags) ? object.tags.map((e: any) => String(e)) : [], - summary: isSet(object.summary) ? String(object.summary) : "", - description: isSet(object.description) ? String(object.description) : "", - externalDocs: isSet(object.externalDocs) - ? ExternalDocumentation.fromJSON(object.externalDocs) - : undefined, - operationId: isSet(object.operationId) ? String(object.operationId) : "", - consumes: Array.isArray(object?.consumes) ? object.consumes.map((e: any) => String(e)) : [], - produces: Array.isArray(object?.produces) ? object.produces.map((e: any) => String(e)) : [], - responses: isObject(object.responses) - ? Object.entries(object.responses).reduce<{ [key: string]: Response }>( - (acc, [key, value]) => { - acc[key] = Response.fromJSON(value); - return acc; - }, - {}, - ) - : {}, - schemes: Array.isArray(object?.schemes) - ? object.schemes.map((e: any) => schemeFromJSON(e)) - : [], - deprecated: isSet(object.deprecated) ? Boolean(object.deprecated) : false, - security: Array.isArray(object?.security) - ? object.security.map((e: any) => SecurityRequirement.fromJSON(e)) - : [], - extensions: isObject(object.extensions) - ? Object.entries(object.extensions).reduce<{ [key: string]: any }>((acc, [key, value]) => { - acc[key] = value as any; - return acc; - }, {}) - : {}, - }; + const message = { ...baseOperation } as Operation; + message.tags = []; + message.consumes = []; + message.produces = []; + message.responses = {}; + message.schemes = []; + message.security = []; + message.extensions = {}; + if (object.tags !== undefined && object.tags !== null) { + for (const e of object.tags) { + message.tags.push(String(e)); + } + } + if (object.summary !== undefined && object.summary !== null) { + message.summary = String(object.summary); + } else { + message.summary = ""; + } + if (object.description !== undefined && object.description !== null) { + message.description = String(object.description); + } else { + message.description = ""; + } + if (object.externalDocs !== undefined && object.externalDocs !== null) { + message.externalDocs = ExternalDocumentation.fromJSON(object.externalDocs); + } else { + message.externalDocs = undefined; + } + if (object.operationId !== undefined && object.operationId !== null) { + message.operationId = String(object.operationId); + } else { + message.operationId = ""; + } + if (object.consumes !== undefined && object.consumes !== null) { + for (const e of object.consumes) { + message.consumes.push(String(e)); + } + } + if (object.produces !== undefined && object.produces !== null) { + for (const e of object.produces) { + message.produces.push(String(e)); + } + } + if (object.responses !== undefined && object.responses !== null) { + Object.entries(object.responses).forEach(([key, value]) => { + message.responses[key] = Response.fromJSON(value); + }); + } + if (object.schemes !== undefined && object.schemes !== null) { + for (const e of object.schemes) { + message.schemes.push(schemeFromJSON(e)); + } + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = Boolean(object.deprecated); + } else { + message.deprecated = false; + } + if (object.security !== undefined && object.security !== null) { + for (const e of object.security) { + message.security.push(SecurityRequirement.fromJSON(e)); + } + } + if (object.extensions !== undefined && object.extensions !== null) { + Object.entries(object.extensions).forEach(([key, value]) => { + message.extensions[key] = Value.fromJSON(value); + }); + } + return message; }, toJSON(message: Operation): unknown { @@ -1551,50 +1680,90 @@ export const Operation = { obj.extensions = {}; if (message.extensions) { Object.entries(message.extensions).forEach(([k, v]) => { - obj.extensions[k] = v; + obj.extensions[k] = Value.toJSON(v); }); } return obj; }, - fromPartial, I>>(object: I): Operation { - const message = createBaseOperation(); - message.tags = object.tags?.map(e => e) || []; - message.summary = object.summary ?? ""; - message.description = object.description ?? ""; - message.externalDocs = - object.externalDocs !== undefined && object.externalDocs !== null - ? ExternalDocumentation.fromPartial(object.externalDocs) - : undefined; - message.operationId = object.operationId ?? ""; - message.consumes = object.consumes?.map(e => e) || []; - message.produces = object.produces?.map(e => e) || []; - message.responses = Object.entries(object.responses ?? {}).reduce<{ - [key: string]: Response; - }>((acc, [key, value]) => { - if (value !== undefined) { - acc[key] = Response.fromPartial(value); + fromPartial(object: DeepPartial): Operation { + const message = { ...baseOperation } as Operation; + message.tags = []; + message.consumes = []; + message.produces = []; + message.responses = {}; + message.schemes = []; + message.security = []; + message.extensions = {}; + if (object.tags !== undefined && object.tags !== null) { + for (const e of object.tags) { + message.tags.push(e); + } + } + if (object.summary !== undefined && object.summary !== null) { + message.summary = object.summary; + } else { + message.summary = ""; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } else { + message.description = ""; + } + if (object.externalDocs !== undefined && object.externalDocs !== null) { + message.externalDocs = ExternalDocumentation.fromPartial(object.externalDocs); + } else { + message.externalDocs = undefined; + } + if (object.operationId !== undefined && object.operationId !== null) { + message.operationId = object.operationId; + } else { + message.operationId = ""; + } + if (object.consumes !== undefined && object.consumes !== null) { + for (const e of object.consumes) { + message.consumes.push(e); + } + } + if (object.produces !== undefined && object.produces !== null) { + for (const e of object.produces) { + message.produces.push(e); + } + } + if (object.responses !== undefined && object.responses !== null) { + Object.entries(object.responses).forEach(([key, value]) => { + if (value !== undefined) { + message.responses[key] = Response.fromPartial(value); + } + }); + } + if (object.schemes !== undefined && object.schemes !== null) { + for (const e of object.schemes) { + message.schemes.push(e); } - return acc; - }, {}); - message.schemes = object.schemes?.map(e => e) || []; - message.deprecated = object.deprecated ?? false; - message.security = object.security?.map(e => SecurityRequirement.fromPartial(e)) || []; - message.extensions = Object.entries(object.extensions ?? {}).reduce<{ - [key: string]: any; - }>((acc, [key, value]) => { - if (value !== undefined) { - acc[key] = value; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } else { + message.deprecated = false; + } + if (object.security !== undefined && object.security !== null) { + for (const e of object.security) { + message.security.push(SecurityRequirement.fromPartial(e)); } - return acc; - }, {}); + } + if (object.extensions !== undefined && object.extensions !== null) { + Object.entries(object.extensions).forEach(([key, value]) => { + if (value !== undefined) { + message.extensions[key] = Value.fromPartial(value); + } + }); + } return message; }, }; -function createBaseOperation_ResponsesEntry(): Operation_ResponsesEntry { - return { key: "", value: undefined }; -} +const baseOperation_ResponsesEntry: object = { key: "" }; export const Operation_ResponsesEntry = { encode(message: Operation_ResponsesEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -1610,7 +1779,9 @@ export const Operation_ResponsesEntry = { decode(input: _m0.Reader | Uint8Array, length?: number): Operation_ResponsesEntry { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseOperation_ResponsesEntry(); + const message = { + ...baseOperation_ResponsesEntry, + } as Operation_ResponsesEntry; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1629,10 +1800,20 @@ export const Operation_ResponsesEntry = { }, fromJSON(object: any): Operation_ResponsesEntry { - return { - key: isSet(object.key) ? String(object.key) : "", - value: isSet(object.value) ? Response.fromJSON(object.value) : undefined, - }; + const message = { + ...baseOperation_ResponsesEntry, + } as Operation_ResponsesEntry; + if (object.key !== undefined && object.key !== null) { + message.key = String(object.key); + } else { + message.key = ""; + } + if (object.value !== undefined && object.value !== null) { + message.value = Response.fromJSON(object.value); + } else { + message.value = undefined; + } + return message; }, toJSON(message: Operation_ResponsesEntry): unknown { @@ -1643,22 +1824,25 @@ export const Operation_ResponsesEntry = { return obj; }, - fromPartial, I>>( - object: I, - ): Operation_ResponsesEntry { - const message = createBaseOperation_ResponsesEntry(); - message.key = object.key ?? ""; - message.value = - object.value !== undefined && object.value !== null - ? Response.fromPartial(object.value) - : undefined; + fromPartial(object: DeepPartial): Operation_ResponsesEntry { + const message = { + ...baseOperation_ResponsesEntry, + } as Operation_ResponsesEntry; + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } else { + message.key = ""; + } + if (object.value !== undefined && object.value !== null) { + message.value = Response.fromPartial(object.value); + } else { + message.value = undefined; + } return message; }, }; -function createBaseOperation_ExtensionsEntry(): Operation_ExtensionsEntry { - return { key: "", value: undefined }; -} +const baseOperation_ExtensionsEntry: object = { key: "" }; export const Operation_ExtensionsEntry = { encode(message: Operation_ExtensionsEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -1666,7 +1850,7 @@ export const Operation_ExtensionsEntry = { writer.uint32(10).string(message.key); } if (message.value !== undefined) { - Value.encode(Value.wrap(message.value), writer.uint32(18).fork()).ldelim(); + Value.encode(message.value, writer.uint32(18).fork()).ldelim(); } return writer; }, @@ -1674,7 +1858,9 @@ export const Operation_ExtensionsEntry = { decode(input: _m0.Reader | Uint8Array, length?: number): Operation_ExtensionsEntry { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseOperation_ExtensionsEntry(); + const message = { + ...baseOperation_ExtensionsEntry, + } as Operation_ExtensionsEntry; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1682,7 +1868,7 @@ export const Operation_ExtensionsEntry = { message.key = reader.string(); break; case 2: - message.value = Value.unwrap(Value.decode(reader, reader.uint32())); + message.value = Value.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -1693,32 +1879,55 @@ export const Operation_ExtensionsEntry = { }, fromJSON(object: any): Operation_ExtensionsEntry { - return { - key: isSet(object.key) ? String(object.key) : "", - value: isSet(object?.value) ? object.value : undefined, - }; + const message = { + ...baseOperation_ExtensionsEntry, + } as Operation_ExtensionsEntry; + if (object.key !== undefined && object.key !== null) { + message.key = String(object.key); + } else { + message.key = ""; + } + if (object.value !== undefined && object.value !== null) { + message.value = Value.fromJSON(object.value); + } else { + message.value = undefined; + } + return message; }, toJSON(message: Operation_ExtensionsEntry): unknown { const obj: any = {}; message.key !== undefined && (obj.key = message.key); - message.value !== undefined && (obj.value = message.value); + message.value !== undefined && + (obj.value = message.value ? Value.toJSON(message.value) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): Operation_ExtensionsEntry { - const message = createBaseOperation_ExtensionsEntry(); - message.key = object.key ?? ""; - message.value = object.value ?? undefined; + fromPartial(object: DeepPartial): Operation_ExtensionsEntry { + const message = { + ...baseOperation_ExtensionsEntry, + } as Operation_ExtensionsEntry; + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } else { + message.key = ""; + } + if (object.value !== undefined && object.value !== null) { + message.value = Value.fromPartial(object.value); + } else { + message.value = undefined; + } return message; }, }; -function createBaseHeader(): Header { - return { description: "", type: "", format: "", default: "", pattern: "" }; -} +const baseHeader: object = { + description: "", + type: "", + format: "", + default: "", + pattern: "", +}; export const Header = { encode(message: Header, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -1743,7 +1952,7 @@ export const Header = { decode(input: _m0.Reader | Uint8Array, length?: number): Header { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseHeader(); + const message = { ...baseHeader } as Header; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1771,13 +1980,33 @@ export const Header = { }, fromJSON(object: any): Header { - return { - description: isSet(object.description) ? String(object.description) : "", - type: isSet(object.type) ? String(object.type) : "", - format: isSet(object.format) ? String(object.format) : "", - default: isSet(object.default) ? String(object.default) : "", - pattern: isSet(object.pattern) ? String(object.pattern) : "", - }; + const message = { ...baseHeader } as Header; + if (object.description !== undefined && object.description !== null) { + message.description = String(object.description); + } else { + message.description = ""; + } + if (object.type !== undefined && object.type !== null) { + message.type = String(object.type); + } else { + message.type = ""; + } + if (object.format !== undefined && object.format !== null) { + message.format = String(object.format); + } else { + message.format = ""; + } + if (object.default !== undefined && object.default !== null) { + message.default = String(object.default); + } else { + message.default = ""; + } + if (object.pattern !== undefined && object.pattern !== null) { + message.pattern = String(object.pattern); + } else { + message.pattern = ""; + } + return message; }, toJSON(message: Header): unknown { @@ -1790,26 +2019,38 @@ export const Header = { return obj; }, - fromPartial, I>>(object: I): Header { - const message = createBaseHeader(); - message.description = object.description ?? ""; - message.type = object.type ?? ""; - message.format = object.format ?? ""; - message.default = object.default ?? ""; - message.pattern = object.pattern ?? ""; + fromPartial(object: DeepPartial
): Header { + const message = { ...baseHeader } as Header; + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } else { + message.description = ""; + } + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } else { + message.type = ""; + } + if (object.format !== undefined && object.format !== null) { + message.format = object.format; + } else { + message.format = ""; + } + if (object.default !== undefined && object.default !== null) { + message.default = object.default; + } else { + message.default = ""; + } + if (object.pattern !== undefined && object.pattern !== null) { + message.pattern = object.pattern; + } else { + message.pattern = ""; + } return message; }, }; -function createBaseResponse(): Response { - return { - description: "", - schema: undefined, - headers: {}, - examples: {}, - extensions: {}, - }; -} +const baseResponse: object = { description: "" }; export const Response = { encode(message: Response, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -1826,12 +2067,10 @@ export const Response = { Response_ExamplesEntry.encode({ key: key as any, value }, writer.uint32(34).fork()).ldelim(); }); Object.entries(message.extensions).forEach(([key, value]) => { - if (value !== undefined) { - Response_ExtensionsEntry.encode( - { key: key as any, value }, - writer.uint32(42).fork(), - ).ldelim(); - } + Response_ExtensionsEntry.encode( + { key: key as any, value }, + writer.uint32(42).fork(), + ).ldelim(); }); return writer; }, @@ -1839,7 +2078,10 @@ export const Response = { decode(input: _m0.Reader | Uint8Array, length?: number): Response { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseResponse(); + const message = { ...baseResponse } as Response; + message.headers = {}; + message.examples = {}; + message.extensions = {}; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1876,28 +2118,36 @@ export const Response = { }, fromJSON(object: any): Response { - return { - description: isSet(object.description) ? String(object.description) : "", - schema: isSet(object.schema) ? Schema.fromJSON(object.schema) : undefined, - headers: isObject(object.headers) - ? Object.entries(object.headers).reduce<{ [key: string]: Header }>((acc, [key, value]) => { - acc[key] = Header.fromJSON(value); - return acc; - }, {}) - : {}, - examples: isObject(object.examples) - ? Object.entries(object.examples).reduce<{ [key: string]: string }>((acc, [key, value]) => { - acc[key] = String(value); - return acc; - }, {}) - : {}, - extensions: isObject(object.extensions) - ? Object.entries(object.extensions).reduce<{ [key: string]: any }>((acc, [key, value]) => { - acc[key] = value as any; - return acc; - }, {}) - : {}, - }; + const message = { ...baseResponse } as Response; + message.headers = {}; + message.examples = {}; + message.extensions = {}; + if (object.description !== undefined && object.description !== null) { + message.description = String(object.description); + } else { + message.description = ""; + } + if (object.schema !== undefined && object.schema !== null) { + message.schema = Schema.fromJSON(object.schema); + } else { + message.schema = undefined; + } + if (object.headers !== undefined && object.headers !== null) { + Object.entries(object.headers).forEach(([key, value]) => { + message.headers[key] = Header.fromJSON(value); + }); + } + if (object.examples !== undefined && object.examples !== null) { + Object.entries(object.examples).forEach(([key, value]) => { + message.examples[key] = String(value); + }); + } + if (object.extensions !== undefined && object.extensions !== null) { + Object.entries(object.extensions).forEach(([key, value]) => { + message.extensions[key] = Value.fromJSON(value); + }); + } + return message; }, toJSON(message: Response): unknown { @@ -1920,50 +2170,53 @@ export const Response = { obj.extensions = {}; if (message.extensions) { Object.entries(message.extensions).forEach(([k, v]) => { - obj.extensions[k] = v; + obj.extensions[k] = Value.toJSON(v); }); } return obj; }, - fromPartial, I>>(object: I): Response { - const message = createBaseResponse(); - message.description = object.description ?? ""; - message.schema = - object.schema !== undefined && object.schema !== null - ? Schema.fromPartial(object.schema) - : undefined; - message.headers = Object.entries(object.headers ?? {}).reduce<{ - [key: string]: Header; - }>((acc, [key, value]) => { - if (value !== undefined) { - acc[key] = Header.fromPartial(value); - } - return acc; - }, {}); - message.examples = Object.entries(object.examples ?? {}).reduce<{ - [key: string]: string; - }>((acc, [key, value]) => { - if (value !== undefined) { - acc[key] = String(value); - } - return acc; - }, {}); - message.extensions = Object.entries(object.extensions ?? {}).reduce<{ - [key: string]: any; - }>((acc, [key, value]) => { - if (value !== undefined) { - acc[key] = value; - } - return acc; - }, {}); + fromPartial(object: DeepPartial): Response { + const message = { ...baseResponse } as Response; + message.headers = {}; + message.examples = {}; + message.extensions = {}; + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } else { + message.description = ""; + } + if (object.schema !== undefined && object.schema !== null) { + message.schema = Schema.fromPartial(object.schema); + } else { + message.schema = undefined; + } + if (object.headers !== undefined && object.headers !== null) { + Object.entries(object.headers).forEach(([key, value]) => { + if (value !== undefined) { + message.headers[key] = Header.fromPartial(value); + } + }); + } + if (object.examples !== undefined && object.examples !== null) { + Object.entries(object.examples).forEach(([key, value]) => { + if (value !== undefined) { + message.examples[key] = String(value); + } + }); + } + if (object.extensions !== undefined && object.extensions !== null) { + Object.entries(object.extensions).forEach(([key, value]) => { + if (value !== undefined) { + message.extensions[key] = Value.fromPartial(value); + } + }); + } return message; }, }; -function createBaseResponse_HeadersEntry(): Response_HeadersEntry { - return { key: "", value: undefined }; -} +const baseResponse_HeadersEntry: object = { key: "" }; export const Response_HeadersEntry = { encode(message: Response_HeadersEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -1979,7 +2232,7 @@ export const Response_HeadersEntry = { decode(input: _m0.Reader | Uint8Array, length?: number): Response_HeadersEntry { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseResponse_HeadersEntry(); + const message = { ...baseResponse_HeadersEntry } as Response_HeadersEntry; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1998,10 +2251,18 @@ export const Response_HeadersEntry = { }, fromJSON(object: any): Response_HeadersEntry { - return { - key: isSet(object.key) ? String(object.key) : "", - value: isSet(object.value) ? Header.fromJSON(object.value) : undefined, - }; + const message = { ...baseResponse_HeadersEntry } as Response_HeadersEntry; + if (object.key !== undefined && object.key !== null) { + message.key = String(object.key); + } else { + message.key = ""; + } + if (object.value !== undefined && object.value !== null) { + message.value = Header.fromJSON(object.value); + } else { + message.value = undefined; + } + return message; }, toJSON(message: Response_HeadersEntry): unknown { @@ -2012,22 +2273,23 @@ export const Response_HeadersEntry = { return obj; }, - fromPartial, I>>( - object: I, - ): Response_HeadersEntry { - const message = createBaseResponse_HeadersEntry(); - message.key = object.key ?? ""; - message.value = - object.value !== undefined && object.value !== null - ? Header.fromPartial(object.value) - : undefined; + fromPartial(object: DeepPartial): Response_HeadersEntry { + const message = { ...baseResponse_HeadersEntry } as Response_HeadersEntry; + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } else { + message.key = ""; + } + if (object.value !== undefined && object.value !== null) { + message.value = Header.fromPartial(object.value); + } else { + message.value = undefined; + } return message; }, }; -function createBaseResponse_ExamplesEntry(): Response_ExamplesEntry { - return { key: "", value: "" }; -} +const baseResponse_ExamplesEntry: object = { key: "", value: "" }; export const Response_ExamplesEntry = { encode(message: Response_ExamplesEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -2043,7 +2305,7 @@ export const Response_ExamplesEntry = { decode(input: _m0.Reader | Uint8Array, length?: number): Response_ExamplesEntry { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseResponse_ExamplesEntry(); + const message = { ...baseResponse_ExamplesEntry } as Response_ExamplesEntry; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2062,10 +2324,18 @@ export const Response_ExamplesEntry = { }, fromJSON(object: any): Response_ExamplesEntry { - return { - key: isSet(object.key) ? String(object.key) : "", - value: isSet(object.value) ? String(object.value) : "", - }; + const message = { ...baseResponse_ExamplesEntry } as Response_ExamplesEntry; + if (object.key !== undefined && object.key !== null) { + message.key = String(object.key); + } else { + message.key = ""; + } + if (object.value !== undefined && object.value !== null) { + message.value = String(object.value); + } else { + message.value = ""; + } + return message; }, toJSON(message: Response_ExamplesEntry): unknown { @@ -2075,19 +2345,23 @@ export const Response_ExamplesEntry = { return obj; }, - fromPartial, I>>( - object: I, - ): Response_ExamplesEntry { - const message = createBaseResponse_ExamplesEntry(); - message.key = object.key ?? ""; - message.value = object.value ?? ""; + fromPartial(object: DeepPartial): Response_ExamplesEntry { + const message = { ...baseResponse_ExamplesEntry } as Response_ExamplesEntry; + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } else { + message.key = ""; + } + if (object.value !== undefined && object.value !== null) { + message.value = object.value; + } else { + message.value = ""; + } return message; }, }; -function createBaseResponse_ExtensionsEntry(): Response_ExtensionsEntry { - return { key: "", value: undefined }; -} +const baseResponse_ExtensionsEntry: object = { key: "" }; export const Response_ExtensionsEntry = { encode(message: Response_ExtensionsEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -2095,7 +2369,7 @@ export const Response_ExtensionsEntry = { writer.uint32(10).string(message.key); } if (message.value !== undefined) { - Value.encode(Value.wrap(message.value), writer.uint32(18).fork()).ldelim(); + Value.encode(message.value, writer.uint32(18).fork()).ldelim(); } return writer; }, @@ -2103,7 +2377,9 @@ export const Response_ExtensionsEntry = { decode(input: _m0.Reader | Uint8Array, length?: number): Response_ExtensionsEntry { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseResponse_ExtensionsEntry(); + const message = { + ...baseResponse_ExtensionsEntry, + } as Response_ExtensionsEntry; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2111,7 +2387,7 @@ export const Response_ExtensionsEntry = { message.key = reader.string(); break; case 2: - message.value = Value.unwrap(Value.decode(reader, reader.uint32())); + message.value = Value.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -2122,40 +2398,54 @@ export const Response_ExtensionsEntry = { }, fromJSON(object: any): Response_ExtensionsEntry { - return { - key: isSet(object.key) ? String(object.key) : "", - value: isSet(object?.value) ? object.value : undefined, - }; + const message = { + ...baseResponse_ExtensionsEntry, + } as Response_ExtensionsEntry; + if (object.key !== undefined && object.key !== null) { + message.key = String(object.key); + } else { + message.key = ""; + } + if (object.value !== undefined && object.value !== null) { + message.value = Value.fromJSON(object.value); + } else { + message.value = undefined; + } + return message; }, toJSON(message: Response_ExtensionsEntry): unknown { const obj: any = {}; message.key !== undefined && (obj.key = message.key); - message.value !== undefined && (obj.value = message.value); + message.value !== undefined && + (obj.value = message.value ? Value.toJSON(message.value) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): Response_ExtensionsEntry { - const message = createBaseResponse_ExtensionsEntry(); - message.key = object.key ?? ""; - message.value = object.value ?? undefined; + fromPartial(object: DeepPartial): Response_ExtensionsEntry { + const message = { + ...baseResponse_ExtensionsEntry, + } as Response_ExtensionsEntry; + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } else { + message.key = ""; + } + if (object.value !== undefined && object.value !== null) { + message.value = Value.fromPartial(object.value); + } else { + message.value = undefined; + } return message; }, }; -function createBaseInfo(): Info { - return { - title: "", - description: "", - termsOfService: "", - contact: undefined, - license: undefined, - version: "", - extensions: {}, - }; -} +const baseInfo: object = { + title: "", + description: "", + termsOfService: "", + version: "", +}; export const Info = { encode(message: Info, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -2178,9 +2468,7 @@ export const Info = { writer.uint32(50).string(message.version); } Object.entries(message.extensions).forEach(([key, value]) => { - if (value !== undefined) { - Info_ExtensionsEntry.encode({ key: key as any, value }, writer.uint32(58).fork()).ldelim(); - } + Info_ExtensionsEntry.encode({ key: key as any, value }, writer.uint32(58).fork()).ldelim(); }); return writer; }, @@ -2188,7 +2476,8 @@ export const Info = { decode(input: _m0.Reader | Uint8Array, length?: number): Info { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseInfo(); + const message = { ...baseInfo } as Info; + message.extensions = {}; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2225,20 +2514,44 @@ export const Info = { }, fromJSON(object: any): Info { - return { - title: isSet(object.title) ? String(object.title) : "", - description: isSet(object.description) ? String(object.description) : "", - termsOfService: isSet(object.termsOfService) ? String(object.termsOfService) : "", - contact: isSet(object.contact) ? Contact.fromJSON(object.contact) : undefined, - license: isSet(object.license) ? License.fromJSON(object.license) : undefined, - version: isSet(object.version) ? String(object.version) : "", - extensions: isObject(object.extensions) - ? Object.entries(object.extensions).reduce<{ [key: string]: any }>((acc, [key, value]) => { - acc[key] = value as any; - return acc; - }, {}) - : {}, - }; + const message = { ...baseInfo } as Info; + message.extensions = {}; + if (object.title !== undefined && object.title !== null) { + message.title = String(object.title); + } else { + message.title = ""; + } + if (object.description !== undefined && object.description !== null) { + message.description = String(object.description); + } else { + message.description = ""; + } + if (object.termsOfService !== undefined && object.termsOfService !== null) { + message.termsOfService = String(object.termsOfService); + } else { + message.termsOfService = ""; + } + if (object.contact !== undefined && object.contact !== null) { + message.contact = Contact.fromJSON(object.contact); + } else { + message.contact = undefined; + } + if (object.license !== undefined && object.license !== null) { + message.license = License.fromJSON(object.license); + } else { + message.license = undefined; + } + if (object.version !== undefined && object.version !== null) { + message.version = String(object.version); + } else { + message.version = ""; + } + if (object.extensions !== undefined && object.extensions !== null) { + Object.entries(object.extensions).forEach(([key, value]) => { + message.extensions[key] = Value.fromJSON(value); + }); + } + return message; }, toJSON(message: Info): unknown { @@ -2254,41 +2567,57 @@ export const Info = { obj.extensions = {}; if (message.extensions) { Object.entries(message.extensions).forEach(([k, v]) => { - obj.extensions[k] = v; + obj.extensions[k] = Value.toJSON(v); }); } return obj; }, - fromPartial, I>>(object: I): Info { - const message = createBaseInfo(); - message.title = object.title ?? ""; - message.description = object.description ?? ""; - message.termsOfService = object.termsOfService ?? ""; - message.contact = - object.contact !== undefined && object.contact !== null - ? Contact.fromPartial(object.contact) - : undefined; - message.license = - object.license !== undefined && object.license !== null - ? License.fromPartial(object.license) - : undefined; - message.version = object.version ?? ""; - message.extensions = Object.entries(object.extensions ?? {}).reduce<{ - [key: string]: any; - }>((acc, [key, value]) => { - if (value !== undefined) { - acc[key] = value; - } - return acc; - }, {}); - return message; - }, + fromPartial(object: DeepPartial): Info { + const message = { ...baseInfo } as Info; + message.extensions = {}; + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } else { + message.title = ""; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } else { + message.description = ""; + } + if (object.termsOfService !== undefined && object.termsOfService !== null) { + message.termsOfService = object.termsOfService; + } else { + message.termsOfService = ""; + } + if (object.contact !== undefined && object.contact !== null) { + message.contact = Contact.fromPartial(object.contact); + } else { + message.contact = undefined; + } + if (object.license !== undefined && object.license !== null) { + message.license = License.fromPartial(object.license); + } else { + message.license = undefined; + } + if (object.version !== undefined && object.version !== null) { + message.version = object.version; + } else { + message.version = ""; + } + if (object.extensions !== undefined && object.extensions !== null) { + Object.entries(object.extensions).forEach(([key, value]) => { + if (value !== undefined) { + message.extensions[key] = Value.fromPartial(value); + } + }); + } + return message; + }, }; -function createBaseInfo_ExtensionsEntry(): Info_ExtensionsEntry { - return { key: "", value: undefined }; -} +const baseInfo_ExtensionsEntry: object = { key: "" }; export const Info_ExtensionsEntry = { encode(message: Info_ExtensionsEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -2296,7 +2625,7 @@ export const Info_ExtensionsEntry = { writer.uint32(10).string(message.key); } if (message.value !== undefined) { - Value.encode(Value.wrap(message.value), writer.uint32(18).fork()).ldelim(); + Value.encode(message.value, writer.uint32(18).fork()).ldelim(); } return writer; }, @@ -2304,7 +2633,7 @@ export const Info_ExtensionsEntry = { decode(input: _m0.Reader | Uint8Array, length?: number): Info_ExtensionsEntry { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseInfo_ExtensionsEntry(); + const message = { ...baseInfo_ExtensionsEntry } as Info_ExtensionsEntry; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2312,7 +2641,7 @@ export const Info_ExtensionsEntry = { message.key = reader.string(); break; case 2: - message.value = Value.unwrap(Value.decode(reader, reader.uint32())); + message.value = Value.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -2323,32 +2652,45 @@ export const Info_ExtensionsEntry = { }, fromJSON(object: any): Info_ExtensionsEntry { - return { - key: isSet(object.key) ? String(object.key) : "", - value: isSet(object?.value) ? object.value : undefined, - }; + const message = { ...baseInfo_ExtensionsEntry } as Info_ExtensionsEntry; + if (object.key !== undefined && object.key !== null) { + message.key = String(object.key); + } else { + message.key = ""; + } + if (object.value !== undefined && object.value !== null) { + message.value = Value.fromJSON(object.value); + } else { + message.value = undefined; + } + return message; }, toJSON(message: Info_ExtensionsEntry): unknown { const obj: any = {}; message.key !== undefined && (obj.key = message.key); - message.value !== undefined && (obj.value = message.value); + message.value !== undefined && + (obj.value = message.value ? Value.toJSON(message.value) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): Info_ExtensionsEntry { - const message = createBaseInfo_ExtensionsEntry(); - message.key = object.key ?? ""; - message.value = object.value ?? undefined; + fromPartial(object: DeepPartial): Info_ExtensionsEntry { + const message = { ...baseInfo_ExtensionsEntry } as Info_ExtensionsEntry; + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } else { + message.key = ""; + } + if (object.value !== undefined && object.value !== null) { + message.value = Value.fromPartial(object.value); + } else { + message.value = undefined; + } return message; }, }; -function createBaseContact(): Contact { - return { name: "", url: "", email: "" }; -} +const baseContact: object = { name: "", url: "", email: "" }; export const Contact = { encode(message: Contact, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -2367,7 +2709,7 @@ export const Contact = { decode(input: _m0.Reader | Uint8Array, length?: number): Contact { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseContact(); + const message = { ...baseContact } as Contact; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2389,11 +2731,23 @@ export const Contact = { }, fromJSON(object: any): Contact { - return { - name: isSet(object.name) ? String(object.name) : "", - url: isSet(object.url) ? String(object.url) : "", - email: isSet(object.email) ? String(object.email) : "", - }; + const message = { ...baseContact } as Contact; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.url !== undefined && object.url !== null) { + message.url = String(object.url); + } else { + message.url = ""; + } + if (object.email !== undefined && object.email !== null) { + message.email = String(object.email); + } else { + message.email = ""; + } + return message; }, toJSON(message: Contact): unknown { @@ -2404,18 +2758,28 @@ export const Contact = { return obj; }, - fromPartial, I>>(object: I): Contact { - const message = createBaseContact(); - message.name = object.name ?? ""; - message.url = object.url ?? ""; - message.email = object.email ?? ""; + fromPartial(object: DeepPartial): Contact { + const message = { ...baseContact } as Contact; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.url !== undefined && object.url !== null) { + message.url = object.url; + } else { + message.url = ""; + } + if (object.email !== undefined && object.email !== null) { + message.email = object.email; + } else { + message.email = ""; + } return message; }, }; -function createBaseLicense(): License { - return { name: "", url: "" }; -} +const baseLicense: object = { name: "", url: "" }; export const License = { encode(message: License, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -2431,7 +2795,7 @@ export const License = { decode(input: _m0.Reader | Uint8Array, length?: number): License { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseLicense(); + const message = { ...baseLicense } as License; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2450,10 +2814,18 @@ export const License = { }, fromJSON(object: any): License { - return { - name: isSet(object.name) ? String(object.name) : "", - url: isSet(object.url) ? String(object.url) : "", - }; + const message = { ...baseLicense } as License; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.url !== undefined && object.url !== null) { + message.url = String(object.url); + } else { + message.url = ""; + } + return message; }, toJSON(message: License): unknown { @@ -2463,17 +2835,23 @@ export const License = { return obj; }, - fromPartial, I>>(object: I): License { - const message = createBaseLicense(); - message.name = object.name ?? ""; - message.url = object.url ?? ""; + fromPartial(object: DeepPartial): License { + const message = { ...baseLicense } as License; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.url !== undefined && object.url !== null) { + message.url = object.url; + } else { + message.url = ""; + } return message; }, }; -function createBaseExternalDocumentation(): ExternalDocumentation { - return { description: "", url: "" }; -} +const baseExternalDocumentation: object = { description: "", url: "" }; export const ExternalDocumentation = { encode(message: ExternalDocumentation, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -2489,7 +2867,7 @@ export const ExternalDocumentation = { decode(input: _m0.Reader | Uint8Array, length?: number): ExternalDocumentation { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseExternalDocumentation(); + const message = { ...baseExternalDocumentation } as ExternalDocumentation; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2508,10 +2886,18 @@ export const ExternalDocumentation = { }, fromJSON(object: any): ExternalDocumentation { - return { - description: isSet(object.description) ? String(object.description) : "", - url: isSet(object.url) ? String(object.url) : "", - }; + const message = { ...baseExternalDocumentation } as ExternalDocumentation; + if (object.description !== undefined && object.description !== null) { + message.description = String(object.description); + } else { + message.description = ""; + } + if (object.url !== undefined && object.url !== null) { + message.url = String(object.url); + } else { + message.url = ""; + } + return message; }, toJSON(message: ExternalDocumentation): unknown { @@ -2521,25 +2907,23 @@ export const ExternalDocumentation = { return obj; }, - fromPartial, I>>( - object: I, - ): ExternalDocumentation { - const message = createBaseExternalDocumentation(); - message.description = object.description ?? ""; - message.url = object.url ?? ""; + fromPartial(object: DeepPartial): ExternalDocumentation { + const message = { ...baseExternalDocumentation } as ExternalDocumentation; + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } else { + message.description = ""; + } + if (object.url !== undefined && object.url !== null) { + message.url = object.url; + } else { + message.url = ""; + } return message; }, }; -function createBaseSchema(): Schema { - return { - jsonSchema: undefined, - discriminator: "", - readOnly: false, - externalDocs: undefined, - example: "", - }; -} +const baseSchema: object = { discriminator: "", readOnly: false, example: "" }; export const Schema = { encode(message: Schema, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -2564,7 +2948,7 @@ export const Schema = { decode(input: _m0.Reader | Uint8Array, length?: number): Schema { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseSchema(); + const message = { ...baseSchema } as Schema; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2592,15 +2976,33 @@ export const Schema = { }, fromJSON(object: any): Schema { - return { - jsonSchema: isSet(object.jsonSchema) ? JSONSchema.fromJSON(object.jsonSchema) : undefined, - discriminator: isSet(object.discriminator) ? String(object.discriminator) : "", - readOnly: isSet(object.readOnly) ? Boolean(object.readOnly) : false, - externalDocs: isSet(object.externalDocs) - ? ExternalDocumentation.fromJSON(object.externalDocs) - : undefined, - example: isSet(object.example) ? String(object.example) : "", - }; + const message = { ...baseSchema } as Schema; + if (object.jsonSchema !== undefined && object.jsonSchema !== null) { + message.jsonSchema = JSONSchema.fromJSON(object.jsonSchema); + } else { + message.jsonSchema = undefined; + } + if (object.discriminator !== undefined && object.discriminator !== null) { + message.discriminator = String(object.discriminator); + } else { + message.discriminator = ""; + } + if (object.readOnly !== undefined && object.readOnly !== null) { + message.readOnly = Boolean(object.readOnly); + } else { + message.readOnly = false; + } + if (object.externalDocs !== undefined && object.externalDocs !== null) { + message.externalDocs = ExternalDocumentation.fromJSON(object.externalDocs); + } else { + message.externalDocs = undefined; + } + if (object.example !== undefined && object.example !== null) { + message.example = String(object.example); + } else { + message.example = ""; + } + return message; }, toJSON(message: Schema): unknown { @@ -2617,51 +3019,63 @@ export const Schema = { return obj; }, - fromPartial, I>>(object: I): Schema { - const message = createBaseSchema(); - message.jsonSchema = - object.jsonSchema !== undefined && object.jsonSchema !== null - ? JSONSchema.fromPartial(object.jsonSchema) - : undefined; - message.discriminator = object.discriminator ?? ""; - message.readOnly = object.readOnly ?? false; - message.externalDocs = - object.externalDocs !== undefined && object.externalDocs !== null - ? ExternalDocumentation.fromPartial(object.externalDocs) - : undefined; - message.example = object.example ?? ""; + fromPartial(object: DeepPartial): Schema { + const message = { ...baseSchema } as Schema; + if (object.jsonSchema !== undefined && object.jsonSchema !== null) { + message.jsonSchema = JSONSchema.fromPartial(object.jsonSchema); + } else { + message.jsonSchema = undefined; + } + if (object.discriminator !== undefined && object.discriminator !== null) { + message.discriminator = object.discriminator; + } else { + message.discriminator = ""; + } + if (object.readOnly !== undefined && object.readOnly !== null) { + message.readOnly = object.readOnly; + } else { + message.readOnly = false; + } + if (object.externalDocs !== undefined && object.externalDocs !== null) { + message.externalDocs = ExternalDocumentation.fromPartial(object.externalDocs); + } else { + message.externalDocs = undefined; + } + if (object.example !== undefined && object.example !== null) { + message.example = object.example; + } else { + message.example = ""; + } return message; }, }; -function createBaseJSONSchema(): JSONSchema { - return { - ref: "", - title: "", - description: "", - default: "", - readOnly: false, - example: "", - multipleOf: 0, - maximum: 0, - exclusiveMaximum: false, - minimum: 0, - exclusiveMinimum: false, - maxLength: 0, - minLength: 0, - pattern: "", - maxItems: 0, - minItems: 0, - uniqueItems: false, - maxProperties: 0, - minProperties: 0, - required: [], - array: [], - type: [], - format: "", - enum: [], - }; -} +const baseJSONSchema: object = { + ref: "", + title: "", + description: "", + default: "", + readOnly: false, + example: "", + multipleOf: 0, + maximum: 0, + exclusiveMaximum: false, + minimum: 0, + exclusiveMinimum: false, + maxLength: 0, + minLength: 0, + pattern: "", + maxItems: 0, + minItems: 0, + uniqueItems: false, + maxProperties: 0, + minProperties: 0, + required: "", + array: "", + type: 0, + format: "", + enum: "", +}; export const JSONSchema = { encode(message: JSONSchema, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -2745,7 +3159,11 @@ export const JSONSchema = { decode(input: _m0.Reader | Uint8Array, length?: number): JSONSchema { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseJSONSchema(); + const message = { ...baseJSONSchema } as JSONSchema; + message.required = []; + message.array = []; + message.type = []; + message.enum = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2837,34 +3255,132 @@ export const JSONSchema = { }, fromJSON(object: any): JSONSchema { - return { - ref: isSet(object.ref) ? String(object.ref) : "", - title: isSet(object.title) ? String(object.title) : "", - description: isSet(object.description) ? String(object.description) : "", - default: isSet(object.default) ? String(object.default) : "", - readOnly: isSet(object.readOnly) ? Boolean(object.readOnly) : false, - example: isSet(object.example) ? String(object.example) : "", - multipleOf: isSet(object.multipleOf) ? Number(object.multipleOf) : 0, - maximum: isSet(object.maximum) ? Number(object.maximum) : 0, - exclusiveMaximum: isSet(object.exclusiveMaximum) ? Boolean(object.exclusiveMaximum) : false, - minimum: isSet(object.minimum) ? Number(object.minimum) : 0, - exclusiveMinimum: isSet(object.exclusiveMinimum) ? Boolean(object.exclusiveMinimum) : false, - maxLength: isSet(object.maxLength) ? Number(object.maxLength) : 0, - minLength: isSet(object.minLength) ? Number(object.minLength) : 0, - pattern: isSet(object.pattern) ? String(object.pattern) : "", - maxItems: isSet(object.maxItems) ? Number(object.maxItems) : 0, - minItems: isSet(object.minItems) ? Number(object.minItems) : 0, - uniqueItems: isSet(object.uniqueItems) ? Boolean(object.uniqueItems) : false, - maxProperties: isSet(object.maxProperties) ? Number(object.maxProperties) : 0, - minProperties: isSet(object.minProperties) ? Number(object.minProperties) : 0, - required: Array.isArray(object?.required) ? object.required.map((e: any) => String(e)) : [], - array: Array.isArray(object?.array) ? object.array.map((e: any) => String(e)) : [], - type: Array.isArray(object?.type) - ? object.type.map((e: any) => jSONSchema_JSONSchemaSimpleTypesFromJSON(e)) - : [], - format: isSet(object.format) ? String(object.format) : "", - enum: Array.isArray(object?.enum) ? object.enum.map((e: any) => String(e)) : [], - }; + const message = { ...baseJSONSchema } as JSONSchema; + message.required = []; + message.array = []; + message.type = []; + message.enum = []; + if (object.ref !== undefined && object.ref !== null) { + message.ref = String(object.ref); + } else { + message.ref = ""; + } + if (object.title !== undefined && object.title !== null) { + message.title = String(object.title); + } else { + message.title = ""; + } + if (object.description !== undefined && object.description !== null) { + message.description = String(object.description); + } else { + message.description = ""; + } + if (object.default !== undefined && object.default !== null) { + message.default = String(object.default); + } else { + message.default = ""; + } + if (object.readOnly !== undefined && object.readOnly !== null) { + message.readOnly = Boolean(object.readOnly); + } else { + message.readOnly = false; + } + if (object.example !== undefined && object.example !== null) { + message.example = String(object.example); + } else { + message.example = ""; + } + if (object.multipleOf !== undefined && object.multipleOf !== null) { + message.multipleOf = Number(object.multipleOf); + } else { + message.multipleOf = 0; + } + if (object.maximum !== undefined && object.maximum !== null) { + message.maximum = Number(object.maximum); + } else { + message.maximum = 0; + } + if (object.exclusiveMaximum !== undefined && object.exclusiveMaximum !== null) { + message.exclusiveMaximum = Boolean(object.exclusiveMaximum); + } else { + message.exclusiveMaximum = false; + } + if (object.minimum !== undefined && object.minimum !== null) { + message.minimum = Number(object.minimum); + } else { + message.minimum = 0; + } + if (object.exclusiveMinimum !== undefined && object.exclusiveMinimum !== null) { + message.exclusiveMinimum = Boolean(object.exclusiveMinimum); + } else { + message.exclusiveMinimum = false; + } + if (object.maxLength !== undefined && object.maxLength !== null) { + message.maxLength = Number(object.maxLength); + } else { + message.maxLength = 0; + } + if (object.minLength !== undefined && object.minLength !== null) { + message.minLength = Number(object.minLength); + } else { + message.minLength = 0; + } + if (object.pattern !== undefined && object.pattern !== null) { + message.pattern = String(object.pattern); + } else { + message.pattern = ""; + } + if (object.maxItems !== undefined && object.maxItems !== null) { + message.maxItems = Number(object.maxItems); + } else { + message.maxItems = 0; + } + if (object.minItems !== undefined && object.minItems !== null) { + message.minItems = Number(object.minItems); + } else { + message.minItems = 0; + } + if (object.uniqueItems !== undefined && object.uniqueItems !== null) { + message.uniqueItems = Boolean(object.uniqueItems); + } else { + message.uniqueItems = false; + } + if (object.maxProperties !== undefined && object.maxProperties !== null) { + message.maxProperties = Number(object.maxProperties); + } else { + message.maxProperties = 0; + } + if (object.minProperties !== undefined && object.minProperties !== null) { + message.minProperties = Number(object.minProperties); + } else { + message.minProperties = 0; + } + if (object.required !== undefined && object.required !== null) { + for (const e of object.required) { + message.required.push(String(e)); + } + } + if (object.array !== undefined && object.array !== null) { + for (const e of object.array) { + message.array.push(String(e)); + } + } + if (object.type !== undefined && object.type !== null) { + for (const e of object.type) { + message.type.push(jSONSchema_JSONSchemaSimpleTypesFromJSON(e)); + } + } + if (object.format !== undefined && object.format !== null) { + message.format = String(object.format); + } else { + message.format = ""; + } + if (object.enum !== undefined && object.enum !== null) { + for (const e of object.enum) { + message.enum.push(String(e)); + } + } + return message; }, toJSON(message: JSONSchema): unknown { @@ -2880,14 +3396,14 @@ export const JSONSchema = { message.exclusiveMaximum !== undefined && (obj.exclusiveMaximum = message.exclusiveMaximum); message.minimum !== undefined && (obj.minimum = message.minimum); message.exclusiveMinimum !== undefined && (obj.exclusiveMinimum = message.exclusiveMinimum); - message.maxLength !== undefined && (obj.maxLength = Math.round(message.maxLength)); - message.minLength !== undefined && (obj.minLength = Math.round(message.minLength)); + message.maxLength !== undefined && (obj.maxLength = message.maxLength); + message.minLength !== undefined && (obj.minLength = message.minLength); message.pattern !== undefined && (obj.pattern = message.pattern); - message.maxItems !== undefined && (obj.maxItems = Math.round(message.maxItems)); - message.minItems !== undefined && (obj.minItems = Math.round(message.minItems)); + message.maxItems !== undefined && (obj.maxItems = message.maxItems); + message.minItems !== undefined && (obj.minItems = message.minItems); message.uniqueItems !== undefined && (obj.uniqueItems = message.uniqueItems); - message.maxProperties !== undefined && (obj.maxProperties = Math.round(message.maxProperties)); - message.minProperties !== undefined && (obj.minProperties = Math.round(message.minProperties)); + message.maxProperties !== undefined && (obj.maxProperties = message.maxProperties); + message.minProperties !== undefined && (obj.minProperties = message.minProperties); if (message.required) { obj.required = message.required.map(e => e); } else { @@ -2912,39 +3428,137 @@ export const JSONSchema = { return obj; }, - fromPartial, I>>(object: I): JSONSchema { - const message = createBaseJSONSchema(); - message.ref = object.ref ?? ""; - message.title = object.title ?? ""; - message.description = object.description ?? ""; - message.default = object.default ?? ""; - message.readOnly = object.readOnly ?? false; - message.example = object.example ?? ""; - message.multipleOf = object.multipleOf ?? 0; - message.maximum = object.maximum ?? 0; - message.exclusiveMaximum = object.exclusiveMaximum ?? false; - message.minimum = object.minimum ?? 0; - message.exclusiveMinimum = object.exclusiveMinimum ?? false; - message.maxLength = object.maxLength ?? 0; - message.minLength = object.minLength ?? 0; - message.pattern = object.pattern ?? ""; - message.maxItems = object.maxItems ?? 0; - message.minItems = object.minItems ?? 0; - message.uniqueItems = object.uniqueItems ?? false; - message.maxProperties = object.maxProperties ?? 0; - message.minProperties = object.minProperties ?? 0; - message.required = object.required?.map(e => e) || []; - message.array = object.array?.map(e => e) || []; - message.type = object.type?.map(e => e) || []; - message.format = object.format ?? ""; - message.enum = object.enum?.map(e => e) || []; + fromPartial(object: DeepPartial): JSONSchema { + const message = { ...baseJSONSchema } as JSONSchema; + message.required = []; + message.array = []; + message.type = []; + message.enum = []; + if (object.ref !== undefined && object.ref !== null) { + message.ref = object.ref; + } else { + message.ref = ""; + } + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } else { + message.title = ""; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } else { + message.description = ""; + } + if (object.default !== undefined && object.default !== null) { + message.default = object.default; + } else { + message.default = ""; + } + if (object.readOnly !== undefined && object.readOnly !== null) { + message.readOnly = object.readOnly; + } else { + message.readOnly = false; + } + if (object.example !== undefined && object.example !== null) { + message.example = object.example; + } else { + message.example = ""; + } + if (object.multipleOf !== undefined && object.multipleOf !== null) { + message.multipleOf = object.multipleOf; + } else { + message.multipleOf = 0; + } + if (object.maximum !== undefined && object.maximum !== null) { + message.maximum = object.maximum; + } else { + message.maximum = 0; + } + if (object.exclusiveMaximum !== undefined && object.exclusiveMaximum !== null) { + message.exclusiveMaximum = object.exclusiveMaximum; + } else { + message.exclusiveMaximum = false; + } + if (object.minimum !== undefined && object.minimum !== null) { + message.minimum = object.minimum; + } else { + message.minimum = 0; + } + if (object.exclusiveMinimum !== undefined && object.exclusiveMinimum !== null) { + message.exclusiveMinimum = object.exclusiveMinimum; + } else { + message.exclusiveMinimum = false; + } + if (object.maxLength !== undefined && object.maxLength !== null) { + message.maxLength = object.maxLength; + } else { + message.maxLength = 0; + } + if (object.minLength !== undefined && object.minLength !== null) { + message.minLength = object.minLength; + } else { + message.minLength = 0; + } + if (object.pattern !== undefined && object.pattern !== null) { + message.pattern = object.pattern; + } else { + message.pattern = ""; + } + if (object.maxItems !== undefined && object.maxItems !== null) { + message.maxItems = object.maxItems; + } else { + message.maxItems = 0; + } + if (object.minItems !== undefined && object.minItems !== null) { + message.minItems = object.minItems; + } else { + message.minItems = 0; + } + if (object.uniqueItems !== undefined && object.uniqueItems !== null) { + message.uniqueItems = object.uniqueItems; + } else { + message.uniqueItems = false; + } + if (object.maxProperties !== undefined && object.maxProperties !== null) { + message.maxProperties = object.maxProperties; + } else { + message.maxProperties = 0; + } + if (object.minProperties !== undefined && object.minProperties !== null) { + message.minProperties = object.minProperties; + } else { + message.minProperties = 0; + } + if (object.required !== undefined && object.required !== null) { + for (const e of object.required) { + message.required.push(e); + } + } + if (object.array !== undefined && object.array !== null) { + for (const e of object.array) { + message.array.push(e); + } + } + if (object.type !== undefined && object.type !== null) { + for (const e of object.type) { + message.type.push(e); + } + } + if (object.format !== undefined && object.format !== null) { + message.format = object.format; + } else { + message.format = ""; + } + if (object.enum !== undefined && object.enum !== null) { + for (const e of object.enum) { + message.enum.push(e); + } + } return message; }, }; -function createBaseTag(): Tag { - return { description: "", externalDocs: undefined }; -} +const baseTag: object = { description: "" }; export const Tag = { encode(message: Tag, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -2960,7 +3574,7 @@ export const Tag = { decode(input: _m0.Reader | Uint8Array, length?: number): Tag { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseTag(); + const message = { ...baseTag } as Tag; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2979,12 +3593,18 @@ export const Tag = { }, fromJSON(object: any): Tag { - return { - description: isSet(object.description) ? String(object.description) : "", - externalDocs: isSet(object.externalDocs) - ? ExternalDocumentation.fromJSON(object.externalDocs) - : undefined, - }; + const message = { ...baseTag } as Tag; + if (object.description !== undefined && object.description !== null) { + message.description = String(object.description); + } else { + message.description = ""; + } + if (object.externalDocs !== undefined && object.externalDocs !== null) { + message.externalDocs = ExternalDocumentation.fromJSON(object.externalDocs); + } else { + message.externalDocs = undefined; + } + return message; }, toJSON(message: Tag): unknown { @@ -2997,20 +3617,23 @@ export const Tag = { return obj; }, - fromPartial, I>>(object: I): Tag { - const message = createBaseTag(); - message.description = object.description ?? ""; - message.externalDocs = - object.externalDocs !== undefined && object.externalDocs !== null - ? ExternalDocumentation.fromPartial(object.externalDocs) - : undefined; + fromPartial(object: DeepPartial): Tag { + const message = { ...baseTag } as Tag; + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } else { + message.description = ""; + } + if (object.externalDocs !== undefined && object.externalDocs !== null) { + message.externalDocs = ExternalDocumentation.fromPartial(object.externalDocs); + } else { + message.externalDocs = undefined; + } return message; }, }; -function createBaseSecurityDefinitions(): SecurityDefinitions { - return { security: {} }; -} +const baseSecurityDefinitions: object = {}; export const SecurityDefinitions = { encode(message: SecurityDefinitions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -3026,7 +3649,8 @@ export const SecurityDefinitions = { decode(input: _m0.Reader | Uint8Array, length?: number): SecurityDefinitions { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseSecurityDefinitions(); + const message = { ...baseSecurityDefinitions } as SecurityDefinitions; + message.security = {}; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -3045,16 +3669,14 @@ export const SecurityDefinitions = { }, fromJSON(object: any): SecurityDefinitions { - return { - security: isObject(object.security) - ? Object.entries(object.security).reduce<{ - [key: string]: SecurityScheme; - }>((acc, [key, value]) => { - acc[key] = SecurityScheme.fromJSON(value); - return acc; - }, {}) - : {}, - }; + const message = { ...baseSecurityDefinitions } as SecurityDefinitions; + message.security = {}; + if (object.security !== undefined && object.security !== null) { + Object.entries(object.security).forEach(([key, value]) => { + message.security[key] = SecurityScheme.fromJSON(value); + }); + } + return message; }, toJSON(message: SecurityDefinitions): unknown { @@ -3068,25 +3690,21 @@ export const SecurityDefinitions = { return obj; }, - fromPartial, I>>( - object: I, - ): SecurityDefinitions { - const message = createBaseSecurityDefinitions(); - message.security = Object.entries(object.security ?? {}).reduce<{ - [key: string]: SecurityScheme; - }>((acc, [key, value]) => { - if (value !== undefined) { - acc[key] = SecurityScheme.fromPartial(value); - } - return acc; - }, {}); + fromPartial(object: DeepPartial): SecurityDefinitions { + const message = { ...baseSecurityDefinitions } as SecurityDefinitions; + message.security = {}; + if (object.security !== undefined && object.security !== null) { + Object.entries(object.security).forEach(([key, value]) => { + if (value !== undefined) { + message.security[key] = SecurityScheme.fromPartial(value); + } + }); + } return message; }, }; -function createBaseSecurityDefinitions_SecurityEntry(): SecurityDefinitions_SecurityEntry { - return { key: "", value: undefined }; -} +const baseSecurityDefinitions_SecurityEntry: object = { key: "" }; export const SecurityDefinitions_SecurityEntry = { encode( @@ -3105,7 +3723,9 @@ export const SecurityDefinitions_SecurityEntry = { decode(input: _m0.Reader | Uint8Array, length?: number): SecurityDefinitions_SecurityEntry { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseSecurityDefinitions_SecurityEntry(); + const message = { + ...baseSecurityDefinitions_SecurityEntry, + } as SecurityDefinitions_SecurityEntry; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -3124,10 +3744,20 @@ export const SecurityDefinitions_SecurityEntry = { }, fromJSON(object: any): SecurityDefinitions_SecurityEntry { - return { - key: isSet(object.key) ? String(object.key) : "", - value: isSet(object.value) ? SecurityScheme.fromJSON(object.value) : undefined, - }; + const message = { + ...baseSecurityDefinitions_SecurityEntry, + } as SecurityDefinitions_SecurityEntry; + if (object.key !== undefined && object.key !== null) { + message.key = String(object.key); + } else { + message.key = ""; + } + if (object.value !== undefined && object.value !== null) { + message.value = SecurityScheme.fromJSON(object.value); + } else { + message.value = undefined; + } + return message; }, toJSON(message: SecurityDefinitions_SecurityEntry): unknown { @@ -3138,32 +3768,35 @@ export const SecurityDefinitions_SecurityEntry = { return obj; }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): SecurityDefinitions_SecurityEntry { - const message = createBaseSecurityDefinitions_SecurityEntry(); - message.key = object.key ?? ""; - message.value = - object.value !== undefined && object.value !== null - ? SecurityScheme.fromPartial(object.value) - : undefined; + const message = { + ...baseSecurityDefinitions_SecurityEntry, + } as SecurityDefinitions_SecurityEntry; + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } else { + message.key = ""; + } + if (object.value !== undefined && object.value !== null) { + message.value = SecurityScheme.fromPartial(object.value); + } else { + message.value = undefined; + } return message; }, }; -function createBaseSecurityScheme(): SecurityScheme { - return { - type: 0, - description: "", - name: "", - in: 0, - flow: 0, - authorizationUrl: "", - tokenUrl: "", - scopes: undefined, - extensions: {}, - }; -} +const baseSecurityScheme: object = { + type: 0, + description: "", + name: "", + in: 0, + flow: 0, + authorizationUrl: "", + tokenUrl: "", +}; export const SecurityScheme = { encode(message: SecurityScheme, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -3192,12 +3825,10 @@ export const SecurityScheme = { Scopes.encode(message.scopes, writer.uint32(66).fork()).ldelim(); } Object.entries(message.extensions).forEach(([key, value]) => { - if (value !== undefined) { - SecurityScheme_ExtensionsEntry.encode( - { key: key as any, value }, - writer.uint32(74).fork(), - ).ldelim(); - } + SecurityScheme_ExtensionsEntry.encode( + { key: key as any, value }, + writer.uint32(74).fork(), + ).ldelim(); }); return writer; }, @@ -3205,7 +3836,8 @@ export const SecurityScheme = { decode(input: _m0.Reader | Uint8Array, length?: number): SecurityScheme { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseSecurityScheme(); + const message = { ...baseSecurityScheme } as SecurityScheme; + message.extensions = {}; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -3248,22 +3880,54 @@ export const SecurityScheme = { }, fromJSON(object: any): SecurityScheme { - return { - type: isSet(object.type) ? securityScheme_TypeFromJSON(object.type) : 0, - description: isSet(object.description) ? String(object.description) : "", - name: isSet(object.name) ? String(object.name) : "", - in: isSet(object.in) ? securityScheme_InFromJSON(object.in) : 0, - flow: isSet(object.flow) ? securityScheme_FlowFromJSON(object.flow) : 0, - authorizationUrl: isSet(object.authorizationUrl) ? String(object.authorizationUrl) : "", - tokenUrl: isSet(object.tokenUrl) ? String(object.tokenUrl) : "", - scopes: isSet(object.scopes) ? Scopes.fromJSON(object.scopes) : undefined, - extensions: isObject(object.extensions) - ? Object.entries(object.extensions).reduce<{ [key: string]: any }>((acc, [key, value]) => { - acc[key] = value as any; - return acc; - }, {}) - : {}, - }; + const message = { ...baseSecurityScheme } as SecurityScheme; + message.extensions = {}; + if (object.type !== undefined && object.type !== null) { + message.type = securityScheme_TypeFromJSON(object.type); + } else { + message.type = 0; + } + if (object.description !== undefined && object.description !== null) { + message.description = String(object.description); + } else { + message.description = ""; + } + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.in !== undefined && object.in !== null) { + message.in = securityScheme_InFromJSON(object.in); + } else { + message.in = 0; + } + if (object.flow !== undefined && object.flow !== null) { + message.flow = securityScheme_FlowFromJSON(object.flow); + } else { + message.flow = 0; + } + if (object.authorizationUrl !== undefined && object.authorizationUrl !== null) { + message.authorizationUrl = String(object.authorizationUrl); + } else { + message.authorizationUrl = ""; + } + if (object.tokenUrl !== undefined && object.tokenUrl !== null) { + message.tokenUrl = String(object.tokenUrl); + } else { + message.tokenUrl = ""; + } + if (object.scopes !== undefined && object.scopes !== null) { + message.scopes = Scopes.fromJSON(object.scopes); + } else { + message.scopes = undefined; + } + if (object.extensions !== undefined && object.extensions !== null) { + Object.entries(object.extensions).forEach(([key, value]) => { + message.extensions[key] = Value.fromJSON(value); + }); + } + return message; }, toJSON(message: SecurityScheme): unknown { @@ -3280,40 +3944,67 @@ export const SecurityScheme = { obj.extensions = {}; if (message.extensions) { Object.entries(message.extensions).forEach(([k, v]) => { - obj.extensions[k] = v; + obj.extensions[k] = Value.toJSON(v); }); } return obj; }, - fromPartial, I>>(object: I): SecurityScheme { - const message = createBaseSecurityScheme(); - message.type = object.type ?? 0; - message.description = object.description ?? ""; - message.name = object.name ?? ""; - message.in = object.in ?? 0; - message.flow = object.flow ?? 0; - message.authorizationUrl = object.authorizationUrl ?? ""; - message.tokenUrl = object.tokenUrl ?? ""; - message.scopes = - object.scopes !== undefined && object.scopes !== null - ? Scopes.fromPartial(object.scopes) - : undefined; - message.extensions = Object.entries(object.extensions ?? {}).reduce<{ - [key: string]: any; - }>((acc, [key, value]) => { - if (value !== undefined) { - acc[key] = value; - } - return acc; - }, {}); + fromPartial(object: DeepPartial): SecurityScheme { + const message = { ...baseSecurityScheme } as SecurityScheme; + message.extensions = {}; + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } else { + message.type = 0; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } else { + message.description = ""; + } + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.in !== undefined && object.in !== null) { + message.in = object.in; + } else { + message.in = 0; + } + if (object.flow !== undefined && object.flow !== null) { + message.flow = object.flow; + } else { + message.flow = 0; + } + if (object.authorizationUrl !== undefined && object.authorizationUrl !== null) { + message.authorizationUrl = object.authorizationUrl; + } else { + message.authorizationUrl = ""; + } + if (object.tokenUrl !== undefined && object.tokenUrl !== null) { + message.tokenUrl = object.tokenUrl; + } else { + message.tokenUrl = ""; + } + if (object.scopes !== undefined && object.scopes !== null) { + message.scopes = Scopes.fromPartial(object.scopes); + } else { + message.scopes = undefined; + } + if (object.extensions !== undefined && object.extensions !== null) { + Object.entries(object.extensions).forEach(([key, value]) => { + if (value !== undefined) { + message.extensions[key] = Value.fromPartial(value); + } + }); + } return message; }, }; -function createBaseSecurityScheme_ExtensionsEntry(): SecurityScheme_ExtensionsEntry { - return { key: "", value: undefined }; -} +const baseSecurityScheme_ExtensionsEntry: object = { key: "" }; export const SecurityScheme_ExtensionsEntry = { encode( @@ -3324,7 +4015,7 @@ export const SecurityScheme_ExtensionsEntry = { writer.uint32(10).string(message.key); } if (message.value !== undefined) { - Value.encode(Value.wrap(message.value), writer.uint32(18).fork()).ldelim(); + Value.encode(message.value, writer.uint32(18).fork()).ldelim(); } return writer; }, @@ -3332,7 +4023,9 @@ export const SecurityScheme_ExtensionsEntry = { decode(input: _m0.Reader | Uint8Array, length?: number): SecurityScheme_ExtensionsEntry { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseSecurityScheme_ExtensionsEntry(); + const message = { + ...baseSecurityScheme_ExtensionsEntry, + } as SecurityScheme_ExtensionsEntry; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -3340,7 +4033,7 @@ export const SecurityScheme_ExtensionsEntry = { message.key = reader.string(); break; case 2: - message.value = Value.unwrap(Value.decode(reader, reader.uint32())); + message.value = Value.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -3351,32 +4044,49 @@ export const SecurityScheme_ExtensionsEntry = { }, fromJSON(object: any): SecurityScheme_ExtensionsEntry { - return { - key: isSet(object.key) ? String(object.key) : "", - value: isSet(object?.value) ? object.value : undefined, - }; + const message = { + ...baseSecurityScheme_ExtensionsEntry, + } as SecurityScheme_ExtensionsEntry; + if (object.key !== undefined && object.key !== null) { + message.key = String(object.key); + } else { + message.key = ""; + } + if (object.value !== undefined && object.value !== null) { + message.value = Value.fromJSON(object.value); + } else { + message.value = undefined; + } + return message; }, toJSON(message: SecurityScheme_ExtensionsEntry): unknown { const obj: any = {}; message.key !== undefined && (obj.key = message.key); - message.value !== undefined && (obj.value = message.value); + message.value !== undefined && + (obj.value = message.value ? Value.toJSON(message.value) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): SecurityScheme_ExtensionsEntry { - const message = createBaseSecurityScheme_ExtensionsEntry(); - message.key = object.key ?? ""; - message.value = object.value ?? undefined; + fromPartial(object: DeepPartial): SecurityScheme_ExtensionsEntry { + const message = { + ...baseSecurityScheme_ExtensionsEntry, + } as SecurityScheme_ExtensionsEntry; + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } else { + message.key = ""; + } + if (object.value !== undefined && object.value !== null) { + message.value = Value.fromPartial(object.value); + } else { + message.value = undefined; + } return message; }, }; -function createBaseSecurityRequirement(): SecurityRequirement { - return { securityRequirement: {} }; -} +const baseSecurityRequirement: object = {}; export const SecurityRequirement = { encode(message: SecurityRequirement, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -3392,7 +4102,8 @@ export const SecurityRequirement = { decode(input: _m0.Reader | Uint8Array, length?: number): SecurityRequirement { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseSecurityRequirement(); + const message = { ...baseSecurityRequirement } as SecurityRequirement; + message.securityRequirement = {}; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -3414,16 +4125,15 @@ export const SecurityRequirement = { }, fromJSON(object: any): SecurityRequirement { - return { - securityRequirement: isObject(object.securityRequirement) - ? Object.entries(object.securityRequirement).reduce<{ - [key: string]: SecurityRequirement_SecurityRequirementValue; - }>((acc, [key, value]) => { - acc[key] = SecurityRequirement_SecurityRequirementValue.fromJSON(value); - return acc; - }, {}) - : {}, - }; + const message = { ...baseSecurityRequirement } as SecurityRequirement; + message.securityRequirement = {}; + if (object.securityRequirement !== undefined && object.securityRequirement !== null) { + Object.entries(object.securityRequirement).forEach(([key, value]) => { + message.securityRequirement[key] = + SecurityRequirement_SecurityRequirementValue.fromJSON(value); + }); + } + return message; }, toJSON(message: SecurityRequirement): unknown { @@ -3437,25 +4147,22 @@ export const SecurityRequirement = { return obj; }, - fromPartial, I>>( - object: I, - ): SecurityRequirement { - const message = createBaseSecurityRequirement(); - message.securityRequirement = Object.entries(object.securityRequirement ?? {}).reduce<{ - [key: string]: SecurityRequirement_SecurityRequirementValue; - }>((acc, [key, value]) => { - if (value !== undefined) { - acc[key] = SecurityRequirement_SecurityRequirementValue.fromPartial(value); - } - return acc; - }, {}); + fromPartial(object: DeepPartial): SecurityRequirement { + const message = { ...baseSecurityRequirement } as SecurityRequirement; + message.securityRequirement = {}; + if (object.securityRequirement !== undefined && object.securityRequirement !== null) { + Object.entries(object.securityRequirement).forEach(([key, value]) => { + if (value !== undefined) { + message.securityRequirement[key] = + SecurityRequirement_SecurityRequirementValue.fromPartial(value); + } + }); + } return message; }, }; -function createBaseSecurityRequirement_SecurityRequirementValue(): SecurityRequirement_SecurityRequirementValue { - return { scope: [] }; -} +const baseSecurityRequirement_SecurityRequirementValue: object = { scope: "" }; export const SecurityRequirement_SecurityRequirementValue = { encode( @@ -3474,7 +4181,10 @@ export const SecurityRequirement_SecurityRequirementValue = { ): SecurityRequirement_SecurityRequirementValue { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseSecurityRequirement_SecurityRequirementValue(); + const message = { + ...baseSecurityRequirement_SecurityRequirementValue, + } as SecurityRequirement_SecurityRequirementValue; + message.scope = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -3490,9 +4200,16 @@ export const SecurityRequirement_SecurityRequirementValue = { }, fromJSON(object: any): SecurityRequirement_SecurityRequirementValue { - return { - scope: Array.isArray(object?.scope) ? object.scope.map((e: any) => String(e)) : [], - }; + const message = { + ...baseSecurityRequirement_SecurityRequirementValue, + } as SecurityRequirement_SecurityRequirementValue; + message.scope = []; + if (object.scope !== undefined && object.scope !== null) { + for (const e of object.scope) { + message.scope.push(String(e)); + } + } + return message; }, toJSON(message: SecurityRequirement_SecurityRequirementValue): unknown { @@ -3505,18 +4222,23 @@ export const SecurityRequirement_SecurityRequirementValue = { return obj; }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): SecurityRequirement_SecurityRequirementValue { - const message = createBaseSecurityRequirement_SecurityRequirementValue(); - message.scope = object.scope?.map(e => e) || []; + const message = { + ...baseSecurityRequirement_SecurityRequirementValue, + } as SecurityRequirement_SecurityRequirementValue; + message.scope = []; + if (object.scope !== undefined && object.scope !== null) { + for (const e of object.scope) { + message.scope.push(e); + } + } return message; }, }; -function createBaseSecurityRequirement_SecurityRequirementEntry(): SecurityRequirement_SecurityRequirementEntry { - return { key: "", value: undefined }; -} +const baseSecurityRequirement_SecurityRequirementEntry: object = { key: "" }; export const SecurityRequirement_SecurityRequirementEntry = { encode( @@ -3541,7 +4263,9 @@ export const SecurityRequirement_SecurityRequirementEntry = { ): SecurityRequirement_SecurityRequirementEntry { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseSecurityRequirement_SecurityRequirementEntry(); + const message = { + ...baseSecurityRequirement_SecurityRequirementEntry, + } as SecurityRequirement_SecurityRequirementEntry; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -3563,12 +4287,20 @@ export const SecurityRequirement_SecurityRequirementEntry = { }, fromJSON(object: any): SecurityRequirement_SecurityRequirementEntry { - return { - key: isSet(object.key) ? String(object.key) : "", - value: isSet(object.value) - ? SecurityRequirement_SecurityRequirementValue.fromJSON(object.value) - : undefined, - }; + const message = { + ...baseSecurityRequirement_SecurityRequirementEntry, + } as SecurityRequirement_SecurityRequirementEntry; + if (object.key !== undefined && object.key !== null) { + message.key = String(object.key); + } else { + message.key = ""; + } + if (object.value !== undefined && object.value !== null) { + message.value = SecurityRequirement_SecurityRequirementValue.fromJSON(object.value); + } else { + message.value = undefined; + } + return message; }, toJSON(message: SecurityRequirement_SecurityRequirementEntry): unknown { @@ -3581,22 +4313,27 @@ export const SecurityRequirement_SecurityRequirementEntry = { return obj; }, - fromPartial, I>>( - object: I, + fromPartial( + object: DeepPartial, ): SecurityRequirement_SecurityRequirementEntry { - const message = createBaseSecurityRequirement_SecurityRequirementEntry(); - message.key = object.key ?? ""; - message.value = - object.value !== undefined && object.value !== null - ? SecurityRequirement_SecurityRequirementValue.fromPartial(object.value) - : undefined; + const message = { + ...baseSecurityRequirement_SecurityRequirementEntry, + } as SecurityRequirement_SecurityRequirementEntry; + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } else { + message.key = ""; + } + if (object.value !== undefined && object.value !== null) { + message.value = SecurityRequirement_SecurityRequirementValue.fromPartial(object.value); + } else { + message.value = undefined; + } return message; }, }; -function createBaseScopes(): Scopes { - return { scope: {} }; -} +const baseScopes: object = {}; export const Scopes = { encode(message: Scopes, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -3609,7 +4346,8 @@ export const Scopes = { decode(input: _m0.Reader | Uint8Array, length?: number): Scopes { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseScopes(); + const message = { ...baseScopes } as Scopes; + message.scope = {}; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -3628,14 +4366,14 @@ export const Scopes = { }, fromJSON(object: any): Scopes { - return { - scope: isObject(object.scope) - ? Object.entries(object.scope).reduce<{ [key: string]: string }>((acc, [key, value]) => { - acc[key] = String(value); - return acc; - }, {}) - : {}, - }; + const message = { ...baseScopes } as Scopes; + message.scope = {}; + if (object.scope !== undefined && object.scope !== null) { + Object.entries(object.scope).forEach(([key, value]) => { + message.scope[key] = String(value); + }); + } + return message; }, toJSON(message: Scopes): unknown { @@ -3649,23 +4387,21 @@ export const Scopes = { return obj; }, - fromPartial, I>>(object: I): Scopes { - const message = createBaseScopes(); - message.scope = Object.entries(object.scope ?? {}).reduce<{ - [key: string]: string; - }>((acc, [key, value]) => { - if (value !== undefined) { - acc[key] = String(value); - } - return acc; - }, {}); + fromPartial(object: DeepPartial): Scopes { + const message = { ...baseScopes } as Scopes; + message.scope = {}; + if (object.scope !== undefined && object.scope !== null) { + Object.entries(object.scope).forEach(([key, value]) => { + if (value !== undefined) { + message.scope[key] = String(value); + } + }); + } return message; }, }; -function createBaseScopes_ScopeEntry(): Scopes_ScopeEntry { - return { key: "", value: "" }; -} +const baseScopes_ScopeEntry: object = { key: "", value: "" }; export const Scopes_ScopeEntry = { encode(message: Scopes_ScopeEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { @@ -3681,7 +4417,7 @@ export const Scopes_ScopeEntry = { decode(input: _m0.Reader | Uint8Array, length?: number): Scopes_ScopeEntry { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseScopes_ScopeEntry(); + const message = { ...baseScopes_ScopeEntry } as Scopes_ScopeEntry; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -3700,10 +4436,18 @@ export const Scopes_ScopeEntry = { }, fromJSON(object: any): Scopes_ScopeEntry { - return { - key: isSet(object.key) ? String(object.key) : "", - value: isSet(object.value) ? String(object.value) : "", - }; + const message = { ...baseScopes_ScopeEntry } as Scopes_ScopeEntry; + if (object.key !== undefined && object.key !== null) { + message.key = String(object.key); + } else { + message.key = ""; + } + if (object.value !== undefined && object.value !== null) { + message.value = String(object.value); + } else { + message.value = ""; + } + return message; }, toJSON(message: Scopes_ScopeEntry): unknown { @@ -3713,10 +4457,18 @@ export const Scopes_ScopeEntry = { return obj; }, - fromPartial, I>>(object: I): Scopes_ScopeEntry { - const message = createBaseScopes_ScopeEntry(); - message.key = object.key ?? ""; - message.value = object.value ?? ""; + fromPartial(object: DeepPartial): Scopes_ScopeEntry { + const message = { ...baseScopes_ScopeEntry } as Scopes_ScopeEntry; + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } else { + message.key = ""; + } + if (object.value !== undefined && object.value !== null) { + message.value = object.value; + } else { + message.value = ""; + } return message; }, }; @@ -3733,7 +4485,6 @@ var globalThis: any = (() => { })(); type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - export type DeepPartial = T extends Builtin ? T : T extends Array @@ -3744,11 +4495,6 @@ export type DeepPartial = T extends Builtin ? { [K in keyof T]?: DeepPartial } : Partial; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & Record>, never>; - function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); @@ -3760,11 +4506,3 @@ if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); } - -function isObject(value: any): boolean { - return typeof value === "object" && value !== null; -} - -function isSet(value: any): boolean { - return value !== null && value !== undefined; -}