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

package azure.resourcemanager.managementgroup.fluent;

import azure.resourcemanager.managementgroup.fluent.models.ManagementGroupChildResourceInner;
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;

/**
 * An instance of this class provides access to all the operations defined in ManagementGroupChildResourcesClient.
 */
public interface ManagementGroupChildResourcesClient {
    /**
     * Get a ManagementGroupChildResource.
     * 
     * @param managementGroupId The management group ID.
     * @param managementGroupChildResourceName The name of the ManagementGroupChildResource.
     * @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 ManagementGroupChildResource along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Response<ManagementGroupChildResourceInner> getWithResponse(String managementGroupId,
        String managementGroupChildResourceName, Context context);

    /**
     * Get a ManagementGroupChildResource.
     * 
     * @param managementGroupId The management group ID.
     * @param managementGroupChildResourceName The name of the ManagementGroupChildResource.
     * @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 ManagementGroupChildResource.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    ManagementGroupChildResourceInner get(String managementGroupId, String managementGroupChildResourceName);

    /**
     * Create a ManagementGroupChildResource.
     * 
     * @param managementGroupId The management group ID.
     * @param managementGroupChildResourceName The name of the ManagementGroupChildResource.
     * @param resource Resource create parameters.
     * @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 concrete extension resource types can be created by aliasing this
     * type using a specific property type.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<ManagementGroupChildResourceInner>, ManagementGroupChildResourceInner> beginCreateOrUpdate(
        String managementGroupId, String managementGroupChildResourceName, ManagementGroupChildResourceInner resource);

    /**
     * Create a ManagementGroupChildResource.
     * 
     * @param managementGroupId The management group ID.
     * @param managementGroupChildResourceName The name of the ManagementGroupChildResource.
     * @param resource Resource create parameters.
     * @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 concrete extension resource types can be created by aliasing this
     * type using a specific property type.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<ManagementGroupChildResourceInner>, ManagementGroupChildResourceInner> beginCreateOrUpdate(
        String managementGroupId, String managementGroupChildResourceName, ManagementGroupChildResourceInner resource,
        Context context);

    /**
     * Create a ManagementGroupChildResource.
     * 
     * @param managementGroupId The management group ID.
     * @param managementGroupChildResourceName The name of the ManagementGroupChildResource.
     * @param resource Resource create parameters.
     * @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 concrete extension resource types can be created by aliasing this type using a specific property type.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    ManagementGroupChildResourceInner createOrUpdate(String managementGroupId, String managementGroupChildResourceName,
        ManagementGroupChildResourceInner resource);

    /**
     * Create a ManagementGroupChildResource.
     * 
     * @param managementGroupId The management group ID.
     * @param managementGroupChildResourceName The name of the ManagementGroupChildResource.
     * @param resource Resource create parameters.
     * @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 concrete extension resource types can be created by aliasing this type using a specific property type.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    ManagementGroupChildResourceInner createOrUpdate(String managementGroupId, String managementGroupChildResourceName,
        ManagementGroupChildResourceInner resource, Context context);

    /**
     * Update a ManagementGroupChildResource.
     * 
     * @param managementGroupId The management group ID.
     * @param managementGroupChildResourceName The name of the ManagementGroupChildResource.
     * @param properties The resource properties to be updated.
     * @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 concrete extension resource types can be created by aliasing this type using a specific property type
     * along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Response<ManagementGroupChildResourceInner> updateWithResponse(String managementGroupId,
        String managementGroupChildResourceName, ManagementGroupChildResourceInner properties, Context context);

    /**
     * Update a ManagementGroupChildResource.
     * 
     * @param managementGroupId The management group ID.
     * @param managementGroupChildResourceName The name of the ManagementGroupChildResource.
     * @param properties The resource properties to be updated.
     * @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 concrete extension resource types can be created by aliasing this type using a specific property type.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    ManagementGroupChildResourceInner update(String managementGroupId, String managementGroupChildResourceName,
        ManagementGroupChildResourceInner properties);

    /**
     * Delete a ManagementGroupChildResource.
     * 
     * @param managementGroupId The management group ID.
     * @param managementGroupChildResourceName The name of the ManagementGroupChildResource.
     * @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 Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Response<Void> deleteWithResponse(String managementGroupId, String managementGroupChildResourceName,
        Context context);

    /**
     * Delete a ManagementGroupChildResource.
     * 
     * @param managementGroupId The management group ID.
     * @param managementGroupChildResourceName The name of the ManagementGroupChildResource.
     * @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 managementGroupId, String managementGroupChildResourceName);

    /**
     * List ManagementGroupChildResource resources by scope.
     * 
     * @param managementGroupId The management group ID.
     * @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 response of a ManagementGroupChildResource list operation as paginated response with
     * {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<ManagementGroupChildResourceInner> listByManagementGroup(String managementGroupId);

    /**
     * List ManagementGroupChildResource resources by scope.
     * 
     * @param managementGroupId The management group ID.
     * @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 response of a ManagementGroupChildResource list operation as paginated response with
     * {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<ManagementGroupChildResourceInner> listByManagementGroup(String managementGroupId, Context context);
}
