// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.datamigration.fluent;

import com.azure.core.annotation.ReturnType;
import com.azure.core.annotation.ServiceMethod;
import com.azure.core.http.rest.PagedIterable;
import com.azure.core.http.rest.Response;
import com.azure.core.management.polling.PollResult;
import com.azure.core.util.Context;
import com.azure.core.util.polling.SyncPoller;
import com.azure.resourcemanager.datamigration.fluent.models.AvailableServiceSkuInner;
import com.azure.resourcemanager.datamigration.fluent.models.DataMigrationServiceInner;
import com.azure.resourcemanager.datamigration.fluent.models.DataMigrationServiceStatusResponseInner;
import com.azure.resourcemanager.datamigration.fluent.models.NameAvailabilityResponseInner;
import com.azure.resourcemanager.datamigration.models.NameAvailabilityRequest;

/** An instance of this class provides access to all the operations defined in ServicesClient. */
public interface ServicesClient {
    /**
     * Create or update DMS Instance
     *
     * <p>The services resource is the top-level resource that represents the Database Migration Service. The PUT method
     * creates a new service or updates an existing one. When a service is updated, existing child resources (i.e.
     * tasks) are unaffected. Services currently support a single kind, "vm", which refers to a VM-based service,
     * although other kinds may be added in the future. This method can change the kind, SKU, and network of the
     * service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request
     * ("ServiceIsBusy"). The provider will reply when successful with 200 OK or 201 Created. Long-running operations
     * use the provisioningState property.
     *
     * @param groupName Name of the resource group.
     * @param serviceName Name of the service.
     * @param parameters Information about the service.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link SyncPoller} for polling of a Database Migration Service resource.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<DataMigrationServiceInner>, DataMigrationServiceInner> beginCreateOrUpdate(
        String groupName, String serviceName, DataMigrationServiceInner parameters);

    /**
     * Create or update DMS Instance
     *
     * <p>The services resource is the top-level resource that represents the Database Migration Service. The PUT method
     * creates a new service or updates an existing one. When a service is updated, existing child resources (i.e.
     * tasks) are unaffected. Services currently support a single kind, "vm", which refers to a VM-based service,
     * although other kinds may be added in the future. This method can change the kind, SKU, and network of the
     * service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request
     * ("ServiceIsBusy"). The provider will reply when successful with 200 OK or 201 Created. Long-running operations
     * use the provisioningState property.
     *
     * @param groupName Name of the resource group.
     * @param serviceName Name of the service.
     * @param parameters Information about the service.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link SyncPoller} for polling of a Database Migration Service resource.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<DataMigrationServiceInner>, DataMigrationServiceInner> beginCreateOrUpdate(
        String groupName, String serviceName, DataMigrationServiceInner parameters, Context context);

    /**
     * Create or update DMS Instance
     *
     * <p>The services resource is the top-level resource that represents the Database Migration Service. The PUT method
     * creates a new service or updates an existing one. When a service is updated, existing child resources (i.e.
     * tasks) are unaffected. Services currently support a single kind, "vm", which refers to a VM-based service,
     * although other kinds may be added in the future. This method can change the kind, SKU, and network of the
     * service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request
     * ("ServiceIsBusy"). The provider will reply when successful with 200 OK or 201 Created. Long-running operations
     * use the provisioningState property.
     *
     * @param groupName Name of the resource group.
     * @param serviceName Name of the service.
     * @param parameters Information about the service.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a Database Migration Service resource.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    DataMigrationServiceInner createOrUpdate(
        String groupName, String serviceName, DataMigrationServiceInner parameters);

    /**
     * Create or update DMS Instance
     *
     * <p>The services resource is the top-level resource that represents the Database Migration Service. The PUT method
     * creates a new service or updates an existing one. When a service is updated, existing child resources (i.e.
     * tasks) are unaffected. Services currently support a single kind, "vm", which refers to a VM-based service,
     * although other kinds may be added in the future. This method can change the kind, SKU, and network of the
     * service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request
     * ("ServiceIsBusy"). The provider will reply when successful with 200 OK or 201 Created. Long-running operations
     * use the provisioningState property.
     *
     * @param groupName Name of the resource group.
     * @param serviceName Name of the service.
     * @param parameters Information about the service.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a Database Migration Service resource.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    DataMigrationServiceInner createOrUpdate(
        String groupName, String serviceName, DataMigrationServiceInner parameters, Context context);

    /**
     * Get DMS Service Instance
     *
     * <p>The services resource is the top-level resource that represents the Database Migration Service. The GET method
     * retrieves information about a service instance.
     *
     * @param groupName Name of the resource group.
     * @param serviceName Name of the service.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a Database Migration Service resource along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Response<DataMigrationServiceInner> getByResourceGroupWithResponse(
        String groupName, String serviceName, Context context);

    /**
     * Get DMS Service Instance
     *
     * <p>The services resource is the top-level resource that represents the Database Migration Service. The GET method
     * retrieves information about a service instance.
     *
     * @param groupName Name of the resource group.
     * @param serviceName Name of the service.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a Database Migration Service resource.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    DataMigrationServiceInner getByResourceGroup(String groupName, String serviceName);

    /**
     * Delete DMS Service Instance
     *
     * <p>The services resource is the top-level resource that represents the Database Migration Service. The DELETE
     * method deletes a service. Any running tasks will be canceled.
     *
     * @param groupName Name of the resource group.
     * @param serviceName Name of the service.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link SyncPoller} for polling of long-running operation.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<Void>, Void> beginDelete(String groupName, String serviceName);

    /**
     * Delete DMS Service Instance
     *
     * <p>The services resource is the top-level resource that represents the Database Migration Service. The DELETE
     * method deletes a service. Any running tasks will be canceled.
     *
     * @param groupName Name of the resource group.
     * @param serviceName Name of the service.
     * @param deleteRunningTasks Delete the resource even if it contains running tasks.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link SyncPoller} for polling of long-running operation.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<Void>, Void> beginDelete(
        String groupName, String serviceName, Boolean deleteRunningTasks, Context context);

    /**
     * Delete DMS Service Instance
     *
     * <p>The services resource is the top-level resource that represents the Database Migration Service. The DELETE
     * method deletes a service. Any running tasks will be canceled.
     *
     * @param groupName Name of the resource group.
     * @param serviceName Name of the service.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    void delete(String groupName, String serviceName);

    /**
     * Delete DMS Service Instance
     *
     * <p>The services resource is the top-level resource that represents the Database Migration Service. The DELETE
     * method deletes a service. Any running tasks will be canceled.
     *
     * @param groupName Name of the resource group.
     * @param serviceName Name of the service.
     * @param deleteRunningTasks Delete the resource even if it contains running tasks.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    void delete(String groupName, String serviceName, Boolean deleteRunningTasks, Context context);

    /**
     * Create or update DMS Service Instance
     *
     * <p>The services resource is the top-level resource that represents the Database Migration Service. The PATCH
     * method updates an existing service. This method can change the kind, SKU, and network of the service, but if
     * tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request ("ServiceIsBusy").
     *
     * @param groupName Name of the resource group.
     * @param serviceName Name of the service.
     * @param parameters Information about the service.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link SyncPoller} for polling of a Database Migration Service resource.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<DataMigrationServiceInner>, DataMigrationServiceInner> beginUpdate(
        String groupName, String serviceName, DataMigrationServiceInner parameters);

    /**
     * Create or update DMS Service Instance
     *
     * <p>The services resource is the top-level resource that represents the Database Migration Service. The PATCH
     * method updates an existing service. This method can change the kind, SKU, and network of the service, but if
     * tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request ("ServiceIsBusy").
     *
     * @param groupName Name of the resource group.
     * @param serviceName Name of the service.
     * @param parameters Information about the service.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link SyncPoller} for polling of a Database Migration Service resource.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<DataMigrationServiceInner>, DataMigrationServiceInner> beginUpdate(
        String groupName, String serviceName, DataMigrationServiceInner parameters, Context context);

    /**
     * Create or update DMS Service Instance
     *
     * <p>The services resource is the top-level resource that represents the Database Migration Service. The PATCH
     * method updates an existing service. This method can change the kind, SKU, and network of the service, but if
     * tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request ("ServiceIsBusy").
     *
     * @param groupName Name of the resource group.
     * @param serviceName Name of the service.
     * @param parameters Information about the service.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a Database Migration Service resource.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    DataMigrationServiceInner update(String groupName, String serviceName, DataMigrationServiceInner parameters);

    /**
     * Create or update DMS Service Instance
     *
     * <p>The services resource is the top-level resource that represents the Database Migration Service. The PATCH
     * method updates an existing service. This method can change the kind, SKU, and network of the service, but if
     * tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request ("ServiceIsBusy").
     *
     * @param groupName Name of the resource group.
     * @param serviceName Name of the service.
     * @param parameters Information about the service.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a Database Migration Service resource.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    DataMigrationServiceInner update(
        String groupName, String serviceName, DataMigrationServiceInner parameters, Context context);

    /**
     * Check service health status
     *
     * <p>The services resource is the top-level resource that represents the Database Migration Service. This action
     * performs a health check and returns the status of the service and virtual machine size.
     *
     * @param groupName Name of the resource group.
     * @param serviceName Name of the service.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return service health status along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Response<DataMigrationServiceStatusResponseInner> checkStatusWithResponse(
        String groupName, String serviceName, Context context);

    /**
     * Check service health status
     *
     * <p>The services resource is the top-level resource that represents the Database Migration Service. This action
     * performs a health check and returns the status of the service and virtual machine size.
     *
     * @param groupName Name of the resource group.
     * @param serviceName Name of the service.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return service health status.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    DataMigrationServiceStatusResponseInner checkStatus(String groupName, String serviceName);

    /**
     * Start service
     *
     * <p>The services resource is the top-level resource that represents the Database Migration Service. This action
     * starts the service and the service can be used for data migration.
     *
     * @param groupName Name of the resource group.
     * @param serviceName Name of the service.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link SyncPoller} for polling of long-running operation.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<Void>, Void> beginStart(String groupName, String serviceName);

    /**
     * Start service
     *
     * <p>The services resource is the top-level resource that represents the Database Migration Service. This action
     * starts the service and the service can be used for data migration.
     *
     * @param groupName Name of the resource group.
     * @param serviceName Name of the service.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link SyncPoller} for polling of long-running operation.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<Void>, Void> beginStart(String groupName, String serviceName, Context context);

    /**
     * Start service
     *
     * <p>The services resource is the top-level resource that represents the Database Migration Service. This action
     * starts the service and the service can be used for data migration.
     *
     * @param groupName Name of the resource group.
     * @param serviceName Name of the service.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    void start(String groupName, String serviceName);

    /**
     * Start service
     *
     * <p>The services resource is the top-level resource that represents the Database Migration Service. This action
     * starts the service and the service can be used for data migration.
     *
     * @param groupName Name of the resource group.
     * @param serviceName Name of the service.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    void start(String groupName, String serviceName, Context context);

    /**
     * Stop service
     *
     * <p>The services resource is the top-level resource that represents the Database Migration Service. This action
     * stops the service and the service cannot be used for data migration. The service owner won't be billed when the
     * service is stopped.
     *
     * @param groupName Name of the resource group.
     * @param serviceName Name of the service.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link SyncPoller} for polling of long-running operation.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<Void>, Void> beginStop(String groupName, String serviceName);

    /**
     * Stop service
     *
     * <p>The services resource is the top-level resource that represents the Database Migration Service. This action
     * stops the service and the service cannot be used for data migration. The service owner won't be billed when the
     * service is stopped.
     *
     * @param groupName Name of the resource group.
     * @param serviceName Name of the service.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link SyncPoller} for polling of long-running operation.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<Void>, Void> beginStop(String groupName, String serviceName, Context context);

    /**
     * Stop service
     *
     * <p>The services resource is the top-level resource that represents the Database Migration Service. This action
     * stops the service and the service cannot be used for data migration. The service owner won't be billed when the
     * service is stopped.
     *
     * @param groupName Name of the resource group.
     * @param serviceName Name of the service.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    void stop(String groupName, String serviceName);

    /**
     * Stop service
     *
     * <p>The services resource is the top-level resource that represents the Database Migration Service. This action
     * stops the service and the service cannot be used for data migration. The service owner won't be billed when the
     * service is stopped.
     *
     * @param groupName Name of the resource group.
     * @param serviceName Name of the service.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    void stop(String groupName, String serviceName, Context context);

    /**
     * Get compatible SKUs
     *
     * <p>The services resource is the top-level resource that represents the Database Migration Service. The skus
     * action returns the list of SKUs that a service resource can be updated to.
     *
     * @param groupName Name of the resource group.
     * @param serviceName Name of the service.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return oData page of available SKUs as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<AvailableServiceSkuInner> listSkus(String groupName, String serviceName);

    /**
     * Get compatible SKUs
     *
     * <p>The services resource is the top-level resource that represents the Database Migration Service. The skus
     * action returns the list of SKUs that a service resource can be updated to.
     *
     * @param groupName Name of the resource group.
     * @param serviceName Name of the service.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return oData page of available SKUs as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<AvailableServiceSkuInner> listSkus(String groupName, String serviceName, Context context);

    /**
     * Check nested resource name validity and availability
     *
     * <p>This method checks whether a proposed nested resource name is valid and available.
     *
     * @param groupName Name of the resource group.
     * @param serviceName Name of the service.
     * @param parameters Requested name to validate.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return indicates whether a proposed resource name is available along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Response<NameAvailabilityResponseInner> nestedCheckNameAvailabilityWithResponse(
        String groupName, String serviceName, NameAvailabilityRequest parameters, Context context);

    /**
     * Check nested resource name validity and availability
     *
     * <p>This method checks whether a proposed nested resource name is valid and available.
     *
     * @param groupName Name of the resource group.
     * @param serviceName Name of the service.
     * @param parameters Requested name to validate.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return indicates whether a proposed resource name is available.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    NameAvailabilityResponseInner nestedCheckNameAvailability(
        String groupName, String serviceName, NameAvailabilityRequest parameters);

    /**
     * Get services in resource group
     *
     * <p>The Services resource is the top-level resource that represents the Database Migration Service. This method
     * returns a list of service resources in a resource group.
     *
     * @param groupName Name of the resource group.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return oData page of service objects as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<DataMigrationServiceInner> listByResourceGroup(String groupName);

    /**
     * Get services in resource group
     *
     * <p>The Services resource is the top-level resource that represents the Database Migration Service. This method
     * returns a list of service resources in a resource group.
     *
     * @param groupName Name of the resource group.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return oData page of service objects as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<DataMigrationServiceInner> listByResourceGroup(String groupName, Context context);

    /**
     * Get services in subscription
     *
     * <p>The services resource is the top-level resource that represents the Database Migration Service. This method
     * returns a list of service resources in a subscription.
     *
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return oData page of service objects as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<DataMigrationServiceInner> list();

    /**
     * Get services in subscription
     *
     * <p>The services resource is the top-level resource that represents the Database Migration Service. This method
     * returns a list of service resources in a subscription.
     *
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return oData page of service objects as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<DataMigrationServiceInner> list(Context context);

    /**
     * Check name validity and availability
     *
     * <p>This method checks whether a proposed top-level resource name is valid and available.
     *
     * @param location The Azure region of the operation.
     * @param parameters Requested name to validate.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return indicates whether a proposed resource name is available along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Response<NameAvailabilityResponseInner> checkNameAvailabilityWithResponse(
        String location, NameAvailabilityRequest parameters, Context context);

    /**
     * Check name validity and availability
     *
     * <p>This method checks whether a proposed top-level resource name is valid and available.
     *
     * @param location The Azure region of the operation.
     * @param parameters Requested name to validate.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return indicates whether a proposed resource name is available.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    NameAvailabilityResponseInner checkNameAvailability(String location, NameAvailabilityRequest parameters);
}
