Skip to content

Commit

Permalink
.NET SDK Resource Provider:'ContainerRegistry'
Browse files Browse the repository at this point in the history
REST Spec PR 'Azure/azure-rest-api-specs#5561'
REST Spec PR Author 'jaysterp'
REST Spec PR Last commit
  • Loading branch information
adxsdknet committed Apr 5, 2019
1 parent 036b575 commit a330ce1
Show file tree
Hide file tree
Showing 13 changed files with 284 additions and 22 deletions.
2 changes: 1 addition & 1 deletion src/SDKs/ContainerRegistry/AzSdk.RP.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!--This file and it's contents are updated at build time moving or editing might result in build failure. Take due deligence while editing this file-->
<PropertyGroup>
<AzureApiTag>ContainerRegistry_2017-10-01;ContainerRegistry_2018-09-01;</AzureApiTag>
<AzureApiTag>ContainerRegistry_2017-10-01;ContainerRegistry_2019-04-01;</AzureApiTag>
<PackageTags>$(PackageTags);$(CommonTags);$(AzureApiTag);</PackageTags>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,20 @@ public CustomRegistryCredentials()
/// registry. The password is a secret
/// object that allows multiple ways of providing the value for
/// it.</param>
public CustomRegistryCredentials(SecretObject userName = default(SecretObject), SecretObject password = default(SecretObject))
/// <param name="identity">Indicates the managed identity assigned to
/// the custom credential. If a user-assigned identity
/// this value is the Client ID. If a system-assigned identity, the
/// value will be `system`. In
/// the case of a system-assigned identity, the Client ID will be
/// determined by the runner. This
/// identity may be used to authenticate to key vault to retreive
/// credentials or it may be the only
/// source of authentication used for accessing the registry.</param>
public CustomRegistryCredentials(SecretObject userName = default(SecretObject), SecretObject password = default(SecretObject), string identity = default(string))
{
UserName = userName;
Password = password;
Identity = identity;
CustomInit();
}

Expand All @@ -62,5 +72,19 @@ public CustomRegistryCredentials()
[JsonProperty(PropertyName = "password")]
public SecretObject Password { get; set; }

