From b3126afbede14fc7834f585ccdafad82136a0f30 Mon Sep 17 00:00:00 2001 From: Priyank Raj Date: Fri, 14 May 2021 15:39:02 -0700 Subject: [PATCH] Tags directory within DataModel. Also namespace changes Signed-off-by: Priyank Raj --- Minio.Examples/Cases/CopyObjectReplaceTags.cs | 8 ++++---- Minio.Examples/Cases/GetBucketTags.cs | 4 +++- Minio.Examples/Cases/GetObjectTags.cs | 4 +++- Minio.Examples/Cases/PutObjectWithTags.cs | 3 ++- Minio.Examples/Cases/SetBucketReplication.cs | 2 +- Minio.Examples/Cases/SetBucketTags.cs | 4 ++-- Minio.Examples/Cases/SetObjectTags.cs | 4 ++-- Minio.Functional.Tests/FunctionalTest.cs | 1 + Minio/ApiEndpoints/BucketOperations.cs | 1 + Minio/ApiEndpoints/IBucketOperations.cs | 1 + Minio/ApiEndpoints/IObjectOperations.cs | 1 + Minio/ApiEndpoints/ObjectOperations.cs | 2 +- Minio/DataModel/BucketOperationsArgs.cs | 1 + Minio/DataModel/BucketOperationsReponse.cs | 1 + Minio/DataModel/ILM/AndOperator.cs | 2 ++ Minio/DataModel/ILM/RuleFilter.cs | 1 + Minio/DataModel/ObjectOperationsArgs.cs | 1 + Minio/DataModel/ObjectOperationsResponse.cs | 1 + Minio/DataModel/ObjectWriteArgs.cs | 3 ++- Minio/DataModel/Replication/AndOperator.cs | 2 ++ Minio/DataModel/Replication/RuleFilter.cs | 2 ++ Minio/DataModel/{ => Tags}/Tag.cs | 2 +- Minio/DataModel/{ => Tags}/TagSet.cs | 2 +- Minio/DataModel/{ => Tags}/Tagging.cs | 2 +- 24 files changed, 38 insertions(+), 17 deletions(-) rename Minio/DataModel/{ => Tags}/Tag.cs (97%) rename Minio/DataModel/{ => Tags}/TagSet.cs (97%) rename Minio/DataModel/{ => Tags}/Tagging.cs (99%) diff --git a/Minio.Examples/Cases/CopyObjectReplaceTags.cs b/Minio.Examples/Cases/CopyObjectReplaceTags.cs index 4e7fd4396..b5ccf506a 100644 --- a/Minio.Examples/Cases/CopyObjectReplaceTags.cs +++ b/Minio.Examples/Cases/CopyObjectReplaceTags.cs @@ -1,5 +1,5 @@ /* - * MinIO .NET Library for Amazon S3 Compatible Cloud Storage, (C) 2017-2021 MinIO, Inc. + * MinIO .NET Library for Amazon S3 Compatible Cloud Storage, (C) 2021 MinIO, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,9 +16,8 @@ using System; using System.Collections.Generic; -using System.Globalization; using System.Threading.Tasks; -using Minio.DataModel; +using Minio.DataModel.Tags; namespace Minio.Examples.Cases { @@ -38,13 +37,14 @@ public async static Task Run(MinioClient minio, { { "Test-TagKey", "Test-TagValue" }, }; + Tagging tagObj = Tagging.GetObjectTags(tags); CopySourceObjectArgs cpSrcArgs = new CopySourceObjectArgs() .WithBucket(fromBucketName) .WithObject(fromObjectName); CopyObjectArgs args = new CopyObjectArgs() .WithBucket(destBucketName) .WithObject(destObjectName) - .WithTagging(Tagging.GetObjectTags(tags)) + .WithTagging(tagObj) .WithReplaceTagsDirective(true) .WithCopyObjectSource(cpSrcArgs); await minio.CopyObjectAsync(args).ConfigureAwait(false); diff --git a/Minio.Examples/Cases/GetBucketTags.cs b/Minio.Examples/Cases/GetBucketTags.cs index a5236a2d9..74f5fa1eb 100644 --- a/Minio.Examples/Cases/GetBucketTags.cs +++ b/Minio.Examples/Cases/GetBucketTags.cs @@ -1,5 +1,5 @@ /* - * MinIO .NET Library for Amazon S3 Compatible Cloud Storage, (C) 2020 MinIO, Inc. + * MinIO .NET Library for Amazon S3 Compatible Cloud Storage, (C) 2020, 2021 MinIO, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,6 +16,8 @@ using System; using System.Threading.Tasks; +using Minio.DataModel.Tags; + namespace Minio.Examples.Cases { public class GetBucketTags diff --git a/Minio.Examples/Cases/GetObjectTags.cs b/Minio.Examples/Cases/GetObjectTags.cs index febfcf97d..37c47a890 100644 --- a/Minio.Examples/Cases/GetObjectTags.cs +++ b/Minio.Examples/Cases/GetObjectTags.cs @@ -1,5 +1,5 @@ /* - * MinIO .NET Library for Amazon S3 Compatible Cloud Storage, (C) 2020 MinIO, Inc. + * MinIO .NET Library for Amazon S3 Compatible Cloud Storage, (C) 2020, 2021 MinIO, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,6 +16,8 @@ using System; using System.Threading.Tasks; +using Minio.DataModel.Tags; + namespace Minio.Examples.Cases { public class GetObjectTags diff --git a/Minio.Examples/Cases/PutObjectWithTags.cs b/Minio.Examples/Cases/PutObjectWithTags.cs index 7eebe9980..c6da1347d 100644 --- a/Minio.Examples/Cases/PutObjectWithTags.cs +++ b/Minio.Examples/Cases/PutObjectWithTags.cs @@ -14,11 +14,12 @@ * limitations under the License. */ -using Minio.DataModel; using System; using System.Collections.Generic; using System.Threading.Tasks; +using Minio.DataModel.Tags; + namespace Minio.Examples.Cases { class PutObjectWithTags diff --git a/Minio.Examples/Cases/SetBucketReplication.cs b/Minio.Examples/Cases/SetBucketReplication.cs index 9d6303890..efa369825 100644 --- a/Minio.Examples/Cases/SetBucketReplication.cs +++ b/Minio.Examples/Cases/SetBucketReplication.cs @@ -17,7 +17,7 @@ using System.Collections.Generic; using System.Threading.Tasks; -using Minio.DataModel; +using Minio.DataModel.Tags; using Minio.DataModel.Replication; namespace Minio.Examples.Cases diff --git a/Minio.Examples/Cases/SetBucketTags.cs b/Minio.Examples/Cases/SetBucketTags.cs index d80bef458..900cf7689 100644 --- a/Minio.Examples/Cases/SetBucketTags.cs +++ b/Minio.Examples/Cases/SetBucketTags.cs @@ -1,5 +1,5 @@ /* - * MinIO .NET Library for Amazon S3 Compatible Cloud Storage, (C) 2020 MinIO, Inc. + * MinIO .NET Library for Amazon S3 Compatible Cloud Storage, (C) 2020, 2021 MinIO, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,7 @@ using System; using System.Collections.Generic; using System.Threading.Tasks; -using Minio.DataModel; +using Minio.DataModel.Tags; namespace Minio.Examples.Cases { diff --git a/Minio.Examples/Cases/SetObjectTags.cs b/Minio.Examples/Cases/SetObjectTags.cs index 2183e0ac9..4211a8318 100644 --- a/Minio.Examples/Cases/SetObjectTags.cs +++ b/Minio.Examples/Cases/SetObjectTags.cs @@ -1,5 +1,5 @@ /* - * MinIO .NET Library for Amazon S3 Compatible Cloud Storage, (C) 2020 MinIO, Inc. + * MinIO .NET Library for Amazon S3 Compatible Cloud Storage, (C) 2020, 2021 MinIO, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,7 @@ using System; using System.Collections.Generic; using System.Threading.Tasks; -using Minio.DataModel; +using Minio.DataModel.Tags; namespace Minio.Examples.Cases { diff --git a/Minio.Functional.Tests/FunctionalTest.cs b/Minio.Functional.Tests/FunctionalTest.cs index 9ffcf497e..1f9a6047c 100644 --- a/Minio.Functional.Tests/FunctionalTest.cs +++ b/Minio.Functional.Tests/FunctionalTest.cs @@ -18,6 +18,7 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; using Minio.DataModel; using Minio.DataModel.ILM; +using Minio.DataModel.Tags; using Minio.Exceptions; using Newtonsoft.Json; using System; diff --git a/Minio/ApiEndpoints/BucketOperations.cs b/Minio/ApiEndpoints/BucketOperations.cs index 779741fb7..6574baa75 100644 --- a/Minio/ApiEndpoints/BucketOperations.cs +++ b/Minio/ApiEndpoints/BucketOperations.cs @@ -16,6 +16,7 @@ */ using Minio.DataModel; +using Minio.DataModel.Tags; using Minio.Exceptions; using RestSharp; using System; diff --git a/Minio/ApiEndpoints/IBucketOperations.cs b/Minio/ApiEndpoints/IBucketOperations.cs index b42efdb51..2c001a989 100644 --- a/Minio/ApiEndpoints/IBucketOperations.cs +++ b/Minio/ApiEndpoints/IBucketOperations.cs @@ -23,6 +23,7 @@ using Minio.DataModel; using Minio.DataModel.ILM; using Minio.DataModel.Replication; +using Minio.DataModel.Tags; using Minio.Exceptions; namespace Minio diff --git a/Minio/ApiEndpoints/IObjectOperations.cs b/Minio/ApiEndpoints/IObjectOperations.cs index 5c6647bc7..f9e6779be 100644 --- a/Minio/ApiEndpoints/IObjectOperations.cs +++ b/Minio/ApiEndpoints/IObjectOperations.cs @@ -22,6 +22,7 @@ using System.Threading.Tasks; using Minio.DataModel; +using Minio.DataModel.Tags; using Minio.Exceptions; namespace Minio diff --git a/Minio/ApiEndpoints/ObjectOperations.cs b/Minio/ApiEndpoints/ObjectOperations.cs index 36eda42bb..040531501 100644 --- a/Minio/ApiEndpoints/ObjectOperations.cs +++ b/Minio/ApiEndpoints/ObjectOperations.cs @@ -21,7 +21,6 @@ using System.Globalization; using System.IO; using System.Linq; -using System.Net; using System.Reactive.Linq; using System.Threading; using System.Threading.Tasks; @@ -29,6 +28,7 @@ using System.Xml.Serialization; using Minio.DataModel; +using Minio.DataModel.Tags; using Minio.Exceptions; using Minio.Helper; diff --git a/Minio/DataModel/BucketOperationsArgs.cs b/Minio/DataModel/BucketOperationsArgs.cs index 2eaeb8b06..178537c8f 100644 --- a/Minio/DataModel/BucketOperationsArgs.cs +++ b/Minio/DataModel/BucketOperationsArgs.cs @@ -20,6 +20,7 @@ using Minio.DataModel; using Minio.DataModel.ILM; using Minio.DataModel.Replication; +using Minio.DataModel.Tags; using Minio.Exceptions; using RestSharp; diff --git a/Minio/DataModel/BucketOperationsReponse.cs b/Minio/DataModel/BucketOperationsReponse.cs index 0d660355f..dd6ab38cd 100644 --- a/Minio/DataModel/BucketOperationsReponse.cs +++ b/Minio/DataModel/BucketOperationsReponse.cs @@ -17,6 +17,7 @@ using Minio.DataModel; using Minio.DataModel.ILM; using Minio.DataModel.Replication; +using Minio.DataModel.Tags; using System; using System.Collections.Generic; diff --git a/Minio/DataModel/ILM/AndOperator.cs b/Minio/DataModel/ILM/AndOperator.cs index 39117c6fd..eca174526 100644 --- a/Minio/DataModel/ILM/AndOperator.cs +++ b/Minio/DataModel/ILM/AndOperator.cs @@ -18,6 +18,8 @@ using System.Collections.Generic; using System.Xml.Serialization; +using Minio.DataModel.Tags; + /* * AndOperator is used with Lifecycle RuleFilter to bind the rules together. * Please refer: diff --git a/Minio/DataModel/ILM/RuleFilter.cs b/Minio/DataModel/ILM/RuleFilter.cs index f95df06e9..6853e6d2a 100644 --- a/Minio/DataModel/ILM/RuleFilter.cs +++ b/Minio/DataModel/ILM/RuleFilter.cs @@ -16,6 +16,7 @@ using System; using System.Xml.Serialization; +using Minio.DataModel.Tags; /* * RuleFilter class used within LifecycleRule which encapsulates filter information. diff --git a/Minio/DataModel/ObjectOperationsArgs.cs b/Minio/DataModel/ObjectOperationsArgs.cs index a70b38863..5bf0b4818 100644 --- a/Minio/DataModel/ObjectOperationsArgs.cs +++ b/Minio/DataModel/ObjectOperationsArgs.cs @@ -24,6 +24,7 @@ using System.Linq; using Minio.DataModel; +using Minio.DataModel.Tags; using Minio.Exceptions; using Minio.Helper; using System.Security.Cryptography; diff --git a/Minio/DataModel/ObjectOperationsResponse.cs b/Minio/DataModel/ObjectOperationsResponse.cs index c2d997acd..6cf4ba70d 100644 --- a/Minio/DataModel/ObjectOperationsResponse.cs +++ b/Minio/DataModel/ObjectOperationsResponse.cs @@ -23,6 +23,7 @@ using System.Xml.Serialization; using Minio.DataModel; +using Minio.DataModel.Tags; using RestSharp; namespace Minio diff --git a/Minio/DataModel/ObjectWriteArgs.cs b/Minio/DataModel/ObjectWriteArgs.cs index 8cf8e665d..4625f2d37 100644 --- a/Minio/DataModel/ObjectWriteArgs.cs +++ b/Minio/DataModel/ObjectWriteArgs.cs @@ -1,5 +1,5 @@ /* - * MinIO .NET Library for Amazon S3 Compatible Cloud Storage, (C) 2020 MinIO, Inc. + * MinIO .NET Library for Amazon S3 Compatible Cloud Storage, (C) 2020, 2021 MinIO, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,6 +17,7 @@ using System.Collections.Generic; using Minio.DataModel; +using Minio.DataModel.Tags; namespace Minio { diff --git a/Minio/DataModel/Replication/AndOperator.cs b/Minio/DataModel/Replication/AndOperator.cs index 2b762d1eb..4809aecbe 100644 --- a/Minio/DataModel/Replication/AndOperator.cs +++ b/Minio/DataModel/Replication/AndOperator.cs @@ -18,6 +18,8 @@ using System.Collections.Generic; using System.Xml.Serialization; +using Minio.DataModel.Tags; + /* * AndOperator class used within RuleFilter of ReplicationRule which is used to specify rule components and is equivalent of a Logical And for two or more predicates. * Please refer: diff --git a/Minio/DataModel/Replication/RuleFilter.cs b/Minio/DataModel/Replication/RuleFilter.cs index 4301b6d4a..390414d04 100644 --- a/Minio/DataModel/Replication/RuleFilter.cs +++ b/Minio/DataModel/Replication/RuleFilter.cs @@ -17,6 +17,8 @@ using System; using System.Xml.Serialization; +using Minio.DataModel.Tags; + /* * RuleFilter class used within ReplicationRule which encapsulates filter information. * Please refer: diff --git a/Minio/DataModel/Tag.cs b/Minio/DataModel/Tags/Tag.cs similarity index 97% rename from Minio/DataModel/Tag.cs rename to Minio/DataModel/Tags/Tag.cs index d3cb95583..eb673861e 100644 --- a/Minio/DataModel/Tag.cs +++ b/Minio/DataModel/Tags/Tag.cs @@ -17,7 +17,7 @@ using System; using System.Xml.Serialization; -namespace Minio.DataModel +namespace Minio.DataModel.Tags { [Serializable] [XmlRoot(ElementName = "Tag")] diff --git a/Minio/DataModel/TagSet.cs b/Minio/DataModel/Tags/TagSet.cs similarity index 97% rename from Minio/DataModel/TagSet.cs rename to Minio/DataModel/Tags/TagSet.cs index f5fd79dfb..0ef167782 100644 --- a/Minio/DataModel/TagSet.cs +++ b/Minio/DataModel/Tags/TagSet.cs @@ -18,7 +18,7 @@ using System.Collections.Generic; using System.Xml.Serialization; -namespace Minio.DataModel +namespace Minio.DataModel.Tags { [Serializable] [XmlRoot(ElementName = "TagSet")] diff --git a/Minio/DataModel/Tagging.cs b/Minio/DataModel/Tags/Tagging.cs similarity index 99% rename from Minio/DataModel/Tagging.cs rename to Minio/DataModel/Tags/Tagging.cs index 2ed99204e..c14630a9f 100644 --- a/Minio/DataModel/Tagging.cs +++ b/Minio/DataModel/Tags/Tagging.cs @@ -21,7 +21,7 @@ using System.Xml; using System.Xml.Serialization; -namespace Minio.DataModel +namespace Minio.DataModel.Tags { [Serializable] [XmlRoot(ElementName = "Tagging")]