From 704dc4918d39c9ec117111763a854d5b70b08b6e Mon Sep 17 00:00:00 2001 From: Yash Bhardwaj Date: Fri, 6 Dec 2024 15:14:20 +0530 Subject: [PATCH 1/4] fix : add deprication info in resource table --- Makefile | 2 +- client.yaml | 0 client/local/model/resource_spec.go | 47 +- client/local/specio/resource_spec_io_test.go | 1 + core/job/service/job_service_test.go | 4 +- core/resource/handler/v1beta1/resource.go | 35 +- .../resource/handler/v1beta1/resource_test.go | 8 +- core/resource/resource.go | 53 +- core/resource/resource_test.go | 91 +- core/resource/service/backup_service_test.go | 2 +- .../resource/service/resource_manager_test.go | 46 +- .../resource/service/resource_service_test.go | 168 +-- ext/store/bigquery/backup.go | 2 +- ext/store/bigquery/backup_test.go | 4 +- ext/store/bigquery/batch_test.go | 14 +- ext/store/bigquery/bigquery_test.go | 90 +- ext/store/bigquery/dataset_spec_test.go | 52 +- ext/store/bigquery/dataset_test.go | 16 +- ext/store/bigquery/external_table_test.go | 22 +- ext/store/bigquery/model_test.go | 2 +- ext/store/bigquery/routine_test.go | 2 +- ext/store/bigquery/table_test.go | 22 +- ext/store/bigquery/view_test.go | 20 +- .../store/postgres/resource/repository.go | 14 +- internal/store/postgres/resource/resource.go | 17 +- .../optimus/core/v1beta1/resource.pb.go | 1067 +++++++++-------- .../core/v1beta1/resource.swagger.json | 18 + 27 files changed, 1003 insertions(+), 816 deletions(-) create mode 100644 client.yaml diff --git a/Makefile b/Makefile index 715a24c84b..964b162728 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ NAME = "github.com/goto/optimus" LAST_COMMIT := $(shell git rev-parse --short HEAD) LAST_TAG := "$(shell git rev-list --tags --max-count=1)" OPMS_VERSION := "$(shell git describe --tags ${LAST_TAG})-next" -PROTON_COMMIT := "04fa895e5b1a1c79f2bb9c0cad63617062c55495" +PROTON_COMMIT := "5e7cf7119e5ef2007c8323712c9d08c11863813d" .PHONY: build test test-ci generate-proto unit-test-ci integration-test vet coverage clean install lint diff --git a/client.yaml b/client.yaml new file mode 100644 index 0000000000..e69de29bb2 diff --git a/client/local/model/resource_spec.go b/client/local/model/resource_spec.go index 2986aff132..41a522a862 100644 --- a/client/local/model/resource_spec.go +++ b/client/local/model/resource_spec.go @@ -2,19 +2,28 @@ package model import ( "fmt" + "time" "google.golang.org/protobuf/types/known/structpb" + "google.golang.org/protobuf/types/known/timestamppb" pb "github.com/goto/optimus/protos/gotocompany/optimus/core/v1beta1" ) +type Deprecation struct { + Reason string `yaml:"reason"` + Date string `yaml:"date"` + ReplacementTable string `yaml:"replacement_table"` +} + type ResourceSpec struct { - Version int `yaml:"version"` - Name string `yaml:"name"` - Type string `yaml:"type"` - Labels map[string]string `yaml:"labels"` - Spec map[string]interface{} `yaml:"spec"` - Path string `yaml:"-"` + Version int `yaml:"version"` + Name string `yaml:"name"` + Type string `yaml:"type"` + Labels map[string]string `yaml:"labels"` + Spec map[string]interface{} `yaml:"spec"` + Path string `yaml:"-"` + Deprecation *Deprecation `yaml:"deprecation"` } func (r ResourceSpec) ToProto() (*pb.ResourceSpecification, error) { @@ -22,12 +31,26 @@ func (r ResourceSpec) ToProto() (*pb.ResourceSpecification, error) { if err != nil { return nil, fmt.Errorf("error constructing spec pb: %w", err) } + + var deprecation *pb.Deprecation + if r.Deprecation != nil && len(r.Deprecation.Date) > 0 { + deprecationDate, err := time.Parse(time.DateOnly, r.Deprecation.Date) + if err != nil { + return nil, fmt.Errorf("error parsing deprication Date, for resource: %s, expected_format: [YYYY-MM-DD], got: [%s], err: %w", r.Name, r.Deprecation.Date, err) + } + deprecation = &pb.Deprecation{ + Reason: r.Deprecation.Reason, + Date: timestamppb.New(deprecationDate), + ReplacementTable: r.Deprecation.ReplacementTable, + } + } return &pb.ResourceSpecification{ - Version: int32(r.Version), - Name: r.Name, - Type: r.Type, - Labels: r.Labels, - Spec: specPb, - Assets: nil, // TODO: check if we really need assets + Version: int32(r.Version), + Name: r.Name, + Type: r.Type, + Labels: r.Labels, + Spec: specPb, + Assets: nil, // TODO: check if we really need assets + Deprecation: deprecation, }, nil } diff --git a/client/local/specio/resource_spec_io_test.go b/client/local/specio/resource_spec_io_test.go index c318da859d..c8fbcdd560 100644 --- a/client/local/specio/resource_spec_io_test.go +++ b/client/local/specio/resource_spec_io_test.go @@ -320,6 +320,7 @@ spec: - mode: nullable name: name type: string +deprecation: null `) r.Assert().EqualValues(expectedContent, actualContent) }) diff --git a/core/job/service/job_service_test.go b/core/job/service/job_service_test.go index cd79e96d99..441b29353c 100644 --- a/core/job/service/job_service_test.go +++ b/core/job/service/job_service_test.go @@ -4586,7 +4586,7 @@ func TestJobService(t *testing.T) { resourceExistenceChecker.On("GetByURN", ctx, sampleTenant, resourceURNA).Return(nil, errors.New("unexpected get by urn error")) resourceExistenceChecker.On("ExistInStore", ctx, sampleTenant, resourceURNA).Return(false, errors.New("unexpected exist in store error")) - rsc, err := resource.NewResource("resource_1", "table", resource.Bigquery, sampleTenant, &resource.Metadata{Description: "table for test"}, map[string]any{"version": 1}) + rsc, err := resource.NewResource("resource_1", "table", resource.Bigquery, sampleTenant, &resource.Metadata{Description: "table for test"}, map[string]any{"version": 1}, nil) assert.NoError(t, err) deletedRsc := resource.FromExisting(rsc, resource.ReplaceStatus(resource.StatusDeleted)) @@ -4744,7 +4744,7 @@ func TestJobService(t *testing.T) { jobRunInputCompiler.On("Compile", ctx, mock.Anything, mock.Anything, mock.Anything).Return(nil, nil) - rsc, err := resource.NewResource("resource_1", "table", resource.Bigquery, sampleTenant, &resource.Metadata{Description: "table for test"}, map[string]any{"version": 1}) + rsc, err := resource.NewResource("resource_1", "table", resource.Bigquery, sampleTenant, &resource.Metadata{Description: "table for test"}, map[string]any{"version": 1}, nil) assert.NoError(t, err) resourceExistenceChecker.On("GetByURN", ctx, sampleTenant, resourceURNA).Return(rsc, nil) diff --git a/core/resource/handler/v1beta1/resource.go b/core/resource/handler/v1beta1/resource.go index 3590e0b5e8..655671bbb6 100644 --- a/core/resource/handler/v1beta1/resource.go +++ b/core/resource/handler/v1beta1/resource.go @@ -11,6 +11,7 @@ import ( "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" "google.golang.org/protobuf/types/known/structpb" + "google.golang.org/protobuf/types/known/timestamppb" "github.com/goto/optimus/core/resource" "github.com/goto/optimus/core/tenant" @@ -515,8 +516,16 @@ func fromResourceProto(rs *pb.ResourceSpecification, tnnt tenant.Tenant, store r Description: description, Labels: rs.Labels, } - - return resource.NewResource(rs.Name, rs.GetType(), store, tnnt, &metadata, spec) + var deprecation *resource.Deprecated + deprecationPb := rs.GetDeprecation() + if deprecationPb != nil { + deprecation = &resource.Deprecated{ + Reason: deprecationPb.Reason, + Date: deprecationPb.Date.AsTime(), + ReplacementTable: deprecationPb.ReplacementTable, + } + } + return resource.NewResource(rs.Name, rs.GetType(), store, tnnt, &metadata, spec, deprecation) } func toResourceProto(res *resource.Resource) (*pb.ResourceSpecification, error) { @@ -529,14 +538,24 @@ func toResourceProto(res *resource.Resource) (*pb.ResourceSpecification, error) if err != nil { return nil, errors.InvalidArgument(resource.EntityResource, "unable to convert spec to proto struct") } + deprecation := res.GetDeprecationInfo() + var deprecationPb *pb.Deprecation + if deprecation != nil { + deprecationPb = &pb.Deprecation{ + Reason: deprecation.Reason, + Date: timestamppb.New(deprecation.Date), + ReplacementTable: deprecation.ReplacementTable, + } + } return &pb.ResourceSpecification{ - Version: meta.Version, - Name: res.FullName(), - Type: res.Kind(), - Spec: pbStruct, - Assets: nil, - Labels: meta.Labels, + Version: meta.Version, + Name: res.FullName(), + Type: res.Kind(), + Spec: pbStruct, + Assets: nil, + Labels: meta.Labels, + Deprecation: deprecationPb, }, nil } diff --git a/core/resource/handler/v1beta1/resource_test.go b/core/resource/handler/v1beta1/resource_test.go index 65ae160e33..9c4108df06 100644 --- a/core/resource/handler/v1beta1/resource_test.go +++ b/core/resource/handler/v1beta1/resource_test.go @@ -270,7 +270,7 @@ func TestResourceHandler(t *testing.T) { t.Run("lists the resources successfully", func(t *testing.T) { spec := map[string]any{"a": "b"} dbRes, err := resource.NewResource("proj.set.table", "table", resource.Bigquery, tnnt, - &resource.Metadata{}, spec) + &resource.Metadata{}, spec, nil) assert.Nil(t, err) service := new(resourceService) @@ -547,7 +547,7 @@ func TestResourceHandler(t *testing.T) { invalidKey := "a\xc5z" specWithInvalidUTF := map[string]any{invalidKey: "value"} dbRes, err := resource.NewResource("proj.set.table", "table", resource.Bigquery, tnnt, - &resource.Metadata{}, specWithInvalidUTF) + &resource.Metadata{}, specWithInvalidUTF, nil) assert.Nil(t, err) service := new(resourceService) name := "proj.set.table" @@ -571,7 +571,7 @@ func TestResourceHandler(t *testing.T) { t.Run("returns the resource successfully", func(t *testing.T) { spec := map[string]any{"a": "b"} dbRes, err := resource.NewResource("proj.set.table", "table", resource.Bigquery, tnnt, - &resource.Metadata{}, spec) + &resource.Metadata{}, spec, nil) assert.Nil(t, err) service := new(resourceService) @@ -997,7 +997,7 @@ func TestResourceHandler(t *testing.T) { t.Run("DeleteResource", func(t *testing.T) { resourceName := "project.dataset.test_table" spec := map[string]any{"a": "b"} - existing, _ := resource.NewResource(resourceName, "table", resource.Bigquery, tnnt, &resource.Metadata{}, spec) + existing, _ := resource.NewResource(resourceName, "table", resource.Bigquery, tnnt, &resource.Metadata{}, spec, nil) t.Run("success", func(t *testing.T) { var ( diff --git a/core/resource/resource.go b/core/resource/resource.go index 840711a1b2..74b51ae9b5 100644 --- a/core/resource/resource.go +++ b/core/resource/resource.go @@ -86,6 +86,12 @@ func (n Name) String() string { return string(n) } +type Deprecated struct { + Reason string + Date time.Time + ReplacementTable string +} + type Resource struct { name Name @@ -99,6 +105,15 @@ type Resource struct { metadata *Metadata status Status + + deprecation *Deprecated +} + +func (r *Resource) IsDeprecated() bool { + if r.deprecation != nil { + return true + } + return false } func (r *Resource) GetUpdateImpact(incoming *Resource) UpdateImpact { @@ -108,7 +123,7 @@ func (r *Resource) GetUpdateImpact(incoming *Resource) UpdateImpact { return UnspecifiedImpactChange } -func NewResource(fullName, kind string, store Store, tnnt tenant.Tenant, meta *Metadata, spec map[string]any) (*Resource, error) { +func NewResource(fullName, kind string, store Store, tnnt tenant.Tenant, meta *Metadata, spec map[string]any, deprecation *Deprecated) (*Resource, error) { name, err := NameFrom(fullName) if err != nil { return nil, err @@ -124,13 +139,14 @@ func NewResource(fullName, kind string, store Store, tnnt tenant.Tenant, meta *M } return &Resource{ - name: name, - kind: kind, - store: store, - tenant: tnnt, - spec: spec, - metadata: meta, - status: StatusUnknown, + name: name, + kind: kind, + store: store, + tenant: tnnt, + spec: spec, + metadata: meta, + status: StatusUnknown, + deprecation: deprecation, }, nil } @@ -151,6 +167,10 @@ func (r *Resource) URN() URN { return r.urn } +func (r *Resource) GetDeprecationInfo() *Deprecated { + return r.deprecation +} + func (r *Resource) UpdateURN(urn URN) error { if r.urn.IsZero() { r.urn = urn @@ -234,14 +254,15 @@ func ReplaceStatus(status Status) FromExistingOpt { func FromExisting(existing *Resource, opts ...FromExistingOpt) *Resource { output := &Resource{ - name: existing.name, - kind: existing.kind, - store: existing.store, - tenant: existing.tenant, - spec: existing.spec, - metadata: existing.metadata, - urn: existing.urn, - status: existing.status, + name: existing.name, + kind: existing.kind, + store: existing.store, + tenant: existing.tenant, + spec: existing.spec, + metadata: existing.metadata, + urn: existing.urn, + status: existing.status, + deprecation: existing.deprecation, } for _, opt := range opts { opt(output) diff --git a/core/resource/resource_test.go b/core/resource/resource_test.go index 19ca44ffbb..dbc7471dfe 100644 --- a/core/resource/resource_test.go +++ b/core/resource/resource_test.go @@ -84,18 +84,18 @@ func TestNewResource(t *testing.T) { t.Run("when invalid resource", func(t *testing.T) { t.Run("returns error when name is empty", func(t *testing.T) { - _, err := resource.NewResource("", "table", resource.Bigquery, tnnt, nil, nil) + _, err := resource.NewResource("", "table", resource.Bigquery, tnnt, nil, nil, nil) assert.NotNil(t, err) assert.ErrorContains(t, err, "resource name is empty") }) t.Run("returns error when dataset name is empty", func(t *testing.T) { - _, err := resource.NewResource("", "dataset", resource.Bigquery, tnnt, nil, nil) + _, err := resource.NewResource("", "dataset", resource.Bigquery, tnnt, nil, nil, nil) assert.NotNil(t, err) assert.ErrorContains(t, err, "resource name is empty") }) t.Run("returns error when invalid resource metadata", func(t *testing.T) { spec := map[string]any{"a": "b"} - _, err := resource.NewResource("proj.set.res_name", "table", resource.Bigquery, tnnt, nil, spec) + _, err := resource.NewResource("proj.set.res_name", "table", resource.Bigquery, tnnt, nil, spec, nil) assert.NotNil(t, err) assert.ErrorContains(t, err, "metadata for proj.set.res_name is invalid") }) @@ -104,8 +104,7 @@ func TestNewResource(t *testing.T) { Version: 1, Description: "description", } - _, err := resource.NewResource("proj.set.res_name", "table", - resource.Bigquery, tnnt, &meta, nil) + _, err := resource.NewResource("proj.set.res_name", "table", resource.Bigquery, tnnt, &meta, nil, nil) assert.NotNil(t, err) assert.EqualError(t, err, "invalid argument for entity resource: empty resource spec "+ "for proj.set.res_name") @@ -117,8 +116,7 @@ func TestNewResource(t *testing.T) { Description: "description", } spec := map[string]any{"a": "b"} - res, err := resource.NewResource("proj.set.res_name", "table", - resource.Bigquery, tnnt, meta, spec) + res, err := resource.NewResource("proj.set.res_name", "table", resource.Bigquery, tnnt, meta, spec, nil) assert.Nil(t, err) urn, err := resource.ParseURN("bigquery://proj:set.res_name") assert.NoError(t, err) @@ -142,8 +140,7 @@ func TestNewResource(t *testing.T) { Description: "description", } spec := map[string]any{"a": "b"} - res, err := resource.NewResource("proj.dataset", "dataset", - resource.Bigquery, tnnt, meta, spec) + res, err := resource.NewResource("proj.dataset", "dataset", resource.Bigquery, tnnt, meta, spec, nil) assert.Nil(t, err) assert.Equal(t, "proj.dataset", res.FullName()) @@ -172,7 +169,7 @@ func TestResource(t *testing.T) { spec := map[string]any{ "description": "spec for unit test", } - validResource, err := resource.NewResource("project.dataset.table", "table", resource.Bigquery, tnnt, metadata, spec) + validResource, err := resource.NewResource("project.dataset.table", "table", resource.Bigquery, tnnt, metadata, spec, nil) assert.NoError(t, err) var nilResource *resource.Resource @@ -190,7 +187,7 @@ func TestResource(t *testing.T) { spec := map[string]any{ "description": "spec for unit test", } - validResource, err := resource.NewResource("project.dataset.table", "table", resource.Bigquery, tnnt, metadata, spec) + validResource, err := resource.NewResource("project.dataset.table", "table", resource.Bigquery, tnnt, metadata, spec, nil) assert.NoError(t, err) var nilResource *resource.Resource @@ -208,7 +205,7 @@ func TestResource(t *testing.T) { spec := map[string]any{ "description": "spec for unit test", } - validResource, err := resource.NewResource("project.dataset.table", "table", resource.Bigquery, tnnt, metadata, spec) + validResource, err := resource.NewResource("project.dataset.table", "table", resource.Bigquery, tnnt, metadata, spec, nil) assert.NoError(t, err) invalidResource := &resource.Resource{} @@ -226,7 +223,7 @@ func TestResource(t *testing.T) { spec := map[string]any{ "description": "spec for unit test", } - validResource, err := resource.NewResource("project.dataset.table", "table", resource.Bigquery, tnnt, metadata, spec) + validResource, err := resource.NewResource("project.dataset.table", "table", resource.Bigquery, tnnt, metadata, spec, nil) assert.NoError(t, err) invalidResource := &resource.Resource{} @@ -244,9 +241,9 @@ func TestResource(t *testing.T) { spec := map[string]any{ "description": "spec for unit test", } - resource1, err := resource.NewResource("project.dataset.table1", "table", resource.Bigquery, tnnt, metadata, spec) + resource1, err := resource.NewResource("project.dataset.table1", "table", resource.Bigquery, tnnt, metadata, spec, nil) assert.NoError(t, err) - resource2, err := resource.NewResource("project.dataset.table2", "table", resource.Bigquery, tnnt, metadata, spec) + resource2, err := resource.NewResource("project.dataset.table2", "table", resource.Bigquery, tnnt, metadata, spec, nil) assert.NoError(t, err) actualEquality := resource1.Equal(resource2) @@ -263,9 +260,9 @@ func TestResource(t *testing.T) { spec := map[string]any{ "description": "spec for unit test", } - resource1, err := resource.NewResource("project.dataset1.table", "table", resource.Bigquery, tnnt, metadata, spec) + resource1, err := resource.NewResource("project.dataset1.table", "table", resource.Bigquery, tnnt, metadata, spec, nil) assert.NoError(t, err) - resource2, err := resource.NewResource("project.dataset2.table", "table", resource.Bigquery, tnnt, metadata, spec) + resource2, err := resource.NewResource("project.dataset2.table", "table", resource.Bigquery, tnnt, metadata, spec, nil) assert.NoError(t, err) actualEquality := resource1.Equal(resource2) @@ -282,9 +279,9 @@ func TestResource(t *testing.T) { spec := map[string]any{ "description": "spec for unit test", } - resource1, err := resource.NewResource("project.dataset1.table", "table", resource.Bigquery, tnnt, metadata, spec) + resource1, err := resource.NewResource("project.dataset1.table", "table", resource.Bigquery, tnnt, metadata, spec, nil) assert.NoError(t, err) - resource2, err := resource.NewResource("project.dataset2.table", "table", resource.Bigquery, tnnt, metadata, spec) + resource2, err := resource.NewResource("project.dataset2.table", "table", resource.Bigquery, tnnt, metadata, spec, nil) assert.NoError(t, err) // current implementation does not provide different kind of store to explicitly produce such inequality @@ -309,9 +306,9 @@ func TestResource(t *testing.T) { spec := map[string]any{ "description": "spec for unit test", } - resource1, err := resource.NewResource("project.dataset.table", "table", resource.Bigquery, tnnt, metadata1, spec) + resource1, err := resource.NewResource("project.dataset.table", "table", resource.Bigquery, tnnt, metadata1, spec, nil) assert.NoError(t, err) - resource2, err := resource.NewResource("project.dataset.table", "table", resource.Bigquery, tnnt, metadata2, spec) + resource2, err := resource.NewResource("project.dataset.table", "table", resource.Bigquery, tnnt, metadata2, spec, nil) assert.NoError(t, err) actualEquality := resource1.Equal(resource2) @@ -331,9 +328,9 @@ func TestResource(t *testing.T) { spec2 := map[string]any{ "description": "spec 2 for unit test", } - resource1, err := resource.NewResource("project.dataset.table", "table", resource.Bigquery, tnnt, metadata, spec1) + resource1, err := resource.NewResource("project.dataset.table", "table", resource.Bigquery, tnnt, metadata, spec1, nil) assert.NoError(t, err) - resource2, err := resource.NewResource("project.dataset.table", "table", resource.Bigquery, tnnt, metadata, spec2) + resource2, err := resource.NewResource("project.dataset.table", "table", resource.Bigquery, tnnt, metadata, spec2, nil) assert.NoError(t, err) actualEquality := resource1.Equal(resource2) @@ -358,10 +355,10 @@ func TestResource(t *testing.T) { spec := map[string]any{ "description": "spec for unit test", } - resource1, err := resource.NewResource("project.dataset.table", "table", resource.Bigquery, tnnt, metadata, spec) + resource1, err := resource.NewResource("project.dataset.table", "table", resource.Bigquery, tnnt, metadata, spec, nil) assert.NoError(t, err) resource1.MarkToCreate() - resource2, err := resource.NewResource("project.dataset.table", "table", resource.Bigquery, tnnt, metadata, spec) + resource2, err := resource.NewResource("project.dataset.table", "table", resource.Bigquery, tnnt, metadata, spec, nil) resource1.MarkToUpdate() assert.NoError(t, err) @@ -383,7 +380,7 @@ func TestResource(t *testing.T) { } t.Run("can update the urn when not present", func(t *testing.T) { - validResource, err := resource.NewResource("project.dataset.table", "table", resource.Bigquery, tnnt, metadata, spec) + validResource, err := resource.NewResource("project.dataset.table", "table", resource.Bigquery, tnnt, metadata, spec, nil) assert.NoError(t, err) urn, err := resource.ParseURN("bigquery://project:dataset.table") @@ -393,7 +390,7 @@ func TestResource(t *testing.T) { assert.Equal(t, urn, validResource.URN()) }) t.Run("returns error when urn already present", func(t *testing.T) { - validResource, err := resource.NewResource("project.dataset.table", "table", resource.Bigquery, tnnt, metadata, spec) + validResource, err := resource.NewResource("project.dataset.table", "table", resource.Bigquery, tnnt, metadata, spec, nil) assert.NoError(t, err) urn, err := resource.ParseURN("bigquery://project:dataset.table") @@ -413,7 +410,7 @@ func TestResource(t *testing.T) { t.Run("MarkValidationSuccess", func(t *testing.T) { t.Run("returns error if current status is not unknown", func(t *testing.T) { - res, err := resource.NewResource("proj.ds.name1", "table", resource.Bigquery, tnnt, meta, spec) + res, err := resource.NewResource("proj.ds.name1", "table", resource.Bigquery, tnnt, meta, spec, nil) assert.NoError(t, err) res = resource.FromExisting(res, resource.ReplaceStatus(resource.StatusSkipped)) @@ -423,7 +420,7 @@ func TestResource(t *testing.T) { }) t.Run("changes status to validation_success and returns nil if current status is unknown", func(t *testing.T) { - res, err := resource.NewResource("proj.ds.name1", "table", resource.Bigquery, tnnt, meta, spec) + res, err := resource.NewResource("proj.ds.name1", "table", resource.Bigquery, tnnt, meta, spec, nil) assert.NoError(t, err) actualError := res.MarkValidationSuccess() @@ -434,7 +431,7 @@ func TestResource(t *testing.T) { t.Run("MarkValidationFailure", func(t *testing.T) { t.Run("returns error if current status is not unknown", func(t *testing.T) { - res, err := resource.NewResource("proj.ds.name1", "table", resource.Bigquery, tnnt, meta, spec) + res, err := resource.NewResource("proj.ds.name1", "table", resource.Bigquery, tnnt, meta, spec, nil) assert.NoError(t, err) res = resource.FromExisting(res, resource.ReplaceStatus(resource.StatusSkipped)) @@ -444,7 +441,7 @@ func TestResource(t *testing.T) { }) t.Run("changes status to validation_failure and returns nil if current status is unknown", func(t *testing.T) { - res, err := resource.NewResource("proj.ds.name1", "table", resource.Bigquery, tnnt, meta, spec) + res, err := resource.NewResource("proj.ds.name1", "table", resource.Bigquery, tnnt, meta, spec, nil) assert.NoError(t, err) actualError := res.MarkValidationFailure() @@ -455,7 +452,7 @@ func TestResource(t *testing.T) { t.Run("MarkSkipped", func(t *testing.T) { t.Run("returns error if current status is not validation_success", func(t *testing.T) { - res, err := resource.NewResource("proj.ds.name1", "table", resource.Bigquery, tnnt, meta, spec) + res, err := resource.NewResource("proj.ds.name1", "table", resource.Bigquery, tnnt, meta, spec, nil) assert.NoError(t, err) res = resource.FromExisting(res, resource.ReplaceStatus(resource.StatusToCreate)) @@ -465,7 +462,7 @@ func TestResource(t *testing.T) { }) t.Run("changes status to skipped and returns error if current status is validation_success", func(t *testing.T) { - res, err := resource.NewResource("proj.ds.name1", "table", resource.Bigquery, tnnt, meta, spec) + res, err := resource.NewResource("proj.ds.name1", "table", resource.Bigquery, tnnt, meta, spec, nil) assert.NoError(t, err) res = resource.FromExisting(res, resource.ReplaceStatus(resource.StatusValidationSuccess)) @@ -477,7 +474,7 @@ func TestResource(t *testing.T) { t.Run("MarkToCreate", func(t *testing.T) { t.Run("changes status to to_create and returns nil if current status is validation_success", func(t *testing.T) { - res, err := resource.NewResource("proj.ds.name1", "table", resource.Bigquery, tnnt, meta, spec) + res, err := resource.NewResource("proj.ds.name1", "table", resource.Bigquery, tnnt, meta, spec, nil) assert.NoError(t, err) res = resource.FromExisting(res, resource.ReplaceStatus(resource.StatusValidationSuccess)) @@ -487,7 +484,7 @@ func TestResource(t *testing.T) { }) t.Run("returns error if current status is other statuses", func(t *testing.T) { - res, err := resource.NewResource("proj.ds.name1", "table", resource.Bigquery, tnnt, meta, spec) + res, err := resource.NewResource("proj.ds.name1", "table", resource.Bigquery, tnnt, meta, spec, nil) assert.NoError(t, err) res = resource.FromExisting(res, resource.ReplaceStatus(resource.StatusSkipped)) @@ -499,7 +496,7 @@ func TestResource(t *testing.T) { t.Run("MarkToUpdate", func(t *testing.T) { t.Run("changes status to to_update and returns nil if current status is validation_success", func(t *testing.T) { - res, err := resource.NewResource("proj.ds.name1", "table", resource.Bigquery, tnnt, meta, spec) + res, err := resource.NewResource("proj.ds.name1", "table", resource.Bigquery, tnnt, meta, spec, nil) assert.NoError(t, err) res = resource.FromExisting(res, resource.ReplaceStatus(resource.StatusValidationSuccess)) @@ -509,7 +506,7 @@ func TestResource(t *testing.T) { }) t.Run("returns error if other status", func(t *testing.T) { - res, err := resource.NewResource("proj.ds.name1", "table", resource.Bigquery, tnnt, meta, spec) + res, err := resource.NewResource("proj.ds.name1", "table", resource.Bigquery, tnnt, meta, spec, nil) assert.NoError(t, err) res = resource.FromExisting(res, resource.ReplaceStatus(resource.StatusSkipped)) @@ -521,7 +518,7 @@ func TestResource(t *testing.T) { t.Run("MarkExistInStore", func(t *testing.T) { t.Run("changes status to exist_in_store and return nil if current status is to_create", func(t *testing.T) { - res, err := resource.NewResource("proj.ds.name1", "table", resource.Bigquery, tnnt, meta, spec) + res, err := resource.NewResource("proj.ds.name1", "table", resource.Bigquery, tnnt, meta, spec, nil) assert.NoError(t, err) res = resource.FromExisting(res, resource.ReplaceStatus(resource.StatusToCreate)) @@ -531,7 +528,7 @@ func TestResource(t *testing.T) { }) t.Run("returns error if other status", func(t *testing.T) { - res, err := resource.NewResource("proj.ds.name1", "table", resource.Bigquery, tnnt, meta, spec) + res, err := resource.NewResource("proj.ds.name1", "table", resource.Bigquery, tnnt, meta, spec, nil) assert.NoError(t, err) res = resource.FromExisting(res, resource.ReplaceStatus(resource.StatusSkipped)) @@ -543,7 +540,7 @@ func TestResource(t *testing.T) { t.Run("MarkFailure", func(t *testing.T) { t.Run("changes status to create_failure and return nil if current status is to_create", func(t *testing.T) { - res, err := resource.NewResource("proj.ds.name1", "table", resource.Bigquery, tnnt, meta, spec) + res, err := resource.NewResource("proj.ds.name1", "table", resource.Bigquery, tnnt, meta, spec, nil) assert.NoError(t, err) res = resource.FromExisting(res, resource.ReplaceStatus(resource.StatusToCreate)) @@ -553,7 +550,7 @@ func TestResource(t *testing.T) { }) t.Run("changes status to update_failure and return nil if current status is to_update", func(t *testing.T) { - res, err := resource.NewResource("proj.ds.name1", "table", resource.Bigquery, tnnt, meta, spec) + res, err := resource.NewResource("proj.ds.name1", "table", resource.Bigquery, tnnt, meta, spec, nil) assert.NoError(t, err) res = resource.FromExisting(res, resource.ReplaceStatus(resource.StatusToUpdate)) @@ -563,7 +560,7 @@ func TestResource(t *testing.T) { }) t.Run("returns error if other status", func(t *testing.T) { - res, err := resource.NewResource("proj.ds.name1", "table", resource.Bigquery, tnnt, meta, spec) + res, err := resource.NewResource("proj.ds.name1", "table", resource.Bigquery, tnnt, meta, spec, nil) assert.NoError(t, err) res = resource.FromExisting(res, resource.ReplaceStatus(resource.StatusSkipped)) @@ -575,7 +572,7 @@ func TestResource(t *testing.T) { t.Run("MarkSuccess", func(t *testing.T) { t.Run("changes status and returns nil if current status is to_create", func(t *testing.T) { - res, err := resource.NewResource("proj.ds.name1", "table", resource.Bigquery, tnnt, meta, spec) + res, err := resource.NewResource("proj.ds.name1", "table", resource.Bigquery, tnnt, meta, spec, nil) assert.NoError(t, err) res = resource.FromExisting(res, resource.ReplaceStatus(resource.StatusToCreate)) @@ -585,7 +582,7 @@ func TestResource(t *testing.T) { }) t.Run("changes status and returns nil if current status is to_update", func(t *testing.T) { - res, err := resource.NewResource("proj.ds.name1", "table", resource.Bigquery, tnnt, meta, spec) + res, err := resource.NewResource("proj.ds.name1", "table", resource.Bigquery, tnnt, meta, spec, nil) assert.NoError(t, err) res = resource.FromExisting(res, resource.ReplaceStatus(resource.StatusToUpdate)) @@ -595,7 +592,7 @@ func TestResource(t *testing.T) { }) t.Run("returns error if other status", func(t *testing.T) { - res, err := resource.NewResource("proj.ds.name1", "table", resource.Bigquery, tnnt, meta, spec) + res, err := resource.NewResource("proj.ds.name1", "table", resource.Bigquery, tnnt, meta, spec, nil) assert.NoError(t, err) actualError := res.MarkSuccess() @@ -616,7 +613,7 @@ func TestResource(t *testing.T) { spec := map[string]any{ "description": "spec for unit test", } - res, err := resource.NewResource("proj.set.res_name", "table", resource.Bigquery, tnnt, metadata, spec) + res, err := resource.NewResource("proj.set.res_name", "table", resource.Bigquery, tnnt, metadata, spec, nil) assert.Nil(t, err) version := res.Version() @@ -634,7 +631,7 @@ func TestResource(t *testing.T) { spec := map[string]any{ "description": "spec for unit test", } - res, err := resource.NewResource("proj.set.res_name", "table", resource.Bigquery, tnnt, meta, spec) + res, err := resource.NewResource("proj.set.res_name", "table", resource.Bigquery, tnnt, meta, spec, nil) assert.Nil(t, err) version := res.Version() diff --git a/core/resource/service/backup_service_test.go b/core/resource/service/backup_service_test.go index c3cd395a54..48079493d0 100644 --- a/core/resource/service/backup_service_test.go +++ b/core/resource/service/backup_service_test.go @@ -24,7 +24,7 @@ func TestBackupService(t *testing.T) { backup, _ := resource.NewBackup(store, tnnt, []string{"p.d.t"}, "", createdAt, nil) meta := &resource.Metadata{} spec := map[string]any{"description": "resource table"} - source, resErr := resource.NewResource("p.d.t", "table", store, tnnt, meta, spec) + source, resErr := resource.NewResource("p.d.t", "table", store, tnnt, meta, spec, nil) assert.NoError(t, resErr) validID := "dda7b864-4268-4107-a096-dcf5343a0959" diff --git a/core/resource/service/resource_manager_test.go b/core/resource/service/resource_manager_test.go index b2488cb9d0..958c7e2061 100644 --- a/core/resource/service/resource_manager_test.go +++ b/core/resource/service/resource_manager_test.go @@ -28,7 +28,7 @@ func TestResourceManager(t *testing.T) { manager := service.NewResourceManager(repo, logger) spec := map[string]any{"description": "test spec"} - res, err := resource.NewResource("proj.ds.name1", "table", store, tnnt, meta, spec) + res, err := resource.NewResource("proj.ds.name1", "table", store, tnnt, meta, spec, nil) assert.Nil(t, err) err = manager.CreateResource(ctx, res) @@ -37,7 +37,7 @@ func TestResourceManager(t *testing.T) { }) t.Run("return error when datastore return an error", func(t *testing.T) { spec := map[string]any{"description": "test spec"} - res, err := resource.NewResource("proj.ds.name1", "table", store, tnnt, meta, spec) + res, err := resource.NewResource("proj.ds.name1", "table", store, tnnt, meta, spec, nil) assert.Nil(t, err) createRequest := resource.FromExisting(res, resource.ReplaceStatus(resource.StatusToCreate)) @@ -64,7 +64,7 @@ func TestResourceManager(t *testing.T) { }) t.Run("return error when create fails and mark also fails", func(t *testing.T) { spec := map[string]any{"description": "test spec"} - res, err := resource.NewResource("proj.ds.name1", "table", store, tnnt, meta, spec) + res, err := resource.NewResource("proj.ds.name1", "table", store, tnnt, meta, spec, nil) assert.Nil(t, err) createRequest := resource.FromExisting(res, resource.ReplaceStatus(resource.StatusToCreate)) @@ -93,7 +93,7 @@ func TestResourceManager(t *testing.T) { }) t.Run("marks the create exist_in_store if already exists on datastore", func(t *testing.T) { spec := map[string]any{"description": "test spec"} - res, err := resource.NewResource("proj.ds.name1", "table", store, tnnt, meta, spec) + res, err := resource.NewResource("proj.ds.name1", "table", store, tnnt, meta, spec, nil) assert.Nil(t, err) createRequest := resource.FromExisting(res, resource.ReplaceStatus(resource.StatusToCreate)) @@ -119,7 +119,7 @@ func TestResourceManager(t *testing.T) { }) t.Run("creates the resource on the datastore", func(t *testing.T) { spec := map[string]any{"description": "test spec"} - res, err := resource.NewResource("proj.ds.name1", "table", store, tnnt, meta, spec) + res, err := resource.NewResource("proj.ds.name1", "table", store, tnnt, meta, spec, nil) assert.Nil(t, err) createRequest := resource.FromExisting(res, resource.ReplaceStatus(resource.StatusToCreate)) @@ -151,7 +151,7 @@ func TestResourceManager(t *testing.T) { manager := service.NewResourceManager(repo, logger) spec := map[string]any{"description": "test spec"} - res, err := resource.NewResource("proj.ds.name1", "table", store, tnnt, meta, spec) + res, err := resource.NewResource("proj.ds.name1", "table", store, tnnt, meta, spec, nil) assert.Nil(t, err) err = manager.UpdateResource(ctx, res) @@ -160,7 +160,7 @@ func TestResourceManager(t *testing.T) { }) t.Run("return error when datastore return an error", func(t *testing.T) { spec := map[string]any{"description": "test spec"} - res, err := resource.NewResource("proj.ds.name1", "table", store, tnnt, meta, spec) + res, err := resource.NewResource("proj.ds.name1", "table", store, tnnt, meta, spec, nil) assert.Nil(t, err) updateRequest := resource.FromExisting(res, resource.ReplaceStatus(resource.StatusToUpdate)) @@ -187,7 +187,7 @@ func TestResourceManager(t *testing.T) { }) t.Run("return error when update fails and mark also fails", func(t *testing.T) { spec := map[string]any{"description": "test spec"} - res, err := resource.NewResource("proj.ds.name1", "table", store, tnnt, meta, spec) + res, err := resource.NewResource("proj.ds.name1", "table", store, tnnt, meta, spec, nil) assert.Nil(t, err) updateRequest := resource.FromExisting(res, resource.ReplaceStatus(resource.StatusToUpdate)) @@ -217,7 +217,7 @@ func TestResourceManager(t *testing.T) { }) t.Run("updates the resource on the datastore", func(t *testing.T) { spec := map[string]any{"description": "test spec"} - res, err := resource.NewResource("proj.ds.name1", "table", store, tnnt, meta, spec) + res, err := resource.NewResource("proj.ds.name1", "table", store, tnnt, meta, spec, nil) assert.Nil(t, err) updateRequest := resource.FromExisting(res, resource.ReplaceStatus(resource.StatusToUpdate)) @@ -245,7 +245,7 @@ func TestResourceManager(t *testing.T) { t.Run("Validate", func(t *testing.T) { t.Run("return error when service not found for datastore", func(t *testing.T) { spec := map[string]any{"description": "test spec"} - res, err := resource.NewResource("proj.ds.name1", "table", store, tnnt, meta, spec) + res, err := resource.NewResource("proj.ds.name1", "table", store, tnnt, meta, spec, nil) assert.Nil(t, err) updateRequest := resource.FromExisting(res, resource.ReplaceStatus(resource.StatusToUpdate)) @@ -259,7 +259,7 @@ func TestResourceManager(t *testing.T) { }) t.Run("returns response from the datastore", func(t *testing.T) { spec := map[string]any{"description": "test spec"} - res, err := resource.NewResource("proj.ds.name1", "table", store, tnnt, meta, spec) + res, err := resource.NewResource("proj.ds.name1", "table", store, tnnt, meta, spec, nil) assert.Nil(t, err) updateRequest := resource.FromExisting(res, resource.ReplaceStatus(resource.StatusToUpdate)) @@ -279,7 +279,7 @@ func TestResourceManager(t *testing.T) { t.Run("URN", func(t *testing.T) { t.Run("return error when service not found for datastore", func(t *testing.T) { spec := map[string]any{"description": "test spec"} - res, err := resource.NewResource("proj.ds.name1", "table", store, tnnt, meta, spec) + res, err := resource.NewResource("proj.ds.name1", "table", store, tnnt, meta, spec, nil) assert.Nil(t, err) updateRequest := resource.FromExisting(res, resource.ReplaceStatus(resource.StatusToUpdate)) @@ -293,7 +293,7 @@ func TestResourceManager(t *testing.T) { }) t.Run("returns response from the datastore", func(t *testing.T) { spec := map[string]any{"description": "test spec"} - res, err := resource.NewResource("proj.ds.name1", "table", store, tnnt, meta, spec) + res, err := resource.NewResource("proj.ds.name1", "table", store, tnnt, meta, spec, nil) assert.Nil(t, err) updateRequest := resource.FromExisting(res, resource.ReplaceStatus(resource.StatusToUpdate)) @@ -317,7 +317,7 @@ func TestResourceManager(t *testing.T) { t.Run("BatchUpdate", func(t *testing.T) { t.Run("return error when service not found for datastore", func(t *testing.T) { spec := map[string]any{"description": "test spec"} - res, err := resource.NewResource("proj.ds.name1", "table", store, tnnt, meta, spec) + res, err := resource.NewResource("proj.ds.name1", "table", store, tnnt, meta, spec, nil) assert.Nil(t, err) updateRequest := resource.FromExisting(res, resource.ReplaceStatus(resource.StatusToUpdate)) @@ -332,7 +332,7 @@ func TestResourceManager(t *testing.T) { }) t.Run("return error when error in both batchUpdate and update status", func(t *testing.T) { spec := map[string]any{"description": "test spec"} - res, err := resource.NewResource("proj.ds.name1", "table", store, tnnt, meta, spec) + res, err := resource.NewResource("proj.ds.name1", "table", store, tnnt, meta, spec, nil) assert.Nil(t, err) updateRequest := resource.FromExisting(res, resource.ReplaceStatus(resource.StatusToUpdate)) batchReq := []*resource.Resource{updateRequest} @@ -375,7 +375,7 @@ func TestResourceManager(t *testing.T) { }) t.Run("returns success when no error in updating the batch", func(t *testing.T) { spec := map[string]any{"description": "test spec"} - res, err := resource.NewResource("proj.ds.name1", "table", store, tnnt, meta, spec) + res, err := resource.NewResource("proj.ds.name1", "table", store, tnnt, meta, spec, nil) assert.Nil(t, err) updateRequest := resource.FromExisting(res, resource.ReplaceStatus(resource.StatusToUpdate)) batchReq := []*resource.Resource{updateRequest} @@ -414,7 +414,7 @@ func TestResourceManager(t *testing.T) { manager := service.NewResourceManager(repo, logger) spec := map[string]any{"description": "test spec"} - res, err := resource.NewResource("proj.ds.name1", "table", store, tnnt, meta, spec) + res, err := resource.NewResource("proj.ds.name1", "table", store, tnnt, meta, spec, nil) assert.Nil(t, err) createdAt := time.Date(2022, 11, 18, 1, 0, 0, 0, time.UTC) @@ -428,7 +428,7 @@ func TestResourceManager(t *testing.T) { }) t.Run("runs backup in datastore", func(t *testing.T) { spec := map[string]any{"description": "test spec"} - res, err := resource.NewResource("proj.ds.name1", "table", store, tnnt, meta, spec) + res, err := resource.NewResource("proj.ds.name1", "table", store, tnnt, meta, spec, nil) assert.Nil(t, err) createdAt := time.Date(2022, 11, 18, 1, 0, 0, 0, time.UTC) @@ -458,7 +458,7 @@ func TestResourceManager(t *testing.T) { manager := service.NewResourceManager(repo, logger) spec := map[string]any{"description": "test spec"} - res, err := resource.NewResource("proj.ds.name1", "table", store, tnnt, meta, spec) + res, err := resource.NewResource("proj.ds.name1", "table", store, tnnt, meta, spec, nil) assert.Nil(t, err) err = manager.SyncResource(ctx, res) @@ -467,7 +467,7 @@ func TestResourceManager(t *testing.T) { }) t.Run("returns error when create fails", func(t *testing.T) { spec := map[string]any{"description": "test spec"} - res, err := resource.NewResource("proj.ds.name1", "table", store, tnnt, meta, spec) + res, err := resource.NewResource("proj.ds.name1", "table", store, tnnt, meta, spec, nil) assert.Nil(t, err) argMatcher := mock.MatchedBy(func(r []*resource.Resource) bool { @@ -494,7 +494,7 @@ func TestResourceManager(t *testing.T) { }) t.Run("returns error when update fails", func(t *testing.T) { spec := map[string]any{"description": "test spec"} - res, err := resource.NewResource("proj.ds.name1", "table", store, tnnt, meta, spec) + res, err := resource.NewResource("proj.ds.name1", "table", store, tnnt, meta, spec, nil) assert.Nil(t, err) argMatcher := mock.MatchedBy(func(r []*resource.Resource) bool { @@ -522,7 +522,7 @@ func TestResourceManager(t *testing.T) { }) t.Run("returns error when fails to update in db", func(t *testing.T) { spec := map[string]any{"description": "test spec"} - res, err := resource.NewResource("proj.ds.name1", "table", store, tnnt, meta, spec) + res, err := resource.NewResource("proj.ds.name1", "table", store, tnnt, meta, spec, nil) assert.Nil(t, err) argMatcher := mock.MatchedBy(func(r []*resource.Resource) bool { @@ -549,7 +549,7 @@ func TestResourceManager(t *testing.T) { }) t.Run("returns success when successful", func(t *testing.T) { spec := map[string]any{"description": "test spec"} - res, err := resource.NewResource("proj.ds.name1", "table", store, tnnt, meta, spec) + res, err := resource.NewResource("proj.ds.name1", "table", store, tnnt, meta, spec, nil) assert.Nil(t, err) argMatcher := mock.MatchedBy(func(r []*resource.Resource) bool { diff --git a/core/resource/service/resource_service_test.go b/core/resource/service/resource_service_test.go index 59a0b7d4b0..c3e22a7f7e 100644 --- a/core/resource/service/resource_service_test.go +++ b/core/resource/service/resource_service_test.go @@ -74,7 +74,7 @@ func TestResourceService(t *testing.T) { t.Run("Create", func(t *testing.T) { t.Run("returns error if resource is invalid", func(t *testing.T) { - invalid, err := resource.NewResource("", "table", resource.Bigquery, tnnt, meta, spec) + invalid, err := resource.NewResource("", "table", resource.Bigquery, tnnt, meta, spec, nil) assert.NoError(t, err) tenantDetailsGetter := new(mockTenantDetailsGetter) @@ -90,7 +90,7 @@ func TestResourceService(t *testing.T) { assert.ErrorContains(t, actualError, "validation error") }) t.Run("returns error cannot get resource urn", func(t *testing.T) { - incoming, err := resource.NewResource("project.dataset", "dataset", resource.Bigquery, tnnt, meta, spec) + incoming, err := resource.NewResource("project.dataset", "dataset", resource.Bigquery, tnnt, meta, spec, nil) assert.NoError(t, err) tenantDetailsGetter := new(mockTenantDetailsGetter) @@ -107,7 +107,7 @@ func TestResourceService(t *testing.T) { assert.ErrorContains(t, actualError, "urn error") }) t.Run("returns error if cannot update resource urn", func(t *testing.T) { - incoming, err := resource.NewResource("project.dataset", "dataset", resource.Bigquery, tnnt, meta, spec) + incoming, err := resource.NewResource("project.dataset", "dataset", resource.Bigquery, tnnt, meta, spec, nil) assert.NoError(t, err) err = incoming.UpdateURN(tableURN) assert.NoError(t, err) @@ -126,7 +126,7 @@ func TestResourceService(t *testing.T) { onlyActive := false t.Run("returns error if unknown error is encountered when getting existing resource", func(t *testing.T) { - incoming, err := resource.NewResource("project.dataset", "dataset", resource.Bigquery, tnnt, meta, spec) + incoming, err := resource.NewResource("project.dataset", "dataset", resource.Bigquery, tnnt, meta, spec, nil) assert.NoError(t, err) mgr := NewResourceManager(t) @@ -144,7 +144,7 @@ func TestResourceService(t *testing.T) { t.Run("resource does not exist in repository", func(t *testing.T) { t.Run("returns error if error is encountered when creating resource to repository", func(t *testing.T) { - incoming, err := resource.NewResource("project.dataset", "dataset", resource.Bigquery, tnnt, meta, spec) + incoming, err := resource.NewResource("project.dataset", "dataset", resource.Bigquery, tnnt, meta, spec, nil) assert.NoError(t, err) repo := newResourceRepository(t) @@ -164,7 +164,7 @@ func TestResourceService(t *testing.T) { t.Run("resource already exists in repository", func(t *testing.T) { t.Run("returns no error if status is success or exists_in_store", func(t *testing.T) { - existing, err := resource.NewResource("project.dataset", "dataset", resource.Bigquery, tnnt, meta, spec) + existing, err := resource.NewResource("project.dataset", "dataset", resource.Bigquery, tnnt, meta, spec, nil) assert.NoError(t, err) mgr := NewResourceManager(t) @@ -177,7 +177,7 @@ func TestResourceService(t *testing.T) { } for _, status := range statusToTest { - incoming, err := resource.NewResource("project.dataset", "dataset", resource.Bigquery, tnnt, meta, spec) + incoming, err := resource.NewResource("project.dataset", "dataset", resource.Bigquery, tnnt, meta, spec, nil) assert.NoError(t, err) existingWithStatus := resource.FromExisting(existing, resource.ReplaceStatus(status)) @@ -193,7 +193,7 @@ func TestResourceService(t *testing.T) { } }) t.Run("returns error if status is neither create_failure nor to_create", func(t *testing.T) { - existing, err := resource.NewResource("project.dataset", "dataset", resource.Bigquery, tnnt, meta, spec) + existing, err := resource.NewResource("project.dataset", "dataset", resource.Bigquery, tnnt, meta, spec, nil) assert.NoError(t, err) mgr := NewResourceManager(t) @@ -210,7 +210,7 @@ func TestResourceService(t *testing.T) { } for _, status := range unacceptableStatuses { - incoming, err := resource.NewResource("project.dataset", "dataset", resource.Bigquery, tnnt, meta, spec) + incoming, err := resource.NewResource("project.dataset", "dataset", resource.Bigquery, tnnt, meta, spec, nil) assert.NoError(t, err) existingWithStatus := resource.FromExisting(existing, resource.ReplaceStatus(status)) @@ -227,9 +227,9 @@ func TestResourceService(t *testing.T) { }) t.Run("returns error if error is encountered when updating to repository", func(t *testing.T) { - incoming, err := resource.NewResource("project.dataset", "dataset", resource.Bigquery, tnnt, meta, spec) + incoming, err := resource.NewResource("project.dataset", "dataset", resource.Bigquery, tnnt, meta, spec, nil) assert.NoError(t, err) - existing, err := resource.NewResource("project.dataset", "dataset", resource.Bigquery, tnnt, meta, spec) + existing, err := resource.NewResource("project.dataset", "dataset", resource.Bigquery, tnnt, meta, spec, nil) assert.NoError(t, err) existing = resource.FromExisting(existing, resource.ReplaceStatus(resource.StatusCreateFailure)) @@ -249,7 +249,7 @@ func TestResourceService(t *testing.T) { }) t.Run("returns error if error is encountered when creating to store", func(t *testing.T) { - incoming, err := resource.NewResource("project.dataset", "dataset", resource.Bigquery, tnnt, meta, spec) + incoming, err := resource.NewResource("project.dataset", "dataset", resource.Bigquery, tnnt, meta, spec, nil) assert.NoError(t, err) repo := newResourceRepository(t) @@ -268,7 +268,7 @@ func TestResourceService(t *testing.T) { }) t.Run("returns nil if no error is encountered", func(t *testing.T) { - incoming, err := resource.NewResource("project.dataset", "dataset", resource.Bigquery, tnnt, meta, spec) + incoming, err := resource.NewResource("project.dataset", "dataset", resource.Bigquery, tnnt, meta, spec, nil) assert.NoError(t, err) repo := newResourceRepository(t) @@ -291,7 +291,7 @@ func TestResourceService(t *testing.T) { }) t.Run("v2 spec return error if tenant details return error and validation fails", func(t *testing.T) { - incoming, err := resource.NewResource("data-table", bigquery.KindTable, resource.Bigquery, tnnt, metaV2, specV2) + incoming, err := resource.NewResource("data-table", bigquery.KindTable, resource.Bigquery, tnnt, metaV2, specV2, nil) assert.NoError(t, err) repo := newResourceRepository(t) @@ -310,7 +310,7 @@ func TestResourceService(t *testing.T) { }) t.Run("v2 spec return nil if resource is successfully saved", func(t *testing.T) { - incoming, err := resource.NewResource("data-table", bigquery.KindTable, resource.Bigquery, tnnt, metaV2, specV2) + incoming, err := resource.NewResource("data-table", bigquery.KindTable, resource.Bigquery, tnnt, metaV2, specV2, nil) assert.NoError(t, err) tenantDetailsGetter := new(mockTenantDetailsGetter) @@ -351,7 +351,7 @@ func TestResourceService(t *testing.T) { assert.Error(t, actualError) }) t.Run("returns error cannot get resource urn", func(t *testing.T) { - incoming, err := resource.NewResource("project.dataset", "dataset", resource.Bigquery, tnnt, meta, spec) + incoming, err := resource.NewResource("project.dataset", "dataset", resource.Bigquery, tnnt, meta, spec, nil) assert.NoError(t, err) mgr := NewResourceManager(t) @@ -365,7 +365,7 @@ func TestResourceService(t *testing.T) { assert.ErrorContains(t, actualError, "urn error") }) t.Run("returns error if cannot update resource urn", func(t *testing.T) { - incoming, err := resource.NewResource("project.dataset", "dataset", resource.Bigquery, tnnt, meta, spec) + incoming, err := resource.NewResource("project.dataset", "dataset", resource.Bigquery, tnnt, meta, spec, nil) assert.NoError(t, err) urn, err := resource.ParseURN("bigquery://project:dataset.table") assert.NoError(t, err) @@ -385,7 +385,7 @@ func TestResourceService(t *testing.T) { t.Run("returns error if error is encountered when getting from repo", func(t *testing.T) { fullName := "project.dataset" - resourceToUpdate, err := resource.NewResource(fullName, "dataset", resource.Bigquery, tnnt, meta, spec) + resourceToUpdate, err := resource.NewResource(fullName, "dataset", resource.Bigquery, tnnt, meta, spec, nil) assert.NoError(t, err) repo := newResourceRepository(t) @@ -402,7 +402,7 @@ func TestResourceService(t *testing.T) { }) t.Run("returns error if status is not one of to_update, success, exist_in_store, or update_failure", func(t *testing.T) { - existing, err := resource.NewResource("project.dataset", "dataset", resource.Bigquery, tnnt, meta, spec) + existing, err := resource.NewResource("project.dataset", "dataset", resource.Bigquery, tnnt, meta, spec, nil) assert.NoError(t, err) mgr := NewResourceManager(t) @@ -422,7 +422,7 @@ func TestResourceService(t *testing.T) { } for _, status := range unacceptableStatuses { - resourceToUpdate, err := resource.NewResource("project.dataset", "dataset", resource.Bigquery, tnnt, meta, spec) + resourceToUpdate, err := resource.NewResource("project.dataset", "dataset", resource.Bigquery, tnnt, meta, spec, nil) assert.NoError(t, err) existingWithStatus := resource.FromExisting(existing, resource.ReplaceStatus(status)) @@ -436,9 +436,9 @@ func TestResourceService(t *testing.T) { t.Run("returns error if error is encountered when updating to repo", func(t *testing.T) { fullName := "project.dataset" - resourceToUpdate, err := resource.NewResource(fullName, "dataset", resource.Bigquery, tnnt, meta, spec) + resourceToUpdate, err := resource.NewResource(fullName, "dataset", resource.Bigquery, tnnt, meta, spec, nil) assert.NoError(t, err) - existingResource, err := resource.NewResource(fullName, "dataset", resource.Bigquery, tnnt, meta, spec) + existingResource, err := resource.NewResource(fullName, "dataset", resource.Bigquery, tnnt, meta, spec, nil) assert.NoError(t, err) existingResource = resource.FromExisting(existingResource, resource.ReplaceStatus(resource.StatusToUpdate)) @@ -458,9 +458,9 @@ func TestResourceService(t *testing.T) { t.Run("returns error if error is encountered when updating to store", func(t *testing.T) { fullName := "project.dataset" - resourceToUpdate, err := resource.NewResource(fullName, "dataset", resource.Bigquery, tnnt, meta, spec) + resourceToUpdate, err := resource.NewResource(fullName, "dataset", resource.Bigquery, tnnt, meta, spec, nil) assert.NoError(t, err) - existingResource, err := resource.NewResource(fullName, "dataset", resource.Bigquery, tnnt, meta, spec) + existingResource, err := resource.NewResource(fullName, "dataset", resource.Bigquery, tnnt, meta, spec, nil) assert.NoError(t, err) existingResource = resource.FromExisting(existingResource, resource.ReplaceStatus(resource.StatusToUpdate)) @@ -482,10 +482,10 @@ func TestResourceService(t *testing.T) { t.Run("returns error if encountered error when refreshing downstream", func(t *testing.T) { fullName := "project.dataset" incomingSpec := map[string]any{"view_query": "select 1;"} - resourceToUpdate, err := resource.NewResource(fullName, "dataset", resource.Bigquery, tnnt, meta, incomingSpec) + resourceToUpdate, err := resource.NewResource(fullName, "dataset", resource.Bigquery, tnnt, meta, incomingSpec, nil) assert.NoError(t, err) existingSpec := map[string]any{"view_query": "select 2;"} - existingResource, err := resource.NewResource(fullName, "dataset", resource.Bigquery, tnnt, meta, existingSpec) + existingResource, err := resource.NewResource(fullName, "dataset", resource.Bigquery, tnnt, meta, existingSpec, nil) assert.NoError(t, err) existingResource = resource.FromExisting(existingResource, resource.ReplaceStatus(resource.StatusToUpdate)) @@ -520,10 +520,10 @@ func TestResourceService(t *testing.T) { t.Run("returns nil if no error is encountered", func(t *testing.T) { fullName := "project.dataset" incomingSpec := map[string]any{"view_query": "select 1;"} - resourceToUpdate, err := resource.NewResource(fullName, "dataset", resource.Bigquery, tnnt, meta, incomingSpec) + resourceToUpdate, err := resource.NewResource(fullName, "dataset", resource.Bigquery, tnnt, meta, incomingSpec, nil) assert.NoError(t, err) existingSpec := map[string]any{"view_query": "select 2;"} - existingResource, err := resource.NewResource(fullName, "dataset", resource.Bigquery, tnnt, meta, existingSpec) + existingResource, err := resource.NewResource(fullName, "dataset", resource.Bigquery, tnnt, meta, existingSpec, nil) assert.NoError(t, err) existingResource = resource.FromExisting(existingResource, resource.ReplaceStatus(resource.StatusToUpdate)) @@ -550,7 +550,7 @@ func TestResourceService(t *testing.T) { }) t.Run("v2 spec return error if tenant details return error and validation fails", func(t *testing.T) { - incoming, err := resource.NewResource("data-table", bigquery.KindTable, resource.Bigquery, tnnt, metaV2, specV2) + incoming, err := resource.NewResource("data-table", bigquery.KindTable, resource.Bigquery, tnnt, metaV2, specV2, nil) assert.NoError(t, err) repo := newResourceRepository(t) @@ -570,9 +570,9 @@ func TestResourceService(t *testing.T) { t.Run("v2 spec return nil if resource is successfully updated", func(t *testing.T) { tableName := "data-table" - incoming, err := resource.NewResource(tableName, bigquery.KindTable, resource.Bigquery, tnnt, metaV2, specV2) + incoming, err := resource.NewResource(tableName, bigquery.KindTable, resource.Bigquery, tnnt, metaV2, specV2, nil) assert.NoError(t, err) - existingResource, err := resource.NewResource(tableName, bigquery.KindTable, resource.Bigquery, tnnt, metaV2, specV2) + existingResource, err := resource.NewResource(tableName, bigquery.KindTable, resource.Bigquery, tnnt, metaV2, specV2, nil) assert.NoError(t, err) existingResource = resource.FromExisting(existingResource, resource.ReplaceStatus(resource.StatusToUpdate)) @@ -615,7 +615,7 @@ func TestResourceService(t *testing.T) { }) t.Run("returns error cannot get resource urn", func(t *testing.T) { - incoming, err := resource.NewResource("project.dataset", "dataset", resource.Bigquery, tnnt, meta, spec) + incoming, err := resource.NewResource("project.dataset", "dataset", resource.Bigquery, tnnt, meta, spec, nil) assert.NoError(t, err) mgr := NewResourceManager(t) @@ -630,7 +630,7 @@ func TestResourceService(t *testing.T) { }) t.Run("returns error if cannot update resource urn", func(t *testing.T) { - incoming, err := resource.NewResource("project.dataset", "dataset", resource.Bigquery, tnnt, meta, spec) + incoming, err := resource.NewResource("project.dataset", "dataset", resource.Bigquery, tnnt, meta, spec, nil) assert.NoError(t, err) err = incoming.UpdateURN(tableURN) assert.NoError(t, err) @@ -649,7 +649,7 @@ func TestResourceService(t *testing.T) { onlyActive := false t.Run("returns error if unknown error is encountered when getting existing resource", func(t *testing.T) { - incoming, err := resource.NewResource("project.dataset", "dataset", resource.Bigquery, tnnt, meta, spec) + incoming, err := resource.NewResource("project.dataset", "dataset", resource.Bigquery, tnnt, meta, spec, nil) assert.NoError(t, err) mgr := NewResourceManager(t) @@ -667,7 +667,7 @@ func TestResourceService(t *testing.T) { t.Run("resource does not exist in repository", func(t *testing.T) { t.Run("returns error if error is encountered when creating resource to repository", func(t *testing.T) { - incoming, err := resource.NewResource("project.dataset", "dataset", resource.Bigquery, tnnt, meta, spec) + incoming, err := resource.NewResource("project.dataset", "dataset", resource.Bigquery, tnnt, meta, spec, nil) assert.NoError(t, err) repo := newResourceRepository(t) @@ -685,7 +685,7 @@ func TestResourceService(t *testing.T) { }) t.Run("returns error if error is encountered when creating to store", func(t *testing.T) { - incoming, err := resource.NewResource("project.dataset", "dataset", resource.Bigquery, tnnt, meta, spec) + incoming, err := resource.NewResource("project.dataset", "dataset", resource.Bigquery, tnnt, meta, spec, nil) assert.NoError(t, err) repo := newResourceRepository(t) @@ -704,7 +704,7 @@ func TestResourceService(t *testing.T) { }) t.Run("returns nil if no error is encountered", func(t *testing.T) { - incoming, err := resource.NewResource("project.dataset", "dataset", resource.Bigquery, tnnt, meta, spec) + incoming, err := resource.NewResource("project.dataset", "dataset", resource.Bigquery, tnnt, meta, spec, nil) assert.NoError(t, err) repo := newResourceRepository(t) @@ -728,9 +728,9 @@ func TestResourceService(t *testing.T) { t.Run("resource already exists in repository", func(t *testing.T) { t.Run("returns error if error is encountered when updating to repo", func(t *testing.T) { fullName := "project.dataset" - resourceToUpdate, err := resource.NewResource(fullName, "dataset", resource.Bigquery, tnnt, meta, spec) + resourceToUpdate, err := resource.NewResource(fullName, "dataset", resource.Bigquery, tnnt, meta, spec, nil) assert.NoError(t, err) - existingResource, err := resource.NewResource(fullName, "dataset", resource.Bigquery, tnnt, meta, spec) + existingResource, err := resource.NewResource(fullName, "dataset", resource.Bigquery, tnnt, meta, spec, nil) assert.NoError(t, err) existingResource = resource.FromExisting(existingResource, resource.ReplaceStatus(resource.StatusToUpdate)) @@ -750,9 +750,9 @@ func TestResourceService(t *testing.T) { t.Run("returns error if error is encountered when updating to store", func(t *testing.T) { fullName := "project.dataset" - resourceToUpdate, err := resource.NewResource(fullName, "dataset", resource.Bigquery, tnnt, meta, spec) + resourceToUpdate, err := resource.NewResource(fullName, "dataset", resource.Bigquery, tnnt, meta, spec, nil) assert.NoError(t, err) - existingResource, err := resource.NewResource(fullName, "dataset", resource.Bigquery, tnnt, meta, spec) + existingResource, err := resource.NewResource(fullName, "dataset", resource.Bigquery, tnnt, meta, spec, nil) assert.NoError(t, err) existingResource = resource.FromExisting(existingResource, resource.ReplaceStatus(resource.StatusToUpdate)) @@ -774,10 +774,10 @@ func TestResourceService(t *testing.T) { t.Run("returns error if encountered error when refreshing downstream", func(t *testing.T) { fullName := "project.dataset" incomingSpec := map[string]any{"view_query": "select 1;"} - resourceToUpdate, err := resource.NewResource(fullName, "dataset", resource.Bigquery, tnnt, meta, incomingSpec) + resourceToUpdate, err := resource.NewResource(fullName, "dataset", resource.Bigquery, tnnt, meta, incomingSpec, nil) assert.NoError(t, err) existingSpec := map[string]any{"view_query": "select 2;"} - existingResource, err := resource.NewResource(fullName, "dataset", resource.Bigquery, tnnt, meta, existingSpec) + existingResource, err := resource.NewResource(fullName, "dataset", resource.Bigquery, tnnt, meta, existingSpec, nil) assert.NoError(t, err) existingResource = resource.FromExisting(existingResource, resource.ReplaceStatus(resource.StatusToUpdate)) @@ -813,10 +813,10 @@ func TestResourceService(t *testing.T) { t.Run("returns nil if no error is encountered", func(t *testing.T) { fullName := "project.dataset" incomingSpec := map[string]any{"view_query": "select 1;"} - resourceToUpdate, err := resource.NewResource(fullName, "dataset", resource.Bigquery, tnnt, meta, incomingSpec) + resourceToUpdate, err := resource.NewResource(fullName, "dataset", resource.Bigquery, tnnt, meta, incomingSpec, nil) assert.NoError(t, err) existingSpec := map[string]any{"view_query": "select 2;"} - existingResource, err := resource.NewResource(fullName, "dataset", resource.Bigquery, tnnt, meta, existingSpec) + existingResource, err := resource.NewResource(fullName, "dataset", resource.Bigquery, tnnt, meta, existingSpec, nil) assert.NoError(t, err) existingResource = resource.FromExisting(existingResource, resource.ReplaceStatus(resource.StatusToUpdate)) @@ -842,7 +842,7 @@ func TestResourceService(t *testing.T) { }) t.Run("v2 spec return error if tenant details return error and validation fails", func(t *testing.T) { - incoming, err := resource.NewResource("data-table", bigquery.KindTable, resource.Bigquery, tnnt, metaV2, specV2) + incoming, err := resource.NewResource("data-table", bigquery.KindTable, resource.Bigquery, tnnt, metaV2, specV2, nil) assert.NoError(t, err) repo := newResourceRepository(t) @@ -862,7 +862,7 @@ func TestResourceService(t *testing.T) { t.Run("v2 spec return nil if resource is successfully created", func(t *testing.T) { tableName := "data-table" - incoming, err := resource.NewResource(tableName, bigquery.KindTable, resource.Bigquery, tnnt, metaV2, specV2) + incoming, err := resource.NewResource(tableName, bigquery.KindTable, resource.Bigquery, tnnt, metaV2, specV2, nil) assert.NoError(t, err) tenantDetailsGetter := new(mockTenantDetailsGetter) @@ -890,9 +890,9 @@ func TestResourceService(t *testing.T) { t.Run("v2 spec return nil if resource is successfully updated", func(t *testing.T) { tableName := "data-table" - incoming, err := resource.NewResource(tableName, bigquery.KindTable, resource.Bigquery, tnnt, metaV2, specV2) + incoming, err := resource.NewResource(tableName, bigquery.KindTable, resource.Bigquery, tnnt, metaV2, specV2, nil) assert.NoError(t, err) - existingResource, err := resource.NewResource(tableName, bigquery.KindTable, resource.Bigquery, tnnt, metaV2, specV2) + existingResource, err := resource.NewResource(tableName, bigquery.KindTable, resource.Bigquery, tnnt, metaV2, specV2, nil) assert.NoError(t, err) existingResource = resource.FromExisting(existingResource, resource.ReplaceStatus(resource.StatusToUpdate)) @@ -947,7 +947,7 @@ func TestResourceService(t *testing.T) { t.Run("returns resource and nil if no error is encountered", func(t *testing.T) { fullName := "project.dataset" - existingResource, err := resource.NewResource(fullName, "dataset", resource.Bigquery, tnnt, meta, spec) + existingResource, err := resource.NewResource(fullName, "dataset", resource.Bigquery, tnnt, meta, spec, nil) assert.NoError(t, err) repo := newResourceRepository(t) @@ -979,7 +979,7 @@ func TestResourceService(t *testing.T) { }) t.Run("returns resources and nil if no error is encountered", func(t *testing.T) { - existingResource, err := resource.NewResource("project.dataset", "dataset", resource.Bigquery, tnnt, meta, spec) + existingResource, err := resource.NewResource("project.dataset", "dataset", resource.Bigquery, tnnt, meta, spec, nil) assert.NoError(t, err) repo := newResourceRepository(t) @@ -1001,7 +1001,7 @@ func TestResourceService(t *testing.T) { "view_query": "select * from `proj.dataset.table`", } resourceWithStatus := func(name string, spec map[string]any, status resource.Status) *resource.Resource { - existingResource, resErr := resource.NewResource(name, "view", resource.Bigquery, tnnt, meta, spec) + existingResource, resErr := resource.NewResource(name, "view", resource.Bigquery, tnnt, meta, spec, nil) assert.NoError(t, resErr) return resource.FromExisting(existingResource, resource.ReplaceStatus(status)) } @@ -1024,7 +1024,7 @@ func TestResourceService(t *testing.T) { }) t.Run("skips resource when cannot get resource urn", func(t *testing.T) { - incoming, err := resource.NewResource("project.dataset", "dataset", resource.Bigquery, tnnt, meta, spec) + incoming, err := resource.NewResource("project.dataset", "dataset", resource.Bigquery, tnnt, meta, spec, nil) assert.NoError(t, err) mgr := NewResourceManager(t) @@ -1043,7 +1043,7 @@ func TestResourceService(t *testing.T) { }) t.Run("returns error if cannot update resource urn", func(t *testing.T) { - incoming, err := resource.NewResource("project.dataset", "dataset", resource.Bigquery, tnnt, meta, spec) + incoming, err := resource.NewResource("project.dataset", "dataset", resource.Bigquery, tnnt, meta, spec, nil) assert.NoError(t, err) urn, err := resource.ParseURN("bigquery://project:dataset.table") assert.NoError(t, err) @@ -1086,7 +1086,7 @@ func TestResourceService(t *testing.T) { }) t.Run("returns nil if there is no resource to create or modify", func(t *testing.T) { - incomingResourceToUpdate, resErr := resource.NewResource("project.dataset.view1", "view", resource.Bigquery, tnnt, meta, viewSpec) + incomingResourceToUpdate, resErr := resource.NewResource("project.dataset.view1", "view", resource.Bigquery, tnnt, meta, viewSpec, nil) assert.NoError(t, resErr) existing := resourceWithStatus("project.dataset.view1", viewSpec, resource.StatusSuccess) @@ -1111,7 +1111,7 @@ func TestResourceService(t *testing.T) { Description: "incoming resource metadata", } fullName := "project.dataset" - incomingResourceToUpdate, err := resource.NewResource(fullName, "dataset", resource.Bigquery, tnnt, incomingMetadata, spec) + incomingResourceToUpdate, err := resource.NewResource(fullName, "dataset", resource.Bigquery, tnnt, incomingMetadata, spec, nil) assert.NoError(t, err) repo := newResourceRepository(t) @@ -1138,7 +1138,7 @@ func TestResourceService(t *testing.T) { incomingMetadata := &resource.Metadata{ Description: "incoming resource metadata", } - incomingResourceToUpdate, err := resource.NewResource(fullName, "view", resource.Bigquery, tnnt, incomingMetadata, viewSpec) + incomingResourceToUpdate, err := resource.NewResource(fullName, "view", resource.Bigquery, tnnt, incomingMetadata, viewSpec, nil) assert.NoError(t, err) existing := resourceWithStatus(fullName, viewSpec, resource.StatusSuccess) @@ -1169,7 +1169,7 @@ func TestResourceService(t *testing.T) { incomingMetadata := &resource.Metadata{ Description: "incoming resource metadata", } - incomingResourceToUpdate, err := resource.NewResource(fullName, "view", resource.Bigquery, tnnt, incomingMetadata, viewSpec) + incomingResourceToUpdate, err := resource.NewResource(fullName, "view", resource.Bigquery, tnnt, incomingMetadata, viewSpec, nil) assert.NoError(t, err) existing := resourceWithStatus(fullName, viewSpec, resource.StatusCreateFailure) @@ -1200,12 +1200,12 @@ func TestResourceService(t *testing.T) { Description: "existing resource metadata", } fullName := "project.dataset" - existingResource, err := resource.NewResource(fullName, "dataset", resource.Bigquery, tnnt, existingMetadata, spec) + existingResource, err := resource.NewResource(fullName, "dataset", resource.Bigquery, tnnt, existingMetadata, spec, nil) assert.NoError(t, err) incomingMetadata := &resource.Metadata{ Description: "incoming resource metadata", } - incomingResourceToUpdate, err := resource.NewResource(fullName, "dataset", resource.Bigquery, tnnt, incomingMetadata, spec) + incomingResourceToUpdate, err := resource.NewResource(fullName, "dataset", resource.Bigquery, tnnt, incomingMetadata, spec, nil) assert.NoError(t, err) repo := newResourceRepository(t) @@ -1242,13 +1242,13 @@ func TestResourceService(t *testing.T) { updatedViewSpec := map[string]any{ "view_query": "select 1;", } - incomingToUpdate, err := resource.NewResource("project.dataset.view3", "view", resource.Bigquery, tnnt, meta, updatedViewSpec) + incomingToUpdate, err := resource.NewResource("project.dataset.view3", "view", resource.Bigquery, tnnt, meta, updatedViewSpec, nil) assert.NoError(t, err) - incomingToCreateExisting, resErr := resource.NewResource("project.dataset.view1", "view", resource.Bigquery, tnnt, meta, viewSpec) + incomingToCreateExisting, resErr := resource.NewResource("project.dataset.view1", "view", resource.Bigquery, tnnt, meta, viewSpec, nil) assert.NoError(t, resErr) - incomingToSkip, resErr := resource.NewResource("project.dataset.view2", "view", resource.Bigquery, tnnt, meta, viewSpec) + incomingToSkip, resErr := resource.NewResource("project.dataset.view2", "view", resource.Bigquery, tnnt, meta, viewSpec, nil) assert.NoError(t, resErr) - incomingToCreate, resErr := resource.NewResource("project.dataset.view5", "view", resource.Bigquery, tnnt, meta, viewSpec) + incomingToCreate, resErr := resource.NewResource("project.dataset.view5", "view", resource.Bigquery, tnnt, meta, viewSpec, nil) assert.NoError(t, resErr) repo := newResourceRepository(t) @@ -1296,13 +1296,13 @@ func TestResourceService(t *testing.T) { updatedViewSpec := map[string]any{ "view_query": "select 1;", } - incomingToUpdate, err := resource.NewResource("project.dataset.view3", "view", resource.Bigquery, tnnt, meta, updatedViewSpec) + incomingToUpdate, err := resource.NewResource("project.dataset.view3", "view", resource.Bigquery, tnnt, meta, updatedViewSpec, nil) assert.NoError(t, err) - incomingToCreateExisting, resErr := resource.NewResource("project.dataset.view1", "view", resource.Bigquery, tnnt, meta, viewSpec) + incomingToCreateExisting, resErr := resource.NewResource("project.dataset.view1", "view", resource.Bigquery, tnnt, meta, viewSpec, nil) assert.NoError(t, resErr) - incomingToSkip, resErr := resource.NewResource("project.dataset.view2", "view", resource.Bigquery, tnnt, meta, viewSpec) + incomingToSkip, resErr := resource.NewResource("project.dataset.view2", "view", resource.Bigquery, tnnt, meta, viewSpec, nil) assert.NoError(t, resErr) - incomingToCreate, resErr := resource.NewResource("project.dataset.view5", "view", resource.Bigquery, tnnt, meta, viewSpec) + incomingToCreate, resErr := resource.NewResource("project.dataset.view5", "view", resource.Bigquery, tnnt, meta, viewSpec, nil) assert.NoError(t, resErr) repo := newResourceRepository(t) @@ -1351,15 +1351,15 @@ func TestResourceService(t *testing.T) { updatedViewSpec := map[string]any{ "view_query": "select 1;", } - incomingToUpdate, err := resource.NewResource("project.dataset.view3", "view", resource.Bigquery, tnnt, meta, updatedViewSpec) + incomingToUpdate, err := resource.NewResource("project.dataset.view3", "view", resource.Bigquery, tnnt, meta, updatedViewSpec, nil) assert.NoError(t, err) - incomingToCreateExisting, resErr := resource.NewResource("project.dataset.view1", "view", resource.Bigquery, tnnt, meta, viewSpec) + incomingToCreateExisting, resErr := resource.NewResource("project.dataset.view1", "view", resource.Bigquery, tnnt, meta, viewSpec, nil) assert.NoError(t, resErr) - incomingToSkip, resErr := resource.NewResource("project.dataset.view2", "view", resource.Bigquery, tnnt, meta, viewSpec) + incomingToSkip, resErr := resource.NewResource("project.dataset.view2", "view", resource.Bigquery, tnnt, meta, viewSpec, nil) assert.NoError(t, resErr) - incomingToCreate, resErr := resource.NewResource("project.dataset.view5", "view", resource.Bigquery, tnnt, meta, viewSpec) + incomingToCreate, resErr := resource.NewResource("project.dataset.view5", "view", resource.Bigquery, tnnt, meta, viewSpec, nil) assert.NoError(t, resErr) - incomingToRecreate, resErr := resource.NewResource("project.dataset.view4", "view", resource.Bigquery, tnnt, meta, viewSpec) + incomingToRecreate, resErr := resource.NewResource("project.dataset.view4", "view", resource.Bigquery, tnnt, meta, viewSpec, nil) assert.NoError(t, resErr) repo := newResourceRepository(t) @@ -1418,7 +1418,7 @@ func TestResourceService(t *testing.T) { "name": "table-update", "a": "a", } - existingToUpdate, err := resource.NewResource("data-table-update", bigquery.KindTable, resource.Bigquery, tnnt, &resourceMeta, existingSpec) + existingToUpdate, err := resource.NewResource("data-table-update", bigquery.KindTable, resource.Bigquery, tnnt, &resourceMeta, existingSpec, nil) assert.NoError(t, err) newSpec := map[string]any{ @@ -1427,7 +1427,7 @@ func TestResourceService(t *testing.T) { "name": "table-create", "a": "b", } - incomingToCreate, err := resource.NewResource("data-table-create", bigquery.KindTable, resource.Bigquery, tnnt, &resourceMeta, newSpec) + incomingToCreate, err := resource.NewResource("data-table-create", bigquery.KindTable, resource.Bigquery, tnnt, &resourceMeta, newSpec, nil) assert.NoError(t, err) toUpdateSpec := map[string]any{ @@ -1436,7 +1436,7 @@ func TestResourceService(t *testing.T) { "name": "table-update", "a": "b", } - incomingToUpdate, err := resource.NewResource("data-table-update", bigquery.KindTable, resource.Bigquery, tnnt, &resourceMeta, toUpdateSpec) + incomingToUpdate, err := resource.NewResource("data-table-update", bigquery.KindTable, resource.Bigquery, tnnt, &resourceMeta, toUpdateSpec, nil) assert.NoError(t, err) tenantDetailsGetter := new(mockTenantDetailsGetter) @@ -1524,7 +1524,7 @@ func TestResourceService(t *testing.T) { }) t.Run("returns error while syncing resource", func(t *testing.T) { fullName := "project.dataset" - incoming, err := resource.NewResource(fullName, "dataset", resource.Bigquery, tnnt, meta, spec) + incoming, err := resource.NewResource(fullName, "dataset", resource.Bigquery, tnnt, meta, spec, nil) assert.NoError(t, err) repo := newResourceRepository(t) @@ -1544,7 +1544,7 @@ func TestResourceService(t *testing.T) { }) t.Run("syncs the resource successfully", func(t *testing.T) { fullName := "project.dataset" - incoming, err := resource.NewResource(fullName, "dataset", resource.Bigquery, tnnt, meta, spec) + incoming, err := resource.NewResource(fullName, "dataset", resource.Bigquery, tnnt, meta, spec, nil) assert.NoError(t, err) repo := newResourceRepository(t) @@ -1578,7 +1578,7 @@ func TestResourceService(t *testing.T) { FullName: resourceName, Force: false, } - existingResource, _ = resource.NewResource(resourceName, "dataset", resource.Bigquery, tnnt, meta, spec) + existingResource, _ = resource.NewResource(resourceName, "dataset", resource.Bigquery, tnnt, meta, spec, nil) ) defer mockDepResolver.AssertExpectations(t) @@ -1604,7 +1604,7 @@ func TestResourceService(t *testing.T) { FullName: resourceName, Force: true, } - existingResource, _ = resource.NewResource(resourceName, "dataset", resource.Bigquery, tnnt, meta, spec) + existingResource, _ = resource.NewResource(resourceName, "dataset", resource.Bigquery, tnnt, meta, spec, nil) ) defer mockDepResolver.AssertExpectations(t) @@ -1636,7 +1636,7 @@ func TestResourceService(t *testing.T) { FullName: resourceName, Force: false, } - existingResource, _ = resource.NewResource(resourceName, "dataset", resource.Bigquery, tnnt, meta, spec) + existingResource, _ = resource.NewResource(resourceName, "dataset", resource.Bigquery, tnnt, meta, spec, nil) ) defer mockDepResolver.AssertExpectations(t) @@ -1661,7 +1661,7 @@ func TestResourceService(t *testing.T) { FullName: resourceName, Force: false, } - existingResource, _ = resource.NewResource(resourceName, "dataset", resource.Bigquery, tnnt, meta, spec) + existingResource, _ = resource.NewResource(resourceName, "dataset", resource.Bigquery, tnnt, meta, spec, nil) ) defer mockDepResolver.AssertExpectations(t) @@ -1686,7 +1686,7 @@ func TestResourceService(t *testing.T) { FullName: resourceName, Force: false, } - existingResource, _ = resource.NewResource(resourceName, "dataset", resource.Bigquery, tnnt, meta, spec) + existingResource, _ = resource.NewResource(resourceName, "dataset", resource.Bigquery, tnnt, meta, spec, nil) ) defer mockDepResolver.AssertExpectations(t) @@ -1759,7 +1759,7 @@ func TestResourceService(t *testing.T) { urn, err := resource.ParseURN("bigquery://project:dataset.table") assert.NoError(t, err) - expectedResource, err := resource.NewResource("project.dataset", "dataset", resource.Bigquery, tnnt, meta, spec) + expectedResource, err := resource.NewResource("project.dataset", "dataset", resource.Bigquery, tnnt, meta, spec, nil) assert.NoError(t, err) repo.On("ReadByURN", ctx, tnnt, urn).Return(expectedResource, nil) diff --git a/ext/store/bigquery/backup.go b/ext/store/bigquery/backup.go index 14f4256daa..ed685b87f8 100644 --- a/ext/store/bigquery/backup.go +++ b/ext/store/bigquery/backup.go @@ -79,7 +79,7 @@ func CreateIfDatasetDoesNotExist(ctx context.Context, client Client, dataset Dat Labels: map[string]string{"created_by": "optimus"}, } spec := map[string]any{"description": backupMetadata.Description} - r, err := resource.NewResource(dataset.FullName(), KindDataset, resource.Bigquery, tenant.Tenant{}, backupMetadata, spec) + r, err := resource.NewResource(dataset.FullName(), KindDataset, resource.Bigquery, tenant.Tenant{}, backupMetadata, spec, nil) if err != nil { return err } diff --git a/ext/store/bigquery/backup_test.go b/ext/store/bigquery/backup_test.go index 5bebbb8fb7..203149ba81 100644 --- a/ext/store/bigquery/backup_test.go +++ b/ext/store/bigquery/backup_test.go @@ -25,7 +25,7 @@ func TestBigqueryBackup(t *testing.T) { "description": "test resource", } fullName := "t-optimus.playground.product" - source, resErr := resource.NewResource(fullName, kindTable, store, tnnt, meta, spec) + source, resErr := resource.NewResource(fullName, kindTable, store, tnnt, meta, spec, nil) assert.NoError(t, resErr) t.Run("BackupResources", func(t *testing.T) { @@ -33,7 +33,7 @@ func TestBigqueryBackup(t *testing.T) { client := new(mockClient) viewName := "t-optimus.playground.product-view" - view, err := resource.NewResource(viewName, bigquery.KindView, store, tnnt, meta, spec) + view, err := resource.NewResource(viewName, bigquery.KindView, store, tnnt, meta, spec, nil) assert.NoError(t, err) backup, err := resource.NewBackup(store, tnnt, []string{"p.d.t"}, "", createdAt, nil) diff --git a/ext/store/bigquery/batch_test.go b/ext/store/bigquery/batch_test.go index 4ba2d7491b..c5f6ca662a 100644 --- a/ext/store/bigquery/batch_test.go +++ b/ext/store/bigquery/batch_test.go @@ -27,20 +27,20 @@ func TestBatches(t *testing.T) { ds1Name := "t-optimus.playground" ds2Name := "t-optimus.mart" - ds1, resErr := resource.NewResource(ds1Name, kindDS, store, tnnt, meta1, spec) + ds1, resErr := resource.NewResource(ds1Name, kindDS, store, tnnt, meta1, spec, nil) assert.Nil(t, resErr) - tab1, resErr := resource.NewResource(ds1Name+".table1", bigquery.KindTable, store, tnnt, meta1, spec) + tab1, resErr := resource.NewResource(ds1Name+".table1", bigquery.KindTable, store, tnnt, meta1, spec, nil) assert.Nil(t, resErr) - view1, resErr := resource.NewResource(ds1Name+".view1", bigquery.KindView, store, tnnt, meta1, spec) + view1, resErr := resource.NewResource(ds1Name+".view1", bigquery.KindView, store, tnnt, meta1, spec, nil) assert.Nil(t, resErr) - extTab1, resErr := resource.NewResource(ds2Name+".extTable1", bigquery.KindExternalTable, store, tnnt, meta1, spec) + extTab1, resErr := resource.NewResource(ds2Name+".extTable1", bigquery.KindExternalTable, store, tnnt, meta1, spec, nil) assert.Nil(t, resErr) - view2, resErr := resource.NewResource(ds2Name+".view2", bigquery.KindView, store, tnnt, meta1, spec) + view2, resErr := resource.NewResource(ds2Name+".view2", bigquery.KindView, store, tnnt, meta1, spec, nil) assert.Nil(t, resErr) t.Run("BatchesFrom", func(t *testing.T) { - invalidRes, err2 := resource.NewResource(ds2Name+".invalid1", "stream", store, tnnt, meta1, spec) + invalidRes, err2 := resource.NewResource(ds2Name+".invalid1", "stream", store, tnnt, meta1, spec, nil) assert.Nil(t, err2) batches, err := bigquery.BatchesFrom([]*resource.Resource{ds1, tab1, view1, extTab1, view2, invalidRes}, nil) @@ -89,7 +89,7 @@ func TestBatches(t *testing.T) { createView2 := resource.FromExisting(view2, resource.ReplaceStatus(resource.StatusToCreate)) updateView2 := resource.FromExisting(view2, resource.ReplaceStatus(resource.StatusToUpdate)) - tab2, resErr := resource.NewResource(ds1Name+".table2", bigquery.KindTable, store, tnnt, meta1, spec) + tab2, resErr := resource.NewResource(ds1Name+".table2", bigquery.KindTable, store, tnnt, meta1, spec, nil) assert.Nil(t, resErr) successTab2 := resource.FromExisting(tab2, resource.ReplaceStatus(resource.StatusSuccess)) diff --git a/ext/store/bigquery/bigquery_test.go b/ext/store/bigquery/bigquery_test.go index 40073f3920..2fdec62f75 100644 --- a/ext/store/bigquery/bigquery_test.go +++ b/ext/store/bigquery/bigquery_test.go @@ -33,7 +33,7 @@ func TestBigqueryStore(t *testing.T) { clientProvider := new(mockClientProvider) bqStore := bigquery.NewBigqueryDataStore(secretProvider, clientProvider) - dataset, err := resource.NewResource("project.dataset", bigquery.KindDataset, store, tnnt, &metadata, spec) + dataset, err := resource.NewResource("project.dataset", bigquery.KindDataset, store, tnnt, &metadata, spec, nil) assert.Nil(t, err) err = bqStore.Create(ctx, dataset) @@ -53,7 +53,7 @@ func TestBigqueryStore(t *testing.T) { bqStore := bigquery.NewBigqueryDataStore(secretProvider, clientProvider) - dataset, err := resource.NewResource("project.dataset", bigquery.KindDataset, store, tnnt, &metadata, spec) + dataset, err := resource.NewResource("project.dataset", bigquery.KindDataset, store, tnnt, &metadata, spec, nil) assert.Nil(t, err) err = bqStore.Create(ctx, dataset) @@ -77,7 +77,7 @@ func TestBigqueryStore(t *testing.T) { bqStore := bigquery.NewBigqueryDataStore(secretProvider, clientProvider) - dataset, err := resource.NewResource("project.dataset.name", "unknown", store, tnnt, &metadata, spec) + dataset, err := resource.NewResource("project.dataset.name", "unknown", store, tnnt, &metadata, spec, nil) assert.Nil(t, err) err = bqStore.Create(ctx, dataset) @@ -91,7 +91,7 @@ func TestBigqueryStore(t *testing.T) { Return(pts, nil) defer secretProvider.AssertExpectations(t) - dataset, err := resource.NewResource("project.dataset", bigquery.KindDataset, store, tnnt, &metadata, spec) + dataset, err := resource.NewResource("project.dataset", bigquery.KindDataset, store, tnnt, &metadata, spec, nil) assert.Nil(t, err) datasetHandle := new(mockTableResourceHandle) @@ -119,7 +119,7 @@ func TestBigqueryStore(t *testing.T) { Return(pts, nil) defer secretProvider.AssertExpectations(t) - dataset, err := resource.NewResource("project.dataset", bigquery.KindDataset, store, tnnt, &metadata, spec) + dataset, err := resource.NewResource("project.dataset", bigquery.KindDataset, store, tnnt, &metadata, spec, nil) assert.Nil(t, err) datasetHandle := new(mockTableResourceHandle) @@ -148,7 +148,7 @@ func TestBigqueryStore(t *testing.T) { Return(pts, nil) defer secretProvider.AssertExpectations(t) - table, err := resource.NewResource("project.dataset.table", bigquery.KindTable, store, tnnt, &metadata, spec) + table, err := resource.NewResource("project.dataset.table", bigquery.KindTable, store, tnnt, &metadata, spec, nil) assert.Nil(t, err) tableHandle := new(mockTableResourceHandle) @@ -177,7 +177,7 @@ func TestBigqueryStore(t *testing.T) { Return(pts, nil) defer secretProvider.AssertExpectations(t) - view, err := resource.NewResource("project.dataset.view", bigquery.KindView, store, tnnt, &metadata, spec) + view, err := resource.NewResource("project.dataset.view", bigquery.KindView, store, tnnt, &metadata, spec, nil) assert.Nil(t, err) viewHandle := new(mockTableResourceHandle) @@ -205,7 +205,7 @@ func TestBigqueryStore(t *testing.T) { Return(pts, nil) defer secretProvider.AssertExpectations(t) - extTable, err := resource.NewResource("project.dataset.extTable", bigquery.KindExternalTable, store, tnnt, &metadata, spec) + extTable, err := resource.NewResource("project.dataset.extTable", bigquery.KindExternalTable, store, tnnt, &metadata, spec, nil) assert.Nil(t, err) extTableHandle := new(mockTableResourceHandle) @@ -246,7 +246,7 @@ func TestBigqueryStore(t *testing.T) { Return(pts, nil) defer secretProvider.AssertExpectations(t) - datasetRes, err := resource.NewResource("project-dataset", bigquery.KindDataset, store, tnnt, &metadataV2, specV2) + datasetRes, err := resource.NewResource("project-dataset", bigquery.KindDataset, store, tnnt, &metadataV2, specV2, nil) assert.Nil(t, err) datasetHandle := new(mockTableResourceHandle) @@ -282,7 +282,7 @@ func TestBigqueryStore(t *testing.T) { Return(pts, nil) defer secretProvider.AssertExpectations(t) - tableRes, err := resource.NewResource("project.dataset.table", bigquery.KindTable, store, tnnt, &metadataV2, specV2) + tableRes, err := resource.NewResource("project.dataset.table", bigquery.KindTable, store, tnnt, &metadataV2, specV2, nil) assert.Nil(t, err) tableHandle := new(mockTableResourceHandle) @@ -318,7 +318,7 @@ func TestBigqueryStore(t *testing.T) { Return(pts, nil) defer secretProvider.AssertExpectations(t) - viewRes, err := resource.NewResource("project.dataset.table", bigquery.KindView, store, tnnt, &metadataV2, specV2) + viewRes, err := resource.NewResource("project.dataset.table", bigquery.KindView, store, tnnt, &metadataV2, specV2, nil) assert.NoError(t, err) viewHandle := new(mockTableResourceHandle) @@ -350,7 +350,7 @@ func TestBigqueryStore(t *testing.T) { clientProvider := new(mockClientProvider) bqStore := bigquery.NewBigqueryDataStore(secretProvider, clientProvider) - dataset, err := resource.NewResource("project.dataset", bigquery.KindDataset, store, tnnt, &metadata, spec) + dataset, err := resource.NewResource("project.dataset", bigquery.KindDataset, store, tnnt, &metadata, spec, nil) assert.Nil(t, err) err = bqStore.Update(ctx, dataset) @@ -370,7 +370,7 @@ func TestBigqueryStore(t *testing.T) { bqStore := bigquery.NewBigqueryDataStore(secretProvider, clientProvider) - dataset, err := resource.NewResource("project.dataset", bigquery.KindDataset, store, tnnt, &metadata, spec) + dataset, err := resource.NewResource("project.dataset", bigquery.KindDataset, store, tnnt, &metadata, spec, nil) assert.Nil(t, err) err = bqStore.Update(ctx, dataset) @@ -393,7 +393,7 @@ func TestBigqueryStore(t *testing.T) { bqStore := bigquery.NewBigqueryDataStore(secretProvider, clientProvider) - dataset, err := resource.NewResource("project.dataset.name1", "unknown", store, tnnt, &metadata, spec) + dataset, err := resource.NewResource("project.dataset.name1", "unknown", store, tnnt, &metadata, spec, nil) assert.Nil(t, err) err = bqStore.Update(ctx, dataset) @@ -407,7 +407,7 @@ func TestBigqueryStore(t *testing.T) { Return(pts, nil) defer secretProvider.AssertExpectations(t) - dataset, err := resource.NewResource("project.dataset", bigquery.KindDataset, store, tnnt, &metadata, spec) + dataset, err := resource.NewResource("project.dataset", bigquery.KindDataset, store, tnnt, &metadata, spec, nil) assert.Nil(t, err) datasetHandle := new(mockTableResourceHandle) @@ -435,7 +435,7 @@ func TestBigqueryStore(t *testing.T) { Return(pts, nil) defer secretProvider.AssertExpectations(t) - dataset, err := resource.NewResource("project.dataset", bigquery.KindDataset, store, tnnt, &metadata, spec) + dataset, err := resource.NewResource("project.dataset", bigquery.KindDataset, store, tnnt, &metadata, spec, nil) assert.Nil(t, err) datasetHandle := new(mockTableResourceHandle) @@ -463,7 +463,7 @@ func TestBigqueryStore(t *testing.T) { Return(pts, nil) defer secretProvider.AssertExpectations(t) - table, err := resource.NewResource("project.dataset.table", bigquery.KindTable, store, tnnt, &metadata, spec) + table, err := resource.NewResource("project.dataset.table", bigquery.KindTable, store, tnnt, &metadata, spec, nil) assert.Nil(t, err) tableHandle := new(mockTableResourceHandle) @@ -491,7 +491,7 @@ func TestBigqueryStore(t *testing.T) { Return(pts, nil) defer secretProvider.AssertExpectations(t) - view, err := resource.NewResource("project.dataset.view", bigquery.KindView, store, tnnt, &metadata, spec) + view, err := resource.NewResource("project.dataset.view", bigquery.KindView, store, tnnt, &metadata, spec, nil) assert.Nil(t, err) viewHandle := new(mockTableResourceHandle) @@ -519,7 +519,7 @@ func TestBigqueryStore(t *testing.T) { Return(pts, nil) defer secretProvider.AssertExpectations(t) - extTable, err := resource.NewResource("project.dataset.extTable", bigquery.KindExternalTable, store, tnnt, &metadata, spec) + extTable, err := resource.NewResource("project.dataset.extTable", bigquery.KindExternalTable, store, tnnt, &metadata, spec, nil) assert.Nil(t, err) extTableHandle := new(mockTableResourceHandle) @@ -559,7 +559,7 @@ func TestBigqueryStore(t *testing.T) { Return(pts, nil) defer secretProvider.AssertExpectations(t) - datasetRes, err := resource.NewResource("project-dataset", bigquery.KindDataset, store, tnnt, &metadataV2, specV2) + datasetRes, err := resource.NewResource("project-dataset", bigquery.KindDataset, store, tnnt, &metadataV2, specV2, nil) assert.Nil(t, err) datasetHandle := new(mockTableResourceHandle) @@ -595,7 +595,7 @@ func TestBigqueryStore(t *testing.T) { Return(pts, nil) defer secretProvider.AssertExpectations(t) - tableRes, err := resource.NewResource("project.dataset.table", bigquery.KindTable, store, tnnt, &metadataV2, specV2) + tableRes, err := resource.NewResource("project.dataset.table", bigquery.KindTable, store, tnnt, &metadataV2, specV2, nil) assert.Nil(t, err) tableHandle := new(mockTableResourceHandle) @@ -631,7 +631,7 @@ func TestBigqueryStore(t *testing.T) { Return(pts, nil) defer secretProvider.AssertExpectations(t) - viewRes, err := resource.NewResource("project.dataset.table", bigquery.KindView, store, tnnt, &metadataV2, specV2) + viewRes, err := resource.NewResource("project.dataset.table", bigquery.KindView, store, tnnt, &metadataV2, specV2, nil) assert.NoError(t, err) viewHandle := new(mockTableResourceHandle) @@ -669,7 +669,7 @@ func TestBigqueryStore(t *testing.T) { clientProvider := new(mockClientProvider) bqStore := bigquery.NewBigqueryDataStore(secretProvider, clientProvider) - dataset, err := resource.NewResource("project.dataset", bigquery.KindDataset, store, tnnt, &metadata, spec) + dataset, err := resource.NewResource("project.dataset", bigquery.KindDataset, store, tnnt, &metadata, spec, nil) assert.Nil(t, err) err = bqStore.BatchUpdate(ctx, []*resource.Resource{dataset}) @@ -683,7 +683,7 @@ func TestBigqueryStore(t *testing.T) { Return(pts, nil) defer secretProvider.AssertExpectations(t) - dataset, err := resource.NewResource("project.dataset", bigquery.KindDataset, store, tnnt, &metadata, spec) + dataset, err := resource.NewResource("project.dataset", bigquery.KindDataset, store, tnnt, &metadata, spec, nil) assert.Nil(t, err) updateDS := resource.FromExisting(dataset, resource.ReplaceStatus(resource.StatusToUpdate)) @@ -704,7 +704,7 @@ func TestBigqueryStore(t *testing.T) { Return(pts, nil) defer secretProvider.AssertExpectations(t) - dataset, err := resource.NewResource("project.dataset", bigquery.KindDataset, store, tnnt, &metadata, spec) + dataset, err := resource.NewResource("project.dataset", bigquery.KindDataset, store, tnnt, &metadata, spec, nil) assert.Nil(t, err) updateDS := resource.FromExisting(dataset, resource.ReplaceStatus(resource.StatusToUpdate)) @@ -732,7 +732,7 @@ func TestBigqueryStore(t *testing.T) { Return(pts, nil) defer secretProvider.AssertExpectations(t) - dataset, err := resource.NewResource("project.dataset", bigquery.KindDataset, store, tnnt, &metadata, spec) + dataset, err := resource.NewResource("project.dataset", bigquery.KindDataset, store, tnnt, &metadata, spec, nil) assert.Nil(t, err) updateDS := resource.FromExisting(dataset, resource.ReplaceStatus(resource.StatusToUpdate)) @@ -760,7 +760,7 @@ func TestBigqueryStore(t *testing.T) { Return(pts, nil) defer secretProvider.AssertExpectations(t) - dataset, err := resource.NewResource("project.dataset", bigquery.KindDataset, store, tnnt, &metadata, spec) + dataset, err := resource.NewResource("project.dataset", bigquery.KindDataset, store, tnnt, &metadata, spec, nil) assert.Nil(t, err) deleteDS := resource.FromExisting(dataset, resource.ReplaceStatus(resource.StatusToDelete)) @@ -794,8 +794,7 @@ func TestBigqueryStore(t *testing.T) { assert.ErrorContains(t, err, "invalid sections in name:") }) t.Run("returns error for invalid resource kind", func(t *testing.T) { - res, err := resource.NewResource("project.set.view_name1", "unknown", resource.Bigquery, - tnnt, &resource.Metadata{}, invalidSpec) + res, err := resource.NewResource("project.set.view_name1", "unknown", resource.Bigquery, tnnt, &resource.Metadata{}, invalidSpec, nil) assert.NoError(t, err) bqStore := bigquery.NewBigqueryDataStore(nil, nil) @@ -805,8 +804,7 @@ func TestBigqueryStore(t *testing.T) { }) t.Run("for view", func(t *testing.T) { t.Run("returns error when cannot decode view spec", func(t *testing.T) { - res, err := resource.NewResource("project.set.view_name1", bigquery.KindView, resource.Bigquery, - tnnt, &resource.Metadata{}, invalidSpec) + res, err := resource.NewResource("project.set.view_name1", bigquery.KindView, resource.Bigquery, tnnt, &resource.Metadata{}, invalidSpec, nil) assert.Nil(t, err) assert.Equal(t, "project.set.view_name1", res.FullName()) @@ -817,8 +815,7 @@ func TestBigqueryStore(t *testing.T) { assert.ErrorContains(t, err, "not able to decode spec for project.set.view_name1") }) t.Run("returns error for validation failure", func(t *testing.T) { - res, err := resource.NewResource("project.set.view_name1", bigquery.KindView, resource.Bigquery, - tnnt, &resource.Metadata{}, specWithoutValues) + res, err := resource.NewResource("project.set.view_name1", bigquery.KindView, resource.Bigquery, tnnt, &resource.Metadata{}, specWithoutValues, nil) assert.Nil(t, err) assert.Equal(t, "project.set.view_name1", res.FullName()) @@ -830,8 +827,7 @@ func TestBigqueryStore(t *testing.T) { }) t.Run("for external_table", func(t *testing.T) { t.Run("returns error when cannot decode spec", func(t *testing.T) { - res, err := resource.NewResource("project.set.external_name1", bigquery.KindExternalTable, resource.Bigquery, - tnnt, &resource.Metadata{}, invalidSpec) + res, err := resource.NewResource("project.set.external_name1", bigquery.KindExternalTable, resource.Bigquery, tnnt, &resource.Metadata{}, invalidSpec, nil) assert.Nil(t, err) assert.Equal(t, "project.set.external_name1", res.FullName()) @@ -841,8 +837,7 @@ func TestBigqueryStore(t *testing.T) { assert.ErrorContains(t, err, "not able to decode spec for project.set.external_name1") }) t.Run("returns error when external_table spec is invalid", func(t *testing.T) { - res, err := resource.NewResource("project.set.external_name1", bigquery.KindExternalTable, resource.Bigquery, - tnnt, &resource.Metadata{}, specWithoutValues) + res, err := resource.NewResource("project.set.external_name1", bigquery.KindExternalTable, resource.Bigquery, tnnt, &resource.Metadata{}, specWithoutValues, nil) assert.Nil(t, err) assert.Equal(t, "project.set.external_name1", res.FullName()) @@ -854,8 +849,7 @@ func TestBigqueryStore(t *testing.T) { }) t.Run("for table", func(t *testing.T) { t.Run("returns error when cannot decode table", func(t *testing.T) { - res, err := resource.NewResource("project.set.table_name1", bigquery.KindTable, resource.Bigquery, - tnnt, &resource.Metadata{}, invalidSpec) + res, err := resource.NewResource("project.set.table_name1", bigquery.KindTable, resource.Bigquery, tnnt, &resource.Metadata{}, invalidSpec, nil) assert.Nil(t, err) assert.Equal(t, "project.set.table_name1", res.FullName()) @@ -865,8 +859,7 @@ func TestBigqueryStore(t *testing.T) { assert.ErrorContains(t, err, "not able to decode spec for project.set.table_name1") }) t.Run("returns error when cannot decode table", func(t *testing.T) { - res, err := resource.NewResource("project.set.table_name1", bigquery.KindTable, resource.Bigquery, - tnnt, &resource.Metadata{}, specWithoutValues) + res, err := resource.NewResource("project.set.table_name1", bigquery.KindTable, resource.Bigquery, tnnt, &resource.Metadata{}, specWithoutValues, nil) assert.Nil(t, err) assert.Equal(t, "project.set.table_name1", res.FullName()) @@ -878,8 +871,7 @@ func TestBigqueryStore(t *testing.T) { }) t.Run("for dataset", func(t *testing.T) { t.Run("returns error when cannot decode dataset", func(t *testing.T) { - res, err := resource.NewResource("project.set_name1", bigquery.KindDataset, resource.Bigquery, - tnnt, &resource.Metadata{}, invalidSpec) + res, err := resource.NewResource("project.set_name1", bigquery.KindDataset, resource.Bigquery, tnnt, &resource.Metadata{}, invalidSpec, nil) assert.Nil(t, err) bqStore := bigquery.NewBigqueryDataStore(nil, nil) err = bqStore.Validate(res) @@ -887,8 +879,7 @@ func TestBigqueryStore(t *testing.T) { assert.ErrorContains(t, err, "not able to decode spec for project.set_name1") }) t.Run("returns no error when validation passes", func(t *testing.T) { - res, err := resource.NewResource("project.set_name1", bigquery.KindDataset, resource.Bigquery, - tnnt, &resource.Metadata{}, specWithoutValues) + res, err := resource.NewResource("project.set_name1", bigquery.KindDataset, resource.Bigquery, tnnt, &resource.Metadata{}, specWithoutValues, nil) assert.Nil(t, err) bqStore := bigquery.NewBigqueryDataStore(nil, nil) err = bqStore.Validate(res) @@ -898,8 +889,7 @@ func TestBigqueryStore(t *testing.T) { }) t.Run("URNFor", func(t *testing.T) { t.Run("returns urn for resource", func(t *testing.T) { - res, err := resource.NewResource("project.set.view_name1", "unknown", resource.Bigquery, - tnnt, &resource.Metadata{}, spec) + res, err := resource.NewResource("project.set.view_name1", "unknown", resource.Bigquery, tnnt, &resource.Metadata{}, spec, nil) assert.NoError(t, err) expectedURN, err := resource.ParseURN("bigquery://project:set.view_name1") @@ -925,7 +915,7 @@ func TestBigqueryStore(t *testing.T) { clientProvider := new(mockClientProvider) bqStore := bigquery.NewBigqueryDataStore(secretProvider, clientProvider) - dataset, err := resource.NewResource("project.dataset", bigquery.KindDataset, store, tnnt, &metadata, spec) + dataset, err := resource.NewResource("project.dataset", bigquery.KindDataset, store, tnnt, &metadata, spec, nil) assert.Nil(t, err) _, err = bqStore.Backup(ctx, backup, []*resource.Resource{dataset}) @@ -945,7 +935,7 @@ func TestBigqueryStore(t *testing.T) { bqStore := bigquery.NewBigqueryDataStore(secretProvider, clientProvider) - dataset, err := resource.NewResource("project.dataset", bigquery.KindDataset, store, tnnt, &metadata, spec) + dataset, err := resource.NewResource("project.dataset", bigquery.KindDataset, store, tnnt, &metadata, spec, nil) assert.Nil(t, err) _, err = bqStore.Backup(ctx, backup, []*resource.Resource{dataset}) @@ -969,7 +959,7 @@ func TestBigqueryStore(t *testing.T) { bqStore := bigquery.NewBigqueryDataStore(secretProvider, clientProvider) - dataset, err := resource.NewResource("project.dataset", bigquery.KindDataset, store, tnnt, &metadata, spec) + dataset, err := resource.NewResource("project.dataset", bigquery.KindDataset, store, tnnt, &metadata, spec, nil) assert.Nil(t, err) result, err := bqStore.Backup(ctx, backup, []*resource.Resource{dataset}) diff --git a/ext/store/bigquery/dataset_spec_test.go b/ext/store/bigquery/dataset_spec_test.go index 27567391bb..f2dba0da11 100644 --- a/ext/store/bigquery/dataset_spec_test.go +++ b/ext/store/bigquery/dataset_spec_test.go @@ -53,11 +53,11 @@ func TestDataSet(t *testing.T) { Labels: map[string]string{"owner": "optimus"}, } spec := map[string]any{"description": []string{"a", "b"}} - res, err := resource.NewResource("proj.dataset.extTable1", bigquery.KindExternalTable, bqStore, tnnt, &metadata, spec) + res, err := resource.NewResource("proj.dataset.extTable1", bigquery.KindExternalTable, bqStore, tnnt, &metadata, spec, nil) assert.Nil(t, err) t.Run("returns error when name not valid", func(t *testing.T) { - invalidRes, err := resource.NewResource("proj.", bigquery.KindExternalTable, bqStore, tnnt, &metadata, spec) + invalidRes, err := resource.NewResource("proj.", bigquery.KindExternalTable, bqStore, tnnt, &metadata, spec, nil) assert.Nil(t, err) _, err = bigquery.DataSetFor(invalidRes.Name()) @@ -82,12 +82,12 @@ func TestResourceName(t *testing.T) { Labels: map[string]string{"owner": "optimus"}, } spec := map[string]any{"description": []string{"a", "b"}} - res, err := resource.NewResource("proj.dataset.extTable1", bigquery.KindExternalTable, bqStore, tnnt, &metadata, spec) + res, err := resource.NewResource("proj.dataset.extTable1", bigquery.KindExternalTable, bqStore, tnnt, &metadata, spec, nil) assert.Nil(t, err) t.Run("for dataset", func(t *testing.T) { t.Run("return error when invalid", func(t *testing.T) { - dsRes, dsErr := resource.NewResource("proj", bigquery.KindDataset, bqStore, tnnt, &metadata, spec) + dsRes, dsErr := resource.NewResource("proj", bigquery.KindDataset, bqStore, tnnt, &metadata, spec, nil) assert.NoError(t, dsErr) _, err := bigquery.ResourceNameFor(dsRes.Name(), dsRes.Kind()) @@ -95,7 +95,7 @@ func TestResourceName(t *testing.T) { assert.ErrorContains(t, err, "invalid resource name: proj") }) t.Run("name when valid", func(t *testing.T) { - dsRes, dsErr := resource.NewResource("proj.dataset", bigquery.KindDataset, bqStore, tnnt, &metadata, spec) + dsRes, dsErr := resource.NewResource("proj.dataset", bigquery.KindDataset, bqStore, tnnt, &metadata, spec, nil) assert.NoError(t, dsErr) name, err := bigquery.ResourceNameFor(dsRes.Name(), dsRes.Kind()) @@ -105,7 +105,7 @@ func TestResourceName(t *testing.T) { }) t.Run("for other resources", func(t *testing.T) { t.Run("return error when invalid", func(t *testing.T) { - dsRes, dsErr := resource.NewResource("proj.dataset", bigquery.KindTable, bqStore, tnnt, &metadata, spec) + dsRes, dsErr := resource.NewResource("proj.dataset", bigquery.KindTable, bqStore, tnnt, &metadata, spec, nil) assert.NoError(t, dsErr) _, err := bigquery.ResourceNameFor(dsRes.Name(), dsRes.Kind()) @@ -113,7 +113,7 @@ func TestResourceName(t *testing.T) { assert.ErrorContains(t, err, "invalid resource name") }) t.Run("return error when resource name is empty", func(t *testing.T) { - dsRes, dsErr := resource.NewResource("proj.dataset.", bigquery.KindTable, bqStore, tnnt, &metadata, spec) + dsRes, dsErr := resource.NewResource("proj.dataset.", bigquery.KindTable, bqStore, tnnt, &metadata, spec, nil) assert.NoError(t, dsErr) _, err := bigquery.ResourceNameFor(dsRes.Name(), dsRes.Kind()) @@ -152,7 +152,7 @@ func TestValidateName(t *testing.T) { t.Run("when invalid", func(t *testing.T) { t.Run("return error for not enough sections", func(t *testing.T) { - res, err := resource.NewResource("proj", bigquery.KindDataset, bqStore, tnnt, &metadata, spec) + res, err := resource.NewResource("proj", bigquery.KindDataset, bqStore, tnnt, &metadata, spec, nil) assert.NoError(t, err) err = bigquery.ValidateName(res) @@ -160,7 +160,7 @@ func TestValidateName(t *testing.T) { assert.ErrorContains(t, err, "invalid sections in name: proj") }) t.Run("return error for invalid character in project name", func(t *testing.T) { - res, err := resource.NewResource("proj@.dataset", bigquery.KindDataset, bqStore, tnnt, &metadata, spec) + res, err := resource.NewResource("proj@.dataset", bigquery.KindDataset, bqStore, tnnt, &metadata, spec, nil) assert.NoError(t, err) err = bigquery.ValidateName(res) @@ -168,7 +168,7 @@ func TestValidateName(t *testing.T) { assert.ErrorContains(t, err, "invalid character in project name proj@.dataset") }) t.Run("return error for invalid character in dataset name", func(t *testing.T) { - res, err := resource.NewResource("p-project.data-set", bigquery.KindDataset, bqStore, tnnt, &metadata, spec) + res, err := resource.NewResource("p-project.data-set", bigquery.KindDataset, bqStore, tnnt, &metadata, spec, nil) assert.NoError(t, err) err = bigquery.ValidateName(res) @@ -176,7 +176,7 @@ func TestValidateName(t *testing.T) { assert.ErrorContains(t, err, "invalid character in dataset name p-project.data-set") }) t.Run("returns error when sections in table name are less", func(t *testing.T) { - res, err := resource.NewResource("p-project.dataset", bigquery.KindTable, bqStore, tnnt, &metadata, spec) + res, err := resource.NewResource("p-project.dataset", bigquery.KindTable, bqStore, tnnt, &metadata, spec, nil) assert.NoError(t, err) err = bigquery.ValidateName(res) @@ -184,7 +184,7 @@ func TestValidateName(t *testing.T) { assert.ErrorContains(t, err, "invalid resource name sections: p-project.dataset") }) t.Run("returns error when table name is invalid", func(t *testing.T) { - res, err := resource.NewResource("p-project.dataset.tab@tab1", bigquery.KindTable, bqStore, tnnt, &metadata, spec) + res, err := resource.NewResource("p-project.dataset.tab@tab1", bigquery.KindTable, bqStore, tnnt, &metadata, spec, nil) assert.NoError(t, err) err = bigquery.ValidateName(res) @@ -198,7 +198,7 @@ func TestValidateName(t *testing.T) { "dataset": "dataset", "name": "table", } - res, err := resource.NewResource("project.dataset.table", bigquery.KindTable, bqStore, tnnt, &metadataV2, invalidSpecV2) + res, err := resource.NewResource("project.dataset.table", bigquery.KindTable, bqStore, tnnt, &metadataV2, invalidSpecV2, nil) assert.NoError(t, err) err = bigquery.ValidateName(res) @@ -212,7 +212,7 @@ func TestValidateName(t *testing.T) { "dataset": "datasetINVALID!", "name": "table", } - res, err := resource.NewResource("project.dataset.table", bigquery.KindTable, bqStore, tnnt, &metadataV2, invalidSpecV2) + res, err := resource.NewResource("project.dataset.table", bigquery.KindTable, bqStore, tnnt, &metadataV2, invalidSpecV2, nil) assert.NoError(t, err) err = bigquery.ValidateName(res) @@ -226,7 +226,7 @@ func TestValidateName(t *testing.T) { "dataset": "dataset", "name": "table@", } - res, err := resource.NewResource("project.dataset.table", bigquery.KindTable, bqStore, tnnt, &metadataV2, invalidSpecV2) + res, err := resource.NewResource("project.dataset.table", bigquery.KindTable, bqStore, tnnt, &metadataV2, invalidSpecV2, nil) assert.NoError(t, err) err = bigquery.ValidateName(res) @@ -237,7 +237,7 @@ func TestValidateName(t *testing.T) { t.Run("when valid", func(t *testing.T) { t.Run("return no error for dataset", func(t *testing.T) { - res, err := resource.NewResource("p-project.dataset", bigquery.KindDataset, bqStore, tnnt, &metadata, spec) + res, err := resource.NewResource("p-project.dataset", bigquery.KindDataset, bqStore, tnnt, &metadata, spec, nil) assert.NoError(t, err) err = bigquery.ValidateName(res) @@ -245,7 +245,7 @@ func TestValidateName(t *testing.T) { }) t.Run("returns no error when table name is valid", func(t *testing.T) { - res, err := resource.NewResource("p-project.dataset.tab1", bigquery.KindTable, bqStore, tnnt, &metadata, spec) + res, err := resource.NewResource("p-project.dataset.tab1", bigquery.KindTable, bqStore, tnnt, &metadata, spec, nil) assert.NoError(t, err) err = bigquery.ValidateName(res) @@ -253,7 +253,7 @@ func TestValidateName(t *testing.T) { }) t.Run("returns no error for dataset v2 spec", func(t *testing.T) { - res, err := resource.NewResource("project.dataset", bigquery.KindDataset, bqStore, tnnt, &metadataV2, specV2) + res, err := resource.NewResource("project.dataset", bigquery.KindDataset, bqStore, tnnt, &metadataV2, specV2, nil) assert.NoError(t, err) err = bigquery.ValidateName(res) @@ -261,7 +261,7 @@ func TestValidateName(t *testing.T) { }) t.Run("returns no error for table v2 spec", func(t *testing.T) { - res, err := resource.NewResource("project.dataset.table", bigquery.KindTable, bqStore, tnnt, &metadataV2, specV2) + res, err := resource.NewResource("project.dataset.table", bigquery.KindTable, bqStore, tnnt, &metadataV2, specV2, nil) assert.NoError(t, err) err = bigquery.ValidateName(res) @@ -298,14 +298,14 @@ func TestURNFor(t *testing.T) { } t.Run("returns error when cannot get dataset", func(t *testing.T) { - res, err := resource.NewResource("p-project.", bigquery.KindDataset, bqStore, tnnt, &metadata, spec) + res, err := resource.NewResource("p-project.", bigquery.KindDataset, bqStore, tnnt, &metadata, spec, nil) assert.NoError(t, err) _, err = bigquery.URNFor(res) assert.Error(t, err) }) t.Run("returns urn for dataset", func(t *testing.T) { - res, err := resource.NewResource("p-project.dataset", bigquery.KindDataset, bqStore, tnnt, &metadata, spec) + res, err := resource.NewResource("p-project.dataset", bigquery.KindDataset, bqStore, tnnt, &metadata, spec, nil) assert.NoError(t, err) urn, err := bigquery.URNFor(res) @@ -313,7 +313,7 @@ func TestURNFor(t *testing.T) { assert.Equal(t, "bigquery://p-project:dataset", urn.String()) }) t.Run("returns error when cannot get resource name", func(t *testing.T) { - res, err := resource.NewResource("p-project.dataset.", bigquery.KindTable, bqStore, tnnt, &metadata, spec) + res, err := resource.NewResource("p-project.dataset.", bigquery.KindTable, bqStore, tnnt, &metadata, spec, nil) assert.NoError(t, err) _, err = bigquery.URNFor(res) @@ -321,7 +321,7 @@ func TestURNFor(t *testing.T) { assert.ErrorContains(t, err, "invalid resource name") }) t.Run("returns urn for table", func(t *testing.T) { - res, err := resource.NewResource("p-project.dataset.table1", bigquery.KindTable, bqStore, tnnt, &metadata, spec) + res, err := resource.NewResource("p-project.dataset.table1", bigquery.KindTable, bqStore, tnnt, &metadata, spec, nil) assert.NoError(t, err) urn, err := bigquery.URNFor(res) @@ -330,7 +330,7 @@ func TestURNFor(t *testing.T) { }) t.Run("returns urn for table with v2 spec", func(t *testing.T) { - res, err := resource.NewResource("project.dataset.table1", bigquery.KindDataset, bqStore, tnnt, &metadataV2, specV2) + res, err := resource.NewResource("project.dataset.table1", bigquery.KindDataset, bqStore, tnnt, &metadataV2, specV2, nil) assert.NoError(t, err) urn, err := bigquery.URNFor(res) @@ -339,7 +339,7 @@ func TestURNFor(t *testing.T) { }) t.Run("returns urn for dataset with v2 spec", func(t *testing.T) { - res, err := resource.NewResource("project.dataset", bigquery.KindTable, bqStore, tnnt, &metadataV2, specV2) + res, err := resource.NewResource("project.dataset", bigquery.KindTable, bqStore, tnnt, &metadataV2, specV2, nil) assert.NoError(t, err) urn, err := bigquery.URNFor(res) @@ -348,7 +348,7 @@ func TestURNFor(t *testing.T) { }) t.Run("returns error for table with invalid v2 spec", func(t *testing.T) { - res, err := resource.NewResource("project.dataset.table", bigquery.KindTable, bqStore, tnnt, &metadataV2, invalidSpecV2) + res, err := resource.NewResource("project.dataset.table", bigquery.KindTable, bqStore, tnnt, &metadataV2, invalidSpecV2, nil) assert.NoError(t, err) _, err = bigquery.URNFor(res) diff --git a/ext/store/bigquery/dataset_test.go b/ext/store/bigquery/dataset_test.go index 5435308d2a..bf38b8d3ce 100644 --- a/ext/store/bigquery/dataset_test.go +++ b/ext/store/bigquery/dataset_test.go @@ -31,7 +31,7 @@ func TestDatasetHandle(t *testing.T) { dsHandle := bigquery.NewDatasetHandle(ds) spec := map[string]any{"description": []string{"a", "b"}} - res, err := resource.NewResource("proj.dataset", bigquery.KindDataset, bqStore, tnnt, &metadata, spec) + res, err := resource.NewResource("proj.dataset", bigquery.KindDataset, bqStore, tnnt, &metadata, spec, nil) assert.Nil(t, err) err = dsHandle.Create(ctx, res) @@ -49,7 +49,7 @@ func TestDatasetHandle(t *testing.T) { dsHandle := bigquery.NewDatasetHandle(ds) spec := map[string]any{"description": "test create"} - res, err := resource.NewResource("proj.dataset", bigquery.KindDataset, bqStore, tnnt, &metadata, spec) + res, err := resource.NewResource("proj.dataset", bigquery.KindDataset, bqStore, tnnt, &metadata, spec, nil) assert.Nil(t, err) err = dsHandle.Create(ctx, res) @@ -64,7 +64,7 @@ func TestDatasetHandle(t *testing.T) { dsHandle := bigquery.NewDatasetHandle(ds) spec := map[string]any{"description": "test create"} - res, err := resource.NewResource("proj.dataset", bigquery.KindDataset, bqStore, tnnt, &metadata, spec) + res, err := resource.NewResource("proj.dataset", bigquery.KindDataset, bqStore, tnnt, &metadata, spec, nil) assert.Nil(t, err) err = dsHandle.Create(ctx, res) @@ -83,7 +83,7 @@ func TestDatasetHandle(t *testing.T) { "location": "asia-southeast2", "table_expiration": 2, } - res, err := resource.NewResource("proj.dataset", bigquery.KindDataset, bqStore, tnnt, &metadata, spec) + res, err := resource.NewResource("proj.dataset", bigquery.KindDataset, bqStore, tnnt, &metadata, spec, nil) assert.Nil(t, err) err = dsHandle.Create(ctx, res) @@ -96,7 +96,7 @@ func TestDatasetHandle(t *testing.T) { dsHandle := bigquery.NewDatasetHandle(ds) spec := map[string]any{"description": []string{"a", "b"}} - res, err := resource.NewResource("proj.dataset", bigquery.KindDataset, bqStore, tnnt, &metadata, spec) + res, err := resource.NewResource("proj.dataset", bigquery.KindDataset, bqStore, tnnt, &metadata, spec, nil) assert.Nil(t, err) err = dsHandle.Update(ctx, res) @@ -112,7 +112,7 @@ func TestDatasetHandle(t *testing.T) { dsHandle := bigquery.NewDatasetHandle(ds) spec := map[string]any{"description": "test update"} - res, err := resource.NewResource("proj.dataset", bigquery.KindDataset, bqStore, tnnt, &metadata, spec) + res, err := resource.NewResource("proj.dataset", bigquery.KindDataset, bqStore, tnnt, &metadata, spec, nil) assert.Nil(t, err) err = dsHandle.Update(ctx, res) @@ -127,7 +127,7 @@ func TestDatasetHandle(t *testing.T) { dsHandle := bigquery.NewDatasetHandle(ds) spec := map[string]any{"description": "test update"} - res, err := resource.NewResource("proj.dataset", bigquery.KindDataset, bqStore, tnnt, &metadata, spec) + res, err := resource.NewResource("proj.dataset", bigquery.KindDataset, bqStore, tnnt, &metadata, spec, nil) assert.Nil(t, err) err = dsHandle.Update(ctx, res) @@ -149,7 +149,7 @@ func TestDatasetHandle(t *testing.T) { "location": "asia-southeast2", "table_expiration": float64(2), } - res, err := resource.NewResource("proj.dataset", bigquery.KindDataset, bqStore, tnnt, &metadata, spec) + res, err := resource.NewResource("proj.dataset", bigquery.KindDataset, bqStore, tnnt, &metadata, spec, nil) assert.Nil(t, err) err = dsHandle.Update(ctx, res) diff --git a/ext/store/bigquery/external_table_test.go b/ext/store/bigquery/external_table_test.go index 81f7dbb22c..720eb0d86b 100644 --- a/ext/store/bigquery/external_table_test.go +++ b/ext/store/bigquery/external_table_test.go @@ -33,7 +33,7 @@ func TestExternalTableHandle(t *testing.T) { etHandle := bigquery.NewExternalTableHandle(et) spec := map[string]any{"description": []string{"a", "b"}} - res, err := resource.NewResource("proj.dataset.extTable1", bigquery.KindExternalTable, bqStore, tnnt, &metadata, spec) + res, err := resource.NewResource("proj.dataset.extTable1", bigquery.KindExternalTable, bqStore, tnnt, &metadata, spec, nil) assert.Nil(t, err) err = etHandle.Create(ctx, res) @@ -48,7 +48,7 @@ func TestExternalTableHandle(t *testing.T) { "description": "test create", "expiration_time": "invalid_date", } - res, err := resource.NewResource("proj.dataset.extTable1", bigquery.KindExternalTable, bqStore, tnnt, &metadata, spec) + res, err := resource.NewResource("proj.dataset.extTable1", bigquery.KindExternalTable, bqStore, tnnt, &metadata, spec, nil) assert.Nil(t, err) err = etHandle.Create(ctx, res) @@ -70,7 +70,7 @@ func TestExternalTableHandle(t *testing.T) { "uris": []string{"https://docs.google.com/sheet"}, }, } - res, err := resource.NewResource("proj.dataset.extTable1", bigquery.KindExternalTable, bqStore, tnnt, &metadata, spec) + res, err := resource.NewResource("proj.dataset.extTable1", bigquery.KindExternalTable, bqStore, tnnt, &metadata, spec, nil) assert.Nil(t, err) err = etHandle.Create(ctx, res) @@ -95,7 +95,7 @@ func TestExternalTableHandle(t *testing.T) { et := new(mockBigQueryTable) etHandle := bigquery.NewExternalTableHandle(et) - res, err := resource.NewResource("proj.dataset.extTable1", bigquery.KindExternalTable, bqStore, tnnt, &metadata, spec) + res, err := resource.NewResource("proj.dataset.extTable1", bigquery.KindExternalTable, bqStore, tnnt, &metadata, spec, nil) assert.Nil(t, err) err = etHandle.Create(ctx, res) @@ -116,7 +116,7 @@ func TestExternalTableHandle(t *testing.T) { "uris": []string{"https://docs.google.com/sheet"}, }, } - res, err := resource.NewResource("proj.dataset.extTable1", bigquery.KindExternalTable, bqStore, tnnt, &metadata, spec) + res, err := resource.NewResource("proj.dataset.extTable1", bigquery.KindExternalTable, bqStore, tnnt, &metadata, spec, nil) assert.Nil(t, err) err = etHandle.Create(ctx, res) @@ -168,7 +168,7 @@ func TestExternalTableHandle(t *testing.T) { etHandle := bigquery.NewExternalTableHandle(et) - res, err := resource.NewResource("proj.dataset.extTable1", bigquery.KindExternalTable, bqStore, tnnt, &metadata, spec) + res, err := resource.NewResource("proj.dataset.extTable1", bigquery.KindExternalTable, bqStore, tnnt, &metadata, spec, nil) assert.Nil(t, err) err = etHandle.Create(ctx, res) @@ -181,7 +181,7 @@ func TestExternalTableHandle(t *testing.T) { etHandle := bigquery.NewExternalTableHandle(et) spec := map[string]any{"description": []string{"a", "b"}} - res, err := resource.NewResource("proj.dataset.extTable1", bigquery.KindExternalTable, bqStore, tnnt, &metadata, spec) + res, err := resource.NewResource("proj.dataset.extTable1", bigquery.KindExternalTable, bqStore, tnnt, &metadata, spec, nil) assert.Nil(t, err) err = etHandle.Update(ctx, res) @@ -196,7 +196,7 @@ func TestExternalTableHandle(t *testing.T) { "description": "test update", "expiration_time": "invalid_date", } - res, err := resource.NewResource("proj.dataset.extTable1", bigquery.KindExternalTable, bqStore, tnnt, &metadata, spec) + res, err := resource.NewResource("proj.dataset.extTable1", bigquery.KindExternalTable, bqStore, tnnt, &metadata, spec, nil) assert.Nil(t, err) err = etHandle.Update(ctx, res) @@ -219,7 +219,7 @@ func TestExternalTableHandle(t *testing.T) { "config": map[string]any{}, }, } - res, err := resource.NewResource("proj.dataset.extTable1", bigquery.KindExternalTable, bqStore, tnnt, &metadata, spec) + res, err := resource.NewResource("proj.dataset.extTable1", bigquery.KindExternalTable, bqStore, tnnt, &metadata, spec, nil) assert.Nil(t, err) err = etHandle.Update(ctx, res) @@ -241,7 +241,7 @@ func TestExternalTableHandle(t *testing.T) { "config": map[string]any{}, }, } - res, err := resource.NewResource("proj.dataset.extTable1", bigquery.KindExternalTable, bqStore, tnnt, &metadata, spec) + res, err := resource.NewResource("proj.dataset.extTable1", bigquery.KindExternalTable, bqStore, tnnt, &metadata, spec, nil) assert.Nil(t, err) err = etHandle.Update(ctx, res) @@ -269,7 +269,7 @@ func TestExternalTableHandle(t *testing.T) { }, }, } - res, err := resource.NewResource("proj.dataset.extTable1", bigquery.KindExternalTable, bqStore, tnnt, &metadata, spec) + res, err := resource.NewResource("proj.dataset.extTable1", bigquery.KindExternalTable, bqStore, tnnt, &metadata, spec, nil) assert.Nil(t, err) err = etHandle.Update(ctx, res) diff --git a/ext/store/bigquery/model_test.go b/ext/store/bigquery/model_test.go index a5862e2790..5a96f87e44 100644 --- a/ext/store/bigquery/model_test.go +++ b/ext/store/bigquery/model_test.go @@ -24,7 +24,7 @@ func TestModelHandle(t *testing.T) { Labels: map[string]string{"owner": "optimus"}, } spec := map[string]any{"description": []string{"a", "b"}} - res, err := resource.NewResource("proj.dataset.view1", storebigquery.KindView, bqStore, tnnt, &metadata, spec) + res, err := resource.NewResource("proj.dataset.view1", storebigquery.KindView, bqStore, tnnt, &metadata, spec, nil) assert.Nil(t, err) t.Run("Create", func(t *testing.T) { diff --git a/ext/store/bigquery/routine_test.go b/ext/store/bigquery/routine_test.go index 0b9b7da69a..86299317d7 100644 --- a/ext/store/bigquery/routine_test.go +++ b/ext/store/bigquery/routine_test.go @@ -24,7 +24,7 @@ func TestRoutineHandle(t *testing.T) { Labels: map[string]string{"owner": "optimus"}, } spec := map[string]any{"description": []string{"a", "b"}} - res, err := resource.NewResource("proj.dataset.view1", storebigquery.KindView, bqStore, tnnt, &metadata, spec) + res, err := resource.NewResource("proj.dataset.view1", storebigquery.KindView, bqStore, tnnt, &metadata, spec, nil) assert.Nil(t, err) t.Run("Create", func(t *testing.T) { diff --git a/ext/store/bigquery/table_test.go b/ext/store/bigquery/table_test.go index ce1c9be91c..17b71ec165 100644 --- a/ext/store/bigquery/table_test.go +++ b/ext/store/bigquery/table_test.go @@ -32,7 +32,7 @@ func TestTableHandle(t *testing.T) { tHandle := bigquery.NewTableHandle(table) spec := map[string]any{"description": []string{"a", "b"}} - res, err := resource.NewResource("proj.dataset.table1", bigquery.KindView, bqStore, tnnt, &metadata, spec) + res, err := resource.NewResource("proj.dataset.table1", bigquery.KindView, bqStore, tnnt, &metadata, spec, nil) assert.Nil(t, err) err = tHandle.Create(ctx, res) @@ -47,7 +47,7 @@ func TestTableHandle(t *testing.T) { "description": "test create", "expiration_time": "invalid_date", } - res, err := resource.NewResource("proj.dataset.table1", bigquery.KindView, bqStore, tnnt, &metadata, spec) + res, err := resource.NewResource("proj.dataset.table1", bigquery.KindView, bqStore, tnnt, &metadata, spec, nil) assert.Nil(t, err) err = tHandle.Create(ctx, res) @@ -63,7 +63,7 @@ func TestTableHandle(t *testing.T) { tHandle := bigquery.NewTableHandle(table) spec := map[string]any{"description": "test create"} - res, err := resource.NewResource("proj.dataset.table1", bigquery.KindView, bqStore, tnnt, &metadata, spec) + res, err := resource.NewResource("proj.dataset.table1", bigquery.KindView, bqStore, tnnt, &metadata, spec, nil) assert.Nil(t, err) err = tHandle.Create(ctx, res) @@ -78,7 +78,7 @@ func TestTableHandle(t *testing.T) { tHandle := bigquery.NewTableHandle(table) spec := map[string]any{"description": "test create"} - res, err := resource.NewResource("proj.dataset.table1", bigquery.KindView, bqStore, tnnt, &metadata, spec) + res, err := resource.NewResource("proj.dataset.table1", bigquery.KindView, bqStore, tnnt, &metadata, spec, nil) assert.Nil(t, err) err = tHandle.Create(ctx, res) @@ -125,7 +125,7 @@ func TestTableHandle(t *testing.T) { }, }, } - res, err := resource.NewResource("proj.dataset.table1", bigquery.KindView, bqStore, tnnt, &metadata, spec) + res, err := resource.NewResource("proj.dataset.table1", bigquery.KindView, bqStore, tnnt, &metadata, spec, nil) assert.Nil(t, err) err = tHandle.Create(ctx, res) @@ -152,7 +152,7 @@ func TestTableHandle(t *testing.T) { "type": "hour", }, } - res, err := resource.NewResource("proj.dataset.table1", bigquery.KindView, bqStore, tnnt, &metadata, spec) + res, err := resource.NewResource("proj.dataset.table1", bigquery.KindView, bqStore, tnnt, &metadata, spec, nil) assert.Nil(t, err) err = tHandle.Create(ctx, res) @@ -165,7 +165,7 @@ func TestTableHandle(t *testing.T) { tHandle := bigquery.NewTableHandle(table) spec := map[string]any{"description": []string{"a", "b"}} - res, err := resource.NewResource("proj.dataset.table1", bigquery.KindView, bqStore, tnnt, &metadata, spec) + res, err := resource.NewResource("proj.dataset.table1", bigquery.KindView, bqStore, tnnt, &metadata, spec, nil) assert.Nil(t, err) err = tHandle.Update(ctx, res) @@ -180,7 +180,7 @@ func TestTableHandle(t *testing.T) { "description": "test update", "expiration_time": "invalid_date", } - res, err := resource.NewResource("proj.dataset.table1", bigquery.KindView, bqStore, tnnt, &metadata, spec) + res, err := resource.NewResource("proj.dataset.table1", bigquery.KindView, bqStore, tnnt, &metadata, spec, nil) assert.Nil(t, err) err = tHandle.Update(ctx, res) @@ -196,7 +196,7 @@ func TestTableHandle(t *testing.T) { tHandle := bigquery.NewTableHandle(table) spec := map[string]any{"description": "test update"} - res, err := resource.NewResource("proj.dataset.table1", bigquery.KindView, bqStore, tnnt, &metadata, spec) + res, err := resource.NewResource("proj.dataset.table1", bigquery.KindView, bqStore, tnnt, &metadata, spec, nil) assert.Nil(t, err) err = tHandle.Update(ctx, res) @@ -211,7 +211,7 @@ func TestTableHandle(t *testing.T) { tHandle := bigquery.NewTableHandle(table) spec := map[string]any{"description": "test update"} - res, err := resource.NewResource("proj.dataset.table1", bigquery.KindView, bqStore, tnnt, &metadata, spec) + res, err := resource.NewResource("proj.dataset.table1", bigquery.KindView, bqStore, tnnt, &metadata, spec, nil) assert.Nil(t, err) err = tHandle.Update(ctx, res) @@ -253,7 +253,7 @@ func TestTableHandle(t *testing.T) { "type": "DAY", }, } - res, err := resource.NewResource("proj.dataset.table1", bigquery.KindView, bqStore, tnnt, &metadata, spec) + res, err := resource.NewResource("proj.dataset.table1", bigquery.KindView, bqStore, tnnt, &metadata, spec, nil) assert.Nil(t, err) err = tHandle.Update(ctx, res) diff --git a/ext/store/bigquery/view_test.go b/ext/store/bigquery/view_test.go index ea4dee4096..301cf8e224 100644 --- a/ext/store/bigquery/view_test.go +++ b/ext/store/bigquery/view_test.go @@ -32,7 +32,7 @@ func TestViewHandle(t *testing.T) { vHandle := bigquery.NewViewHandle(v) spec := map[string]any{"description": []string{"a", "b"}} - res, err := resource.NewResource("proj.dataset.view1", bigquery.KindView, bqStore, tnnt, &metadata, spec) + res, err := resource.NewResource("proj.dataset.view1", bigquery.KindView, bqStore, tnnt, &metadata, spec, nil) assert.Nil(t, err) err = vHandle.Create(ctx, res) @@ -48,7 +48,7 @@ func TestViewHandle(t *testing.T) { "expiration_time": "invalid_date", "view_query": "select * from dummy", } - res, err := resource.NewResource("proj.dataset.view1", bigquery.KindView, bqStore, tnnt, &metadata, spec) + res, err := resource.NewResource("proj.dataset.view1", bigquery.KindView, bqStore, tnnt, &metadata, spec, nil) assert.Nil(t, err) err = vHandle.Create(ctx, res) @@ -64,7 +64,7 @@ func TestViewHandle(t *testing.T) { vHandle := bigquery.NewViewHandle(v) spec := map[string]any{"description": "test create"} - res, err := resource.NewResource("proj.dataset.view1", bigquery.KindView, bqStore, tnnt, &metadata, spec) + res, err := resource.NewResource("proj.dataset.view1", bigquery.KindView, bqStore, tnnt, &metadata, spec, nil) assert.Nil(t, err) err = vHandle.Create(ctx, res) @@ -79,7 +79,7 @@ func TestViewHandle(t *testing.T) { vHandle := bigquery.NewViewHandle(v) spec := map[string]any{"description": "test create"} - res, err := resource.NewResource("proj.dataset.view1", bigquery.KindView, bqStore, tnnt, &metadata, spec) + res, err := resource.NewResource("proj.dataset.view1", bigquery.KindView, bqStore, tnnt, &metadata, spec, nil) assert.Nil(t, err) err = vHandle.Create(ctx, res) @@ -98,7 +98,7 @@ func TestViewHandle(t *testing.T) { "expiration_time": time.Now().Format(time.RFC3339), "view_query": "select * from dummy", } - res, err := resource.NewResource("proj.dataset.view1", bigquery.KindView, bqStore, tnnt, &metadata, spec) + res, err := resource.NewResource("proj.dataset.view1", bigquery.KindView, bqStore, tnnt, &metadata, spec, nil) assert.Nil(t, err) err = vHandle.Create(ctx, res) @@ -111,7 +111,7 @@ func TestViewHandle(t *testing.T) { vHandle := bigquery.NewViewHandle(v) spec := map[string]any{"description": []string{"a", "b"}} - res, err := resource.NewResource("proj.dataset.view1", bigquery.KindView, bqStore, tnnt, &metadata, spec) + res, err := resource.NewResource("proj.dataset.view1", bigquery.KindView, bqStore, tnnt, &metadata, spec, nil) assert.Nil(t, err) err = vHandle.Update(ctx, res) @@ -127,7 +127,7 @@ func TestViewHandle(t *testing.T) { "expiration_time": "invalid_date", "view_query": "select * from dummy", } - res, err := resource.NewResource("proj.dataset.view1", bigquery.KindView, bqStore, tnnt, &metadata, spec) + res, err := resource.NewResource("proj.dataset.view1", bigquery.KindView, bqStore, tnnt, &metadata, spec, nil) assert.Nil(t, err) err = vHandle.Update(ctx, res) @@ -143,7 +143,7 @@ func TestViewHandle(t *testing.T) { vHandle := bigquery.NewViewHandle(v) spec := map[string]any{"description": "test update"} - res, err := resource.NewResource("proj.dataset.view1", bigquery.KindView, bqStore, tnnt, &metadata, spec) + res, err := resource.NewResource("proj.dataset.view1", bigquery.KindView, bqStore, tnnt, &metadata, spec, nil) assert.Nil(t, err) err = vHandle.Update(ctx, res) @@ -158,7 +158,7 @@ func TestViewHandle(t *testing.T) { vHandle := bigquery.NewViewHandle(v) spec := map[string]any{"description": "test update"} - res, err := resource.NewResource("proj.dataset.view1", bigquery.KindView, bqStore, tnnt, &metadata, spec) + res, err := resource.NewResource("proj.dataset.view1", bigquery.KindView, bqStore, tnnt, &metadata, spec, nil) assert.Nil(t, err) err = vHandle.Update(ctx, res) @@ -180,7 +180,7 @@ func TestViewHandle(t *testing.T) { "expiration_time": time.Now().Format(time.RFC3339), "view_query": "select * from dummy", } - res, err := resource.NewResource("proj.dataset.view1", bigquery.KindView, bqStore, tnnt, &metadata, spec) + res, err := resource.NewResource("proj.dataset.view1", bigquery.KindView, bqStore, tnnt, &metadata, spec, nil) assert.Nil(t, err) err = vHandle.Update(ctx, res) diff --git a/internal/store/postgres/resource/repository.go b/internal/store/postgres/resource/repository.go index 02a73c5b07..f8c1e559b1 100644 --- a/internal/store/postgres/resource/repository.go +++ b/internal/store/postgres/resource/repository.go @@ -17,7 +17,7 @@ import ( ) const ( - columnsToStore = `full_name, kind, store, status, urn, project_name, namespace_name, metadata, spec, created_at, updated_at` + columnsToStore = `full_name, kind, store, status, urn, project_name, namespace_name, metadata, spec, deprecation, created_at, updated_at` resourceColumns = `id, ` + columnsToStore changelogColumnsToStore = `entity_type, name, project_name, change_type, changes, created_at` @@ -48,9 +48,9 @@ func NewRepository(pool *pgxpool.Pool) *Repository { func (r Repository) Create(ctx context.Context, resourceModel *resource.Resource) error { res := FromResourceToModel(resourceModel) - insertResource := `INSERT INTO resource (` + columnsToStore + `) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, now(), now())` + insertResource := `INSERT INTO resource (` + columnsToStore + `) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, now(), now())` _, err := r.db.Exec(ctx, insertResource, res.FullName, res.Kind, res.Store, res.Status, res.URN, - res.ProjectName, res.NamespaceName, res.Metadata, res.Spec) + res.ProjectName, res.NamespaceName, res.Metadata, res.Spec, res.Deprecated) return errors.WrapIfErr(tenant.EntityNamespace, "error creating resource to database", err) } @@ -140,10 +140,10 @@ func getResourceDiffs(existing, incoming *Resource) ([]Change, error) { func (r Repository) doUpdate(ctx context.Context, resourceModel *resource.Resource) error { res := FromResourceToModel(resourceModel) - updateResource := `UPDATE resource SET kind=$1, status=$2, urn=$3, metadata=$4, spec=$5, updated_at=now() + updateResource := `UPDATE resource SET kind=$1, status=$2, urn=$3, metadata=$4, spec=$5, deprecation=$10, updated_at=now() WHERE full_name=$6 AND store=$7 AND project_name = $8 And namespace_name = $9` tag, err := r.db.Exec(ctx, updateResource, res.Kind, res.Status, res.URN, - res.Metadata, res.Spec, res.FullName, res.Store, res.ProjectName, res.NamespaceName) + res.Metadata, res.Spec, res.FullName, res.Store, res.ProjectName, res.NamespaceName, res.Deprecated) if err != nil { return errors.Wrap(resource.EntityResource, "error updating resource to database", err) } @@ -229,7 +229,7 @@ func (r Repository) ReadByFullName(ctx context.Context, tnnt tenant.Tenant, stor err := r.db.QueryRow(ctx, getResource, args...). Scan(&res.ID, &res.FullName, &res.Kind, &res.Store, &res.Status, &res.URN, - &res.ProjectName, &res.NamespaceName, &res.Metadata, &res.Spec, &res.CreatedAt, &res.UpdatedAt) + &res.ProjectName, &res.NamespaceName, &res.Metadata, &res.Spec, &res.Deprecated, &res.CreatedAt, &res.UpdatedAt) if err != nil { if errors.Is(err, pgx.ErrNoRows) { return nil, errors.NotFound(resource.EntityResource, fmt.Sprintf("no resource: '%s' found for project:%s, namespace:%s ", fullName, tnnt.ProjectName(), tnnt.NamespaceName())) @@ -260,7 +260,7 @@ func (r Repository) ReadAll(ctx context.Context, tnnt tenant.Tenant, store resou for rows.Next() { var res Resource err = rows.Scan(&res.ID, &res.FullName, &res.Kind, &res.Store, &res.Status, &res.URN, - &res.ProjectName, &res.NamespaceName, &res.Metadata, &res.Spec, &res.CreatedAt, &res.UpdatedAt) + &res.ProjectName, &res.NamespaceName, &res.Metadata, &res.Spec, &res.Deprecated, &res.CreatedAt, &res.UpdatedAt) if err != nil { return nil, errors.Wrap(resource.EntityResource, "error in GetAll", err) } diff --git a/internal/store/postgres/resource/resource.go b/internal/store/postgres/resource/resource.go index 333456b0c5..69dbbc0bfa 100644 --- a/internal/store/postgres/resource/resource.go +++ b/internal/store/postgres/resource/resource.go @@ -11,6 +11,12 @@ import ( "github.com/goto/optimus/internal/errors" ) +type Deprecated struct { + Reason string + Date time.Time + ReplacementTable string +} + type Resource struct { ID uuid.UUID @@ -24,6 +30,8 @@ type Resource struct { Metadata json.RawMessage Spec map[string]any + Deprecated json.RawMessage + URN string Status string @@ -34,6 +42,7 @@ type Resource struct { func FromResourceToModel(r *resource.Resource) *Resource { metadata, _ := json.Marshal(r.Metadata()) + deprecation, _ := json.Marshal(r.GetDeprecationInfo()) return &Resource{ FullName: r.FullName(), @@ -45,6 +54,7 @@ func FromResourceToModel(r *resource.Resource) *Resource { Spec: r.Spec(), URN: r.URN().String(), Status: r.Status().String(), + Deprecated: deprecation, } } @@ -62,7 +72,12 @@ func FromModelToResource(r *Resource) (*resource.Resource, error) { return nil, errors.Wrap(resource.EntityResource, "error unmarshalling metadata", err) } - output, err := resource.NewResource(r.FullName, r.Kind, store, tnnt, metadata, r.Spec) + var deprecated *resource.Deprecated + if err := json.Unmarshal(r.Deprecated, &deprecated); err != nil { + return nil, errors.Wrap(resource.EntityResource, "error unmarshalling deprecation info", err) + } + + output, err := resource.NewResource(r.FullName, r.Kind, store, tnnt, metadata, r.Spec, deprecated) if err == nil { output = resource.FromExisting(output, resource.ReplaceStatus(resource.FromStringToStatus(r.Status))) diff --git a/protos/gotocompany/optimus/core/v1beta1/resource.pb.go b/protos/gotocompany/optimus/core/v1beta1/resource.pb.go index 7727b58468..49194934cd 100644 --- a/protos/gotocompany/optimus/core/v1beta1/resource.pb.go +++ b/protos/gotocompany/optimus/core/v1beta1/resource.pb.go @@ -12,6 +12,7 @@ import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" structpb "google.golang.org/protobuf/types/known/structpb" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" reflect "reflect" sync "sync" ) @@ -843,24 +844,88 @@ func (x *ResourceStatus) GetMessage() string { return "" } +type Deprecation struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Reason string `protobuf:"bytes,1,opt,name=reason,proto3" json:"reason,omitempty"` + Date *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=date,proto3" json:"date,omitempty"` + ReplacementTable string `protobuf:"bytes,3,opt,name=replacement_table,json=replacementTable,proto3" json:"replacement_table,omitempty"` +} + +func (x *Deprecation) Reset() { + *x = Deprecation{} + if protoimpl.UnsafeEnabled { + mi := &file_gotocompany_optimus_core_v1beta1_resource_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Deprecation) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Deprecation) ProtoMessage() {} + +func (x *Deprecation) ProtoReflect() protoreflect.Message { + mi := &file_gotocompany_optimus_core_v1beta1_resource_proto_msgTypes[13] + 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 Deprecation.ProtoReflect.Descriptor instead. +func (*Deprecation) Descriptor() ([]byte, []int) { + return file_gotocompany_optimus_core_v1beta1_resource_proto_rawDescGZIP(), []int{13} +} + +func (x *Deprecation) GetReason() string { + if x != nil { + return x.Reason + } + return "" +} + +func (x *Deprecation) GetDate() *timestamppb.Timestamp { + if x != nil { + return x.Date + } + return nil +} + +func (x *Deprecation) GetReplacementTable() string { + if x != nil { + return x.ReplacementTable + } + return "" +} + // ResourceSpecification are datastore specification representation of a resource type ResourceSpecification struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Version int32 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Type string `protobuf:"bytes,4,opt,name=type,proto3" json:"type,omitempty"` - Spec *structpb.Struct `protobuf:"bytes,5,opt,name=spec,proto3" json:"spec,omitempty"` - Assets map[string]string `protobuf:"bytes,6,rep,name=assets,proto3" json:"assets,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - Labels map[string]string `protobuf:"bytes,7,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Version int32 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Type string `protobuf:"bytes,4,opt,name=type,proto3" json:"type,omitempty"` + Spec *structpb.Struct `protobuf:"bytes,5,opt,name=spec,proto3" json:"spec,omitempty"` + Assets map[string]string `protobuf:"bytes,6,rep,name=assets,proto3" json:"assets,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Labels map[string]string `protobuf:"bytes,7,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Deprecation *Deprecation `protobuf:"bytes,8,opt,name=deprecation,proto3" json:"deprecation,omitempty"` } func (x *ResourceSpecification) Reset() { *x = ResourceSpecification{} if protoimpl.UnsafeEnabled { - mi := &file_gotocompany_optimus_core_v1beta1_resource_proto_msgTypes[13] + mi := &file_gotocompany_optimus_core_v1beta1_resource_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -873,7 +938,7 @@ func (x *ResourceSpecification) String() string { func (*ResourceSpecification) ProtoMessage() {} func (x *ResourceSpecification) ProtoReflect() protoreflect.Message { - mi := &file_gotocompany_optimus_core_v1beta1_resource_proto_msgTypes[13] + mi := &file_gotocompany_optimus_core_v1beta1_resource_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -886,7 +951,7 @@ func (x *ResourceSpecification) ProtoReflect() protoreflect.Message { // Deprecated: Use ResourceSpecification.ProtoReflect.Descriptor instead. func (*ResourceSpecification) Descriptor() ([]byte, []int) { - return file_gotocompany_optimus_core_v1beta1_resource_proto_rawDescGZIP(), []int{13} + return file_gotocompany_optimus_core_v1beta1_resource_proto_rawDescGZIP(), []int{14} } func (x *ResourceSpecification) GetVersion() int32 { @@ -931,6 +996,13 @@ func (x *ResourceSpecification) GetLabels() map[string]string { return nil } +func (x *ResourceSpecification) GetDeprecation() *Deprecation { + if x != nil { + return x.Deprecation + } + return nil +} + type ChangeResourceNamespaceRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -946,7 +1018,7 @@ type ChangeResourceNamespaceRequest struct { func (x *ChangeResourceNamespaceRequest) Reset() { *x = ChangeResourceNamespaceRequest{} if protoimpl.UnsafeEnabled { - mi := &file_gotocompany_optimus_core_v1beta1_resource_proto_msgTypes[14] + mi := &file_gotocompany_optimus_core_v1beta1_resource_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -959,7 +1031,7 @@ func (x *ChangeResourceNamespaceRequest) String() string { func (*ChangeResourceNamespaceRequest) ProtoMessage() {} func (x *ChangeResourceNamespaceRequest) ProtoReflect() protoreflect.Message { - mi := &file_gotocompany_optimus_core_v1beta1_resource_proto_msgTypes[14] + mi := &file_gotocompany_optimus_core_v1beta1_resource_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -972,7 +1044,7 @@ func (x *ChangeResourceNamespaceRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ChangeResourceNamespaceRequest.ProtoReflect.Descriptor instead. func (*ChangeResourceNamespaceRequest) Descriptor() ([]byte, []int) { - return file_gotocompany_optimus_core_v1beta1_resource_proto_rawDescGZIP(), []int{14} + return file_gotocompany_optimus_core_v1beta1_resource_proto_rawDescGZIP(), []int{15} } func (x *ChangeResourceNamespaceRequest) GetProjectName() string { @@ -1019,7 +1091,7 @@ type ChangeResourceNamespaceResponse struct { func (x *ChangeResourceNamespaceResponse) Reset() { *x = ChangeResourceNamespaceResponse{} if protoimpl.UnsafeEnabled { - mi := &file_gotocompany_optimus_core_v1beta1_resource_proto_msgTypes[15] + mi := &file_gotocompany_optimus_core_v1beta1_resource_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1032,7 +1104,7 @@ func (x *ChangeResourceNamespaceResponse) String() string { func (*ChangeResourceNamespaceResponse) ProtoMessage() {} func (x *ChangeResourceNamespaceResponse) ProtoReflect() protoreflect.Message { - mi := &file_gotocompany_optimus_core_v1beta1_resource_proto_msgTypes[15] + mi := &file_gotocompany_optimus_core_v1beta1_resource_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1045,7 +1117,7 @@ func (x *ChangeResourceNamespaceResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ChangeResourceNamespaceResponse.ProtoReflect.Descriptor instead. func (*ChangeResourceNamespaceResponse) Descriptor() ([]byte, []int) { - return file_gotocompany_optimus_core_v1beta1_resource_proto_rawDescGZIP(), []int{15} + return file_gotocompany_optimus_core_v1beta1_resource_proto_rawDescGZIP(), []int{16} } type ApplyResourcesRequest struct { @@ -1062,7 +1134,7 @@ type ApplyResourcesRequest struct { func (x *ApplyResourcesRequest) Reset() { *x = ApplyResourcesRequest{} if protoimpl.UnsafeEnabled { - mi := &file_gotocompany_optimus_core_v1beta1_resource_proto_msgTypes[16] + mi := &file_gotocompany_optimus_core_v1beta1_resource_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1075,7 +1147,7 @@ func (x *ApplyResourcesRequest) String() string { func (*ApplyResourcesRequest) ProtoMessage() {} func (x *ApplyResourcesRequest) ProtoReflect() protoreflect.Message { - mi := &file_gotocompany_optimus_core_v1beta1_resource_proto_msgTypes[16] + mi := &file_gotocompany_optimus_core_v1beta1_resource_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1088,7 +1160,7 @@ func (x *ApplyResourcesRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ApplyResourcesRequest.ProtoReflect.Descriptor instead. func (*ApplyResourcesRequest) Descriptor() ([]byte, []int) { - return file_gotocompany_optimus_core_v1beta1_resource_proto_rawDescGZIP(), []int{16} + return file_gotocompany_optimus_core_v1beta1_resource_proto_rawDescGZIP(), []int{17} } func (x *ApplyResourcesRequest) GetProjectName() string { @@ -1130,7 +1202,7 @@ type ApplyResourcesResponse struct { func (x *ApplyResourcesResponse) Reset() { *x = ApplyResourcesResponse{} if protoimpl.UnsafeEnabled { - mi := &file_gotocompany_optimus_core_v1beta1_resource_proto_msgTypes[17] + mi := &file_gotocompany_optimus_core_v1beta1_resource_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1143,7 +1215,7 @@ func (x *ApplyResourcesResponse) String() string { func (*ApplyResourcesResponse) ProtoMessage() {} func (x *ApplyResourcesResponse) ProtoReflect() protoreflect.Message { - mi := &file_gotocompany_optimus_core_v1beta1_resource_proto_msgTypes[17] + mi := &file_gotocompany_optimus_core_v1beta1_resource_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1156,7 +1228,7 @@ func (x *ApplyResourcesResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ApplyResourcesResponse.ProtoReflect.Descriptor instead. func (*ApplyResourcesResponse) Descriptor() ([]byte, []int) { - return file_gotocompany_optimus_core_v1beta1_resource_proto_rawDescGZIP(), []int{17} + return file_gotocompany_optimus_core_v1beta1_resource_proto_rawDescGZIP(), []int{18} } func (x *ApplyResourcesResponse) GetStatuses() []*ApplyResourcesResponse_ResourceStatus { @@ -1181,7 +1253,7 @@ type DeleteResourceRequest struct { func (x *DeleteResourceRequest) Reset() { *x = DeleteResourceRequest{} if protoimpl.UnsafeEnabled { - mi := &file_gotocompany_optimus_core_v1beta1_resource_proto_msgTypes[18] + mi := &file_gotocompany_optimus_core_v1beta1_resource_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1194,7 +1266,7 @@ func (x *DeleteResourceRequest) String() string { func (*DeleteResourceRequest) ProtoMessage() {} func (x *DeleteResourceRequest) ProtoReflect() protoreflect.Message { - mi := &file_gotocompany_optimus_core_v1beta1_resource_proto_msgTypes[18] + mi := &file_gotocompany_optimus_core_v1beta1_resource_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1207,7 +1279,7 @@ func (x *DeleteResourceRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteResourceRequest.ProtoReflect.Descriptor instead. func (*DeleteResourceRequest) Descriptor() ([]byte, []int) { - return file_gotocompany_optimus_core_v1beta1_resource_proto_rawDescGZIP(), []int{18} + return file_gotocompany_optimus_core_v1beta1_resource_proto_rawDescGZIP(), []int{19} } func (x *DeleteResourceRequest) GetProjectName() string { @@ -1256,7 +1328,7 @@ type DeleteResourceResponse struct { func (x *DeleteResourceResponse) Reset() { *x = DeleteResourceResponse{} if protoimpl.UnsafeEnabled { - mi := &file_gotocompany_optimus_core_v1beta1_resource_proto_msgTypes[19] + mi := &file_gotocompany_optimus_core_v1beta1_resource_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1269,7 +1341,7 @@ func (x *DeleteResourceResponse) String() string { func (*DeleteResourceResponse) ProtoMessage() {} func (x *DeleteResourceResponse) ProtoReflect() protoreflect.Message { - mi := &file_gotocompany_optimus_core_v1beta1_resource_proto_msgTypes[19] + mi := &file_gotocompany_optimus_core_v1beta1_resource_proto_msgTypes[20] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1282,7 +1354,7 @@ func (x *DeleteResourceResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteResourceResponse.ProtoReflect.Descriptor instead. func (*DeleteResourceResponse) Descriptor() ([]byte, []int) { - return file_gotocompany_optimus_core_v1beta1_resource_proto_rawDescGZIP(), []int{19} + return file_gotocompany_optimus_core_v1beta1_resource_proto_rawDescGZIP(), []int{20} } func (x *DeleteResourceResponse) GetDownstreamJobs() []string { @@ -1304,7 +1376,7 @@ type GetResourceChangelogsRequest struct { func (x *GetResourceChangelogsRequest) Reset() { *x = GetResourceChangelogsRequest{} if protoimpl.UnsafeEnabled { - mi := &file_gotocompany_optimus_core_v1beta1_resource_proto_msgTypes[20] + mi := &file_gotocompany_optimus_core_v1beta1_resource_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1317,7 +1389,7 @@ func (x *GetResourceChangelogsRequest) String() string { func (*GetResourceChangelogsRequest) ProtoMessage() {} func (x *GetResourceChangelogsRequest) ProtoReflect() protoreflect.Message { - mi := &file_gotocompany_optimus_core_v1beta1_resource_proto_msgTypes[20] + mi := &file_gotocompany_optimus_core_v1beta1_resource_proto_msgTypes[21] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1330,7 +1402,7 @@ func (x *GetResourceChangelogsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetResourceChangelogsRequest.ProtoReflect.Descriptor instead. func (*GetResourceChangelogsRequest) Descriptor() ([]byte, []int) { - return file_gotocompany_optimus_core_v1beta1_resource_proto_rawDescGZIP(), []int{20} + return file_gotocompany_optimus_core_v1beta1_resource_proto_rawDescGZIP(), []int{21} } func (x *GetResourceChangelogsRequest) GetProjectName() string { @@ -1359,7 +1431,7 @@ type ResourceChange struct { func (x *ResourceChange) Reset() { *x = ResourceChange{} if protoimpl.UnsafeEnabled { - mi := &file_gotocompany_optimus_core_v1beta1_resource_proto_msgTypes[21] + mi := &file_gotocompany_optimus_core_v1beta1_resource_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1372,7 +1444,7 @@ func (x *ResourceChange) String() string { func (*ResourceChange) ProtoMessage() {} func (x *ResourceChange) ProtoReflect() protoreflect.Message { - mi := &file_gotocompany_optimus_core_v1beta1_resource_proto_msgTypes[21] + mi := &file_gotocompany_optimus_core_v1beta1_resource_proto_msgTypes[22] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1385,7 +1457,7 @@ func (x *ResourceChange) ProtoReflect() protoreflect.Message { // Deprecated: Use ResourceChange.ProtoReflect.Descriptor instead. func (*ResourceChange) Descriptor() ([]byte, []int) { - return file_gotocompany_optimus_core_v1beta1_resource_proto_rawDescGZIP(), []int{21} + return file_gotocompany_optimus_core_v1beta1_resource_proto_rawDescGZIP(), []int{22} } func (x *ResourceChange) GetAttributeName() string { @@ -1415,7 +1487,7 @@ type ResourceChangelog struct { func (x *ResourceChangelog) Reset() { *x = ResourceChangelog{} if protoimpl.UnsafeEnabled { - mi := &file_gotocompany_optimus_core_v1beta1_resource_proto_msgTypes[22] + mi := &file_gotocompany_optimus_core_v1beta1_resource_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1428,7 +1500,7 @@ func (x *ResourceChangelog) String() string { func (*ResourceChangelog) ProtoMessage() {} func (x *ResourceChangelog) ProtoReflect() protoreflect.Message { - mi := &file_gotocompany_optimus_core_v1beta1_resource_proto_msgTypes[22] + mi := &file_gotocompany_optimus_core_v1beta1_resource_proto_msgTypes[23] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1441,7 +1513,7 @@ func (x *ResourceChangelog) ProtoReflect() protoreflect.Message { // Deprecated: Use ResourceChangelog.ProtoReflect.Descriptor instead. func (*ResourceChangelog) Descriptor() ([]byte, []int) { - return file_gotocompany_optimus_core_v1beta1_resource_proto_rawDescGZIP(), []int{22} + return file_gotocompany_optimus_core_v1beta1_resource_proto_rawDescGZIP(), []int{23} } func (x *ResourceChangelog) GetEventType() string { @@ -1476,7 +1548,7 @@ type GetResourceChangelogsResponse struct { func (x *GetResourceChangelogsResponse) Reset() { *x = GetResourceChangelogsResponse{} if protoimpl.UnsafeEnabled { - mi := &file_gotocompany_optimus_core_v1beta1_resource_proto_msgTypes[23] + mi := &file_gotocompany_optimus_core_v1beta1_resource_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1489,7 +1561,7 @@ func (x *GetResourceChangelogsResponse) String() string { func (*GetResourceChangelogsResponse) ProtoMessage() {} func (x *GetResourceChangelogsResponse) ProtoReflect() protoreflect.Message { - mi := &file_gotocompany_optimus_core_v1beta1_resource_proto_msgTypes[23] + mi := &file_gotocompany_optimus_core_v1beta1_resource_proto_msgTypes[24] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1502,7 +1574,7 @@ func (x *GetResourceChangelogsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetResourceChangelogsResponse.ProtoReflect.Descriptor instead. func (*GetResourceChangelogsResponse) Descriptor() ([]byte, []int) { - return file_gotocompany_optimus_core_v1beta1_resource_proto_rawDescGZIP(), []int{23} + return file_gotocompany_optimus_core_v1beta1_resource_proto_rawDescGZIP(), []int{24} } func (x *GetResourceChangelogsResponse) GetHistory() []*ResourceChangelog { @@ -1525,7 +1597,7 @@ type ApplyResourcesResponse_ResourceStatus struct { func (x *ApplyResourcesResponse_ResourceStatus) Reset() { *x = ApplyResourcesResponse_ResourceStatus{} if protoimpl.UnsafeEnabled { - mi := &file_gotocompany_optimus_core_v1beta1_resource_proto_msgTypes[26] + mi := &file_gotocompany_optimus_core_v1beta1_resource_proto_msgTypes[27] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1538,7 +1610,7 @@ func (x *ApplyResourcesResponse_ResourceStatus) String() string { func (*ApplyResourcesResponse_ResourceStatus) ProtoMessage() {} func (x *ApplyResourcesResponse_ResourceStatus) ProtoReflect() protoreflect.Message { - mi := &file_gotocompany_optimus_core_v1beta1_resource_proto_msgTypes[26] + mi := &file_gotocompany_optimus_core_v1beta1_resource_proto_msgTypes[27] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1551,7 +1623,7 @@ func (x *ApplyResourcesResponse_ResourceStatus) ProtoReflect() protoreflect.Mess // Deprecated: Use ApplyResourcesResponse_ResourceStatus.ProtoReflect.Descriptor instead. func (*ApplyResourcesResponse_ResourceStatus) Descriptor() ([]byte, []int) { - return file_gotocompany_optimus_core_v1beta1_resource_proto_rawDescGZIP(), []int{17, 0} + return file_gotocompany_optimus_core_v1beta1_resource_proto_rawDescGZIP(), []int{18, 0} } func (x *ApplyResourcesResponse_ResourceStatus) GetResourceName() string { @@ -1587,190 +1659,231 @@ var file_gotocompany_optimus_core_v1beta1_resource_proto_rawDesc = []byte{ 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, - 0x2d, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2f, 0x6f, 0x70, 0x74, - 0x69, 0x6d, 0x75, 0x73, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x61, - 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e, - 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xec, - 0x01, 0x0a, 0x22, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, - 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, - 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x64, 0x61, 0x74, 0x61, - 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0d, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, - 0x55, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, - 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x70, - 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x72, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, - 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, - 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x71, 0x0a, - 0x23, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, - 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x44, 0x0a, 0x0a, 0x6c, 0x6f, 0x67, 0x5f, 0x73, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, - 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, - 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x52, - 0x09, 0x6c, 0x6f, 0x67, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x4a, 0x04, 0x08, 0x01, 0x10, 0x05, - 0x22, 0x93, 0x01, 0x0a, 0x20, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, - 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, - 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x64, 0x61, 0x74, 0x61, - 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0d, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, - 0x25, 0x0a, 0x0e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, - 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x7a, 0x0a, 0x21, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x55, 0x0a, 0x09, 0x72, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x37, + 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x1a, 0x2d, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2f, 0x6f, 0x70, + 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, 0x70, 0x65, 0x6e, + 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e, + 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, + 0xec, 0x01, 0x0a, 0x22, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, + 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, + 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x64, 0x61, 0x74, + 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0d, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x4e, 0x61, 0x6d, 0x65, + 0x12, 0x55, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x03, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, + 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, + 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x72, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x6e, 0x61, 0x6d, 0x65, 0x73, + 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0d, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x71, + 0x0a, 0x23, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x44, 0x0a, 0x0a, 0x6c, 0x6f, 0x67, 0x5f, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x67, 0x6f, 0x74, 0x6f, + 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, + 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x6f, 0x67, + 0x52, 0x09, 0x6c, 0x6f, 0x67, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x4a, 0x04, 0x08, 0x01, 0x10, + 0x05, 0x22, 0x93, 0x01, 0x0a, 0x20, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, + 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, + 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x64, 0x61, 0x74, + 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0d, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x4e, 0x61, 0x6d, 0x65, + 0x12, 0x25, 0x0a, 0x0e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, + 0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x7a, 0x0a, 0x21, 0x4c, 0x69, 0x73, 0x74, 0x52, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x55, 0x0a, 0x09, + 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x37, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, + 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x70, 0x65, 0x63, 0x69, + 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x73, 0x22, 0xdd, 0x01, 0x0a, 0x15, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, + 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, + 0x12, 0x25, 0x0a, 0x0e, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, + 0x6f, 0x72, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x53, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x67, 0x6f, 0x74, 0x6f, + 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, + 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x25, 0x0a, 0x0e, + 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4e, + 0x61, 0x6d, 0x65, 0x22, 0x4c, 0x0a, 0x16, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, + 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, + 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x22, 0xab, 0x01, 0x0a, 0x13, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, + 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, + 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x4e, + 0x61, 0x6d, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x6e, 0x61, 0x6d, 0x65, + 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0d, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x22, + 0x9f, 0x01, 0x0a, 0x14, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, + 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, + 0x73, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x53, 0x0a, 0x08, + 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, - 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x73, 0x22, 0xdd, 0x01, 0x0a, 0x15, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, - 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, - 0x25, 0x0a, 0x0e, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, - 0x72, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x53, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, - 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, - 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x6e, - 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4e, 0x61, - 0x6d, 0x65, 0x22, 0x4c, 0x0a, 0x16, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x22, 0xdd, 0x01, 0x0a, 0x15, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x70, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, + 0x0a, 0x0e, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, + 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x53, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, + 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, + 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x6e, 0x61, + 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, + 0x65, 0x22, 0x4c, 0x0a, 0x16, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, + 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, + 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, + 0xdf, 0x01, 0x0a, 0x15, 0x55, 0x70, 0x73, 0x65, 0x72, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, + 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, + 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x4e, + 0x61, 0x6d, 0x65, 0x12, 0x55, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, + 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, + 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, + 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x6e, 0x61, + 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, + 0x65, 0x22, 0xd4, 0x01, 0x0a, 0x16, 0x55, 0x70, 0x73, 0x65, 0x72, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x22, 0xab, 0x01, 0x0a, 0x13, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x6a, - 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, - 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x64, - 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0d, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x4e, 0x61, - 0x6d, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x6e, 0x61, 0x6d, 0x65, 0x73, - 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0d, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x9f, - 0x01, 0x0a, 0x14, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, - 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, - 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x53, 0x0a, 0x08, 0x72, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x37, 0x2e, - 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, - 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x22, 0xdd, 0x01, 0x0a, 0x15, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, + 0x12, 0x4a, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x30, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, + 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x12, 0x3a, 0x0a, 0x19, + 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x66, 0x75, 0x6c, 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, + 0x17, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x66, 0x75, 0x6c, 0x52, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x22, 0x67, 0x0a, 0x0e, 0x52, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, + 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x22, 0x82, 0x01, 0x0a, 0x0b, 0x44, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x2e, 0x0a, 0x04, 0x64, 0x61, 0x74, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x52, 0x04, 0x64, 0x61, 0x74, 0x65, 0x12, 0x2b, 0x0a, 0x11, 0x72, 0x65, 0x70, + 0x6c, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x6e, + 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x22, 0x8d, 0x04, 0x0a, 0x15, 0x52, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, + 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, + 0x70, 0x65, 0x12, 0x2b, 0x0a, 0x04, 0x73, 0x70, 0x65, 0x63, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x04, 0x73, 0x70, 0x65, 0x63, 0x12, + 0x5b, 0x0a, 0x06, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x43, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, + 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x70, 0x65, 0x63, 0x69, + 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x45, + 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x12, 0x5b, 0x0a, 0x06, + 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x43, 0x2e, 0x67, + 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, + 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, + 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x4f, 0x0a, 0x0b, 0x64, 0x65, 0x70, + 0x72, 0x65, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, + 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, + 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x44, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x64, + 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x39, 0x0a, 0x0b, 0x41, 0x73, + 0x73, 0x65, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x39, 0x0a, 0x0b, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, + 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, + 0x4a, 0x04, 0x08, 0x03, 0x10, 0x04, 0x22, 0xe4, 0x01, 0x0a, 0x1e, 0x43, 0x68, 0x61, 0x6e, 0x67, + 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, + 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, + 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, + 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4e, + 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, + 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x64, 0x61, 0x74, + 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, + 0x2c, 0x0a, 0x12, 0x6e, 0x65, 0x77, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, + 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x6e, 0x65, 0x77, + 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x21, 0x0a, + 0x1f, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4e, + 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0xaf, 0x01, 0x0a, 0x15, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, - 0x0e, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, - 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x53, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, - 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, - 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x6e, 0x61, 0x6d, - 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0d, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, - 0x22, 0x4c, 0x0a, 0x16, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, - 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, - 0x63, 0x65, 0x73, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0xdf, - 0x01, 0x0a, 0x15, 0x55, 0x70, 0x73, 0x65, 0x72, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x6a, - 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, - 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x64, - 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0d, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x4e, 0x61, - 0x6d, 0x65, 0x12, 0x55, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, - 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, - 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, - 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x6e, 0x61, 0x6d, - 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0d, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, - 0x22, 0xd4, 0x01, 0x0a, 0x16, 0x55, 0x70, 0x73, 0x65, 0x72, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, - 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, - 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, - 0x4a, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x30, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, - 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x12, 0x3a, 0x0a, 0x19, 0x73, - 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x66, 0x75, 0x6c, 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x17, - 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x66, 0x75, 0x6c, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x22, 0x67, 0x0a, 0x0e, 0x52, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x16, - 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, - 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x22, 0xbc, 0x03, 0x0a, 0x15, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x70, 0x65, - 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x76, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x2b, 0x0a, 0x04, - 0x73, 0x70, 0x65, 0x63, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, - 0x75, 0x63, 0x74, 0x52, 0x04, 0x73, 0x70, 0x65, 0x63, 0x12, 0x5b, 0x0a, 0x06, 0x61, 0x73, 0x73, - 0x65, 0x74, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x43, 0x2e, 0x67, 0x6f, 0x74, 0x6f, - 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, - 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x2e, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, - 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x12, 0x5b, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, - 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x43, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, - 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, - 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, - 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x6c, 0x61, 0x62, - 0x65, 0x6c, 0x73, 0x1a, 0x39, 0x0a, 0x0b, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x39, - 0x0a, 0x0b, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, - 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, - 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x4a, 0x04, 0x08, 0x03, 0x10, 0x04, 0x22, - 0xe4, 0x01, 0x0a, 0x1e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, - 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, - 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, - 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, - 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x4e, - 0x61, 0x6d, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x2c, 0x0a, 0x12, 0x6e, 0x65, 0x77, 0x5f, - 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x6e, 0x65, 0x77, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, - 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x21, 0x0a, 0x1f, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, - 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xaf, 0x01, 0x0a, 0x15, 0x41, 0x70, - 0x70, 0x6c, 0x79, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x0e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, + 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, + 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x64, 0x61, + 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x72, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x04, 0x20, + 0x03, 0x28, 0x09, 0x52, 0x0d, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4e, 0x61, 0x6d, + 0x65, 0x73, 0x22, 0xe4, 0x01, 0x0a, 0x16, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x52, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x63, 0x0a, + 0x08, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x47, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, + 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x08, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x65, 0x73, 0x1a, 0x65, 0x0a, 0x0e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x22, 0xc3, 0x01, 0x0a, 0x15, 0x44, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, @@ -1778,230 +1891,204 @@ var file_gotocompany_optimus_core_v1beta1_resource_proto_rawDesc = []byte{ 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, - 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x72, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x22, 0xe4, 0x01, 0x0a, 0x16, - 0x41, 0x70, 0x70, 0x6c, 0x79, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x63, 0x0a, 0x08, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x47, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, + 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x6f, 0x72, + 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x22, + 0x41, 0x0a, 0x16, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x64, 0x6f, 0x77, + 0x6e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x5f, 0x6a, 0x6f, 0x62, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x09, 0x52, 0x0e, 0x64, 0x6f, 0x77, 0x6e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x4a, 0x6f, + 0x62, 0x73, 0x22, 0x66, 0x0a, 0x1c, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, + 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x4b, 0x0a, 0x0e, 0x52, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x25, 0x0a, 0x0e, + 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x4e, + 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x69, 0x66, 0x66, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x64, 0x69, 0x66, 0x66, 0x22, 0x9a, 0x01, 0x0a, 0x11, 0x52, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x67, 0x12, 0x1d, 0x0a, + 0x0a, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x09, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1c, 0x0a, 0x09, + 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x48, 0x0a, 0x06, 0x63, 0x68, + 0x61, 0x6e, 0x67, 0x65, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x67, 0x6f, 0x74, + 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, + 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x06, 0x63, 0x68, + 0x61, 0x6e, 0x67, 0x65, 0x22, 0x6e, 0x0a, 0x1d, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x67, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4d, 0x0a, 0x07, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, + 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, + 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x67, 0x52, 0x07, 0x68, 0x69, 0x73, + 0x74, 0x6f, 0x72, 0x79, 0x32, 0xea, 0x12, 0x0a, 0x0f, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0xb0, 0x01, 0x0a, 0x1b, 0x44, 0x65, 0x70, + 0x6c, 0x6f, 0x79, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x70, 0x65, 0x63, 0x69, + 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x44, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, - 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x41, 0x70, 0x70, 0x6c, - 0x79, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x52, 0x08, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x65, 0x73, 0x1a, 0x65, 0x0a, 0x0e, 0x52, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x23, 0x0a, - 0x0d, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4e, 0x61, - 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, - 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x61, 0x73, - 0x6f, 0x6e, 0x22, 0xc3, 0x01, 0x0a, 0x15, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, - 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, - 0x25, 0x0a, 0x0e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, - 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, - 0x6f, 0x72, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, - 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x23, 0x0a, - 0x0d, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4e, 0x61, - 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x22, 0x41, 0x0a, 0x16, 0x44, 0x65, 0x6c, 0x65, - 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x64, 0x6f, 0x77, 0x6e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, - 0x5f, 0x6a, 0x6f, 0x62, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0e, 0x64, 0x6f, 0x77, - 0x6e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x4a, 0x6f, 0x62, 0x73, 0x22, 0x66, 0x0a, 0x1c, 0x47, - 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, - 0x6c, 0x6f, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x70, - 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x23, - 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4e, - 0x61, 0x6d, 0x65, 0x22, 0x4b, 0x0a, 0x0e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x43, - 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, - 0x74, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x61, - 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, - 0x64, 0x69, 0x66, 0x66, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x69, 0x66, 0x66, - 0x22, 0x9a, 0x01, 0x0a, 0x11, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x43, 0x68, 0x61, - 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x67, 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, - 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x65, 0x76, 0x65, 0x6e, - 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, - 0x6d, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, - 0x61, 0x6d, 0x70, 0x12, 0x48, 0x0a, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x03, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, - 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x43, - 0x68, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x22, 0x6e, 0x0a, - 0x1d, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x43, 0x68, 0x61, 0x6e, - 0x67, 0x65, 0x6c, 0x6f, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4d, - 0x0a, 0x07, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x33, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, - 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, - 0x65, 0x6c, 0x6f, 0x67, 0x52, 0x07, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x32, 0xea, 0x12, - 0x0a, 0x0f, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x12, 0xb0, 0x01, 0x0a, 0x1b, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x52, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x12, 0x44, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, - 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x52, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x45, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, - 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, - 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6c, 0x6f, - 0x79, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, - 0x28, 0x01, 0x30, 0x01, 0x12, 0x8c, 0x02, 0x0a, 0x19, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x12, 0x42, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, - 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x43, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, + 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6c, + 0x6f, 0x79, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x45, + 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, + 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x12, 0x8c, 0x02, 0x0a, 0x19, + 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x70, 0x65, 0x63, + 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x42, 0x2e, 0x67, 0x6f, 0x74, 0x6f, + 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, + 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, + 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x43, 0x2e, + 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, + 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x70, 0x65, + 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x66, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x60, 0x12, 0x5e, 0x2f, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x7b, 0x70, 0x72, + 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x6e, 0x61, 0x6d, 0x65, + 0x73, 0x70, 0x61, 0x63, 0x65, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, + 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, + 0x2f, 0x7b, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, + 0x7d, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0xee, 0x01, 0x0a, 0x0e, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x37, 0x2e, + 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, + 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x38, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, - 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x66, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x60, 0x12, 0x5e, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x72, + 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x69, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x63, 0x3a, 0x01, 0x2a, 0x22, 0x5e, 0x2f, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x7b, 0x70, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x6e, 0x61, 0x6d, + 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, + 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, + 0x65, 0x2f, 0x7b, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x6e, 0x61, 0x6d, + 0x65, 0x7d, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0xf5, 0x01, 0x0a, 0x0c, + 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x35, 0x2e, 0x67, + 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, + 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, + 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x36, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, + 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x76, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x70, 0x12, 0x6e, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x7b, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x12, 0xee, 0x01, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, + 0x72, 0x63, 0x65, 0x2f, 0x7b, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6e, 0x61, + 0x6d, 0x65, 0x7d, 0x12, 0xee, 0x01, 0x0a, 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x37, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, - 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x38, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x61, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x69, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x63, 0x3a, 0x01, 0x2a, 0x22, 0x5e, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, + 0x63, 0x3a, 0x01, 0x2a, 0x1a, 0x5e, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x7b, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x72, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x12, 0xf5, 0x01, 0x0a, 0x0c, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x35, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, - 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x36, 0x2e, 0x67, - 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, - 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, - 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x76, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x70, 0x12, 0x6e, 0x2f, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x7b, - 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x6e, 0x61, - 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, - 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, - 0x72, 0x65, 0x2f, 0x7b, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x6e, 0x61, - 0x6d, 0x65, 0x7d, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2f, 0x7b, 0x72, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x12, 0xee, 0x01, 0x0a, - 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, - 0x37, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, - 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x38, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, - 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, - 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x69, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x63, 0x3a, 0x01, 0x2a, 0x1a, 0x5e, 0x2f, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, - 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x6e, - 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, - 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, - 0x6f, 0x72, 0x65, 0x2f, 0x7b, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x6e, - 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0xf6, 0x01, - 0x0a, 0x0e, 0x55, 0x70, 0x73, 0x65, 0x72, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x12, 0x37, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x12, 0xf6, 0x01, 0x0a, 0x0e, 0x55, 0x70, 0x73, 0x65, 0x72, 0x74, 0x52, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x37, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, + 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, + 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x73, 0x65, 0x72, + 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x38, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x73, 0x65, 0x72, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x71, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x6b, 0x3a, 0x01, 0x2a, 0x22, 0x66, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, + 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, + 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, + 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, + 0x7d, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x7b, 0x64, 0x61, 0x74, + 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x72, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2d, 0x75, 0x70, 0x73, 0x65, 0x72, 0x74, 0x12, 0xfb, 0x01, + 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x12, 0x37, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, + 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x38, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, - 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x73, - 0x65, 0x72, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x71, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x6b, 0x3a, 0x01, 0x2a, 0x22, 0x66, - 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, - 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, - 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, - 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x73, - 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x7b, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, - 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2d, - 0x75, 0x70, 0x73, 0x65, 0x72, 0x74, 0x12, 0xfb, 0x01, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74, - 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x37, 0x2e, 0x67, 0x6f, 0x74, 0x6f, - 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x6c, - 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x38, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, - 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x76, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x70, 0x2a, 0x6e, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, - 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, - 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2f, - 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, - 0x2f, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x7b, 0x64, 0x61, 0x74, 0x61, - 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x72, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x2f, 0x7b, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6e, - 0x61, 0x6d, 0x65, 0x7d, 0x12, 0xe4, 0x01, 0x0a, 0x17, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x52, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, - 0x12, 0x40, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, - 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x41, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, - 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x44, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3e, 0x3a, 0x01, 0x2a, - 0x22, 0x39, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, - 0x63, 0x74, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, - 0x7d, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x2d, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x2d, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0xf5, 0x01, 0x0a, 0x0e, - 0x41, 0x70, 0x70, 0x6c, 0x79, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x37, + 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x76, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x70, 0x2a, 0x6e, 0x2f, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x7b, 0x70, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x6e, 0x61, 0x6d, + 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, + 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, + 0x65, 0x2f, 0x7b, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x6e, 0x61, 0x6d, + 0x65, 0x7d, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2f, 0x7b, 0x72, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x12, 0xe4, 0x01, 0x0a, 0x17, + 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4e, 0x61, + 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x40, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, + 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, + 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, + 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, + 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x41, 0x2e, 0x67, 0x6f, 0x74, 0x6f, + 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, + 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x68, 0x61, + 0x6e, 0x67, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x73, + 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x44, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x3e, 0x3a, 0x01, 0x2a, 0x22, 0x39, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, + 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x2d, + 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2d, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, + 0x63, 0x65, 0x12, 0xf5, 0x01, 0x0a, 0x0e, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x52, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x37, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, + 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x52, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x38, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x38, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, - 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, - 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x41, 0x70, 0x70, 0x6c, 0x79, - 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x70, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x6a, 0x3a, 0x01, 0x2a, 0x22, 0x65, 0x2f, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x7b, - 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x6e, 0x61, - 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, - 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, - 0x72, 0x65, 0x2f, 0x7b, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x6e, 0x61, - 0x6d, 0x65, 0x7d, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2d, 0x61, 0x70, - 0x70, 0x6c, 0x79, 0x12, 0xe4, 0x01, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x67, 0x73, 0x12, 0x3e, 0x2e, - 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, - 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x43, 0x68, 0x61, 0x6e, - 0x67, 0x65, 0x6c, 0x6f, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3f, 0x2e, - 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, - 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x43, 0x68, 0x61, 0x6e, - 0x67, 0x65, 0x6c, 0x6f, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4a, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x44, 0x12, 0x42, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, - 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x2f, 0x7b, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, - 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x67, 0x42, 0xa4, 0x01, 0x0a, 0x1e, 0x63, - 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x6e, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x42, 0x16, 0x52, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4d, 0x61, - 0x6e, 0x61, 0x67, 0x65, 0x72, 0x50, 0x01, 0x5a, 0x1e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x6e, 0x2f, - 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x92, 0x41, 0x47, 0x12, 0x05, 0x32, 0x03, 0x30, 0x2e, - 0x31, 0x1a, 0x0e, 0x31, 0x32, 0x37, 0x2e, 0x30, 0x2e, 0x30, 0x2e, 0x31, 0x3a, 0x39, 0x31, 0x30, - 0x30, 0x22, 0x04, 0x2f, 0x61, 0x70, 0x69, 0x2a, 0x01, 0x01, 0x72, 0x25, 0x0a, 0x23, 0x4f, 0x70, - 0x74, 0x69, 0x6d, 0x75, 0x73, 0x20, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x4d, - 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x70, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x6a, + 0x3a, 0x01, 0x2a, 0x22, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x72, + 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, + 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2f, 0x7b, + 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, + 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x7b, 0x64, 0x61, 0x74, 0x61, 0x73, + 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x73, 0x2d, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x12, 0xe4, 0x01, 0x0a, 0x15, 0x47, + 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, + 0x6c, 0x6f, 0x67, 0x73, 0x12, 0x3e, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, + 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x67, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3f, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, + 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x67, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x44, 0x12, 0x42, 0x2f, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, + 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x72, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2f, 0x7b, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, + 0x67, 0x42, 0xa4, 0x01, 0x0a, 0x1e, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, + 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x6e, 0x2e, 0x6f, 0x70, 0x74, + 0x69, 0x6d, 0x75, 0x73, 0x42, 0x16, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x50, 0x01, 0x5a, 0x1e, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x74, 0x6f, 0x2f, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x6e, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x92, 0x41, + 0x47, 0x12, 0x05, 0x32, 0x03, 0x30, 0x2e, 0x31, 0x1a, 0x0e, 0x31, 0x32, 0x37, 0x2e, 0x30, 0x2e, + 0x30, 0x2e, 0x31, 0x3a, 0x39, 0x31, 0x30, 0x30, 0x22, 0x04, 0x2f, 0x61, 0x70, 0x69, 0x2a, 0x01, + 0x01, 0x72, 0x25, 0x0a, 0x23, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x20, 0x52, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, + 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -2016,7 +2103,7 @@ func file_gotocompany_optimus_core_v1beta1_resource_proto_rawDescGZIP() []byte { return file_gotocompany_optimus_core_v1beta1_resource_proto_rawDescData } -var file_gotocompany_optimus_core_v1beta1_resource_proto_msgTypes = make([]protoimpl.MessageInfo, 27) +var file_gotocompany_optimus_core_v1beta1_resource_proto_msgTypes = make([]protoimpl.MessageInfo, 28) var file_gotocompany_optimus_core_v1beta1_resource_proto_goTypes = []interface{}{ (*DeployResourceSpecificationRequest)(nil), // 0: gotocompany.optimus.core.v1beta1.DeployResourceSpecificationRequest (*DeployResourceSpecificationResponse)(nil), // 1: gotocompany.optimus.core.v1beta1.DeployResourceSpecificationResponse @@ -2031,63 +2118,67 @@ var file_gotocompany_optimus_core_v1beta1_resource_proto_goTypes = []interface{} (*UpsertResourceRequest)(nil), // 10: gotocompany.optimus.core.v1beta1.UpsertResourceRequest (*UpsertResourceResponse)(nil), // 11: gotocompany.optimus.core.v1beta1.UpsertResourceResponse (*ResourceStatus)(nil), // 12: gotocompany.optimus.core.v1beta1.ResourceStatus - (*ResourceSpecification)(nil), // 13: gotocompany.optimus.core.v1beta1.ResourceSpecification - (*ChangeResourceNamespaceRequest)(nil), // 14: gotocompany.optimus.core.v1beta1.ChangeResourceNamespaceRequest - (*ChangeResourceNamespaceResponse)(nil), // 15: gotocompany.optimus.core.v1beta1.ChangeResourceNamespaceResponse - (*ApplyResourcesRequest)(nil), // 16: gotocompany.optimus.core.v1beta1.ApplyResourcesRequest - (*ApplyResourcesResponse)(nil), // 17: gotocompany.optimus.core.v1beta1.ApplyResourcesResponse - (*DeleteResourceRequest)(nil), // 18: gotocompany.optimus.core.v1beta1.DeleteResourceRequest - (*DeleteResourceResponse)(nil), // 19: gotocompany.optimus.core.v1beta1.DeleteResourceResponse - (*GetResourceChangelogsRequest)(nil), // 20: gotocompany.optimus.core.v1beta1.GetResourceChangelogsRequest - (*ResourceChange)(nil), // 21: gotocompany.optimus.core.v1beta1.ResourceChange - (*ResourceChangelog)(nil), // 22: gotocompany.optimus.core.v1beta1.ResourceChangelog - (*GetResourceChangelogsResponse)(nil), // 23: gotocompany.optimus.core.v1beta1.GetResourceChangelogsResponse - nil, // 24: gotocompany.optimus.core.v1beta1.ResourceSpecification.AssetsEntry - nil, // 25: gotocompany.optimus.core.v1beta1.ResourceSpecification.LabelsEntry - (*ApplyResourcesResponse_ResourceStatus)(nil), // 26: gotocompany.optimus.core.v1beta1.ApplyResourcesResponse.ResourceStatus - (*Log)(nil), // 27: gotocompany.optimus.core.v1beta1.Log - (*structpb.Struct)(nil), // 28: google.protobuf.Struct + (*Deprecation)(nil), // 13: gotocompany.optimus.core.v1beta1.Deprecation + (*ResourceSpecification)(nil), // 14: gotocompany.optimus.core.v1beta1.ResourceSpecification + (*ChangeResourceNamespaceRequest)(nil), // 15: gotocompany.optimus.core.v1beta1.ChangeResourceNamespaceRequest + (*ChangeResourceNamespaceResponse)(nil), // 16: gotocompany.optimus.core.v1beta1.ChangeResourceNamespaceResponse + (*ApplyResourcesRequest)(nil), // 17: gotocompany.optimus.core.v1beta1.ApplyResourcesRequest + (*ApplyResourcesResponse)(nil), // 18: gotocompany.optimus.core.v1beta1.ApplyResourcesResponse + (*DeleteResourceRequest)(nil), // 19: gotocompany.optimus.core.v1beta1.DeleteResourceRequest + (*DeleteResourceResponse)(nil), // 20: gotocompany.optimus.core.v1beta1.DeleteResourceResponse + (*GetResourceChangelogsRequest)(nil), // 21: gotocompany.optimus.core.v1beta1.GetResourceChangelogsRequest + (*ResourceChange)(nil), // 22: gotocompany.optimus.core.v1beta1.ResourceChange + (*ResourceChangelog)(nil), // 23: gotocompany.optimus.core.v1beta1.ResourceChangelog + (*GetResourceChangelogsResponse)(nil), // 24: gotocompany.optimus.core.v1beta1.GetResourceChangelogsResponse + nil, // 25: gotocompany.optimus.core.v1beta1.ResourceSpecification.AssetsEntry + nil, // 26: gotocompany.optimus.core.v1beta1.ResourceSpecification.LabelsEntry + (*ApplyResourcesResponse_ResourceStatus)(nil), // 27: gotocompany.optimus.core.v1beta1.ApplyResourcesResponse.ResourceStatus + (*Log)(nil), // 28: gotocompany.optimus.core.v1beta1.Log + (*timestamppb.Timestamp)(nil), // 29: google.protobuf.Timestamp + (*structpb.Struct)(nil), // 30: google.protobuf.Struct } var file_gotocompany_optimus_core_v1beta1_resource_proto_depIdxs = []int32{ - 13, // 0: gotocompany.optimus.core.v1beta1.DeployResourceSpecificationRequest.resources:type_name -> gotocompany.optimus.core.v1beta1.ResourceSpecification - 27, // 1: gotocompany.optimus.core.v1beta1.DeployResourceSpecificationResponse.log_status:type_name -> gotocompany.optimus.core.v1beta1.Log - 13, // 2: gotocompany.optimus.core.v1beta1.ListResourceSpecificationResponse.resources:type_name -> gotocompany.optimus.core.v1beta1.ResourceSpecification - 13, // 3: gotocompany.optimus.core.v1beta1.CreateResourceRequest.resource:type_name -> gotocompany.optimus.core.v1beta1.ResourceSpecification - 13, // 4: gotocompany.optimus.core.v1beta1.ReadResourceResponse.resource:type_name -> gotocompany.optimus.core.v1beta1.ResourceSpecification - 13, // 5: gotocompany.optimus.core.v1beta1.UpdateResourceRequest.resource:type_name -> gotocompany.optimus.core.v1beta1.ResourceSpecification - 13, // 6: gotocompany.optimus.core.v1beta1.UpsertResourceRequest.resources:type_name -> gotocompany.optimus.core.v1beta1.ResourceSpecification + 14, // 0: gotocompany.optimus.core.v1beta1.DeployResourceSpecificationRequest.resources:type_name -> gotocompany.optimus.core.v1beta1.ResourceSpecification + 28, // 1: gotocompany.optimus.core.v1beta1.DeployResourceSpecificationResponse.log_status:type_name -> gotocompany.optimus.core.v1beta1.Log + 14, // 2: gotocompany.optimus.core.v1beta1.ListResourceSpecificationResponse.resources:type_name -> gotocompany.optimus.core.v1beta1.ResourceSpecification + 14, // 3: gotocompany.optimus.core.v1beta1.CreateResourceRequest.resource:type_name -> gotocompany.optimus.core.v1beta1.ResourceSpecification + 14, // 4: gotocompany.optimus.core.v1beta1.ReadResourceResponse.resource:type_name -> gotocompany.optimus.core.v1beta1.ResourceSpecification + 14, // 5: gotocompany.optimus.core.v1beta1.UpdateResourceRequest.resource:type_name -> gotocompany.optimus.core.v1beta1.ResourceSpecification + 14, // 6: gotocompany.optimus.core.v1beta1.UpsertResourceRequest.resources:type_name -> gotocompany.optimus.core.v1beta1.ResourceSpecification 12, // 7: gotocompany.optimus.core.v1beta1.UpsertResourceResponse.results:type_name -> gotocompany.optimus.core.v1beta1.ResourceStatus - 28, // 8: gotocompany.optimus.core.v1beta1.ResourceSpecification.spec:type_name -> google.protobuf.Struct - 24, // 9: gotocompany.optimus.core.v1beta1.ResourceSpecification.assets:type_name -> gotocompany.optimus.core.v1beta1.ResourceSpecification.AssetsEntry - 25, // 10: gotocompany.optimus.core.v1beta1.ResourceSpecification.labels:type_name -> gotocompany.optimus.core.v1beta1.ResourceSpecification.LabelsEntry - 26, // 11: gotocompany.optimus.core.v1beta1.ApplyResourcesResponse.statuses:type_name -> gotocompany.optimus.core.v1beta1.ApplyResourcesResponse.ResourceStatus - 21, // 12: gotocompany.optimus.core.v1beta1.ResourceChangelog.change:type_name -> gotocompany.optimus.core.v1beta1.ResourceChange - 22, // 13: gotocompany.optimus.core.v1beta1.GetResourceChangelogsResponse.history:type_name -> gotocompany.optimus.core.v1beta1.ResourceChangelog - 0, // 14: gotocompany.optimus.core.v1beta1.ResourceService.DeployResourceSpecification:input_type -> gotocompany.optimus.core.v1beta1.DeployResourceSpecificationRequest - 2, // 15: gotocompany.optimus.core.v1beta1.ResourceService.ListResourceSpecification:input_type -> gotocompany.optimus.core.v1beta1.ListResourceSpecificationRequest - 4, // 16: gotocompany.optimus.core.v1beta1.ResourceService.CreateResource:input_type -> gotocompany.optimus.core.v1beta1.CreateResourceRequest - 6, // 17: gotocompany.optimus.core.v1beta1.ResourceService.ReadResource:input_type -> gotocompany.optimus.core.v1beta1.ReadResourceRequest - 8, // 18: gotocompany.optimus.core.v1beta1.ResourceService.UpdateResource:input_type -> gotocompany.optimus.core.v1beta1.UpdateResourceRequest - 10, // 19: gotocompany.optimus.core.v1beta1.ResourceService.UpsertResource:input_type -> gotocompany.optimus.core.v1beta1.UpsertResourceRequest - 18, // 20: gotocompany.optimus.core.v1beta1.ResourceService.DeleteResource:input_type -> gotocompany.optimus.core.v1beta1.DeleteResourceRequest - 14, // 21: gotocompany.optimus.core.v1beta1.ResourceService.ChangeResourceNamespace:input_type -> gotocompany.optimus.core.v1beta1.ChangeResourceNamespaceRequest - 16, // 22: gotocompany.optimus.core.v1beta1.ResourceService.ApplyResources:input_type -> gotocompany.optimus.core.v1beta1.ApplyResourcesRequest - 20, // 23: gotocompany.optimus.core.v1beta1.ResourceService.GetResourceChangelogs:input_type -> gotocompany.optimus.core.v1beta1.GetResourceChangelogsRequest - 1, // 24: gotocompany.optimus.core.v1beta1.ResourceService.DeployResourceSpecification:output_type -> gotocompany.optimus.core.v1beta1.DeployResourceSpecificationResponse - 3, // 25: gotocompany.optimus.core.v1beta1.ResourceService.ListResourceSpecification:output_type -> gotocompany.optimus.core.v1beta1.ListResourceSpecificationResponse - 5, // 26: gotocompany.optimus.core.v1beta1.ResourceService.CreateResource:output_type -> gotocompany.optimus.core.v1beta1.CreateResourceResponse - 7, // 27: gotocompany.optimus.core.v1beta1.ResourceService.ReadResource:output_type -> gotocompany.optimus.core.v1beta1.ReadResourceResponse - 9, // 28: gotocompany.optimus.core.v1beta1.ResourceService.UpdateResource:output_type -> gotocompany.optimus.core.v1beta1.UpdateResourceResponse - 11, // 29: gotocompany.optimus.core.v1beta1.ResourceService.UpsertResource:output_type -> gotocompany.optimus.core.v1beta1.UpsertResourceResponse - 19, // 30: gotocompany.optimus.core.v1beta1.ResourceService.DeleteResource:output_type -> gotocompany.optimus.core.v1beta1.DeleteResourceResponse - 15, // 31: gotocompany.optimus.core.v1beta1.ResourceService.ChangeResourceNamespace:output_type -> gotocompany.optimus.core.v1beta1.ChangeResourceNamespaceResponse - 17, // 32: gotocompany.optimus.core.v1beta1.ResourceService.ApplyResources:output_type -> gotocompany.optimus.core.v1beta1.ApplyResourcesResponse - 23, // 33: gotocompany.optimus.core.v1beta1.ResourceService.GetResourceChangelogs:output_type -> gotocompany.optimus.core.v1beta1.GetResourceChangelogsResponse - 24, // [24:34] is the sub-list for method output_type - 14, // [14:24] 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 + 29, // 8: gotocompany.optimus.core.v1beta1.Deprecation.date:type_name -> google.protobuf.Timestamp + 30, // 9: gotocompany.optimus.core.v1beta1.ResourceSpecification.spec:type_name -> google.protobuf.Struct + 25, // 10: gotocompany.optimus.core.v1beta1.ResourceSpecification.assets:type_name -> gotocompany.optimus.core.v1beta1.ResourceSpecification.AssetsEntry + 26, // 11: gotocompany.optimus.core.v1beta1.ResourceSpecification.labels:type_name -> gotocompany.optimus.core.v1beta1.ResourceSpecification.LabelsEntry + 13, // 12: gotocompany.optimus.core.v1beta1.ResourceSpecification.deprecation:type_name -> gotocompany.optimus.core.v1beta1.Deprecation + 27, // 13: gotocompany.optimus.core.v1beta1.ApplyResourcesResponse.statuses:type_name -> gotocompany.optimus.core.v1beta1.ApplyResourcesResponse.ResourceStatus + 22, // 14: gotocompany.optimus.core.v1beta1.ResourceChangelog.change:type_name -> gotocompany.optimus.core.v1beta1.ResourceChange + 23, // 15: gotocompany.optimus.core.v1beta1.GetResourceChangelogsResponse.history:type_name -> gotocompany.optimus.core.v1beta1.ResourceChangelog + 0, // 16: gotocompany.optimus.core.v1beta1.ResourceService.DeployResourceSpecification:input_type -> gotocompany.optimus.core.v1beta1.DeployResourceSpecificationRequest + 2, // 17: gotocompany.optimus.core.v1beta1.ResourceService.ListResourceSpecification:input_type -> gotocompany.optimus.core.v1beta1.ListResourceSpecificationRequest + 4, // 18: gotocompany.optimus.core.v1beta1.ResourceService.CreateResource:input_type -> gotocompany.optimus.core.v1beta1.CreateResourceRequest + 6, // 19: gotocompany.optimus.core.v1beta1.ResourceService.ReadResource:input_type -> gotocompany.optimus.core.v1beta1.ReadResourceRequest + 8, // 20: gotocompany.optimus.core.v1beta1.ResourceService.UpdateResource:input_type -> gotocompany.optimus.core.v1beta1.UpdateResourceRequest + 10, // 21: gotocompany.optimus.core.v1beta1.ResourceService.UpsertResource:input_type -> gotocompany.optimus.core.v1beta1.UpsertResourceRequest + 19, // 22: gotocompany.optimus.core.v1beta1.ResourceService.DeleteResource:input_type -> gotocompany.optimus.core.v1beta1.DeleteResourceRequest + 15, // 23: gotocompany.optimus.core.v1beta1.ResourceService.ChangeResourceNamespace:input_type -> gotocompany.optimus.core.v1beta1.ChangeResourceNamespaceRequest + 17, // 24: gotocompany.optimus.core.v1beta1.ResourceService.ApplyResources:input_type -> gotocompany.optimus.core.v1beta1.ApplyResourcesRequest + 21, // 25: gotocompany.optimus.core.v1beta1.ResourceService.GetResourceChangelogs:input_type -> gotocompany.optimus.core.v1beta1.GetResourceChangelogsRequest + 1, // 26: gotocompany.optimus.core.v1beta1.ResourceService.DeployResourceSpecification:output_type -> gotocompany.optimus.core.v1beta1.DeployResourceSpecificationResponse + 3, // 27: gotocompany.optimus.core.v1beta1.ResourceService.ListResourceSpecification:output_type -> gotocompany.optimus.core.v1beta1.ListResourceSpecificationResponse + 5, // 28: gotocompany.optimus.core.v1beta1.ResourceService.CreateResource:output_type -> gotocompany.optimus.core.v1beta1.CreateResourceResponse + 7, // 29: gotocompany.optimus.core.v1beta1.ResourceService.ReadResource:output_type -> gotocompany.optimus.core.v1beta1.ReadResourceResponse + 9, // 30: gotocompany.optimus.core.v1beta1.ResourceService.UpdateResource:output_type -> gotocompany.optimus.core.v1beta1.UpdateResourceResponse + 11, // 31: gotocompany.optimus.core.v1beta1.ResourceService.UpsertResource:output_type -> gotocompany.optimus.core.v1beta1.UpsertResourceResponse + 20, // 32: gotocompany.optimus.core.v1beta1.ResourceService.DeleteResource:output_type -> gotocompany.optimus.core.v1beta1.DeleteResourceResponse + 16, // 33: gotocompany.optimus.core.v1beta1.ResourceService.ChangeResourceNamespace:output_type -> gotocompany.optimus.core.v1beta1.ChangeResourceNamespaceResponse + 18, // 34: gotocompany.optimus.core.v1beta1.ResourceService.ApplyResources:output_type -> gotocompany.optimus.core.v1beta1.ApplyResourcesResponse + 24, // 35: gotocompany.optimus.core.v1beta1.ResourceService.GetResourceChangelogs:output_type -> gotocompany.optimus.core.v1beta1.GetResourceChangelogsResponse + 26, // [26:36] is the sub-list for method output_type + 16, // [16:26] is the sub-list for method input_type + 16, // [16:16] is the sub-list for extension type_name + 16, // [16:16] is the sub-list for extension extendee + 0, // [0:16] is the sub-list for field type_name } func init() { file_gotocompany_optimus_core_v1beta1_resource_proto_init() } @@ -2254,7 +2345,7 @@ func file_gotocompany_optimus_core_v1beta1_resource_proto_init() { } } file_gotocompany_optimus_core_v1beta1_resource_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ResourceSpecification); i { + switch v := v.(*Deprecation); i { case 0: return &v.state case 1: @@ -2266,7 +2357,7 @@ func file_gotocompany_optimus_core_v1beta1_resource_proto_init() { } } file_gotocompany_optimus_core_v1beta1_resource_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ChangeResourceNamespaceRequest); i { + switch v := v.(*ResourceSpecification); i { case 0: return &v.state case 1: @@ -2278,7 +2369,7 @@ func file_gotocompany_optimus_core_v1beta1_resource_proto_init() { } } file_gotocompany_optimus_core_v1beta1_resource_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ChangeResourceNamespaceResponse); i { + switch v := v.(*ChangeResourceNamespaceRequest); i { case 0: return &v.state case 1: @@ -2290,7 +2381,7 @@ func file_gotocompany_optimus_core_v1beta1_resource_proto_init() { } } file_gotocompany_optimus_core_v1beta1_resource_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ApplyResourcesRequest); i { + switch v := v.(*ChangeResourceNamespaceResponse); i { case 0: return &v.state case 1: @@ -2302,7 +2393,7 @@ func file_gotocompany_optimus_core_v1beta1_resource_proto_init() { } } file_gotocompany_optimus_core_v1beta1_resource_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ApplyResourcesResponse); i { + switch v := v.(*ApplyResourcesRequest); i { case 0: return &v.state case 1: @@ -2314,7 +2405,7 @@ func file_gotocompany_optimus_core_v1beta1_resource_proto_init() { } } file_gotocompany_optimus_core_v1beta1_resource_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteResourceRequest); i { + switch v := v.(*ApplyResourcesResponse); i { case 0: return &v.state case 1: @@ -2326,7 +2417,7 @@ func file_gotocompany_optimus_core_v1beta1_resource_proto_init() { } } file_gotocompany_optimus_core_v1beta1_resource_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteResourceResponse); i { + switch v := v.(*DeleteResourceRequest); i { case 0: return &v.state case 1: @@ -2338,7 +2429,7 @@ func file_gotocompany_optimus_core_v1beta1_resource_proto_init() { } } file_gotocompany_optimus_core_v1beta1_resource_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetResourceChangelogsRequest); i { + switch v := v.(*DeleteResourceResponse); i { case 0: return &v.state case 1: @@ -2350,7 +2441,7 @@ func file_gotocompany_optimus_core_v1beta1_resource_proto_init() { } } file_gotocompany_optimus_core_v1beta1_resource_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ResourceChange); i { + switch v := v.(*GetResourceChangelogsRequest); i { case 0: return &v.state case 1: @@ -2362,7 +2453,7 @@ func file_gotocompany_optimus_core_v1beta1_resource_proto_init() { } } file_gotocompany_optimus_core_v1beta1_resource_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ResourceChangelog); i { + switch v := v.(*ResourceChange); i { case 0: return &v.state case 1: @@ -2374,6 +2465,18 @@ func file_gotocompany_optimus_core_v1beta1_resource_proto_init() { } } file_gotocompany_optimus_core_v1beta1_resource_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ResourceChangelog); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gotocompany_optimus_core_v1beta1_resource_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetResourceChangelogsResponse); i { case 0: return &v.state @@ -2385,7 +2488,7 @@ func file_gotocompany_optimus_core_v1beta1_resource_proto_init() { return nil } } - file_gotocompany_optimus_core_v1beta1_resource_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { + file_gotocompany_optimus_core_v1beta1_resource_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ApplyResourcesResponse_ResourceStatus); i { case 0: return &v.state @@ -2404,7 +2507,7 @@ func file_gotocompany_optimus_core_v1beta1_resource_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_gotocompany_optimus_core_v1beta1_resource_proto_rawDesc, NumEnums: 0, - NumMessages: 27, + NumMessages: 28, NumExtensions: 0, NumServices: 1, }, diff --git a/protos/gotocompany/optimus/core/v1beta1/resource.swagger.json b/protos/gotocompany/optimus/core/v1beta1/resource.swagger.json index 47db41e854..efb132a85c 100644 --- a/protos/gotocompany/optimus/core/v1beta1/resource.swagger.json +++ b/protos/gotocompany/optimus/core/v1beta1/resource.swagger.json @@ -594,6 +594,21 @@ } } }, + "v1beta1Deprecation": { + "type": "object", + "properties": { + "reason": { + "type": "string" + }, + "date": { + "type": "string", + "format": "date-time" + }, + "replacementTable": { + "type": "string" + } + } + }, "v1beta1GetResourceChangelogsResponse": { "type": "object", "properties": { @@ -709,6 +724,9 @@ "additionalProperties": { "type": "string" } + }, + "deprecation": { + "$ref": "#/definitions/v1beta1Deprecation" } }, "title": "ResourceSpecification are datastore specification representation of a resource" From 20b01334353b2ca2dd50c414e1c542518cec139c Mon Sep 17 00:00:00 2001 From: Yash Bhardwaj Date: Fri, 6 Dec 2024 15:14:32 +0530 Subject: [PATCH 2/4] fix : add deprication info in resource table --- .../postgres/migrations/000066_table_deprecation.down.sql | 3 +++ .../store/postgres/migrations/000066_table_deprecation.up.sql | 3 +++ 2 files changed, 6 insertions(+) create mode 100644 internal/store/postgres/migrations/000066_table_deprecation.down.sql create mode 100644 internal/store/postgres/migrations/000066_table_deprecation.up.sql diff --git a/internal/store/postgres/migrations/000066_table_deprecation.down.sql b/internal/store/postgres/migrations/000066_table_deprecation.down.sql new file mode 100644 index 0000000000..495272cb38 --- /dev/null +++ b/internal/store/postgres/migrations/000066_table_deprecation.down.sql @@ -0,0 +1,3 @@ +-- Remove the deprecation column from the resource table +ALTER TABLE resource +DROP COLUMN deprecation; diff --git a/internal/store/postgres/migrations/000066_table_deprecation.up.sql b/internal/store/postgres/migrations/000066_table_deprecation.up.sql new file mode 100644 index 0000000000..4a83a3faaa --- /dev/null +++ b/internal/store/postgres/migrations/000066_table_deprecation.up.sql @@ -0,0 +1,3 @@ +-- Add the deprecation column to the resource table +ALTER TABLE resource +ADD COLUMN deprecation jsonb; \ No newline at end of file From 8f6b701bb09a550eac9d86ce33500c2cd77b2d68 Mon Sep 17 00:00:00 2001 From: Yash Bhardwaj Date: Fri, 6 Dec 2024 15:21:59 +0530 Subject: [PATCH 3/4] fix : tests to add deprication info in resource table --- client/local/model/resource_spec.go | 2 +- core/resource/resource.go | 5 +-- .../postgres/resource/repository_test.go | 42 +++++++++---------- tests/bench/resource/resource_repo_test.go | 14 +++---- 4 files changed, 30 insertions(+), 33 deletions(-) diff --git a/client/local/model/resource_spec.go b/client/local/model/resource_spec.go index 41a522a862..db767adc90 100644 --- a/client/local/model/resource_spec.go +++ b/client/local/model/resource_spec.go @@ -36,7 +36,7 @@ func (r ResourceSpec) ToProto() (*pb.ResourceSpecification, error) { if r.Deprecation != nil && len(r.Deprecation.Date) > 0 { deprecationDate, err := time.Parse(time.DateOnly, r.Deprecation.Date) if err != nil { - return nil, fmt.Errorf("error parsing deprication Date, for resource: %s, expected_format: [YYYY-MM-DD], got: [%s], err: %w", r.Name, r.Deprecation.Date, err) + return nil, fmt.Errorf("error parsing deprivation Date, for resource: %s, expected_format: [YYYY-MM-DD], got: [%s], err: %w", r.Name, r.Deprecation.Date, err) } deprecation = &pb.Deprecation{ Reason: r.Deprecation.Reason, diff --git a/core/resource/resource.go b/core/resource/resource.go index 74b51ae9b5..9350055f2b 100644 --- a/core/resource/resource.go +++ b/core/resource/resource.go @@ -110,10 +110,7 @@ type Resource struct { } func (r *Resource) IsDeprecated() bool { - if r.deprecation != nil { - return true - } - return false + return r.deprecation != nil } func (r *Resource) GetUpdateImpact(incoming *Resource) UpdateImpact { diff --git a/internal/store/postgres/resource/repository_test.go b/internal/store/postgres/resource/repository_test.go index 6fe66e8f9f..1d6bb54be6 100644 --- a/internal/store/postgres/resource/repository_test.go +++ b/internal/store/postgres/resource/repository_test.go @@ -42,7 +42,7 @@ func TestPostgresResourceRepository(t *testing.T) { pool := dbSetup() repository := repoResource.NewRepository(pool) - resourceToCreate, err := serviceResource.NewResource("project.dataset", kindDataset, store, tnnt, meta, spec) + resourceToCreate, err := serviceResource.NewResource("project.dataset", kindDataset, store, tnnt, meta, spec, nil) assert.NoError(t, err) resourceToCreate.UpdateURN(resourceURN) @@ -56,7 +56,7 @@ func TestPostgresResourceRepository(t *testing.T) { pool := dbSetup() repository := repoResource.NewRepository(pool) - resourceToCreate, err := serviceResource.NewResource("project.dataset", kindDataset, store, tnnt, meta, spec) + resourceToCreate, err := serviceResource.NewResource("project.dataset", kindDataset, store, tnnt, meta, spec, nil) assert.NoError(t, err) resourceURN, err := serviceResource.ParseURN("bigquery://project:dataset") assert.NoError(t, err) @@ -77,7 +77,7 @@ func TestPostgresResourceRepository(t *testing.T) { pool := dbSetup() repository := repoResource.NewRepository(pool) - resourceToUpdate, err := serviceResource.NewResource("project.dataset", kindDataset, store, tnnt, meta, spec) + resourceToUpdate, err := serviceResource.NewResource("project.dataset", kindDataset, store, tnnt, meta, spec, nil) assert.NoError(t, err) resourceToUpdate.UpdateURN(resourceURN) @@ -89,7 +89,7 @@ func TestPostgresResourceRepository(t *testing.T) { pool := dbSetup() repository := repoResource.NewRepository(pool) - resourceToCreate, err := serviceResource.NewResource("project.dataset", kindDataset, store, tnnt, meta, spec) + resourceToCreate, err := serviceResource.NewResource("project.dataset", kindDataset, store, tnnt, meta, spec, nil) assert.NoError(t, err) resourceToCreate.UpdateURN(resourceURN) @@ -115,7 +115,7 @@ func TestPostgresResourceRepository(t *testing.T) { pool := dbSetup() repository := repoResource.NewRepository(pool) - resourceToUpdate, err := serviceResource.NewResource("project.dataset", kindDataset, store, tnnt, meta, spec) + resourceToUpdate, err := serviceResource.NewResource("project.dataset", kindDataset, store, tnnt, meta, spec, nil) assert.NoError(t, err) resourceToUpdate.UpdateURN(resourceURN) @@ -127,7 +127,7 @@ func TestPostgresResourceRepository(t *testing.T) { pool := dbSetup() repository := repoResource.NewRepository(pool) - resourceToCreate, err := serviceResource.NewResource("project.dataset", kindDataset, store, tnnt, meta, spec) + resourceToCreate, err := serviceResource.NewResource("project.dataset", kindDataset, store, tnnt, meta, spec, nil) assert.NoError(t, err) resourceToCreate.UpdateURN(resourceURN) @@ -153,13 +153,13 @@ func TestPostgresResourceRepository(t *testing.T) { urn, err := serviceResource.ParseURN("bigquery://project:dataset") assert.NoError(t, err) - resourceExisting, err := serviceResource.NewResource("project.dataset", kindDataset, store, tnnt, meta, spec) + resourceExisting, err := serviceResource.NewResource("project.dataset", kindDataset, store, tnnt, meta, spec, nil) assert.NoError(t, err) resourceExisting.UpdateURN(urn) otherTnnt, err := tenant.NewTenant(tnnt.ProjectName().String(), "n-optimus-2") assert.NoError(t, err) - resourceToChange, err := serviceResource.NewResource("project.dataset", kindDataset, store, otherTnnt, meta, spec) + resourceToChange, err := serviceResource.NewResource("project.dataset", kindDataset, store, otherTnnt, meta, spec, nil) assert.NoError(t, err) resourceToChange.UpdateURN(urn) @@ -194,7 +194,7 @@ func TestPostgresResourceRepository(t *testing.T) { repository := repoResource.NewRepository(pool) fullName := "project.dataset" - resourceToCreate, err := serviceResource.NewResource(fullName, kindDataset, store, tnnt, meta, spec) + resourceToCreate, err := serviceResource.NewResource(fullName, kindDataset, store, tnnt, meta, spec, nil) assert.NoError(t, err) err = repository.Create(ctx, resourceToCreate) @@ -221,7 +221,7 @@ func TestPostgresResourceRepository(t *testing.T) { pool := dbSetup() repository := repoResource.NewRepository(pool) - resourceToCreate, err := serviceResource.NewResource("project.dataset", kindDataset, store, tnnt, meta, spec) + resourceToCreate, err := serviceResource.NewResource("project.dataset", kindDataset, store, tnnt, meta, spec, nil) assert.NoError(t, err) err = repository.Create(ctx, resourceToCreate) @@ -240,7 +240,7 @@ func TestPostgresResourceRepository(t *testing.T) { repository := repoResource.NewRepository(pool) name1 := "project.dataset" - resourceToCreate1, err := serviceResource.NewResource(name1, kindDataset, store, tnnt, meta, spec) + resourceToCreate1, err := serviceResource.NewResource(name1, kindDataset, store, tnnt, meta, spec, nil) assert.NoError(t, err) resourceURN, err := serviceResource.ParseURN("bigquery://project:dataset1") assert.NoError(t, err) @@ -253,7 +253,7 @@ func TestPostgresResourceRepository(t *testing.T) { "view_query": "select * from `project.dataset.table`", } name2 := "project.dataset.view" - resourceToCreate2, err := serviceResource.NewResource(name2, "view", store, tnnt, meta, viewSpec) + resourceToCreate2, err := serviceResource.NewResource(name2, "view", store, tnnt, meta, viewSpec, nil) assert.NoError(t, err) resourceURN, err = serviceResource.ParseURN("bigquery://project:dataset.view") assert.NoError(t, err) @@ -274,11 +274,11 @@ func TestPostgresResourceRepository(t *testing.T) { pool := dbSetup() repository := repoResource.NewRepository(pool) - existingResource, err := serviceResource.NewResource("project.dataset1", kindDataset, store, tnnt, meta, spec) + existingResource, err := serviceResource.NewResource("project.dataset1", kindDataset, store, tnnt, meta, spec, nil) assert.NoError(t, err) err = repository.Create(ctx, existingResource) assert.NoError(t, err) - nonExistingResource, err := serviceResource.NewResource("project.dataset2", kindDataset, store, tnnt, meta, spec) + nonExistingResource, err := serviceResource.NewResource("project.dataset2", kindDataset, store, tnnt, meta, spec, nil) assert.NoError(t, err) resourcesToUpdate := []*serviceResource.Resource{ @@ -299,12 +299,12 @@ func TestPostgresResourceRepository(t *testing.T) { pool := dbSetup() repository := repoResource.NewRepository(pool) - existingResource1, err := serviceResource.NewResource("project.dataset1", kindDataset, store, tnnt, meta, spec) + existingResource1, err := serviceResource.NewResource("project.dataset1", kindDataset, store, tnnt, meta, spec, nil) assert.NoError(t, err) resourceURN, err := serviceResource.ParseURN("bigquery://project:dataset1") assert.NoError(t, err) existingResource1.UpdateURN(resourceURN) - existingResource2, err := serviceResource.NewResource("project.dataset2", kindDataset, store, tnnt, meta, spec) + existingResource2, err := serviceResource.NewResource("project.dataset2", kindDataset, store, tnnt, meta, spec, nil) assert.NoError(t, err) resourceURN, err = serviceResource.ParseURN("bigquery://project:dataset2") assert.NoError(t, err) @@ -317,10 +317,10 @@ func TestPostgresResourceRepository(t *testing.T) { newSpec := map[string]any{ "Description": "spec for testing update status", } - modifiedResource1, err := serviceResource.NewResource("project.dataset1", kindDataset, store, tnnt, meta, newSpec) + modifiedResource1, err := serviceResource.NewResource("project.dataset1", kindDataset, store, tnnt, meta, newSpec, nil) assert.NoError(t, err) modifiedResource1.MarkExistInStore() - modifiedResource2, err := serviceResource.NewResource("project.dataset2", kindDataset, store, tnnt, meta, newSpec) + modifiedResource2, err := serviceResource.NewResource("project.dataset2", kindDataset, store, tnnt, meta, newSpec, nil) assert.NoError(t, err) resourcesToUpdate := []*serviceResource.Resource{ serviceResource.FromExisting(modifiedResource1, serviceResource.ReplaceStatus(serviceResource.StatusSuccess)), @@ -344,7 +344,7 @@ func TestPostgresResourceRepository(t *testing.T) { pool := dbSetup() repository := repoResource.NewRepository(pool) - resourceToDelete, err := serviceResource.NewResource("project.dataset", kindDataset, store, tnnt, meta, spec) + resourceToDelete, err := serviceResource.NewResource("project.dataset", kindDataset, store, tnnt, meta, spec, nil) assert.NoError(t, err) _ = resourceToDelete.MarkToDelete() @@ -359,7 +359,7 @@ func TestPostgresResourceRepository(t *testing.T) { urn, err := serviceResource.ParseURN("bigquery://project:dataset") assert.NoError(t, err) - resourceToCreate, err := serviceResource.NewResource("project.dataset", kindDataset, store, tnnt, meta, spec) + resourceToCreate, err := serviceResource.NewResource("project.dataset", kindDataset, store, tnnt, meta, spec, nil) assert.NoError(t, err) resourceToCreate.UpdateURN(urn) @@ -434,7 +434,7 @@ func TestPostgresResourceRepository(t *testing.T) { urn, err := serviceResource.ParseURN("bigquery://project:dataset.table") assert.NoError(t, err) - resourceToCreate, err := serviceResource.NewResource("project.dataset.table", kindDataset, store, tnnt, meta, spec) + resourceToCreate, err := serviceResource.NewResource("project.dataset.table", kindDataset, store, tnnt, meta, spec, nil) assert.NoError(t, err) err = resourceToCreate.UpdateURN(urn) assert.NoError(t, err) diff --git a/tests/bench/resource/resource_repo_test.go b/tests/bench/resource/resource_repo_test.go index 7c4646a44b..d8821b0fc6 100644 --- a/tests/bench/resource/resource_repo_test.go +++ b/tests/bench/resource/resource_repo_test.go @@ -81,7 +81,7 @@ func BenchmarkResourceRepository(b *testing.B) { for i := 0; i < b.N; i++ { fullName := fmt.Sprintf("project.dataset_%d", i) - resourceToCreate, err := serviceResource.NewResource(fullName, bigquery.KindDataset, serviceResource.Bigquery, tnnt, meta, spec) + resourceToCreate, err := serviceResource.NewResource(fullName, bigquery.KindDataset, serviceResource.Bigquery, tnnt, meta, spec, nil) assert.NoError(b, err) name := fmt.Sprintf("%s:%s.%s", projectName, namespaceName, fullName) @@ -101,7 +101,7 @@ func BenchmarkResourceRepository(b *testing.B) { fullNames := make([]string, maxNumberOfResources) for i := 0; i < maxNumberOfResources; i++ { fullName := fmt.Sprintf("project.dataset_%d", i) - resourceToCreate, err := serviceResource.NewResource(fullName, bigquery.KindDataset, serviceResource.Bigquery, tnnt, meta, spec) + resourceToCreate, err := serviceResource.NewResource(fullName, bigquery.KindDataset, serviceResource.Bigquery, tnnt, meta, spec, nil) assert.NoError(b, err) name := fmt.Sprintf("%s:%s.%s", projectName, namespaceName, fullName) @@ -128,7 +128,7 @@ func BenchmarkResourceRepository(b *testing.B) { resourceIdx := i % maxNumberOfResources fullName := fullNames[resourceIdx] - resourceToUpdate, err := serviceResource.NewResource(fullName, bigquery.KindDataset, serviceResource.Bigquery, tnnt, updatedMeta, spec) + resourceToUpdate, err := serviceResource.NewResource(fullName, bigquery.KindDataset, serviceResource.Bigquery, tnnt, updatedMeta, spec, nil) assert.NoError(b, err) name := fmt.Sprintf("%s:%s.%s", projectName, namespaceName, fullName) @@ -157,7 +157,7 @@ func BenchmarkResourceRepository(b *testing.B) { fullNames := make([]string, maxNumberOfResources) for i := 0; i < maxNumberOfResources; i++ { fullName := fmt.Sprintf("project.dataset_%d", i) - resourceToCreate, err := serviceResource.NewResource(fullName, bigquery.KindDataset, serviceResource.Bigquery, tnnt, meta, spec) + resourceToCreate, err := serviceResource.NewResource(fullName, bigquery.KindDataset, serviceResource.Bigquery, tnnt, meta, spec, nil) assert.NoError(b, err) name := fmt.Sprintf("%s:%s.%s", projectName, namespaceName, fullName) @@ -190,7 +190,7 @@ func BenchmarkResourceRepository(b *testing.B) { repository := repoResource.NewRepository(db) for i := 0; i < maxNumberOfResources; i++ { fullName := fmt.Sprintf("project.dataset_%d", i) - resourceToCreate, err := serviceResource.NewResource(fullName, bigquery.KindDataset, serviceResource.Bigquery, tnnt, meta, spec) + resourceToCreate, err := serviceResource.NewResource(fullName, bigquery.KindDataset, serviceResource.Bigquery, tnnt, meta, spec, nil) assert.NoError(b, err) name := fmt.Sprintf("%s:%s.%s", projectName, namespaceName, fullName) @@ -218,7 +218,7 @@ func BenchmarkResourceRepository(b *testing.B) { fullNames := make([]string, maxNumberOfResources) for i := 0; i < maxNumberOfResources; i++ { fullName := fmt.Sprintf("project.dataset_%d", i) - resourceToCreate, err := serviceResource.NewResource(fullName, bigquery.KindDataset, serviceResource.Bigquery, tnnt, meta, spec) + resourceToCreate, err := serviceResource.NewResource(fullName, bigquery.KindDataset, serviceResource.Bigquery, tnnt, meta, spec, nil) assert.NoError(b, err) name := fmt.Sprintf("%s:%s.%s", projectName, namespaceName, fullName) @@ -248,7 +248,7 @@ func BenchmarkResourceRepository(b *testing.B) { resources := make([]*serviceResource.Resource, maxNumberOfResources) for i := 0; i < maxNumberOfResources; i++ { fullName := fmt.Sprintf("project.dataset_%d", i) - resourceToCreate, err := serviceResource.NewResource(fullName, bigquery.KindDataset, serviceResource.Bigquery, tnnt, meta, spec) + resourceToCreate, err := serviceResource.NewResource(fullName, bigquery.KindDataset, serviceResource.Bigquery, tnnt, meta, spec, nil) assert.NoError(b, err) name := fmt.Sprintf("%s:%s.%s", projectName, namespaceName, fullName) From 09d6371ff7355c7a2237fb3c7dbc448b53392aa0 Mon Sep 17 00:00:00 2001 From: Yash Bhardwaj Date: Fri, 6 Dec 2024 15:39:43 +0530 Subject: [PATCH 4/4] fix : tests to add deprication info in resource table --- internal/store/postgres/resource/repository.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/store/postgres/resource/repository.go b/internal/store/postgres/resource/repository.go index f8c1e559b1..f7f50b17ac 100644 --- a/internal/store/postgres/resource/repository.go +++ b/internal/store/postgres/resource/repository.go @@ -288,7 +288,7 @@ store = $3 AND full_name = any ($4) AND status NOT IN ($5, $6)` for rows.Next() { var res Resource err = rows.Scan(&res.ID, &res.FullName, &res.Kind, &res.Store, &res.Status, &res.URN, - &res.ProjectName, &res.NamespaceName, &res.Metadata, &res.Spec, &res.CreatedAt, &res.UpdatedAt) + &res.ProjectName, &res.NamespaceName, &res.Metadata, &res.Spec, &res.Deprecated, &res.CreatedAt, &res.UpdatedAt) if err != nil { return nil, errors.Wrap(resource.EntityResource, "error in GetAll", err) } @@ -361,7 +361,7 @@ func (r Repository) ReadByURN(ctx context.Context, tnnt tenant.Tenant, urn resou var res Resource err := r.db.QueryRow(ctx, query, args...). Scan(&res.ID, &res.FullName, &res.Kind, &res.Store, &res.Status, &res.URN, - &res.ProjectName, &res.NamespaceName, &res.Metadata, &res.Spec, &res.CreatedAt, &res.UpdatedAt) + &res.ProjectName, &res.NamespaceName, &res.Metadata, &res.Spec, &res.Deprecated, &res.CreatedAt, &res.UpdatedAt) if err != nil { if errors.Is(err, pgx.ErrNoRows) { return nil, errors.NotFound(resource.EntityResource, fmt.Sprintf("no resource with urn: '%s' found for project:%s, namespace:%s ", urn, tnnt.ProjectName(), tnnt.NamespaceName()))