/// <summary>
/// Gets or sets indicates the managed identity assigned to the custom
/// credential. If a user-assigned identity
/// this value is the Client ID. If a system-assigned identity, the
/// value will be `system`. In
/// the case of a system-assigned identity, the Client ID will be
/// determined by the runner. This
/// identity may be used to authenticate to key vault to retreive
/// credentials or it may be the only
/// source of authentication used for accessing the registry.
/// </summary>
[JsonProperty(PropertyName = "identity")]
public string Identity { get; set; }

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
// <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.ContainerRegistry.Models
{
using Newtonsoft.Json;
using System.Collections;
using System.Collections.Generic;
using System.Linq;

/// <summary>
/// Managed identity for the resource.
/// </summary>
public partial class IdentityProperties
{
/// <summary>
/// Initializes a new instance of the IdentityProperties class.
/// </summary>
public IdentityProperties()
{
CustomInit();
}

/// <summary>
/// Initializes a new instance of the IdentityProperties class.
/// </summary>
/// <param name="principalId">The principal ID of resource
/// identity.</param>
/// <param name="tenantId">The tenant ID of resource.</param>
/// <param name="type">The identity type. Possible values include:
/// 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned',
/// 'None'</param>
/// <param name="userAssignedIdentities">The list of user identities
/// associated with the resource. The user identity
/// dictionary key references will be ARM resource ids in the form:
/// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/
/// providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.</param>
public IdentityProperties(string principalId = default(string), string tenantId = default(string), ResourceIdentityType? type = default(ResourceIdentityType?), IDictionary<string, UserIdentityProperties> userAssignedIdentities = default(IDictionary<string, UserIdentityProperties>))
{
PrincipalId = principalId;
TenantId = tenantId;
Type = type;
UserAssignedIdentities = userAssignedIdentities;
CustomInit();
}

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

/// <summary>
/// Gets or sets the principal ID of resource identity.
/// </summary>
[JsonProperty(PropertyName = "principalId")]
public string PrincipalId { get; set; }

/// <summary>
/// Gets or sets the tenant ID of resource.
/// </summary>
[JsonProperty(PropertyName = "tenantId")]
public string TenantId { get; set; }

/// <summary>
/// Gets or sets the identity type. Possible values include:
/// 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned',
/// 'None'
/// </summary>
[JsonProperty(PropertyName = "type")]
public ResourceIdentityType? Type { get; set; }

/// <summary>
/// Gets or sets the list of user identities associated with the
/// resource. The user identity
/// dictionary key references will be ARM resource ids in the form:
/// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/
/// providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
/// </summary>
[JsonProperty(PropertyName = "userAssignedIdentities")]
public IDictionary<string, UserIdentityProperties> UserAssignedIdentities { get; set; }

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
// <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.ContainerRegistry.Models
{
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System.Runtime;
using System.Runtime.Serialization;

/// <summary>
/// Defines values for ResourceIdentityType.
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public enum ResourceIdentityType
{
[EnumMember(Value = "SystemAssigned")]
SystemAssigned,
[EnumMember(Value = "UserAssigned")]
UserAssigned,
[EnumMember(Value = "SystemAssigned, UserAssigned")]
SystemAssignedUserAssigned,
[EnumMember(Value = "None")]
None
}
internal static class ResourceIdentityTypeEnumExtension
{
internal static string ToSerializedValue(this ResourceIdentityType? value)
{
return value == null ? null : ((ResourceIdentityType)value).ToSerializedValue();
}

internal static string ToSerializedValue(this ResourceIdentityType value)
{
switch( value )
{
case ResourceIdentityType.SystemAssigned:
return "SystemAssigned";
case ResourceIdentityType.UserAssigned:
return "UserAssigned";
case ResourceIdentityType.SystemAssignedUserAssigned:
return "SystemAssigned, UserAssigned";
case ResourceIdentityType.None:
return "None";
}
return null;
}

internal static ResourceIdentityType? ParseResourceIdentityType(this string value)
{
switch( value )
{
case "SystemAssigned":
return ResourceIdentityType.SystemAssigned;
case "UserAssigned":
return ResourceIdentityType.UserAssigned;
case "SystemAssigned, UserAssigned":
return ResourceIdentityType.SystemAssignedUserAssigned;
case "None":
return ResourceIdentityType.None;
}
return null;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ public SecretObject()
/// used as is without any modification.</param>
/// <param name="type">The type of the secret object which determines
/// how the value of the secret object has to be
/// interpreted. Possible values include: 'Opaque'</param>
/// interpreted. Possible values include: 'Opaque',
/// 'Vaultsecret'</param>
public SecretObject(string value = default(string), string type = default(string))
{
Value = value;
Expand All @@ -62,7 +63,7 @@ public SecretObject()
/// <summary>
/// Gets or sets the type of the secret object which determines how the
/// value of the secret object has to be
/// interpreted. Possible values include: 'Opaque'
/// interpreted. Possible values include: 'Opaque', 'Vaultsecret'
/// </summary>
[JsonProperty(PropertyName = "type")]
public string Type { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@ namespace Microsoft.Azure.Management.ContainerRegistry.Models
public static class SecretObjectType
{
public const string Opaque = "Opaque";
public const string Vaultsecret = "Vaultsecret";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public Task()
/// <param name="name">The name of the resource.</param>
/// <param name="type">The type of the resource.</param>
/// <param name="tags">The tags of the resource.</param>
/// <param name="identity">Identity for the resource.</param>
/// <param name="provisioningState">The provisioning state of the task.
/// Possible values include: 'Creating', 'Updating', 'Deleting',
/// 'Succeeded', 'Failed', 'Canceled'</param>
Expand All @@ -57,9 +58,10 @@ public Task()
/// the task.</param>
/// <param name="credentials">The properties that describes a set of
/// credentials that will be used when this run is invoked.</param>
public Task(string location, PlatformProperties platform, TaskStepProperties step, string id = default(string), string name = default(string), string type = default(string), IDictionary<string, string> tags = default(IDictionary<string, string>), string provisioningState = default(string), System.DateTime? creationDate = default(System.DateTime?), string status = default(string), AgentProperties agentConfiguration = default(AgentProperties), int? timeout = default(int?), TriggerProperties trigger = default(TriggerProperties), Credentials credentials = default(Credentials))
public Task(string location, PlatformProperties platform, TaskStepProperties step, string id = default(string), string name = default(string), string type = default(string), IDictionary<string, string> tags = default(IDictionary<string, string>), IdentityProperties identity = default(IdentityProperties), string provisioningState = default(string), System.DateTime? creationDate = default(System.DateTime?), string status = default(string), AgentProperties agentConfiguration = default(AgentProperties), int? timeout = default(int?), TriggerProperties trigger = default(TriggerProperties), Credentials credentials = default(Credentials))
: base(location, id, name, type, tags)
{
Identity = identity;
ProvisioningState = provisioningState;
CreationDate = creationDate;
Status = status;
Expand All @@ -77,6 +79,12 @@ public Task()
/// </summary>
partial void CustomInit();

/// <summary>
/// Gets or sets identity for the resource.
/// </summary>
[JsonProperty(PropertyName = "identity")]
public IdentityProperties Identity { get; set; }

/// <summary>
/// Gets the provisioning state of the task. Possible values include:
/// 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public TaskUpdateParameters()
/// <summary>
/// Initializes a new instance of the TaskUpdateParameters class.
/// </summary>
/// <param name="identity">Identity for the resource.</param>
/// <param name="status">The current status of task. Possible values
/// include: 'Disabled', 'Enabled'</param>
/// <param name="platform">The platform properties against which the
Expand All @@ -47,8 +48,9 @@ public TaskUpdateParameters()
/// <param name="credentials">The parameters that describes a set of
/// credentials that will be used when this run is invoked.</param>
/// <param name="tags">The ARM resource tags.</param>
public TaskUpdateParameters(string status = default(string), PlatformUpdateParameters platform = default(PlatformUpdateParameters), AgentProperties agentConfiguration = default(AgentProperties), int? timeout = default(int?), TaskStepUpdateParameters step = default(TaskStepUpdateParameters), TriggerUpdateParameters trigger = default(TriggerUpdateParameters), Credentials credentials = default(Credentials), IDictionary<string, string> tags = default(IDictionary<string, string>))
public TaskUpdateParameters(IdentityProperties identity = default(IdentityProperties), string status = default(string), PlatformUpdateParameters platform = default(PlatformUpdateParameters), AgentProperties agentConfiguration = default(AgentProperties), int? timeout = default(int?), TaskStepUpdateParameters step = default(TaskStepUpdateParameters), TriggerUpdateParameters trigger = default(TriggerUpdateParameters), Credentials credentials = default(Credentials), IDictionary<string, string> tags = default(IDictionary<string, string>))
{
Identity = identity;
Status = status;
Platform = platform;
AgentConfiguration = agentConfiguration;
Expand All @@ -65,6 +67,12 @@ public TaskUpdateParameters()
/// </summary>
partial void CustomInit();

/// <summary>
/// Gets or sets identity for the resource.
/// </summary>
[JsonProperty(PropertyName = "identity")]
public IdentityProperties Identity { get; set; }

/// <summary>
/// Gets or sets the current status of task. Possible values include:
/// 'Disabled', 'Enabled'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
// <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.ContainerRegistry.Models
{
using Newtonsoft.Json;
using System.Linq;

public partial class UserIdentityProperties
{
/// <summary>
/// Initializes a new instance of the UserIdentityProperties class.
/// </summary>
public UserIdentityProperties()
{
CustomInit();
}

/// <summary>
/// Initializes a new instance of the UserIdentityProperties class.
/// </summary>
/// <param name="principalId">The principal id of user assigned
/// identity.</param>
/// <param name="clientId">The client id of user assigned
/// identity.</param>
public UserIdentityProperties(string principalId = default(string), string clientId = default(string))
{
PrincipalId = principalId;
ClientId = clientId;
CustomInit();
}

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

/// <summary>
/// Gets or sets the principal id of user assigned identity.
/// </summary>
[JsonProperty(PropertyName = "principalId")]
public string PrincipalId { get; set; }

/// <summary>
/// Gets or sets the client id of user assigned identity.
/// </summary>
[JsonProperty(PropertyName = "clientId")]
public string ClientId { get; set; }

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1942,7 +1942,7 @@ internal RegistriesOperations(ContainerRegistryManagementClient client)
throw new ValidationException(ValidationRules.Pattern, "registryName", "^[a-zA-Z0-9]*$");
}
}
string apiVersion = "2018-09-01";
string apiVersion = "2019-04-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
Expand Down Expand Up @@ -3311,7 +3311,7 @@ internal RegistriesOperations(ContainerRegistryManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "runRequest");
}
string apiVersion = "2018-09-01";
string apiVersion = "2019-04-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
Expand Down
Loading

0 comments on commit a330ce1

Please sign in to comment.