diff --git a/go/gen/sift/assets/v1/assets.pb.go b/go/gen/sift/assets/v1/assets.pb.go index e94238fae..1ee649d3e 100644 --- a/go/gen/sift/assets/v1/assets.pb.go +++ b/go/gen/sift/assets/v1/assets.pb.go @@ -43,6 +43,8 @@ type Asset struct { Metadata []*v1.MetadataValue `protobuf:"bytes,10,rep,name=metadata,proto3" json:"metadata,omitempty"` // The date the asset was archived. ArchivedDate *timestamppb.Timestamp `protobuf:"bytes,11,opt,name=archived_date,json=archivedDate,proto3" json:"archived_date,omitempty"` + // Whether the asset is archived. This is inferred from whether archived_date is set. + IsArchived bool `protobuf:"varint,12,opt,name=is_archived,json=isArchived,proto3" json:"is_archived,omitempty"` } func (x *Asset) Reset() { @@ -147,6 +149,13 @@ func (x *Asset) GetArchivedDate() *timestamppb.Timestamp { return nil } +func (x *Asset) GetIsArchived() bool { + if x != nil { + return x.IsArchived + } + return false +} + // The request for a call to `AssetService_ListAssets`. type ListAssetsRequest struct { state protoimpl.MessageState @@ -165,7 +174,7 @@ type ListAssetsRequest struct { PageToken string `protobuf:"bytes,2,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` // A [Common Expression Language (CEL)](https://github.com/google/cel-spec) filter string. // Available fields to filter by are `asset_id`, `created_by_user_id`, `modified_by_user_id`, - // `created_date`, `modified_date`, `name`, `tag_id`, `tag_name`, and `metadata`. Metadata can be used in filters by using `metadata.{metadata_key_name}` as the field name. + // `created_date`, `modified_date`, `name`, `tag_id`, `tag_name`, `is_archived`, and `metadata`. Metadata can be used in filters by using `metadata.{metadata_key_name}` as the field name. // For further information about how to use CELs, please refer to [this guide](https://github.com/google/cel-spec/blob/master/doc/langdef.md#standard-definitions). // For more information about the fields used for filtering, please refer to [this definition](/docs/api/grpc/protocol-buffers/assets#asset). Optional. Filter string `protobuf:"bytes,3,opt,name=filter,proto3" json:"filter,omitempty"` @@ -294,6 +303,7 @@ func (x *ListAssetsResponse) GetNextPageToken() string { } // The request for a call to `AssetService_DeleteAsset` to archive a single existing asset by its asset_id. +// Deprecated: Use ArchiveAssetRequest instead. type DeleteAssetRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -352,6 +362,7 @@ func (x *DeleteAssetRequest) GetArchiveRuns() bool { } // The response of a call to `AssetService_DeleteAsset`. +// Deprecated: Use ArchiveAssetResponse instead. type DeleteAssetResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -495,7 +506,7 @@ type UpdateAssetRequest struct { // The asset to update. The asset's `asset_id` field is used to identify asset run to update // and is required. Asset *Asset `protobuf:"bytes,1,opt,name=asset,proto3" json:"asset,omitempty"` - // The list of fields to be updated. The fields available to be updated are `tags`, `metadata`, and `archived_date`. + // The list of fields to be updated. The fields available to be updated are `tags`, `metadata`, `archived_date`, and `is_archived`. UpdateMask *fieldmaskpb.FieldMask `protobuf:"bytes,2,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"` } @@ -593,6 +604,114 @@ func (x *UpdateAssetResponse) GetAsset() *Asset { return nil } +// The request for a call to `AssetService_ArchiveAsset` to archive a single existing asset by its asset_id. +type ArchiveAssetRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The id of the asset to be archived. Required. + AssetId string `protobuf:"bytes,1,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty"` + // If true, will archive all runs associated with the asset. + ArchiveRuns bool `protobuf:"varint,2,opt,name=archive_runs,json=archiveRuns,proto3" json:"archive_runs,omitempty"` +} + +func (x *ArchiveAssetRequest) Reset() { + *x = ArchiveAssetRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_sift_assets_v1_assets_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ArchiveAssetRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ArchiveAssetRequest) ProtoMessage() {} + +func (x *ArchiveAssetRequest) ProtoReflect() protoreflect.Message { + mi := &file_sift_assets_v1_assets_proto_msgTypes[9] + 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 ArchiveAssetRequest.ProtoReflect.Descriptor instead. +func (*ArchiveAssetRequest) Descriptor() ([]byte, []int) { + return file_sift_assets_v1_assets_proto_rawDescGZIP(), []int{9} +} + +func (x *ArchiveAssetRequest) GetAssetId() string { + if x != nil { + return x.AssetId + } + return "" +} + +func (x *ArchiveAssetRequest) GetArchiveRuns() bool { + if x != nil { + return x.ArchiveRuns + } + return false +} + +// The response of a call to `AssetService_ArchiveAsset`. +type ArchiveAssetResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // List of run IDs that were archived when archive_runs was set to true. + // This field will be empty if archive_runs was false or if no runs were archived. + ArchivedRunIds []string `protobuf:"bytes,1,rep,name=archived_run_ids,json=archivedRunIds,proto3" json:"archived_run_ids,omitempty"` +} + +func (x *ArchiveAssetResponse) Reset() { + *x = ArchiveAssetResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_sift_assets_v1_assets_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ArchiveAssetResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ArchiveAssetResponse) ProtoMessage() {} + +func (x *ArchiveAssetResponse) ProtoReflect() protoreflect.Message { + mi := &file_sift_assets_v1_assets_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ArchiveAssetResponse.ProtoReflect.Descriptor instead. +func (*ArchiveAssetResponse) Descriptor() ([]byte, []int) { + return file_sift_assets_v1_assets_proto_rawDescGZIP(), []int{10} +} + +func (x *ArchiveAssetResponse) GetArchivedRunIds() []string { + if x != nil { + return x.ArchivedRunIds + } + return nil +} + var File_sift_assets_v1_assets_proto protoreflect.FileDescriptor var file_sift_assets_v1_assets_proto_rawDesc = []byte{ @@ -612,7 +731,7 @@ var file_sift_assets_v1_assets_proto_rawDesc = []byte{ 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x73, 0x69, 0x66, 0x74, 0x2f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x22, 0xff, 0x03, 0x0a, 0x05, 0x41, 0x73, 0x73, 0x65, 0x74, 0x12, 0x1e, 0x0a, 0x08, 0x61, 0x73, + 0x22, 0xa5, 0x04, 0x0a, 0x05, 0x41, 0x73, 0x73, 0x65, 0x74, 0x12, 0x1e, 0x0a, 0x08, 0x61, 0x73, 0x73, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x07, 0x61, 0x73, 0x73, 0x65, 0x74, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x04, 0x6e, @@ -644,112 +763,136 @@ var file_sift_assets_v1_assets_proto_rawDesc = []byte{ 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, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0c, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x64, 0x44, 0x61, - 0x74, 0x65, 0x22, 0x96, 0x01, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x73, 0x73, 0x65, 0x74, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, - 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x42, 0x03, 0xe0, 0x41, 0x01, - 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x22, 0x0a, 0x0a, 0x70, 0x61, - 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, - 0xe0, 0x41, 0x01, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1b, - 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, - 0xe0, 0x41, 0x01, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x1e, 0x0a, 0x08, 0x6f, - 0x72, 0x64, 0x65, 0x72, 0x5f, 0x62, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, - 0x41, 0x01, 0x52, 0x07, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x42, 0x79, 0x22, 0x6b, 0x0a, 0x12, 0x4c, - 0x69, 0x73, 0x74, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x2d, 0x0a, 0x06, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x15, 0x2e, 0x73, 0x69, 0x66, 0x74, 0x2e, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x2e, - 0x76, 0x31, 0x2e, 0x41, 0x73, 0x73, 0x65, 0x74, 0x52, 0x06, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, - 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, - 0x6b, 0x65, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, - 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x5c, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65, - 0x74, 0x65, 0x41, 0x73, 0x73, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1e, - 0x0a, 0x08, 0x61, 0x73, 0x73, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x07, 0x61, 0x73, 0x73, 0x65, 0x74, 0x49, 0x64, 0x12, 0x26, - 0x0a, 0x0c, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x5f, 0x72, 0x75, 0x6e, 0x73, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x08, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0b, 0x61, 0x72, 0x63, 0x68, 0x69, - 0x76, 0x65, 0x52, 0x75, 0x6e, 0x73, 0x22, 0x15, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, - 0x41, 0x73, 0x73, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x31, 0x0a, - 0x0f, 0x47, 0x65, 0x74, 0x41, 0x73, 0x73, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x1e, 0x0a, 0x08, 0x61, 0x73, 0x73, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x07, 0x61, 0x73, 0x73, 0x65, 0x74, 0x49, 0x64, - 0x22, 0x3f, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x41, 0x73, 0x73, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, + 0x74, 0x65, 0x12, 0x24, 0x0a, 0x0b, 0x69, 0x73, 0x5f, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, + 0x64, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x08, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x0a, 0x69, 0x73, + 0x41, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x64, 0x22, 0x96, 0x01, 0x0a, 0x11, 0x4c, 0x69, 0x73, + 0x74, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, + 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0d, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, + 0x12, 0x22, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, + 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1b, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, + 0x72, 0x12, 0x1e, 0x0a, 0x08, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x62, 0x79, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x07, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x42, + 0x79, 0x22, 0x6b, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2d, 0x0a, 0x06, 0x61, 0x73, 0x73, 0x65, 0x74, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x73, 0x69, 0x66, 0x74, 0x2e, 0x61, + 0x73, 0x73, 0x65, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x73, 0x73, 0x65, 0x74, 0x52, 0x06, + 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, + 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x5c, + 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x73, 0x73, 0x65, 0x74, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x1e, 0x0a, 0x08, 0x61, 0x73, 0x73, 0x65, 0x74, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x07, 0x61, 0x73, 0x73, + 0x65, 0x74, 0x49, 0x64, 0x12, 0x26, 0x0a, 0x0c, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x5f, + 0x72, 0x75, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, + 0x0b, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x52, 0x75, 0x6e, 0x73, 0x22, 0x15, 0x0a, 0x13, + 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x73, 0x73, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x31, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x41, 0x73, 0x73, 0x65, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1e, 0x0a, 0x08, 0x61, 0x73, 0x73, 0x65, 0x74, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x07, 0x61, + 0x73, 0x73, 0x65, 0x74, 0x49, 0x64, 0x22, 0x3f, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x41, 0x73, 0x73, + 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2b, 0x0a, 0x05, 0x61, 0x73, + 0x73, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x73, 0x69, 0x66, 0x74, + 0x2e, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x73, 0x73, 0x65, 0x74, + 0x52, 0x05, 0x61, 0x73, 0x73, 0x65, 0x74, 0x22, 0x83, 0x01, 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x41, 0x73, 0x73, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2b, + 0x0a, 0x05, 0x61, 0x73, 0x73, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, + 0x73, 0x69, 0x66, 0x74, 0x2e, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x41, + 0x73, 0x73, 0x65, 0x74, 0x52, 0x05, 0x61, 0x73, 0x73, 0x65, 0x74, 0x12, 0x40, 0x0a, 0x0b, 0x75, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 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, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x42, 0x03, 0xe0, 0x41, + 0x02, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x22, 0x42, 0x0a, + 0x13, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x73, 0x73, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2b, 0x0a, 0x05, 0x61, 0x73, 0x73, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x73, 0x69, 0x66, 0x74, 0x2e, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x73, 0x73, 0x65, 0x74, 0x52, 0x05, 0x61, 0x73, 0x73, 0x65, - 0x74, 0x22, 0x83, 0x01, 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x73, 0x73, 0x65, - 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2b, 0x0a, 0x05, 0x61, 0x73, 0x73, 0x65, - 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x73, 0x69, 0x66, 0x74, 0x2e, 0x61, - 0x73, 0x73, 0x65, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x73, 0x73, 0x65, 0x74, 0x52, 0x05, - 0x61, 0x73, 0x73, 0x65, 0x74, 0x12, 0x40, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, - 0x6d, 0x61, 0x73, 0x6b, 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, 0x46, 0x69, 0x65, - 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x0a, 0x75, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x22, 0x42, 0x0a, 0x13, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x41, 0x73, 0x73, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2b, - 0x0a, 0x05, 0x61, 0x73, 0x73, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, - 0x73, 0x69, 0x66, 0x74, 0x2e, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x41, - 0x73, 0x73, 0x65, 0x74, 0x52, 0x05, 0x61, 0x73, 0x73, 0x65, 0x74, 0x32, 0x87, 0x06, 0x0a, 0x0c, - 0x41, 0x73, 0x73, 0x65, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x9c, 0x01, 0x0a, - 0x0b, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x73, 0x73, 0x65, 0x74, 0x12, 0x22, 0x2e, 0x73, + 0x74, 0x22, 0x5d, 0x0a, 0x13, 0x41, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x41, 0x73, 0x73, 0x65, + 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1e, 0x0a, 0x08, 0x61, 0x73, 0x73, 0x65, + 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, + 0x07, 0x61, 0x73, 0x73, 0x65, 0x74, 0x49, 0x64, 0x12, 0x26, 0x0a, 0x0c, 0x61, 0x72, 0x63, 0x68, + 0x69, 0x76, 0x65, 0x5f, 0x72, 0x75, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x42, 0x03, + 0xe0, 0x41, 0x01, 0x52, 0x0b, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x52, 0x75, 0x6e, 0x73, + 0x22, 0x45, 0x0a, 0x14, 0x41, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x41, 0x73, 0x73, 0x65, 0x74, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2d, 0x0a, 0x10, 0x61, 0x72, 0x63, 0x68, + 0x69, 0x76, 0x65, 0x64, 0x5f, 0x72, 0x75, 0x6e, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0e, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, + 0x64, 0x52, 0x75, 0x6e, 0x49, 0x64, 0x73, 0x32, 0xb6, 0x07, 0x0a, 0x0c, 0x41, 0x73, 0x73, 0x65, + 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x9f, 0x01, 0x0a, 0x0b, 0x44, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x41, 0x73, 0x73, 0x65, 0x74, 0x12, 0x22, 0x2e, 0x73, 0x69, 0x66, 0x74, 0x2e, + 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x41, 0x73, 0x73, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x73, 0x69, 0x66, 0x74, 0x2e, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, - 0x6c, 0x65, 0x74, 0x65, 0x41, 0x73, 0x73, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x23, 0x2e, 0x73, 0x69, 0x66, 0x74, 0x2e, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x2e, 0x76, - 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x73, 0x73, 0x65, 0x74, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x44, 0x92, 0x41, 0x20, 0x12, 0x0b, 0x44, 0x65, 0x6c, 0x65, - 0x74, 0x65, 0x41, 0x73, 0x73, 0x65, 0x74, 0x1a, 0x11, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x73, - 0x20, 0x61, 0x6e, 0x20, 0x61, 0x73, 0x73, 0x65, 0x74, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1b, - 0x2a, 0x19, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, - 0x2f, 0x7b, 0x61, 0x73, 0x73, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x7d, 0x12, 0x92, 0x01, 0x0a, 0x08, - 0x47, 0x65, 0x74, 0x41, 0x73, 0x73, 0x65, 0x74, 0x12, 0x1f, 0x2e, 0x73, 0x69, 0x66, 0x74, 0x2e, + 0x6c, 0x65, 0x74, 0x65, 0x41, 0x73, 0x73, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x47, 0x88, 0x02, 0x01, 0x92, 0x41, 0x20, 0x12, 0x0b, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x41, 0x73, 0x73, 0x65, 0x74, 0x1a, 0x11, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x73, 0x20, + 0x61, 0x6e, 0x20, 0x61, 0x73, 0x73, 0x65, 0x74, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1b, 0x2a, + 0x19, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x2f, + 0x7b, 0x61, 0x73, 0x73, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x7d, 0x12, 0x92, 0x01, 0x0a, 0x08, 0x47, + 0x65, 0x74, 0x41, 0x73, 0x73, 0x65, 0x74, 0x12, 0x1f, 0x2e, 0x73, 0x69, 0x66, 0x74, 0x2e, 0x61, + 0x73, 0x73, 0x65, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x73, 0x73, 0x65, + 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x73, 0x69, 0x66, 0x74, 0x2e, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x73, 0x73, - 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x73, 0x69, 0x66, 0x74, - 0x2e, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x73, - 0x73, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x43, 0x92, 0x41, 0x1f, - 0x12, 0x08, 0x47, 0x65, 0x74, 0x41, 0x73, 0x73, 0x65, 0x74, 0x1a, 0x13, 0x52, 0x65, 0x74, 0x72, - 0x69, 0x65, 0x76, 0x65, 0x73, 0x20, 0x61, 0x6e, 0x20, 0x61, 0x73, 0x73, 0x65, 0x74, 0x2e, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x1b, 0x12, 0x19, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x61, - 0x73, 0x73, 0x65, 0x74, 0x73, 0x2f, 0x7b, 0x61, 0x73, 0x73, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x7d, - 0x12, 0xa6, 0x01, 0x0a, 0x0a, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x12, - 0x21, 0x2e, 0x73, 0x69, 0x66, 0x74, 0x2e, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x2e, 0x76, 0x31, - 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x73, 0x69, 0x66, 0x74, 0x2e, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, - 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x51, 0x92, 0x41, 0x38, 0x12, 0x0a, 0x4c, 0x69, 0x73, - 0x74, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x1a, 0x2a, 0x52, 0x65, 0x74, 0x72, 0x69, 0x65, 0x76, - 0x65, 0x73, 0x20, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x20, 0x75, 0x73, 0x69, 0x6e, 0x67, 0x20, - 0x61, 0x6e, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x66, 0x69, 0x6c, 0x74, - 0x65, 0x72, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x10, 0x12, 0x0e, 0x2f, 0x61, 0x70, 0x69, 0x2f, - 0x76, 0x31, 0x2f, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x12, 0x9d, 0x01, 0x0a, 0x0b, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x41, 0x73, 0x73, 0x65, 0x74, 0x12, 0x22, 0x2e, 0x73, 0x69, 0x66, 0x74, - 0x2e, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x41, 0x73, 0x73, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, - 0x73, 0x69, 0x66, 0x74, 0x2e, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x73, 0x73, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x45, 0x92, 0x41, 0x29, 0x12, 0x0b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, - 0x73, 0x73, 0x65, 0x74, 0x1a, 0x1a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x20, 0x66, 0x69, 0x65, - 0x6c, 0x64, 0x73, 0x20, 0x6f, 0x6e, 0x20, 0x61, 0x6e, 0x20, 0x61, 0x73, 0x73, 0x65, 0x74, 0x2e, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x13, 0x3a, 0x01, 0x2a, 0x32, 0x0e, 0x2f, 0x61, 0x70, 0x69, 0x2f, - 0x76, 0x31, 0x2f, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x1a, 0x7a, 0x92, 0x41, 0x77, 0x12, 0x44, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x70, 0x72, 0x6f, 0x67, 0x72, - 0x61, 0x6d, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x6c, 0x79, 0x20, 0x69, 0x6e, 0x74, 0x65, - 0x72, 0x61, 0x63, 0x74, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x5b, 0x61, 0x73, 0x73, 0x65, 0x74, - 0x73, 0x5d, 0x28, 0x2f, 0x67, 0x6c, 0x6f, 0x73, 0x73, 0x61, 0x72, 0x79, 0x23, 0x61, 0x73, 0x73, - 0x65, 0x74, 0x29, 0x2e, 0x1a, 0x2f, 0x0a, 0x20, 0x52, 0x65, 0x61, 0x64, 0x20, 0x6d, 0x6f, 0x72, - 0x65, 0x20, 0x61, 0x62, 0x6f, 0x75, 0x74, 0x20, 0x77, 0x68, 0x61, 0x74, 0x20, 0x61, 0x73, 0x73, - 0x65, 0x74, 0x73, 0x20, 0x61, 0x72, 0x65, 0x2e, 0x12, 0x0b, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x2d, - 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x42, 0xca, 0x01, 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x69, - 0x66, 0x74, 0x2e, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x41, 0x73, - 0x73, 0x65, 0x74, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x39, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x69, 0x66, 0x74, 0x2d, 0x73, 0x74, 0x61, - 0x63, 0x6b, 0x2f, 0x73, 0x69, 0x66, 0x74, 0x2f, 0x67, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x73, - 0x69, 0x66, 0x74, 0x2f, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x61, 0x73, - 0x73, 0x65, 0x74, 0x73, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x53, 0x41, 0x58, 0xaa, 0x02, 0x0e, 0x53, - 0x69, 0x66, 0x74, 0x2e, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0e, - 0x53, 0x69, 0x66, 0x74, 0x5c, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x5c, 0x56, 0x31, 0xe2, 0x02, - 0x1a, 0x53, 0x69, 0x66, 0x74, 0x5c, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x5c, 0x56, 0x31, 0x5c, - 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x10, 0x53, 0x69, - 0x66, 0x74, 0x3a, 0x3a, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x3a, 0x3a, 0x56, 0x31, 0x92, 0x41, - 0x11, 0x12, 0x0f, 0x0a, 0x0d, 0x41, 0x73, 0x73, 0x65, 0x74, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x43, 0x92, 0x41, 0x1f, 0x12, + 0x08, 0x47, 0x65, 0x74, 0x41, 0x73, 0x73, 0x65, 0x74, 0x1a, 0x13, 0x52, 0x65, 0x74, 0x72, 0x69, + 0x65, 0x76, 0x65, 0x73, 0x20, 0x61, 0x6e, 0x20, 0x61, 0x73, 0x73, 0x65, 0x74, 0x2e, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x1b, 0x12, 0x19, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x73, + 0x73, 0x65, 0x74, 0x73, 0x2f, 0x7b, 0x61, 0x73, 0x73, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x7d, 0x12, + 0xa6, 0x01, 0x0a, 0x0a, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x12, 0x21, + 0x2e, 0x73, 0x69, 0x66, 0x74, 0x2e, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, + 0x4c, 0x69, 0x73, 0x74, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x22, 0x2e, 0x73, 0x69, 0x66, 0x74, 0x2e, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x2e, + 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x51, 0x92, 0x41, 0x38, 0x12, 0x0a, 0x4c, 0x69, 0x73, 0x74, + 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x1a, 0x2a, 0x52, 0x65, 0x74, 0x72, 0x69, 0x65, 0x76, 0x65, + 0x73, 0x20, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x20, 0x75, 0x73, 0x69, 0x6e, 0x67, 0x20, 0x61, + 0x6e, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x66, 0x69, 0x6c, 0x74, 0x65, + 0x72, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x10, 0x12, 0x0e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, + 0x31, 0x2f, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x12, 0x9d, 0x01, 0x0a, 0x0b, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x41, 0x73, 0x73, 0x65, 0x74, 0x12, 0x22, 0x2e, 0x73, 0x69, 0x66, 0x74, 0x2e, + 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x41, 0x73, 0x73, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x73, + 0x69, 0x66, 0x74, 0x2e, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x41, 0x73, 0x73, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x45, 0x92, 0x41, 0x29, 0x12, 0x0b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x73, + 0x73, 0x65, 0x74, 0x1a, 0x1a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x20, 0x66, 0x69, 0x65, 0x6c, + 0x64, 0x73, 0x20, 0x6f, 0x6e, 0x20, 0x61, 0x6e, 0x20, 0x61, 0x73, 0x73, 0x65, 0x74, 0x2e, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x13, 0x3a, 0x01, 0x2a, 0x32, 0x0e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, + 0x31, 0x2f, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x12, 0xa9, 0x01, 0x0a, 0x0c, 0x41, 0x72, 0x63, + 0x68, 0x69, 0x76, 0x65, 0x41, 0x73, 0x73, 0x65, 0x74, 0x12, 0x23, 0x2e, 0x73, 0x69, 0x66, 0x74, + 0x2e, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x72, 0x63, 0x68, 0x69, + 0x76, 0x65, 0x41, 0x73, 0x73, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, + 0x2e, 0x73, 0x69, 0x66, 0x74, 0x2e, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, + 0x41, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x41, 0x73, 0x73, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4e, 0x92, 0x41, 0x22, 0x12, 0x0c, 0x41, 0x72, 0x63, 0x68, 0x69, + 0x76, 0x65, 0x41, 0x73, 0x73, 0x65, 0x74, 0x1a, 0x12, 0x41, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, + 0x73, 0x20, 0x61, 0x6e, 0x20, 0x61, 0x73, 0x73, 0x65, 0x74, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x23, 0x22, 0x21, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x73, 0x73, 0x65, 0x74, + 0x73, 0x2f, 0x7b, 0x61, 0x73, 0x73, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x61, 0x72, 0x63, + 0x68, 0x69, 0x76, 0x65, 0x1a, 0x7a, 0x92, 0x41, 0x77, 0x12, 0x44, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x6d, 0x61, 0x74, + 0x69, 0x63, 0x61, 0x6c, 0x6c, 0x79, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x61, 0x63, 0x74, 0x20, + 0x77, 0x69, 0x74, 0x68, 0x20, 0x5b, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x5d, 0x28, 0x2f, 0x67, + 0x6c, 0x6f, 0x73, 0x73, 0x61, 0x72, 0x79, 0x23, 0x61, 0x73, 0x73, 0x65, 0x74, 0x29, 0x2e, 0x1a, + 0x2f, 0x0a, 0x20, 0x52, 0x65, 0x61, 0x64, 0x20, 0x6d, 0x6f, 0x72, 0x65, 0x20, 0x61, 0x62, 0x6f, + 0x75, 0x74, 0x20, 0x77, 0x68, 0x61, 0x74, 0x20, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x20, 0x61, + 0x72, 0x65, 0x2e, 0x12, 0x0b, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x2d, 0x6d, 0x6f, 0x64, 0x65, 0x6c, + 0x42, 0xca, 0x01, 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x69, 0x66, 0x74, 0x2e, 0x61, 0x73, + 0x73, 0x65, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x50, + 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x39, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x73, 0x69, 0x66, 0x74, 0x2d, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2f, 0x73, 0x69, + 0x66, 0x74, 0x2f, 0x67, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x73, 0x69, 0x66, 0x74, 0x2f, 0x61, + 0x73, 0x73, 0x65, 0x74, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x76, + 0x31, 0xa2, 0x02, 0x03, 0x53, 0x41, 0x58, 0xaa, 0x02, 0x0e, 0x53, 0x69, 0x66, 0x74, 0x2e, 0x41, + 0x73, 0x73, 0x65, 0x74, 0x73, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0e, 0x53, 0x69, 0x66, 0x74, 0x5c, + 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1a, 0x53, 0x69, 0x66, 0x74, + 0x5c, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x10, 0x53, 0x69, 0x66, 0x74, 0x3a, 0x3a, 0x41, + 0x73, 0x73, 0x65, 0x74, 0x73, 0x3a, 0x3a, 0x56, 0x31, 0x92, 0x41, 0x11, 0x12, 0x0f, 0x0a, 0x0d, + 0x41, 0x73, 0x73, 0x65, 0x74, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -764,7 +907,7 @@ func file_sift_assets_v1_assets_proto_rawDescGZIP() []byte { return file_sift_assets_v1_assets_proto_rawDescData } -var file_sift_assets_v1_assets_proto_msgTypes = make([]protoimpl.MessageInfo, 9) +var file_sift_assets_v1_assets_proto_msgTypes = make([]protoimpl.MessageInfo, 11) var file_sift_assets_v1_assets_proto_goTypes = []interface{}{ (*Asset)(nil), // 0: sift.assets.v1.Asset (*ListAssetsRequest)(nil), // 1: sift.assets.v1.ListAssetsRequest @@ -775,30 +918,34 @@ var file_sift_assets_v1_assets_proto_goTypes = []interface{}{ (*GetAssetResponse)(nil), // 6: sift.assets.v1.GetAssetResponse (*UpdateAssetRequest)(nil), // 7: sift.assets.v1.UpdateAssetRequest (*UpdateAssetResponse)(nil), // 8: sift.assets.v1.UpdateAssetResponse - (*timestamppb.Timestamp)(nil), // 9: google.protobuf.Timestamp - (*v1.MetadataValue)(nil), // 10: sift.metadata.v1.MetadataValue - (*fieldmaskpb.FieldMask)(nil), // 11: google.protobuf.FieldMask + (*ArchiveAssetRequest)(nil), // 9: sift.assets.v1.ArchiveAssetRequest + (*ArchiveAssetResponse)(nil), // 10: sift.assets.v1.ArchiveAssetResponse + (*timestamppb.Timestamp)(nil), // 11: google.protobuf.Timestamp + (*v1.MetadataValue)(nil), // 12: sift.metadata.v1.MetadataValue + (*fieldmaskpb.FieldMask)(nil), // 13: google.protobuf.FieldMask } var file_sift_assets_v1_assets_proto_depIdxs = []int32{ - 9, // 0: sift.assets.v1.Asset.created_date:type_name -> google.protobuf.Timestamp - 9, // 1: sift.assets.v1.Asset.modified_date:type_name -> google.protobuf.Timestamp - 10, // 2: sift.assets.v1.Asset.metadata:type_name -> sift.metadata.v1.MetadataValue - 9, // 3: sift.assets.v1.Asset.archived_date:type_name -> google.protobuf.Timestamp + 11, // 0: sift.assets.v1.Asset.created_date:type_name -> google.protobuf.Timestamp + 11, // 1: sift.assets.v1.Asset.modified_date:type_name -> google.protobuf.Timestamp + 12, // 2: sift.assets.v1.Asset.metadata:type_name -> sift.metadata.v1.MetadataValue + 11, // 3: sift.assets.v1.Asset.archived_date:type_name -> google.protobuf.Timestamp 0, // 4: sift.assets.v1.ListAssetsResponse.assets:type_name -> sift.assets.v1.Asset 0, // 5: sift.assets.v1.GetAssetResponse.asset:type_name -> sift.assets.v1.Asset 0, // 6: sift.assets.v1.UpdateAssetRequest.asset:type_name -> sift.assets.v1.Asset - 11, // 7: sift.assets.v1.UpdateAssetRequest.update_mask:type_name -> google.protobuf.FieldMask + 13, // 7: sift.assets.v1.UpdateAssetRequest.update_mask:type_name -> google.protobuf.FieldMask 0, // 8: sift.assets.v1.UpdateAssetResponse.asset:type_name -> sift.assets.v1.Asset 3, // 9: sift.assets.v1.AssetService.DeleteAsset:input_type -> sift.assets.v1.DeleteAssetRequest 5, // 10: sift.assets.v1.AssetService.GetAsset:input_type -> sift.assets.v1.GetAssetRequest 1, // 11: sift.assets.v1.AssetService.ListAssets:input_type -> sift.assets.v1.ListAssetsRequest 7, // 12: sift.assets.v1.AssetService.UpdateAsset:input_type -> sift.assets.v1.UpdateAssetRequest - 4, // 13: sift.assets.v1.AssetService.DeleteAsset:output_type -> sift.assets.v1.DeleteAssetResponse - 6, // 14: sift.assets.v1.AssetService.GetAsset:output_type -> sift.assets.v1.GetAssetResponse - 2, // 15: sift.assets.v1.AssetService.ListAssets:output_type -> sift.assets.v1.ListAssetsResponse - 8, // 16: sift.assets.v1.AssetService.UpdateAsset:output_type -> sift.assets.v1.UpdateAssetResponse - 13, // [13:17] is the sub-list for method output_type - 9, // [9:13] is the sub-list for method input_type + 9, // 13: sift.assets.v1.AssetService.ArchiveAsset:input_type -> sift.assets.v1.ArchiveAssetRequest + 4, // 14: sift.assets.v1.AssetService.DeleteAsset:output_type -> sift.assets.v1.DeleteAssetResponse + 6, // 15: sift.assets.v1.AssetService.GetAsset:output_type -> sift.assets.v1.GetAssetResponse + 2, // 16: sift.assets.v1.AssetService.ListAssets:output_type -> sift.assets.v1.ListAssetsResponse + 8, // 17: sift.assets.v1.AssetService.UpdateAsset:output_type -> sift.assets.v1.UpdateAssetResponse + 10, // 18: sift.assets.v1.AssetService.ArchiveAsset:output_type -> sift.assets.v1.ArchiveAssetResponse + 14, // [14:19] is the sub-list for method output_type + 9, // [9:14] is the sub-list for method input_type 9, // [9:9] is the sub-list for extension type_name 9, // [9:9] is the sub-list for extension extendee 0, // [0:9] is the sub-list for field type_name @@ -918,6 +1065,30 @@ func file_sift_assets_v1_assets_proto_init() { return nil } } + file_sift_assets_v1_assets_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ArchiveAssetRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_sift_assets_v1_assets_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ArchiveAssetResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -925,7 +1096,7 @@ func file_sift_assets_v1_assets_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_sift_assets_v1_assets_proto_rawDesc, NumEnums: 0, - NumMessages: 9, + NumMessages: 11, NumExtensions: 0, NumServices: 1, }, diff --git a/go/gen/sift/assets/v1/assets.pb.gw.go b/go/gen/sift/assets/v1/assets.pb.gw.go index f8682e5f5..eda3d6c81 100644 --- a/go/gen/sift/assets/v1/assets.pb.gw.go +++ b/go/gen/sift/assets/v1/assets.pb.gw.go @@ -223,6 +223,76 @@ func local_request_AssetService_UpdateAsset_0(ctx context.Context, marshaler run } +var ( + filter_AssetService_ArchiveAsset_0 = &utilities.DoubleArray{Encoding: map[string]int{"asset_id": 0, "assetId": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} +) + +func request_AssetService_ArchiveAsset_0(ctx context.Context, marshaler runtime.Marshaler, client AssetServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ArchiveAssetRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["asset_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "asset_id") + } + + protoReq.AssetId, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "asset_id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AssetService_ArchiveAsset_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ArchiveAsset(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_AssetService_ArchiveAsset_0(ctx context.Context, marshaler runtime.Marshaler, server AssetServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ArchiveAssetRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["asset_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "asset_id") + } + + protoReq.AssetId, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "asset_id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AssetService_ArchiveAsset_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ArchiveAsset(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterAssetServiceHandlerServer registers the http handlers for service AssetService to "mux". // UnaryRPC :call AssetServiceServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -329,6 +399,31 @@ func RegisterAssetServiceHandlerServer(ctx context.Context, mux *runtime.ServeMu }) + mux.Handle("POST", pattern_AssetService_ArchiveAsset_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/sift.assets.v1.AssetService/ArchiveAsset", runtime.WithHTTPPathPattern("/api/v1/assets/{asset_id}/archive")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_AssetService_ArchiveAsset_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_AssetService_ArchiveAsset_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -458,6 +553,28 @@ func RegisterAssetServiceHandlerClient(ctx context.Context, mux *runtime.ServeMu }) + mux.Handle("POST", pattern_AssetService_ArchiveAsset_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/sift.assets.v1.AssetService/ArchiveAsset", runtime.WithHTTPPathPattern("/api/v1/assets/{asset_id}/archive")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_AssetService_ArchiveAsset_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_AssetService_ArchiveAsset_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -469,6 +586,8 @@ var ( pattern_AssetService_ListAssets_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "assets"}, "")) pattern_AssetService_UpdateAsset_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "assets"}, "")) + + pattern_AssetService_ArchiveAsset_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"api", "v1", "assets", "asset_id", "archive"}, "")) ) var ( @@ -479,4 +598,6 @@ var ( forward_AssetService_ListAssets_0 = runtime.ForwardResponseMessage forward_AssetService_UpdateAsset_0 = runtime.ForwardResponseMessage + + forward_AssetService_ArchiveAsset_0 = runtime.ForwardResponseMessage ) diff --git a/go/gen/sift/assets/v1/assets_vtproto.pb.go b/go/gen/sift/assets/v1/assets_vtproto.pb.go index 57547e870..84faa4e28 100644 --- a/go/gen/sift/assets/v1/assets_vtproto.pb.go +++ b/go/gen/sift/assets/v1/assets_vtproto.pb.go @@ -42,6 +42,7 @@ func (m *Asset) CloneVT() *Asset { r.ModifiedDate = (*timestamppb.Timestamp)((*timestamppb1.Timestamp)(m.ModifiedDate).CloneVT()) r.ModifiedByUserId = m.ModifiedByUserId r.ArchivedDate = (*timestamppb.Timestamp)((*timestamppb1.Timestamp)(m.ArchivedDate).CloneVT()) + r.IsArchived = m.IsArchived if rhs := m.Tags; rhs != nil { tmpContainer := make([]string, len(rhs)) copy(tmpContainer, rhs) @@ -216,6 +217,45 @@ func (m *UpdateAssetResponse) CloneMessageVT() proto.Message { return m.CloneVT() } +func (m *ArchiveAssetRequest) CloneVT() *ArchiveAssetRequest { + if m == nil { + return (*ArchiveAssetRequest)(nil) + } + r := new(ArchiveAssetRequest) + r.AssetId = m.AssetId + r.ArchiveRuns = m.ArchiveRuns + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *ArchiveAssetRequest) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *ArchiveAssetResponse) CloneVT() *ArchiveAssetResponse { + if m == nil { + return (*ArchiveAssetResponse)(nil) + } + r := new(ArchiveAssetResponse) + if rhs := m.ArchivedRunIds; rhs != nil { + tmpContainer := make([]string, len(rhs)) + copy(tmpContainer, rhs) + r.ArchivedRunIds = tmpContainer + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *ArchiveAssetResponse) CloneMessageVT() proto.Message { + return m.CloneVT() +} + func (this *Asset) EqualVT(that *Asset) bool { if this == that { return true @@ -276,6 +316,9 @@ func (this *Asset) EqualVT(that *Asset) bool { if !(*timestamppb1.Timestamp)(this.ArchivedDate).EqualVT((*timestamppb1.Timestamp)(that.ArchivedDate)) { return false } + if this.IsArchived != that.IsArchived { + return false + } return string(this.unknownFields) == string(that.unknownFields) } @@ -467,6 +510,53 @@ func (this *UpdateAssetResponse) EqualMessageVT(thatMsg proto.Message) bool { } return this.EqualVT(that) } +func (this *ArchiveAssetRequest) EqualVT(that *ArchiveAssetRequest) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.AssetId != that.AssetId { + return false + } + if this.ArchiveRuns != that.ArchiveRuns { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *ArchiveAssetRequest) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*ArchiveAssetRequest) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *ArchiveAssetResponse) EqualVT(that *ArchiveAssetResponse) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if len(this.ArchivedRunIds) != len(that.ArchivedRunIds) { + return false + } + for i, vx := range this.ArchivedRunIds { + vy := that.ArchivedRunIds[i] + if vx != vy { + return false + } + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *ArchiveAssetResponse) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*ArchiveAssetResponse) + if !ok { + return false + } + return this.EqualVT(that) +} // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. @@ -477,13 +567,17 @@ const _ = grpc.SupportPackageIsVersion7 // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type AssetServiceClient interface { + // Deprecated: Do not use. // Delete will archive an asset. + // Deprecated: Use ArchiveAsset instead. DeleteAsset(ctx context.Context, in *DeleteAssetRequest, opts ...grpc.CallOption) (*DeleteAssetResponse, error) // Retrieves an asset. GetAsset(ctx context.Context, in *GetAssetRequest, opts ...grpc.CallOption) (*GetAssetResponse, error) // Retrieves assets using an optional filter. ListAssets(ctx context.Context, in *ListAssetsRequest, opts ...grpc.CallOption) (*ListAssetsResponse, error) UpdateAsset(ctx context.Context, in *UpdateAssetRequest, opts ...grpc.CallOption) (*UpdateAssetResponse, error) + // Archive an asset. + ArchiveAsset(ctx context.Context, in *ArchiveAssetRequest, opts ...grpc.CallOption) (*ArchiveAssetResponse, error) } type assetServiceClient struct { @@ -494,6 +588,7 @@ func NewAssetServiceClient(cc grpc.ClientConnInterface) AssetServiceClient { return &assetServiceClient{cc} } +// Deprecated: Do not use. func (c *assetServiceClient) DeleteAsset(ctx context.Context, in *DeleteAssetRequest, opts ...grpc.CallOption) (*DeleteAssetResponse, error) { out := new(DeleteAssetResponse) err := c.cc.Invoke(ctx, "/sift.assets.v1.AssetService/DeleteAsset", in, out, opts...) @@ -530,17 +625,30 @@ func (c *assetServiceClient) UpdateAsset(ctx context.Context, in *UpdateAssetReq return out, nil } +func (c *assetServiceClient) ArchiveAsset(ctx context.Context, in *ArchiveAssetRequest, opts ...grpc.CallOption) (*ArchiveAssetResponse, error) { + out := new(ArchiveAssetResponse) + err := c.cc.Invoke(ctx, "/sift.assets.v1.AssetService/ArchiveAsset", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // AssetServiceServer is the server API for AssetService service. // All implementations must embed UnimplementedAssetServiceServer // for forward compatibility type AssetServiceServer interface { + // Deprecated: Do not use. // Delete will archive an asset. + // Deprecated: Use ArchiveAsset instead. DeleteAsset(context.Context, *DeleteAssetRequest) (*DeleteAssetResponse, error) // Retrieves an asset. GetAsset(context.Context, *GetAssetRequest) (*GetAssetResponse, error) // Retrieves assets using an optional filter. ListAssets(context.Context, *ListAssetsRequest) (*ListAssetsResponse, error) UpdateAsset(context.Context, *UpdateAssetRequest) (*UpdateAssetResponse, error) + // Archive an asset. + ArchiveAsset(context.Context, *ArchiveAssetRequest) (*ArchiveAssetResponse, error) mustEmbedUnimplementedAssetServiceServer() } @@ -560,6 +668,9 @@ func (UnimplementedAssetServiceServer) ListAssets(context.Context, *ListAssetsRe func (UnimplementedAssetServiceServer) UpdateAsset(context.Context, *UpdateAssetRequest) (*UpdateAssetResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateAsset not implemented") } +func (UnimplementedAssetServiceServer) ArchiveAsset(context.Context, *ArchiveAssetRequest) (*ArchiveAssetResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ArchiveAsset not implemented") +} func (UnimplementedAssetServiceServer) mustEmbedUnimplementedAssetServiceServer() {} // UnsafeAssetServiceServer may be embedded to opt out of forward compatibility for this service. @@ -645,6 +756,24 @@ func _AssetService_UpdateAsset_Handler(srv interface{}, ctx context.Context, dec return interceptor(ctx, in, info, handler) } +func _AssetService_ArchiveAsset_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ArchiveAssetRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AssetServiceServer).ArchiveAsset(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/sift.assets.v1.AssetService/ArchiveAsset", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AssetServiceServer).ArchiveAsset(ctx, req.(*ArchiveAssetRequest)) + } + return interceptor(ctx, in, info, handler) +} + // AssetService_ServiceDesc is the grpc.ServiceDesc for AssetService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -668,6 +797,10 @@ var AssetService_ServiceDesc = grpc.ServiceDesc{ MethodName: "UpdateAsset", Handler: _AssetService_UpdateAsset_Handler, }, + { + MethodName: "ArchiveAsset", + Handler: _AssetService_ArchiveAsset_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "sift/assets/v1/assets.proto", @@ -703,6 +836,16 @@ func (m *Asset) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } + if m.IsArchived { + i-- + if m.IsArchived { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x60 + } if m.ArchivedDate != nil { size, err := (*timestamppb1.Timestamp)(m.ArchivedDate).MarshalToSizedBufferVT(dAtA[:i]) if err != nil { @@ -1177,6 +1320,98 @@ func (m *UpdateAssetResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *ArchiveAssetRequest) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ArchiveAssetRequest) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *ArchiveAssetRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.ArchiveRuns { + i-- + if m.ArchiveRuns { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + if len(m.AssetId) > 0 { + i -= len(m.AssetId) + copy(dAtA[i:], m.AssetId) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.AssetId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ArchiveAssetResponse) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ArchiveAssetResponse) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *ArchiveAssetResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.ArchivedRunIds) > 0 { + for iNdEx := len(m.ArchivedRunIds) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.ArchivedRunIds[iNdEx]) + copy(dAtA[i:], m.ArchivedRunIds[iNdEx]) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.ArchivedRunIds[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + func (m *Asset) MarshalVTStrict() (dAtA []byte, err error) { if m == nil { return nil, nil @@ -1207,6 +1442,16 @@ func (m *Asset) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } + if m.IsArchived { + i-- + if m.IsArchived { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x60 + } if m.ArchivedDate != nil { size, err := (*timestamppb1.Timestamp)(m.ArchivedDate).MarshalToSizedBufferVTStrict(dAtA[:i]) if err != nil { @@ -1681,38 +1926,130 @@ func (m *UpdateAssetResponse) MarshalToSizedBufferVTStrict(dAtA []byte) (int, er return len(dAtA) - i, nil } -func (m *Asset) SizeVT() (n int) { +func (m *ArchiveAssetRequest) MarshalVTStrict() (dAtA []byte, err error) { if m == nil { - return 0 + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ArchiveAssetRequest) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *ArchiveAssetRequest) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + if m == nil { + return 0, nil } + i := len(dAtA) + _ = i var l int _ = l - l = len(m.AssetId) - if l > 0 { - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) - } - l = len(m.Name) - if l > 0 { - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) } - l = len(m.OrganizationId) - if l > 0 { - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + if m.ArchiveRuns { + i-- + if m.ArchiveRuns { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 } - if m.CreatedDate != nil { - l = (*timestamppb1.Timestamp)(m.CreatedDate).SizeVT() - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + if len(m.AssetId) > 0 { + i -= len(m.AssetId) + copy(dAtA[i:], m.AssetId) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.AssetId))) + i-- + dAtA[i] = 0xa } - l = len(m.CreatedByUserId) - if l > 0 { - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + return len(dAtA) - i, nil +} + +func (m *ArchiveAssetResponse) MarshalVTStrict() (dAtA []byte, err error) { + if m == nil { + return nil, nil } - if m.ModifiedDate != nil { - l = (*timestamppb1.Timestamp)(m.ModifiedDate).SizeVT() - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) + if err != nil { + return nil, err } - l = len(m.ModifiedByUserId) - if l > 0 { + return dAtA[:n], nil +} + +func (m *ArchiveAssetResponse) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *ArchiveAssetResponse) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.ArchivedRunIds) > 0 { + for iNdEx := len(m.ArchivedRunIds) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.ArchivedRunIds[iNdEx]) + copy(dAtA[i:], m.ArchivedRunIds[iNdEx]) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.ArchivedRunIds[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *Asset) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.AssetId) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.OrganizationId) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.CreatedDate != nil { + l = (*timestamppb1.Timestamp)(m.CreatedDate).SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.CreatedByUserId) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.ModifiedDate != nil { + l = (*timestamppb1.Timestamp)(m.ModifiedDate).SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.ModifiedByUserId) + if l > 0 { n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if len(m.Tags) > 0 { @@ -1737,6 +2074,9 @@ func (m *Asset) SizeVT() (n int) { l = (*timestamppb1.Timestamp)(m.ArchivedDate).SizeVT() n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } + if m.IsArchived { + n += 2 + } n += len(m.unknownFields) return n } @@ -1873,6 +2213,39 @@ func (m *UpdateAssetResponse) SizeVT() (n int) { return n } +func (m *ArchiveAssetRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.AssetId) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.ArchiveRuns { + n += 2 + } + n += len(m.unknownFields) + return n +} + +func (m *ArchiveAssetResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.ArchivedRunIds) > 0 { + for _, s := range m.ArchivedRunIds { + l = len(s) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + n += len(m.unknownFields) + return n +} + func (m *Asset) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -2244,6 +2617,26 @@ func (m *Asset) UnmarshalVT(dAtA []byte) error { return err } iNdEx = postIndex + case 12: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IsArchived", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IsArchived = bool(v != 0) default: iNdEx = preIndex skippy, err := protohelpers.Skip(dAtA[iNdEx:]) @@ -3083,6 +3476,192 @@ func (m *UpdateAssetResponse) UnmarshalVT(dAtA []byte) error { } return nil } +func (m *ArchiveAssetRequest) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ArchiveAssetRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ArchiveAssetRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AssetId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AssetId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ArchiveRuns", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.ArchiveRuns = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ArchiveAssetResponse) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ArchiveAssetResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ArchiveAssetResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ArchivedRunIds", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ArchivedRunIds = append(m.ArchivedRunIds, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *Asset) UnmarshalVTUnsafe(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -3478,6 +4057,26 @@ func (m *Asset) UnmarshalVTUnsafe(dAtA []byte) error { return err } iNdEx = postIndex + case 12: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IsArchived", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IsArchived = bool(v != 0) default: iNdEx = preIndex skippy, err := protohelpers.Skip(dAtA[iNdEx:]) @@ -4341,3 +4940,197 @@ func (m *UpdateAssetResponse) UnmarshalVTUnsafe(dAtA []byte) error { } return nil } +func (m *ArchiveAssetRequest) UnmarshalVTUnsafe(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ArchiveAssetRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ArchiveAssetRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AssetId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.AssetId = stringValue + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ArchiveRuns", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.ArchiveRuns = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ArchiveAssetResponse) UnmarshalVTUnsafe(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ArchiveAssetResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ArchiveAssetResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ArchivedRunIds", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.ArchivedRunIds = append(m.ArchivedRunIds, stringValue) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} diff --git a/protos/sift/assets/v1/assets.proto b/protos/sift/assets/v1/assets.proto index b974bb04b..29dbe53f6 100644 --- a/protos/sift/assets/v1/assets.proto +++ b/protos/sift/assets/v1/assets.proto @@ -18,13 +18,15 @@ service AssetService { option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_tag) = { description: "Service to programmatically interact with [assets](/glossary#asset)." external_docs: { - url: "/data-model", - description: "Read more about what assets are."; + url: "/data-model" + description: "Read more about what assets are." } }; // Delete will archive an asset. + // Deprecated: Use ArchiveAsset instead. rpc DeleteAsset(DeleteAssetRequest) returns (DeleteAssetResponse) { + option deprecated = true; option (google.api.http) = {delete: "/api/v1/assets/{asset_id}"}; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { summary: "DeleteAsset" @@ -52,7 +54,7 @@ service AssetService { rpc UpdateAsset(UpdateAssetRequest) returns (UpdateAssetResponse) { option (google.api.http) = { - patch: "/api/v1/assets", + patch: "/api/v1/assets" body: "*" }; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { @@ -60,6 +62,15 @@ service AssetService { description: "Update fields on an asset." }; } + + // Archive an asset. + rpc ArchiveAsset(ArchiveAssetRequest) returns (ArchiveAssetResponse) { + option (google.api.http) = {post: "/api/v1/assets/{asset_id}/archive"}; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + summary: "ArchiveAsset" + description: "Archives an asset." + }; + } } message Asset { @@ -79,6 +90,9 @@ message Asset { // The date the asset was archived. google.protobuf.Timestamp archived_date = 11 [(google.api.field_behavior) = OPTIONAL]; + + // Whether the asset is archived. This is inferred from whether archived_date is set. + bool is_archived = 12 [(google.api.field_behavior) = REQUIRED]; } // The request for a call to `AssetService_ListAssets`. @@ -97,7 +111,7 @@ message ListAssetsRequest { // A [Common Expression Language (CEL)](https://github.com/google/cel-spec) filter string. // Available fields to filter by are `asset_id`, `created_by_user_id`, `modified_by_user_id`, - // `created_date`, `modified_date`, `name`, `tag_id`, `tag_name`, and `metadata`. Metadata can be used in filters by using `metadata.{metadata_key_name}` as the field name. + // `created_date`, `modified_date`, `name`, `tag_id`, `tag_name`, `is_archived`, and `metadata`. Metadata can be used in filters by using `metadata.{metadata_key_name}` as the field name. // For further information about how to use CELs, please refer to [this guide](https://github.com/google/cel-spec/blob/master/doc/langdef.md#standard-definitions). // For more information about the fields used for filtering, please refer to [this definition](/docs/api/grpc/protocol-buffers/assets#asset). Optional. string filter = 3 [(google.api.field_behavior) = OPTIONAL]; @@ -117,6 +131,7 @@ message ListAssetsResponse { } // The request for a call to `AssetService_DeleteAsset` to archive a single existing asset by its asset_id. +// Deprecated: Use ArchiveAssetRequest instead. message DeleteAssetRequest { // The id of the asset to be archived. Required. string asset_id = 1 [(google.api.field_behavior) = REQUIRED]; @@ -126,6 +141,7 @@ message DeleteAssetRequest { } // The response of a call to `AssetService_DeleteAsset`. +// Deprecated: Use ArchiveAssetResponse instead. message DeleteAssetResponse {} // The request for a call to `AssetService_GetAsset` to retrieve a single existing asset by its asset_id. @@ -144,7 +160,7 @@ message UpdateAssetRequest { // and is required. Asset asset = 1; - // The list of fields to be updated. The fields available to be updated are `tags`, `metadata`, and `archived_date`. + // The list of fields to be updated. The fields available to be updated are `tags`, `metadata`, `archived_date`, and `is_archived`. google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; } @@ -152,3 +168,19 @@ message UpdateAssetRequest { message UpdateAssetResponse { Asset asset = 1; } + +// The request for a call to `AssetService_ArchiveAsset` to archive a single existing asset by its asset_id. +message ArchiveAssetRequest { + // The id of the asset to be archived. Required. + string asset_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // If true, will archive all runs associated with the asset. + bool archive_runs = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// The response of a call to `AssetService_ArchiveAsset`. +message ArchiveAssetResponse { + // List of run IDs that were archived when archive_runs was set to true. + // This field will be empty if archive_runs was false or if no runs were archived. + repeated string archived_run_ids = 1 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/python/lib/sift/assets/v1/assets_pb2.py b/python/lib/sift/assets/v1/assets_pb2.py index 10778299c..a528613f2 100644 --- a/python/lib/sift/assets/v1/assets_pb2.py +++ b/python/lib/sift/assets/v1/assets_pb2.py @@ -20,7 +20,7 @@ from sift.metadata.v1 import metadata_pb2 as sift_dot_metadata_dot_v1_dot_metadata__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1bsift/assets/v1/assets.proto\x12\x0esift.assets.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a.protoc-gen-openapiv2/options/annotations.proto\x1a\x1fsift/metadata/v1/metadata.proto\"\xff\x03\n\x05\x41sset\x12\x1e\n\x08\x61sset_id\x18\x01 \x01(\tB\x03\xe0\x41\x02R\x07\x61ssetId\x12\x17\n\x04name\x18\x02 \x01(\tB\x03\xe0\x41\x02R\x04name\x12,\n\x0forganization_id\x18\x04 \x01(\tB\x03\xe0\x41\x02R\x0eorganizationId\x12\x42\n\x0c\x63reated_date\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x02R\x0b\x63reatedDate\x12\x30\n\x12\x63reated_by_user_id\x18\x06 \x01(\tB\x03\xe0\x41\x02R\x0f\x63reatedByUserId\x12\x44\n\rmodified_date\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x02R\x0cmodifiedDate\x12\x32\n\x13modified_by_user_id\x18\x08 \x01(\tB\x03\xe0\x41\x02R\x10modifiedByUserId\x12\x17\n\x04tags\x18\t \x03(\tB\x03\xe0\x41\x02R\x04tags\x12@\n\x08metadata\x18\n \x03(\x0b\x32\x1f.sift.metadata.v1.MetadataValueB\x03\xe0\x41\x02R\x08metadata\x12\x44\n\rarchived_date\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01R\x0c\x61rchivedDate\"\x96\x01\n\x11ListAssetsRequest\x12 \n\tpage_size\x18\x01 \x01(\rB\x03\xe0\x41\x01R\x08pageSize\x12\"\n\npage_token\x18\x02 \x01(\tB\x03\xe0\x41\x01R\tpageToken\x12\x1b\n\x06\x66ilter\x18\x03 \x01(\tB\x03\xe0\x41\x01R\x06\x66ilter\x12\x1e\n\x08order_by\x18\x04 \x01(\tB\x03\xe0\x41\x01R\x07orderBy\"k\n\x12ListAssetsResponse\x12-\n\x06\x61ssets\x18\x01 \x03(\x0b\x32\x15.sift.assets.v1.AssetR\x06\x61ssets\x12&\n\x0fnext_page_token\x18\x05 \x01(\tR\rnextPageToken\"\\\n\x12\x44\x65leteAssetRequest\x12\x1e\n\x08\x61sset_id\x18\x01 \x01(\tB\x03\xe0\x41\x02R\x07\x61ssetId\x12&\n\x0c\x61rchive_runs\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01R\x0b\x61rchiveRuns\"\x15\n\x13\x44\x65leteAssetResponse\"1\n\x0fGetAssetRequest\x12\x1e\n\x08\x61sset_id\x18\x01 \x01(\tB\x03\xe0\x41\x02R\x07\x61ssetId\"?\n\x10GetAssetResponse\x12+\n\x05\x61sset\x18\x01 \x01(\x0b\x32\x15.sift.assets.v1.AssetR\x05\x61sset\"\x83\x01\n\x12UpdateAssetRequest\x12+\n\x05\x61sset\x18\x01 \x01(\x0b\x32\x15.sift.assets.v1.AssetR\x05\x61sset\x12@\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02R\nupdateMask\"B\n\x13UpdateAssetResponse\x12+\n\x05\x61sset\x18\x01 \x01(\x0b\x32\x15.sift.assets.v1.AssetR\x05\x61sset2\x87\x06\n\x0c\x41ssetService\x12\x9c\x01\n\x0b\x44\x65leteAsset\x12\".sift.assets.v1.DeleteAssetRequest\x1a#.sift.assets.v1.DeleteAssetResponse\"D\x92\x41 \x12\x0b\x44\x65leteAsset\x1a\x11\x44\x65letes an asset.\x82\xd3\xe4\x93\x02\x1b*\x19/api/v1/assets/{asset_id}\x12\x92\x01\n\x08GetAsset\x12\x1f.sift.assets.v1.GetAssetRequest\x1a .sift.assets.v1.GetAssetResponse\"C\x92\x41\x1f\x12\x08GetAsset\x1a\x13Retrieves an asset.\x82\xd3\xe4\x93\x02\x1b\x12\x19/api/v1/assets/{asset_id}\x12\xa6\x01\n\nListAssets\x12!.sift.assets.v1.ListAssetsRequest\x1a\".sift.assets.v1.ListAssetsResponse\"Q\x92\x41\x38\x12\nListAssets\x1a*Retrieves assets using an optional filter.\x82\xd3\xe4\x93\x02\x10\x12\x0e/api/v1/assets\x12\x9d\x01\n\x0bUpdateAsset\x12\".sift.assets.v1.UpdateAssetRequest\x1a#.sift.assets.v1.UpdateAssetResponse\"E\x92\x41)\x12\x0bUpdateAsset\x1a\x1aUpdate fields on an asset.\x82\xd3\xe4\x93\x02\x13\x32\x0e/api/v1/assets:\x01*\x1az\x92\x41w\x12\x44Service to programmatically interact with [assets](/glossary#asset).\x1a/\n Read more about what assets are.\x12\x0b/data-modelB\x8f\x01\n\x12\x63om.sift.assets.v1B\x0b\x41ssetsProtoP\x01\xa2\x02\x03SAX\xaa\x02\x0eSift.Assets.V1\xca\x02\x0eSift\\Assets\\V1\xe2\x02\x1aSift\\Assets\\V1\\GPBMetadata\xea\x02\x10Sift::Assets::V1\x92\x41\x11\x12\x0f\n\rAsset Serviceb\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1bsift/assets/v1/assets.proto\x12\x0esift.assets.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a.protoc-gen-openapiv2/options/annotations.proto\x1a\x1fsift/metadata/v1/metadata.proto\"\xa5\x04\n\x05\x41sset\x12\x1e\n\x08\x61sset_id\x18\x01 \x01(\tB\x03\xe0\x41\x02R\x07\x61ssetId\x12\x17\n\x04name\x18\x02 \x01(\tB\x03\xe0\x41\x02R\x04name\x12,\n\x0forganization_id\x18\x04 \x01(\tB\x03\xe0\x41\x02R\x0eorganizationId\x12\x42\n\x0c\x63reated_date\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x02R\x0b\x63reatedDate\x12\x30\n\x12\x63reated_by_user_id\x18\x06 \x01(\tB\x03\xe0\x41\x02R\x0f\x63reatedByUserId\x12\x44\n\rmodified_date\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x02R\x0cmodifiedDate\x12\x32\n\x13modified_by_user_id\x18\x08 \x01(\tB\x03\xe0\x41\x02R\x10modifiedByUserId\x12\x17\n\x04tags\x18\t \x03(\tB\x03\xe0\x41\x02R\x04tags\x12@\n\x08metadata\x18\n \x03(\x0b\x32\x1f.sift.metadata.v1.MetadataValueB\x03\xe0\x41\x02R\x08metadata\x12\x44\n\rarchived_date\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01R\x0c\x61rchivedDate\x12$\n\x0bis_archived\x18\x0c \x01(\x08\x42\x03\xe0\x41\x02R\nisArchived\"\x96\x01\n\x11ListAssetsRequest\x12 \n\tpage_size\x18\x01 \x01(\rB\x03\xe0\x41\x01R\x08pageSize\x12\"\n\npage_token\x18\x02 \x01(\tB\x03\xe0\x41\x01R\tpageToken\x12\x1b\n\x06\x66ilter\x18\x03 \x01(\tB\x03\xe0\x41\x01R\x06\x66ilter\x12\x1e\n\x08order_by\x18\x04 \x01(\tB\x03\xe0\x41\x01R\x07orderBy\"k\n\x12ListAssetsResponse\x12-\n\x06\x61ssets\x18\x01 \x03(\x0b\x32\x15.sift.assets.v1.AssetR\x06\x61ssets\x12&\n\x0fnext_page_token\x18\x05 \x01(\tR\rnextPageToken\"\\\n\x12\x44\x65leteAssetRequest\x12\x1e\n\x08\x61sset_id\x18\x01 \x01(\tB\x03\xe0\x41\x02R\x07\x61ssetId\x12&\n\x0c\x61rchive_runs\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01R\x0b\x61rchiveRuns\"\x15\n\x13\x44\x65leteAssetResponse\"1\n\x0fGetAssetRequest\x12\x1e\n\x08\x61sset_id\x18\x01 \x01(\tB\x03\xe0\x41\x02R\x07\x61ssetId\"?\n\x10GetAssetResponse\x12+\n\x05\x61sset\x18\x01 \x01(\x0b\x32\x15.sift.assets.v1.AssetR\x05\x61sset\"\x83\x01\n\x12UpdateAssetRequest\x12+\n\x05\x61sset\x18\x01 \x01(\x0b\x32\x15.sift.assets.v1.AssetR\x05\x61sset\x12@\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02R\nupdateMask\"B\n\x13UpdateAssetResponse\x12+\n\x05\x61sset\x18\x01 \x01(\x0b\x32\x15.sift.assets.v1.AssetR\x05\x61sset\"]\n\x13\x41rchiveAssetRequest\x12\x1e\n\x08\x61sset_id\x18\x01 \x01(\tB\x03\xe0\x41\x02R\x07\x61ssetId\x12&\n\x0c\x61rchive_runs\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01R\x0b\x61rchiveRuns\"E\n\x14\x41rchiveAssetResponse\x12-\n\x10\x61rchived_run_ids\x18\x01 \x03(\tB\x03\xe0\x41\x01R\x0e\x61rchivedRunIds2\xb6\x07\n\x0c\x41ssetService\x12\x9f\x01\n\x0b\x44\x65leteAsset\x12\".sift.assets.v1.DeleteAssetRequest\x1a#.sift.assets.v1.DeleteAssetResponse\"G\x88\x02\x01\x92\x41 \x12\x0b\x44\x65leteAsset\x1a\x11\x44\x65letes an asset.\x82\xd3\xe4\x93\x02\x1b*\x19/api/v1/assets/{asset_id}\x12\x92\x01\n\x08GetAsset\x12\x1f.sift.assets.v1.GetAssetRequest\x1a .sift.assets.v1.GetAssetResponse\"C\x92\x41\x1f\x12\x08GetAsset\x1a\x13Retrieves an asset.\x82\xd3\xe4\x93\x02\x1b\x12\x19/api/v1/assets/{asset_id}\x12\xa6\x01\n\nListAssets\x12!.sift.assets.v1.ListAssetsRequest\x1a\".sift.assets.v1.ListAssetsResponse\"Q\x92\x41\x38\x12\nListAssets\x1a*Retrieves assets using an optional filter.\x82\xd3\xe4\x93\x02\x10\x12\x0e/api/v1/assets\x12\x9d\x01\n\x0bUpdateAsset\x12\".sift.assets.v1.UpdateAssetRequest\x1a#.sift.assets.v1.UpdateAssetResponse\"E\x92\x41)\x12\x0bUpdateAsset\x1a\x1aUpdate fields on an asset.\x82\xd3\xe4\x93\x02\x13\x32\x0e/api/v1/assets:\x01*\x12\xa9\x01\n\x0c\x41rchiveAsset\x12#.sift.assets.v1.ArchiveAssetRequest\x1a$.sift.assets.v1.ArchiveAssetResponse\"N\x92\x41\"\x12\x0c\x41rchiveAsset\x1a\x12\x41rchives an asset.\x82\xd3\xe4\x93\x02#\"!/api/v1/assets/{asset_id}/archive\x1az\x92\x41w\x12\x44Service to programmatically interact with [assets](/glossary#asset).\x1a/\n Read more about what assets are.\x12\x0b/data-modelB\x8f\x01\n\x12\x63om.sift.assets.v1B\x0b\x41ssetsProtoP\x01\xa2\x02\x03SAX\xaa\x02\x0eSift.Assets.V1\xca\x02\x0eSift\\Assets\\V1\xe2\x02\x1aSift\\Assets\\V1\\GPBMetadata\xea\x02\x10Sift::Assets::V1\x92\x41\x11\x12\x0f\n\rAsset Serviceb\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -48,6 +48,8 @@ _globals['_ASSET'].fields_by_name['metadata']._serialized_options = b'\340A\002' _globals['_ASSET'].fields_by_name['archived_date']._loaded_options = None _globals['_ASSET'].fields_by_name['archived_date']._serialized_options = b'\340A\001' + _globals['_ASSET'].fields_by_name['is_archived']._loaded_options = None + _globals['_ASSET'].fields_by_name['is_archived']._serialized_options = b'\340A\002' _globals['_LISTASSETSREQUEST'].fields_by_name['page_size']._loaded_options = None _globals['_LISTASSETSREQUEST'].fields_by_name['page_size']._serialized_options = b'\340A\001' _globals['_LISTASSETSREQUEST'].fields_by_name['page_token']._loaded_options = None @@ -64,34 +66,46 @@ _globals['_GETASSETREQUEST'].fields_by_name['asset_id']._serialized_options = b'\340A\002' _globals['_UPDATEASSETREQUEST'].fields_by_name['update_mask']._loaded_options = None _globals['_UPDATEASSETREQUEST'].fields_by_name['update_mask']._serialized_options = b'\340A\002' + _globals['_ARCHIVEASSETREQUEST'].fields_by_name['asset_id']._loaded_options = None + _globals['_ARCHIVEASSETREQUEST'].fields_by_name['asset_id']._serialized_options = b'\340A\002' + _globals['_ARCHIVEASSETREQUEST'].fields_by_name['archive_runs']._loaded_options = None + _globals['_ARCHIVEASSETREQUEST'].fields_by_name['archive_runs']._serialized_options = b'\340A\001' + _globals['_ARCHIVEASSETRESPONSE'].fields_by_name['archived_run_ids']._loaded_options = None + _globals['_ARCHIVEASSETRESPONSE'].fields_by_name['archived_run_ids']._serialized_options = b'\340A\001' _globals['_ASSETSERVICE']._loaded_options = None _globals['_ASSETSERVICE']._serialized_options = b'\222Aw\022DService to programmatically interact with [assets](/glossary#asset).\032/\n Read more about what assets are.\022\013/data-model' _globals['_ASSETSERVICE'].methods_by_name['DeleteAsset']._loaded_options = None - _globals['_ASSETSERVICE'].methods_by_name['DeleteAsset']._serialized_options = b'\222A \022\013DeleteAsset\032\021Deletes an asset.\202\323\344\223\002\033*\031/api/v1/assets/{asset_id}' + _globals['_ASSETSERVICE'].methods_by_name['DeleteAsset']._serialized_options = b'\210\002\001\222A \022\013DeleteAsset\032\021Deletes an asset.\202\323\344\223\002\033*\031/api/v1/assets/{asset_id}' _globals['_ASSETSERVICE'].methods_by_name['GetAsset']._loaded_options = None _globals['_ASSETSERVICE'].methods_by_name['GetAsset']._serialized_options = b'\222A\037\022\010GetAsset\032\023Retrieves an asset.\202\323\344\223\002\033\022\031/api/v1/assets/{asset_id}' _globals['_ASSETSERVICE'].methods_by_name['ListAssets']._loaded_options = None _globals['_ASSETSERVICE'].methods_by_name['ListAssets']._serialized_options = b'\222A8\022\nListAssets\032*Retrieves assets using an optional filter.\202\323\344\223\002\020\022\016/api/v1/assets' _globals['_ASSETSERVICE'].methods_by_name['UpdateAsset']._loaded_options = None _globals['_ASSETSERVICE'].methods_by_name['UpdateAsset']._serialized_options = b'\222A)\022\013UpdateAsset\032\032Update fields on an asset.\202\323\344\223\002\0232\016/api/v1/assets:\001*' + _globals['_ASSETSERVICE'].methods_by_name['ArchiveAsset']._loaded_options = None + _globals['_ASSETSERVICE'].methods_by_name['ArchiveAsset']._serialized_options = b'\222A\"\022\014ArchiveAsset\032\022Archives an asset.\202\323\344\223\002#\"!/api/v1/assets/{asset_id}/archive' _globals['_ASSET']._serialized_start=259 - _globals['_ASSET']._serialized_end=770 - _globals['_LISTASSETSREQUEST']._serialized_start=773 - _globals['_LISTASSETSREQUEST']._serialized_end=923 - _globals['_LISTASSETSRESPONSE']._serialized_start=925 - _globals['_LISTASSETSRESPONSE']._serialized_end=1032 - _globals['_DELETEASSETREQUEST']._serialized_start=1034 - _globals['_DELETEASSETREQUEST']._serialized_end=1126 - _globals['_DELETEASSETRESPONSE']._serialized_start=1128 - _globals['_DELETEASSETRESPONSE']._serialized_end=1149 - _globals['_GETASSETREQUEST']._serialized_start=1151 - _globals['_GETASSETREQUEST']._serialized_end=1200 - _globals['_GETASSETRESPONSE']._serialized_start=1202 - _globals['_GETASSETRESPONSE']._serialized_end=1265 - _globals['_UPDATEASSETREQUEST']._serialized_start=1268 - _globals['_UPDATEASSETREQUEST']._serialized_end=1399 - _globals['_UPDATEASSETRESPONSE']._serialized_start=1401 - _globals['_UPDATEASSETRESPONSE']._serialized_end=1467 - _globals['_ASSETSERVICE']._serialized_start=1470 - _globals['_ASSETSERVICE']._serialized_end=2245 + _globals['_ASSET']._serialized_end=808 + _globals['_LISTASSETSREQUEST']._serialized_start=811 + _globals['_LISTASSETSREQUEST']._serialized_end=961 + _globals['_LISTASSETSRESPONSE']._serialized_start=963 + _globals['_LISTASSETSRESPONSE']._serialized_end=1070 + _globals['_DELETEASSETREQUEST']._serialized_start=1072 + _globals['_DELETEASSETREQUEST']._serialized_end=1164 + _globals['_DELETEASSETRESPONSE']._serialized_start=1166 + _globals['_DELETEASSETRESPONSE']._serialized_end=1187 + _globals['_GETASSETREQUEST']._serialized_start=1189 + _globals['_GETASSETREQUEST']._serialized_end=1238 + _globals['_GETASSETRESPONSE']._serialized_start=1240 + _globals['_GETASSETRESPONSE']._serialized_end=1303 + _globals['_UPDATEASSETREQUEST']._serialized_start=1306 + _globals['_UPDATEASSETREQUEST']._serialized_end=1437 + _globals['_UPDATEASSETRESPONSE']._serialized_start=1439 + _globals['_UPDATEASSETRESPONSE']._serialized_end=1505 + _globals['_ARCHIVEASSETREQUEST']._serialized_start=1507 + _globals['_ARCHIVEASSETREQUEST']._serialized_end=1600 + _globals['_ARCHIVEASSETRESPONSE']._serialized_start=1602 + _globals['_ARCHIVEASSETRESPONSE']._serialized_end=1671 + _globals['_ASSETSERVICE']._serialized_start=1674 + _globals['_ASSETSERVICE']._serialized_end=2624 # @@protoc_insertion_point(module_scope) diff --git a/python/lib/sift/assets/v1/assets_pb2.pyi b/python/lib/sift/assets/v1/assets_pb2.pyi index e2aca464f..aee7534f6 100644 --- a/python/lib/sift/assets/v1/assets_pb2.pyi +++ b/python/lib/sift/assets/v1/assets_pb2.pyi @@ -29,11 +29,14 @@ class Asset(google.protobuf.message.Message): TAGS_FIELD_NUMBER: builtins.int METADATA_FIELD_NUMBER: builtins.int ARCHIVED_DATE_FIELD_NUMBER: builtins.int + IS_ARCHIVED_FIELD_NUMBER: builtins.int asset_id: builtins.str name: builtins.str organization_id: builtins.str created_by_user_id: builtins.str modified_by_user_id: builtins.str + is_archived: builtins.bool + """Whether the asset is archived. This is inferred from whether archived_date is set.""" @property def created_date(self) -> google.protobuf.timestamp_pb2.Timestamp: ... @property @@ -63,9 +66,10 @@ class Asset(google.protobuf.message.Message): tags: collections.abc.Iterable[builtins.str] | None = ..., metadata: collections.abc.Iterable[sift.metadata.v1.metadata_pb2.MetadataValue] | None = ..., archived_date: google.protobuf.timestamp_pb2.Timestamp | None = ..., + is_archived: builtins.bool = ..., ) -> None: ... def HasField(self, field_name: typing.Literal["archived_date", b"archived_date", "created_date", b"created_date", "modified_date", b"modified_date"]) -> builtins.bool: ... - def ClearField(self, field_name: typing.Literal["archived_date", b"archived_date", "asset_id", b"asset_id", "created_by_user_id", b"created_by_user_id", "created_date", b"created_date", "metadata", b"metadata", "modified_by_user_id", b"modified_by_user_id", "modified_date", b"modified_date", "name", b"name", "organization_id", b"organization_id", "tags", b"tags"]) -> None: ... + def ClearField(self, field_name: typing.Literal["archived_date", b"archived_date", "asset_id", b"asset_id", "created_by_user_id", b"created_by_user_id", "created_date", b"created_date", "is_archived", b"is_archived", "metadata", b"metadata", "modified_by_user_id", b"modified_by_user_id", "modified_date", b"modified_date", "name", b"name", "organization_id", b"organization_id", "tags", b"tags"]) -> None: ... global___Asset = Asset @@ -94,7 +98,7 @@ class ListAssetsRequest(google.protobuf.message.Message): filter: builtins.str """A [Common Expression Language (CEL)](https://github.com/google/cel-spec) filter string. Available fields to filter by are `asset_id`, `created_by_user_id`, `modified_by_user_id`, - `created_date`, `modified_date`, `name`, `tag_id`, `tag_name`, and `metadata`. Metadata can be used in filters by using `metadata.{metadata_key_name}` as the field name. + `created_date`, `modified_date`, `name`, `tag_id`, `tag_name`, `is_archived`, and `metadata`. Metadata can be used in filters by using `metadata.{metadata_key_name}` as the field name. For further information about how to use CELs, please refer to [this guide](https://github.com/google/cel-spec/blob/master/doc/langdef.md#standard-definitions). For more information about the fields used for filtering, please refer to [this definition](/docs/api/grpc/protocol-buffers/assets#asset). Optional. """ @@ -140,7 +144,9 @@ global___ListAssetsResponse = ListAssetsResponse @typing.final class DeleteAssetRequest(google.protobuf.message.Message): - """The request for a call to `AssetService_DeleteAsset` to archive a single existing asset by its asset_id.""" + """The request for a call to `AssetService_DeleteAsset` to archive a single existing asset by its asset_id. + Deprecated: Use ArchiveAssetRequest instead. + """ DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -162,7 +168,9 @@ global___DeleteAssetRequest = DeleteAssetRequest @typing.final class DeleteAssetResponse(google.protobuf.message.Message): - """The response of a call to `AssetService_DeleteAsset`.""" + """The response of a call to `AssetService_DeleteAsset`. + Deprecated: Use ArchiveAssetResponse instead. + """ DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -223,7 +231,7 @@ class UpdateAssetRequest(google.protobuf.message.Message): @property def update_mask(self) -> google.protobuf.field_mask_pb2.FieldMask: - """The list of fields to be updated. The fields available to be updated are `tags`, `metadata`, and `archived_date`.""" + """The list of fields to be updated. The fields available to be updated are `tags`, `metadata`, `archived_date`, and `is_archived`.""" def __init__( self, @@ -254,3 +262,47 @@ class UpdateAssetResponse(google.protobuf.message.Message): def ClearField(self, field_name: typing.Literal["asset", b"asset"]) -> None: ... global___UpdateAssetResponse = UpdateAssetResponse + +@typing.final +class ArchiveAssetRequest(google.protobuf.message.Message): + """The request for a call to `AssetService_ArchiveAsset` to archive a single existing asset by its asset_id.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + ASSET_ID_FIELD_NUMBER: builtins.int + ARCHIVE_RUNS_FIELD_NUMBER: builtins.int + asset_id: builtins.str + """The id of the asset to be archived. Required.""" + archive_runs: builtins.bool + """If true, will archive all runs associated with the asset.""" + def __init__( + self, + *, + asset_id: builtins.str = ..., + archive_runs: builtins.bool = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["archive_runs", b"archive_runs", "asset_id", b"asset_id"]) -> None: ... + +global___ArchiveAssetRequest = ArchiveAssetRequest + +@typing.final +class ArchiveAssetResponse(google.protobuf.message.Message): + """The response of a call to `AssetService_ArchiveAsset`.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + ARCHIVED_RUN_IDS_FIELD_NUMBER: builtins.int + @property + def archived_run_ids(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: + """List of run IDs that were archived when archive_runs was set to true. + This field will be empty if archive_runs was false or if no runs were archived. + """ + + def __init__( + self, + *, + archived_run_ids: collections.abc.Iterable[builtins.str] | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["archived_run_ids", b"archived_run_ids"]) -> None: ... + +global___ArchiveAssetResponse = ArchiveAssetResponse diff --git a/python/lib/sift/assets/v1/assets_pb2_grpc.py b/python/lib/sift/assets/v1/assets_pb2_grpc.py index 3fea10dcd..18b356b12 100644 --- a/python/lib/sift/assets/v1/assets_pb2_grpc.py +++ b/python/lib/sift/assets/v1/assets_pb2_grpc.py @@ -34,6 +34,11 @@ def __init__(self, channel): request_serializer=sift_dot_assets_dot_v1_dot_assets__pb2.UpdateAssetRequest.SerializeToString, response_deserializer=sift_dot_assets_dot_v1_dot_assets__pb2.UpdateAssetResponse.FromString, ) + self.ArchiveAsset = channel.unary_unary( + '/sift.assets.v1.AssetService/ArchiveAsset', + request_serializer=sift_dot_assets_dot_v1_dot_assets__pb2.ArchiveAssetRequest.SerializeToString, + response_deserializer=sift_dot_assets_dot_v1_dot_assets__pb2.ArchiveAssetResponse.FromString, + ) class AssetServiceServicer(object): @@ -41,6 +46,7 @@ class AssetServiceServicer(object): def DeleteAsset(self, request, context): """Delete will archive an asset. + Deprecated: Use ArchiveAsset instead. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') @@ -66,6 +72,13 @@ def UpdateAsset(self, request, context): context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') + def ArchiveAsset(self, request, context): + """Archive an asset. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + def add_AssetServiceServicer_to_server(servicer, server): rpc_method_handlers = { @@ -89,6 +102,11 @@ def add_AssetServiceServicer_to_server(servicer, server): request_deserializer=sift_dot_assets_dot_v1_dot_assets__pb2.UpdateAssetRequest.FromString, response_serializer=sift_dot_assets_dot_v1_dot_assets__pb2.UpdateAssetResponse.SerializeToString, ), + 'ArchiveAsset': grpc.unary_unary_rpc_method_handler( + servicer.ArchiveAsset, + request_deserializer=sift_dot_assets_dot_v1_dot_assets__pb2.ArchiveAssetRequest.FromString, + response_serializer=sift_dot_assets_dot_v1_dot_assets__pb2.ArchiveAssetResponse.SerializeToString, + ), } generic_handler = grpc.method_handlers_generic_handler( 'sift.assets.v1.AssetService', rpc_method_handlers) @@ -166,3 +184,20 @@ def UpdateAsset(request, sift_dot_assets_dot_v1_dot_assets__pb2.UpdateAssetResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def ArchiveAsset(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/sift.assets.v1.AssetService/ArchiveAsset', + sift_dot_assets_dot_v1_dot_assets__pb2.ArchiveAssetRequest.SerializeToString, + sift_dot_assets_dot_v1_dot_assets__pb2.ArchiveAssetResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) diff --git a/python/lib/sift/assets/v1/assets_pb2_grpc.pyi b/python/lib/sift/assets/v1/assets_pb2_grpc.pyi index 5302ad567..a583dc83d 100644 --- a/python/lib/sift/assets/v1/assets_pb2_grpc.pyi +++ b/python/lib/sift/assets/v1/assets_pb2_grpc.pyi @@ -23,7 +23,9 @@ class AssetServiceStub: sift.assets.v1.assets_pb2.DeleteAssetRequest, sift.assets.v1.assets_pb2.DeleteAssetResponse, ] - """Delete will archive an asset.""" + """Delete will archive an asset. + Deprecated: Use ArchiveAsset instead. + """ GetAsset: grpc.UnaryUnaryMultiCallable[ sift.assets.v1.assets_pb2.GetAssetRequest, @@ -42,12 +44,20 @@ class AssetServiceStub: sift.assets.v1.assets_pb2.UpdateAssetResponse, ] + ArchiveAsset: grpc.UnaryUnaryMultiCallable[ + sift.assets.v1.assets_pb2.ArchiveAssetRequest, + sift.assets.v1.assets_pb2.ArchiveAssetResponse, + ] + """Archive an asset.""" + class AssetServiceAsyncStub: DeleteAsset: grpc.aio.UnaryUnaryMultiCallable[ sift.assets.v1.assets_pb2.DeleteAssetRequest, sift.assets.v1.assets_pb2.DeleteAssetResponse, ] - """Delete will archive an asset.""" + """Delete will archive an asset. + Deprecated: Use ArchiveAsset instead. + """ GetAsset: grpc.aio.UnaryUnaryMultiCallable[ sift.assets.v1.assets_pb2.GetAssetRequest, @@ -66,6 +76,12 @@ class AssetServiceAsyncStub: sift.assets.v1.assets_pb2.UpdateAssetResponse, ] + ArchiveAsset: grpc.aio.UnaryUnaryMultiCallable[ + sift.assets.v1.assets_pb2.ArchiveAssetRequest, + sift.assets.v1.assets_pb2.ArchiveAssetResponse, + ] + """Archive an asset.""" + class AssetServiceServicer(metaclass=abc.ABCMeta): @abc.abstractmethod def DeleteAsset( @@ -73,7 +89,9 @@ class AssetServiceServicer(metaclass=abc.ABCMeta): request: sift.assets.v1.assets_pb2.DeleteAssetRequest, context: _ServicerContext, ) -> typing.Union[sift.assets.v1.assets_pb2.DeleteAssetResponse, collections.abc.Awaitable[sift.assets.v1.assets_pb2.DeleteAssetResponse]]: - """Delete will archive an asset.""" + """Delete will archive an asset. + Deprecated: Use ArchiveAsset instead. + """ @abc.abstractmethod def GetAsset( @@ -98,4 +116,12 @@ class AssetServiceServicer(metaclass=abc.ABCMeta): context: _ServicerContext, ) -> typing.Union[sift.assets.v1.assets_pb2.UpdateAssetResponse, collections.abc.Awaitable[sift.assets.v1.assets_pb2.UpdateAssetResponse]]: ... + @abc.abstractmethod + def ArchiveAsset( + self, + request: sift.assets.v1.assets_pb2.ArchiveAssetRequest, + context: _ServicerContext, + ) -> typing.Union[sift.assets.v1.assets_pb2.ArchiveAssetResponse, collections.abc.Awaitable[sift.assets.v1.assets_pb2.ArchiveAssetResponse]]: + """Archive an asset.""" + def add_AssetServiceServicer_to_server(servicer: AssetServiceServicer, server: typing.Union[grpc.Server, grpc.aio.Server]) -> None: ... diff --git a/rust/crates/sift_rs/src/gen/sift.assets.v1.rs b/rust/crates/sift_rs/src/gen/sift.assets.v1.rs index 5329d86d5..6f4c160af 100644 --- a/rust/crates/sift_rs/src/gen/sift.assets.v1.rs +++ b/rust/crates/sift_rs/src/gen/sift.assets.v1.rs @@ -23,6 +23,8 @@ pub struct Asset { pub metadata: ::prost::alloc::vec::Vec, #[prost(message, optional, tag="11")] pub archived_date: ::core::option::Option<::pbjson_types::Timestamp>, + #[prost(bool, tag="12")] + pub is_archived: bool, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -82,6 +84,20 @@ pub struct UpdateAssetResponse { #[prost(message, optional, tag="1")] pub asset: ::core::option::Option, } +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ArchiveAssetRequest { + #[prost(string, tag="1")] + pub asset_id: ::prost::alloc::string::String, + #[prost(bool, tag="2")] + pub archive_runs: bool, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ArchiveAssetResponse { + #[prost(string, repeated, tag="1")] + pub archived_run_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} include!("sift.assets.v1.tonic.rs"); include!("sift.assets.v1.serde.rs"); // @@protoc_insertion_point(module) \ No newline at end of file diff --git a/rust/crates/sift_rs/src/gen/sift.assets.v1.serde.rs b/rust/crates/sift_rs/src/gen/sift.assets.v1.serde.rs index 6b23b209e..a7d6d5dd4 100644 --- a/rust/crates/sift_rs/src/gen/sift.assets.v1.serde.rs +++ b/rust/crates/sift_rs/src/gen/sift.assets.v1.serde.rs @@ -1,4 +1,206 @@ // @generated +impl serde::Serialize for ArchiveAssetRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.asset_id.is_empty() { + len += 1; + } + if self.archive_runs { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("sift.assets.v1.ArchiveAssetRequest", len)?; + if !self.asset_id.is_empty() { + struct_ser.serialize_field("assetId", &self.asset_id)?; + } + if self.archive_runs { + struct_ser.serialize_field("archiveRuns", &self.archive_runs)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ArchiveAssetRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "asset_id", + "assetId", + "archive_runs", + "archiveRuns", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + AssetId, + ArchiveRuns, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "assetId" | "asset_id" => Ok(GeneratedField::AssetId), + "archiveRuns" | "archive_runs" => Ok(GeneratedField::ArchiveRuns), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ArchiveAssetRequest; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct sift.assets.v1.ArchiveAssetRequest") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut asset_id__ = None; + let mut archive_runs__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::AssetId => { + if asset_id__.is_some() { + return Err(serde::de::Error::duplicate_field("assetId")); + } + asset_id__ = Some(map_.next_value()?); + } + GeneratedField::ArchiveRuns => { + if archive_runs__.is_some() { + return Err(serde::de::Error::duplicate_field("archiveRuns")); + } + archive_runs__ = Some(map_.next_value()?); + } + } + } + Ok(ArchiveAssetRequest { + asset_id: asset_id__.unwrap_or_default(), + archive_runs: archive_runs__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("sift.assets.v1.ArchiveAssetRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for ArchiveAssetResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.archived_run_ids.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("sift.assets.v1.ArchiveAssetResponse", len)?; + if !self.archived_run_ids.is_empty() { + struct_ser.serialize_field("archivedRunIds", &self.archived_run_ids)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ArchiveAssetResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "archived_run_ids", + "archivedRunIds", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ArchivedRunIds, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "archivedRunIds" | "archived_run_ids" => Ok(GeneratedField::ArchivedRunIds), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ArchiveAssetResponse; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct sift.assets.v1.ArchiveAssetResponse") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut archived_run_ids__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ArchivedRunIds => { + if archived_run_ids__.is_some() { + return Err(serde::de::Error::duplicate_field("archivedRunIds")); + } + archived_run_ids__ = Some(map_.next_value()?); + } + } + } + Ok(ArchiveAssetResponse { + archived_run_ids: archived_run_ids__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("sift.assets.v1.ArchiveAssetResponse", FIELDS, GeneratedVisitor) + } +} impl serde::Serialize for Asset { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result @@ -37,6 +239,9 @@ impl serde::Serialize for Asset { if self.archived_date.is_some() { len += 1; } + if self.is_archived { + len += 1; + } let mut struct_ser = serializer.serialize_struct("sift.assets.v1.Asset", len)?; if !self.asset_id.is_empty() { struct_ser.serialize_field("assetId", &self.asset_id)?; @@ -68,6 +273,9 @@ impl serde::Serialize for Asset { if let Some(v) = self.archived_date.as_ref() { struct_ser.serialize_field("archivedDate", v)?; } + if self.is_archived { + struct_ser.serialize_field("isArchived", &self.is_archived)?; + } struct_ser.end() } } @@ -95,6 +303,8 @@ impl<'de> serde::Deserialize<'de> for Asset { "metadata", "archived_date", "archivedDate", + "is_archived", + "isArchived", ]; #[allow(clippy::enum_variant_names)] @@ -109,6 +319,7 @@ impl<'de> serde::Deserialize<'de> for Asset { Tags, Metadata, ArchivedDate, + IsArchived, } impl<'de> serde::Deserialize<'de> for GeneratedField { fn deserialize(deserializer: D) -> std::result::Result @@ -140,6 +351,7 @@ impl<'de> serde::Deserialize<'de> for Asset { "tags" => Ok(GeneratedField::Tags), "metadata" => Ok(GeneratedField::Metadata), "archivedDate" | "archived_date" => Ok(GeneratedField::ArchivedDate), + "isArchived" | "is_archived" => Ok(GeneratedField::IsArchived), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -169,6 +381,7 @@ impl<'de> serde::Deserialize<'de> for Asset { let mut tags__ = None; let mut metadata__ = None; let mut archived_date__ = None; + let mut is_archived__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::AssetId => { @@ -231,6 +444,12 @@ impl<'de> serde::Deserialize<'de> for Asset { } archived_date__ = map_.next_value()?; } + GeneratedField::IsArchived => { + if is_archived__.is_some() { + return Err(serde::de::Error::duplicate_field("isArchived")); + } + is_archived__ = Some(map_.next_value()?); + } } } Ok(Asset { @@ -244,6 +463,7 @@ impl<'de> serde::Deserialize<'de> for Asset { tags: tags__.unwrap_or_default(), metadata: metadata__.unwrap_or_default(), archived_date: archived_date__, + is_archived: is_archived__.unwrap_or_default(), }) } } diff --git a/rust/crates/sift_rs/src/gen/sift.assets.v1.tonic.rs b/rust/crates/sift_rs/src/gen/sift.assets.v1.tonic.rs index b23f49dc0..d4e36f4ae 100644 --- a/rust/crates/sift_rs/src/gen/sift.assets.v1.tonic.rs +++ b/rust/crates/sift_rs/src/gen/sift.assets.v1.tonic.rs @@ -184,6 +184,31 @@ pub mod asset_service_client { .insert(GrpcMethod::new("sift.assets.v1.AssetService", "UpdateAsset")); self.inner.unary(req, path, codec).await } + pub async fn archive_asset( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/sift.assets.v1.AssetService/ArchiveAsset", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("sift.assets.v1.AssetService", "ArchiveAsset")); + self.inner.unary(req, path, codec).await + } } } /// Generated server implementations. @@ -221,6 +246,13 @@ pub mod asset_service_server { tonic::Response, tonic::Status, >; + async fn archive_asset( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; } #[derive(Debug)] pub struct AssetServiceServer { @@ -485,6 +517,52 @@ pub mod asset_service_server { }; Box::pin(fut) } + "/sift.assets.v1.AssetService/ArchiveAsset" => { + #[allow(non_camel_case_types)] + struct ArchiveAssetSvc(pub Arc); + impl< + T: AssetService, + > tonic::server::UnaryService + for ArchiveAssetSvc { + type Response = super::ArchiveAssetResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::archive_asset(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ArchiveAssetSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } _ => { Box::pin(async move { Ok(