Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

using interface IReadOnlyDictionary instead of a dicrionary in TagSet and Tagging #1149

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Minio.Examples/Cases/SetBucketTags.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/*
* MinIO .NET Library for Amazon S3 Compatible Cloud Storage, (C) 2020, 2021 MinIO, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -24,7 +24,7 @@ public static class SetBucketTags
// Set Tags to the bucket
public static async Task Run(IMinioClient minio,
string bucketName = "my-bucket-name",
IDictionary<string, string> tags = null)
IReadOnlyDictionary<string, string> tags = null)
{
if (minio is null) throw new ArgumentNullException(nameof(minio));

Expand Down
4 changes: 2 additions & 2 deletions Minio.Examples/Cases/SetObjectTags.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/*
* MinIO .NET Library for Amazon S3 Compatible Cloud Storage, (C) 2020, 2021 MinIO, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -25,7 +25,7 @@ public static class SetObjectTags
public static async Task Run(IMinioClient minio,
string bucketName = "my-bucket-name",
string objectName = "my-object-name",
IDictionary<string, string> tags = null,
IReadOnlyDictionary<string, string> tags = null,
string versionId = null)
{
if (minio is null) throw new ArgumentNullException(nameof(minio));
Expand Down
2 changes: 1 addition & 1 deletion Minio/DataModel/ILM/AndOperator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public AndOperator(string prefix, IList<Tag> tag)
Tags = new Collection<Tag>(tag);
}

public AndOperator(string prefix, IDictionary<string, string> tags)
public AndOperator(string prefix, IReadOnlyDictionary<string, string> tags)
{
Prefix = prefix;
if (tags is null || tags.Count == 0)
Expand Down
2 changes: 1 addition & 1 deletion Minio/DataModel/Replication/AndOperator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public AndOperator(string prefix, ICollection<Tag> tag)
Tags = tag;
}

public AndOperator(string prefix, IDictionary<string, string> tags)
public AndOperator(string prefix, IReadOnlyDictionary<string, string> tags)
{
if (tags is null) throw new ArgumentNullException(nameof(tags));

Expand Down
4 changes: 2 additions & 2 deletions Minio/DataModel/Tags/TagSet.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/*
* MinIO .NET Library for Amazon S3 Compatible Cloud Storage, (C) 2020 MinIO, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -28,7 +28,7 @@ public TagSet()
Tag = null;
}

public TagSet(IDictionary<string, string> tags)
public TagSet(IReadOnlyDictionary<string, string> tags)
{
if (tags is null || tags.Count == 0) return;
Tag = new Collection<Tag>();
Expand Down
8 changes: 4 additions & 4 deletions Minio/DataModel/Tags/Tagging.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public Tagging()
TaggingSet = null;
}

public Tagging(IDictionary<string, string> tags, bool isObjects)
public Tagging(IReadOnlyDictionary<string, string> tags, bool isObjects)
{
if (tags is null)
{
Expand All @@ -67,7 +67,7 @@ public Tagging(IDictionary<string, string> tags, bool isObjects)
[XmlElement("TagSet")] public TagSet TaggingSet { get; set; }

[XmlIgnore]
public IDictionary<string, string> Tags
public IReadOnlyDictionary<string, string> Tags
{
get
{
Expand Down Expand Up @@ -133,12 +133,12 @@ public string MarshalXML()
return str;
}

public static Tagging GetBucketTags(IDictionary<string, string> tags)
public static Tagging GetBucketTags(IReadOnlyDictionary<string, string> tags)
{
return new Tagging(tags, false);
}

public static Tagging GetObjectTags(IDictionary<string, string> tags)
public static Tagging GetObjectTags(IReadOnlyDictionary<string, string> tags)
{
return new Tagging(tags, true);
}
Expand Down
Loading