Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,16 @@ public ManagementPolicyFilter()
/// <summary>
/// Initializes a new instance of the ManagementPolicyFilter class.
/// </summary>
/// <param name="blobTypes">An array of predefined enum values. Only
/// blockBlob is supported.</param>
/// <param name="blobTypes">An array of predefined enum values.</param>
/// <param name="prefixMatch">An array of strings for prefixes to be
/// match.</param>
public ManagementPolicyFilter(IList<string> blobTypes, IList<string> prefixMatch = default(IList<string>))
/// <param name="blobIndexMatch">An array of tag based filters, there
/// can be at most 10 tag filters</param>
public ManagementPolicyFilter(IList<string> blobTypes, IList<string> prefixMatch = default(IList<string>), IList<TagFilter> blobIndexMatch = default(IList<TagFilter>))
{
PrefixMatch = prefixMatch;
BlobTypes = blobTypes;
BlobIndexMatch = blobIndexMatch;
CustomInit();
}

Expand All @@ -57,12 +59,18 @@ public ManagementPolicyFilter()
public IList<string> PrefixMatch { get; set; }

/// <summary>
/// Gets or sets an array of predefined enum values. Only blockBlob is
/// supported.
/// Gets or sets an array of predefined enum values.
/// </summary>
[JsonProperty(PropertyName = "blobTypes")]
public IList<string> BlobTypes { get; set; }

/// <summary>
/// Gets or sets an array of tag based filters, there can be at most 10
/// tag filters
/// </summary>
[JsonProperty(PropertyName = "blobIndexMatch")]
public IList<TagFilter> BlobIndexMatch { get; set; }

/// <summary>
/// Validate the object.
/// </summary>
Expand All @@ -75,6 +83,16 @@ public virtual void Validate()
{
throw new ValidationException(ValidationRules.CannotBeNull, "BlobTypes");
}
if (BlobIndexMatch != null)
{
foreach (var element in BlobIndexMatch)
{
if (element != null)
{
element.Validate();
}
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
// <auto-generated>
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for
// license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
// </auto-generated>

namespace Microsoft.Azure.Management.Storage.Models
{
using Microsoft.Rest;
using Newtonsoft.Json;
using System.Linq;

/// <summary>
/// Tag based filtering for blob objects
/// </summary>
public partial class TagFilter
{
/// <summary>
/// Initializes a new instance of the TagFilter class.
/// </summary>
public TagFilter()
{
CustomInit();
}

/// <summary>
/// Initializes a new instance of the TagFilter class.
/// </summary>
/// <param name="name">This is the filter tag name, it can have 1 - 128
/// characters</param>
/// <param name="op">This is the comparison operator which is used for
/// object comparsion and filtering. Only == (equality operator) is
/// currently supported</param>
/// <param name="value">This is the filter tag value field used for tag
/// based filtering, it can have 1 - 256 characters</param>
public TagFilter(string name, string op, string value)
{
Name = name;
Op = op;
Value = value;
CustomInit();
}

/// <summary>
/// An initialization method that performs custom operations like setting defaults
/// </summary>
partial void CustomInit();

/// <summary>
/// Gets or sets this is the filter tag name, it can have 1 - 128
/// characters
/// </summary>
[JsonProperty(PropertyName = "name")]
public string Name { get; set; }

/// <summary>
/// Gets or sets this is the comparison operator which is used for
/// object comparsion and filtering. Only == (equality operator) is
/// currently supported
/// </summary>
[JsonProperty(PropertyName = "op")]
public string Op { get; set; }

/// <summary>
/// Gets or sets this is the filter tag value field used for tag based
/// filtering, it can have 1 - 256 characters
/// </summary>
[JsonProperty(PropertyName = "value")]
public string Value { get; set; }

/// <summary>
/// Validate the object.
/// </summary>
/// <exception cref="ValidationException">
/// Thrown if validation fails
/// </exception>
public virtual void Validate()
{
if (Name == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "Name");
}
if (Op == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "Op");
}
if (Value == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "Value");
}
if (Name != null)
{
if (Name.Length > 128)
{
throw new ValidationException(ValidationRules.MaxLength, "Name", 128);
}
if (Name.Length < 1)
{
throw new ValidationException(ValidationRules.MinLength, "Name", 1);
}
}
if (Value != null)
{
if (Value.Length > 256)
{
throw new ValidationException(ValidationRules.MaxLength, "Value", 256);
}
if (Value.Length < 1)
{
throw new ValidationException(ValidationRules.MinLength, "Value", 1);
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,5 @@ public static IEnumerable<Tuple<string, string, string>> ApiInfo_StorageManageme
}.AsEnumerable();
}
}
// BEGIN: Code Generation Metadata Section
public static readonly String AutoRestVersion = "latest";
public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4413";
public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/storage/resource-manager/readme.md --csharp --version=latest --reflect-api-versions --csharp.output-folder=C:\\code\\srpsdk\\sdk\\storage\\Microsoft.Azure.Management.Storage\\src\\Generated";
public static readonly String GithubForkName = "Azure";
public static readonly String GithubBranchName = "master";
public static readonly String GithubCommidId = "1840a3849622fcd715717b08186839b93fc40483";
public static readonly String CodeGenerationErrors = "";
public static readonly String GithubRepoName = "azure-rest-api-specs";
// END: Code Generation Metadata Section
}
}