/// <summary>
 /// Adds an API to the specified Gateway.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='serviceName'>
 /// The name of the API Management service.
 /// </param>
 /// <param name='gatewayId'>
 /// Gateway entity identifier. Must be unique in the current API Management
 /// service instance. Must not have value 'managed'
 /// </param>
 /// <param name='apiId'>
 /// API identifier. Must be unique in the current API Management service
 /// instance.
 /// </param>
 /// <param name='parameters'>
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <ApiContract> CreateOrUpdateAsync(this IGatewayApiOperations operations, string resourceGroupName, string serviceName, string gatewayId, string apiId, AssociationContract parameters = default(AssociationContract), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serviceName, gatewayId, apiId, parameters, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Lists a collection of the APIs associated with a gateway.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='serviceName'>
 /// The name of the API Management service.
 /// </param>
 /// <param name='gatewayId'>
 /// Gateway entity identifier. Must be unique in the current API Management
 /// service instance. Must not have value 'managed'
 /// </param>
 /// <param name='top'>
 /// Number of records to return.
 /// </param>
 /// <param name='skip'>
 /// Number of records to skip.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IPage <ApiContract> > ListByServiceAsync(this IGatewayApiOperations operations, string resourceGroupName, string serviceName, string gatewayId, int?top = default(int?), int?skip = default(int?), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListByServiceWithHttpMessagesAsync(resourceGroupName, serviceName, gatewayId, top, skip, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Lists a collection of the APIs associated with a gateway.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='nextPageLink'>
 /// The NextLink from the previous successful call to List operation.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IPage <ApiContract> > ListByServiceNextAsync(this IGatewayApiOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListByServiceNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Checks that API entity specified by identifier is associated with the
 /// Gateway entity.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='serviceName'>
 /// The name of the API Management service.
 /// </param>
 /// <param name='gatewayId'>
 /// Gateway entity identifier. Must be unique in the current API Management
 /// service instance. Must not have value 'managed'
 /// </param>
 /// <param name='apiId'>
 /// API identifier. Must be unique in the current API Management service
 /// instance.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <GatewayApiGetEntityTagHeaders> GetEntityTagAsync(this IGatewayApiOperations operations, string resourceGroupName, string serviceName, string gatewayId, string apiId, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetEntityTagWithHttpMessagesAsync(resourceGroupName, serviceName, gatewayId, apiId, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Headers);
     }
 }
 /// <summary>
 /// Lists a collection of the APIs associated with a gateway.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='serviceName'>
 /// The name of the API Management service.
 /// </param>
 /// <param name='gatewayId'>
 /// Gateway entity identifier. Must be unique in the current API Management
 /// service instance. Must not have value 'managed'
 /// </param>
 /// <param name='top'>
 /// Number of records to return.
 /// </param>
 /// <param name='skip'>
 /// Number of records to skip.
 /// </param>
 public static IPage <ApiContract> ListByService(this IGatewayApiOperations operations, string resourceGroupName, string serviceName, string gatewayId, int?top = default(int?), int?skip = default(int?))
 {
     return(operations.ListByServiceAsync(resourceGroupName, serviceName, gatewayId, top, skip).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Lists a collection of the APIs associated with a gateway.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='nextPageLink'>
 /// The NextLink from the previous successful call to List operation.
 /// </param>
 public static IPage <ApiContract> ListByServiceNext(this IGatewayApiOperations operations, string nextPageLink)
 {
     return(operations.ListByServiceNextAsync(nextPageLink).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Deletes the specified API from the specified Gateway.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='serviceName'>
 /// The name of the API Management service.
 /// </param>
 /// <param name='gatewayId'>
 /// Gateway entity identifier. Must be unique in the current API Management
 /// service instance. Must not have value 'managed'
 /// </param>
 /// <param name='apiId'>
 /// API identifier. Must be unique in the current API Management service
 /// instance.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task DeleteAsync(this IGatewayApiOperations operations, string resourceGroupName, string serviceName, string gatewayId, string apiId, CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, serviceName, gatewayId, apiId, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
 /// <summary>
 /// Deletes the specified API from the specified Gateway.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='serviceName'>
 /// The name of the API Management service.
 /// </param>
 /// <param name='gatewayId'>
 /// Gateway entity identifier. Must be unique in the current API Management
 /// service instance. Must not have value 'managed'
 /// </param>
 /// <param name='apiId'>
 /// API identifier. Must be unique in the current API Management service
 /// instance.
 /// </param>
 public static void Delete(this IGatewayApiOperations operations, string resourceGroupName, string serviceName, string gatewayId, string apiId)
 {
     operations.DeleteAsync(resourceGroupName, serviceName, gatewayId, apiId).GetAwaiter().GetResult();
 }
 /// <summary>
 /// Adds an API to the specified Gateway.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='serviceName'>
 /// The name of the API Management service.
 /// </param>
 /// <param name='gatewayId'>
 /// Gateway entity identifier. Must be unique in the current API Management
 /// service instance. Must not have value 'managed'
 /// </param>
 /// <param name='apiId'>
 /// API identifier. Must be unique in the current API Management service
 /// instance.
 /// </param>
 /// <param name='parameters'>
 /// </param>
 public static ApiContract CreateOrUpdate(this IGatewayApiOperations operations, string resourceGroupName, string serviceName, string gatewayId, string apiId, AssociationContract parameters = default(AssociationContract))
 {
     return(operations.CreateOrUpdateAsync(resourceGroupName, serviceName, gatewayId, apiId, parameters).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Checks that API entity specified by identifier is associated with the
 /// Gateway entity.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='serviceName'>
 /// The name of the API Management service.
 /// </param>
 /// <param name='gatewayId'>
 /// Gateway entity identifier. Must be unique in the current API Management
 /// service instance. Must not have value 'managed'
 /// </param>
 /// <param name='apiId'>
 /// API identifier. Must be unique in the current API Management service
 /// instance.
 /// </param>
 public static GatewayApiGetEntityTagHeaders GetEntityTag(this IGatewayApiOperations operations, string resourceGroupName, string serviceName, string gatewayId, string apiId)
 {
     return(operations.GetEntityTagAsync(resourceGroupName, serviceName, gatewayId, apiId).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Lists a collection of the APIs associated with a gateway.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='serviceName'>
 /// The name of the API Management service.
 /// </param>
 /// <param name='gatewayId'>
 /// Gateway entity identifier. Must be unique in the current API Management
 /// service instance. Must not have value 'managed'
 /// </param>
 /// <param name='odataQuery'>
 /// OData parameters to apply to the operation.
 /// </param>
 public static IPage <ApiContract> ListByService(this IGatewayApiOperations operations, string resourceGroupName, string serviceName, string gatewayId, ODataQuery <ApiContract> odataQuery = default(ODataQuery <ApiContract>))
 {
     return(operations.ListByServiceAsync(resourceGroupName, serviceName, gatewayId, odataQuery).GetAwaiter().GetResult());
 }