Skip to content
Merged
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
@@ -1,7 +1,9 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System;
using System.Threading;
using System.Threading.Tasks;
using Azure.Core;
using Azure.ResourceManager.Resources.Models;

Expand All @@ -18,6 +20,8 @@ namespace Azure.ResourceManager.Resources
[CodeGenSuppress("GetAvailableLocationsAsync", typeof(CancellationToken))]
[CodeGenSuppress("GetTenants")]
[CodeGenSuppress("CreateResourceIdentifier")]
[CodeGenSuppress("GetGenericResourceAsync", typeof(ResourceIdentifier), typeof(string), typeof(CancellationToken))]
[CodeGenSuppress("GetGenericResource", typeof(ResourceIdentifier), typeof(string), typeof(CancellationToken))]
// [CodeGenSuppress("_tenantsRestClient")] // TODO: not working for private member
public partial class TenantResource : ArmResource
{
Expand Down Expand Up @@ -83,5 +87,51 @@ public virtual Pageable<TenantResourceProvider> GetTenantResourceProviders(int?
{
return GetTenantResourceProviders(expand, cancellationToken);
}

/// <summary>
/// Gets a resource by ID.
/// <list type="bullet">
/// <item>
/// <term>Request Path</term>
/// <description>/{resourceId}</description>
/// </item>
/// <item>
/// <term>Operation Id</term>
/// <description>Resources_GetById</description>
/// </item>
/// </list>
/// </summary>
/// <param name="resourceId"> The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
/// <exception cref="ArgumentNullException"> <paramref name="resourceId"/> is null. </exception>
// api-version is defined as method parameter in spec but used as client parameter for Resources_GetById to keep the contract unchaged
[ForwardsClientCalls]
public virtual async Task<Response<GenericResource>> GetGenericResourceAsync(ResourceIdentifier resourceId, CancellationToken cancellationToken = default)
{
return await GetGenericResources().GetAsync(resourceId, cancellationToken).ConfigureAwait(false);
}

/// <summary>
/// Gets a resource by ID.
/// <list type="bullet">
/// <item>
/// <term>Request Path</term>
/// <description>/{resourceId}</description>
/// </item>
/// <item>
/// <term>Operation Id</term>
/// <description>Resources_GetById</description>
/// </item>
/// </list>
/// </summary>
/// <param name="resourceId"> The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
/// <exception cref="ArgumentNullException"> <paramref name="resourceId"/> is null. </exception>
// api-version is defined as method parameter in spec but used as client parameter for Resources_GetById to keep the contract unchaged
[ForwardsClientCalls]
public virtual Response<GenericResource> GetGenericResource(ResourceIdentifier resourceId, CancellationToken cancellationToken = default)
{
return GetGenericResources().Get(resourceId, cancellationToken);
}
}
}
Loading