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

package com.azure.resourcemanager.providerhub.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.providerhub.fluent.models.ResourceTypeRegistrationInner;

/** An instance of this class provides access to all the operations defined in ResourceTypeRegistrationsClient. */
public interface ResourceTypeRegistrationsClient {
    /**
     * Gets a resource type details in the given subscription and provider.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @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 resource type details in the given subscription and provider along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Response<ResourceTypeRegistrationInner> getWithResponse(
        String providerNamespace, String resourceType, Context context);

    /**
     * Gets a resource type details in the given subscription and provider.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @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 resource type details in the given subscription and provider.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    ResourceTypeRegistrationInner get(String providerNamespace, String resourceType);

    /**
     * Creates or updates a resource type.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param properties The required request body parameters supplied to the resource type registration CreateOrUpdate
     *     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<ResourceTypeRegistrationInner>, ResourceTypeRegistrationInner> beginCreateOrUpdate(
        String providerNamespace, String resourceType, ResourceTypeRegistrationInner properties);

    /**
     * Creates or updates a resource type.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param properties The required request body parameters supplied to the resource type registration CreateOrUpdate
     *     operation.
     * @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<ResourceTypeRegistrationInner>, ResourceTypeRegistrationInner> beginCreateOrUpdate(
        String providerNamespace, String resourceType, ResourceTypeRegistrationInner properties, Context context);

    /**
     * Creates or updates a resource type.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param properties The required request body parameters supplied to the resource type registration CreateOrUpdate
     *     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.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    ResourceTypeRegistrationInner createOrUpdate(
        String providerNamespace, String resourceType, ResourceTypeRegistrationInner properties);

    /**
     * Creates or updates a resource type.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param properties The required request body parameters supplied to the resource type registration CreateOrUpdate
     *     operation.
     * @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.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    ResourceTypeRegistrationInner createOrUpdate(
        String providerNamespace, String resourceType, ResourceTypeRegistrationInner properties, Context context);

    /**
     * Deletes a resource type.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @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 providerNamespace, String resourceType, Context context);

    /**
     * Deletes a resource type.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @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 providerNamespace, String resourceType);

    /**
     * Gets the list of the resource types for the given provider.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @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 list of the resource types for the given provider as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<ResourceTypeRegistrationInner> listByProviderRegistration(String providerNamespace);

    /**
     * Gets the list of the resource types for the given provider.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @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 list of the resource types for the given provider as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<ResourceTypeRegistrationInner> listByProviderRegistration(String providerNamespace, Context context);
}
