Skip to content

Commit 32d823b

Browse files
Add TemplateModelFactory to resolve AZC0035 analyzer error (Azure#50690)
* Initial plan for issue * Add TemplateModelFactory to resolve AZC0035 analyzer issue Co-authored-by: KrzysztofCwalina <[email protected]> * Address PR feedback: remove test file and update comment Co-authored-by: KrzysztofCwalina <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: KrzysztofCwalina <[email protected]>
1 parent 7bb9926 commit 32d823b

File tree

3 files changed

+37
-0
lines changed

3 files changed

+37
-0
lines changed

sdk/template/Azure.Template/api/Azure.Template.net8.0.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ internal SecretBundle() { }
3838
public System.Collections.Generic.IReadOnlyDictionary<string, string> Tags { get { throw null; } }
3939
public string Value { get { throw null; } }
4040
}
41+
public static partial class TemplateModelFactory
42+
{
43+
public static Azure.Template.Models.SecretBundle SecretBundle(string value = null, string id = null, string contentType = null, System.Collections.Generic.IReadOnlyDictionary<string, string> tags = null, string kid = null, bool? managed = default(bool?)) { throw null; }
44+
}
4145
}
4246
namespace Microsoft.Extensions.Azure
4347
{

sdk/template/Azure.Template/api/Azure.Template.netstandard2.0.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ internal SecretBundle() { }
3838
public System.Collections.Generic.IReadOnlyDictionary<string, string> Tags { get { throw null; } }
3939
public string Value { get { throw null; } }
4040
}
41+
public static partial class TemplateModelFactory
42+
{
43+
public static Azure.Template.Models.SecretBundle SecretBundle(string value = null, string id = null, string contentType = null, System.Collections.Generic.IReadOnlyDictionary<string, string> tags = null, string kid = null, bool? managed = default(bool?)) { throw null; }
44+
}
4145
}
4246
namespace Microsoft.Extensions.Azure
4347
{
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
4+
#nullable disable
5+
6+
using System.Collections.Generic;
7+
using Azure.Core;
8+
9+
namespace Azure.Template.Models
10+
{
11+
/// <summary> Model factory that enables mocking of the Template client library. </summary>
12+
public static partial class TemplateModelFactory
13+
{
14+
/// <summary> Initializes a new instance of <see cref="SecretBundle"/>. </summary>
15+
/// <param name="value"> The secret value. </param>
16+
/// <param name="id"> The secret id. </param>
17+
/// <param name="contentType"> The content type of the secret. </param>
18+
/// <param name="tags"> Application specific metadata in the form of key-value pairs. </param>
19+
/// <param name="kid"> If this is a secret backing a KV certificate, then this field specifies the corresponding key backing the KV certificate. </param>
20+
/// <param name="managed"> True if the secret's lifetime is managed by key vault. If this is a secret backing a certificate, then managed will be true. </param>
21+
/// <returns> A new <see cref="SecretBundle"/> instance for mocking. </returns>
22+
public static SecretBundle SecretBundle(string value = null, string id = null, string contentType = null, IReadOnlyDictionary<string, string> tags = null, string kid = null, bool? managed = null)
23+
{
24+
tags ??= new Dictionary<string, string>();
25+
26+
return new SecretBundle(value, id, contentType, tags, kid, managed);
27+
}
28+
}
29+
}

0 commit comments

Comments
 (0)